fits_tools – Functions related with the fits format

Functions related with fits files

pyhetdex.tools.files.fits_tools.wavelength_to_index(header, wavelength)[source]

Using the CRVAL1 and CDELT1 keywords in header determine the index of wavelength

Parameters:

header : dictionary like

dictionary containing the above keywords

wavelength : float

wavelength. If None, return None

Returns:

int or None

index of wavelength

Examples

>>> wavelength_to_index({'CRVAL1': 3500, 'CDELT1': 2}, 4000)
250