create_data_hash#

jdaviz.utils.create_data_hash(input_data)[source]#

Create and return a deterministic hash for the provided data. The function supports various input types including numpy arrays, astropy Quantities, strings, and specutils Spectrum objects. If the input is None or of an unsupported type (e.g., a plain number), the function returns None.

Parameters:
input_dataarray-like, str, astropy.units.Quantity, specutils.Spectrum1D, or None

The data to hash. If a list or tuple, it may contain arrays or strings. If astropy.units.Quantity, the unit is included in the hash. If None, the function returns None.

Returns:
str or None

A hexadecimal string representing the SHA-256 hash of the data, or None if ‘input_data’ is None or of an unsupported type (e.g., a plain number).