httm.fits_utilities.raw_fits

This module contains functions for marshalling and de-marshalling SingleCCDRawConverter and the other book-keeping objects it contains to and from FITS files or astropy.io.fits.HDUList objects.

make_slice_from_raw_data(image_and_smear_pixels, index, early_dark_pixels, late_dark_pixels)[source]

Construct a slice from raw pixel data given a specified index.

Result is in Analogue to Digital Converter Units (ADU).

Parameters:
  • image_and_smear_pixels (numpy.ndarray) – Image pixels from the raw FITS data.
  • index (int) – The index of the slice to construct.
  • early_dark_pixels (numpy.ndarray) – The leftmost columns are dark pixels, to be placed on the left of the slice.
  • late_dark_pixels (numpy.ndarray) – The rightmost columns are dark pixels, to be placed on the right of the slice.
Return type:

Slice

raw_converter_flags_from_fits_header(fits_header, flag_overrides=None)[source]

Construct a SingleCCDRawConverterFlags from a FITS header.

TODO: Document me

Parameters:
  • fits_header (astropy.io.fits.Header) – FITS header to use for parsing parameters
  • flag_overrides (object or dict) –
Return type:

SingleCCDRawConverterFlags

raw_converter_from_fits(input_file, command=None, checksum=True, flag_overrides=None, parameter_overrides=None)[source]

TODO: Document this

Parameters:
  • input_file
  • command
  • checksum
  • flag_overrides (object or dict) –
  • parameter_overrides (object or dict) –
Return type:

raw_converter_from_hdulist(header_data_unit_list, command=None, origin_file_name=None, flag_overrides=None, parameter_overrides=None)[source]

TODO: Document this

Parameters:
  • header_data_unit_list
  • command
  • origin_file_name
  • flag_overrides (object or dict) –
  • parameter_overrides (object or dict) –
Return type:

SingleCCDRawConverter

raw_converter_parameters_from_fits_header(fits_header, parameter_overrides=None)[source]

TODO: Document this

Parameters:
  • fits_header (astropy.io.fits.Header) – FITS header to use for parsing parameters
  • parameter_overrides (object or dict) –
Return type:

SingleCCDRawConverterParameters

raw_converter_to_calibrated_hdulist(converter)[source]

TODO: Document me

Parameters:converter
raw_fits_to_calibrated(fits_input_file, fits_output_file, command=None, checksum=True, flag_overrides=None, parameter_overrides=None, transformation_settings=None)[source]

Read a raw FITS file in as input, with units specified in Analogue to Digital Converter Units (ADU), run a series of transformations over it, and output the results to a specified file.

Parameters:
  • fits_input_file (str) – A raw FITS file to use as input
  • fits_output_file (str) – A FITS file to use as output; will be clobbered if it exists
  • command (str) – The command issued to be recorded in the HISTORY header keyword in the output
  • checksum (bool) – Whether to use checksums for data validation in reading and writing
  • flag_overrides (object or dict) – An object or dictionary specifying values transformation flags should take rather than their defaults
  • parameter_overrides (object or dict) – An object or dictionary specifying values parameters should take rather than their defaults
  • transformation_settings (object) – An object which specifies which transformations should run, rather than the defaults
write_raw_converter_to_calibrated_fits(converter, output_file, checksum=True)[source]

Write a completed SingleCCDRawConverter to a calibrated FITS file.

Parameters:
Return type:

NoneType