httm.fits_utilities.electron_flux_fits

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

electron_flux_converter_flags_from_fits_header(fits_header, flag_overrides=None)[source]

Construct a SingleCCDElectronFluxConverterFlags from a file or file name.

Parameters:
  • fits_header (astropy.io.fits.Header) – The file or file name to input
  • flag_overrides (object or dict) –
Return type:

SingleCCDElectronFluxConverterFlags

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

TODO: Document me

Parameters:
Return type:

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

TODO: Document me

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

SingleCCDElectronFluxConverter

electron_flux_converter_parameters_from_fits_header(fits_header, parameter_overrides=None)[source]

TODO: Document me

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

SingleCCDElectronFluxConverterParameters

electron_flux_converter_to_simulated_raw_hdulist(converter)[source]

This function converts a SingleCCDElectronFluxConverter into an astropy.io.fits.HDUList object, suitable for writing out to a simulated raw FITS file.

Parameters:converter (SingleCCDElectronFluxConverter) – An electron flux converter object
Return type:astropy.io.fits.HDUList
electron_flux_fits_to_raw(fits_input_file, fits_output_file, command=None, checksum=True, flag_overrides=None, parameter_overrides=None, transformation_settings=None)[source]

Read an electron flux FITS file in as input, with units specified in electron counts, run a series of transformations over it, and output the results to a specified file.

Parameters:
  • fits_input_file (str) – A FITS file with electron counts
  • 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 check-sums 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
make_slice_from_electron_flux_data(pixels, early_dark_pixel_columns, late_dark_pixel_columns, final_dark_pixel_rows, smear_rows, index)[source]

Construct a slice from an array of electron flux pixel data given a specified index.

Result is in electron counts.

Parameters:
  • pixels (numpy.ndarray) – Image pixels from the electron flux data
  • early_dark_pixel_columns (int) –
  • late_dark_pixel_columns (int) –
  • final_dark_pixel_rows (int) –
  • smear_rows (int) –
  • index (int) – The index of the slice to construct
Return type:

Slice

write_electron_flux_converter_to_simulated_raw_fits(converter, output_file, checksum=True)[source]

Write a SingleCCDElectronFluxConverter to a simulated raw FITS file.

Called for effect.

Parameters:
Return type:

NoneType