SimulationInfo

class sofia_redux.scan.simulation.info.SimulationInfo(configuration_path=None)[source]

Bases: CameraInfo

Initialize the example instrument simulation information object.

Parameters:
configuration_pathstr, optional

An alternate directory path to the configuration tree to be used during the reduction. The default is <package>/data/configurations.

Methods Summary

copy()

Return a copy of the SimulationInfo.

create_data(scan_hdu, header, source_model, ...)

Create modelled source data.

get_file_id()

Return the file ID.

max_pixels()

Return the maximum number of pixels in the example instrument.

modify_data(data, **kwargs)

Add various properties to simulated scan data.

scan_hdu_from_header(header, **kwargs)

Create an HDU containing the simulated scan pattern from a header.

set_frames_coordinates(frames, table)

Set the frame data from an HDU Binary table.

simulated_data(scan_hdu, header, ...)

Create an HDU containing modelled source data.

simulated_hdul([object_name, ra, dec, ...])

Create an HDU list containing simulated data.

simulated_observation_header([object_name, ...])

Create a simulated observation primary header.

write_simulated_hdul(filename[, ...])

Write a simulated HDU list to file.

Methods Documentation

copy()[source]

Return a copy of the SimulationInfo.

Returns:
SimulationInfo
create_data(scan_hdu, header, source_model, **kwargs)[source]

Create modelled source data.

Parameters:
scan_hdufits.BinTableHDU

A FITS table containing scanning data which must include the columns RA, DEC, AZ, and EL.

headerfits.Header

The primary FITS header. Must contain the keys OBSRA, OBSDEC, SITELON, and SITELAT.

source_modelSimulatedSource
kwargsdict, optional

Optional keyword arguments that will be applied to the data.

Returns:
datanumpy.ndarray

Simulated data of the shape (n_records, n_row, n_col).

static get_file_id()[source]

Return the file ID.

Returns:
str
max_pixels()[source]

Return the maximum number of pixels in the example instrument.

Returns:
int
static modify_data(data, **kwargs)[source]

Add various properties to simulated scan data.

Parameters:
datanumpy.ndarray (float)

The simulated data of shape (n_records, n_row, n_col). Will be modified in-place.

Returns:
None
scan_hdu_from_header(header, **kwargs)[source]

Create an HDU containing the simulated scan pattern from a header.

Parameters:
headerfits.Header

The simulated observation primary header.

kwargsdict, optional

Optional keyword arguments to pass into the scan pattern simulator.

Returns:
hdufits.BinTableHDU

The header data unit containing DMJD, LST, RA, DEC, AZ, and EL columns.

set_frames_coordinates(frames, table)[source]

Set the frame data from an HDU Binary table.

Parameters:
framessofia_redux.scan.custom.example.frames.frames.ExampleFrames

The frames to populate with the HDU data.

tableastropy.table.Table or dict or fits.FITS_rec

The HDU table containing the the columns: DMJD, LST, RA, DEC, AZ, and EL.

Returns:
None
simulated_data(scan_hdu, header, source_model, **kwargs)[source]

Create an HDU containing modelled source data.

Parameters:
scan_hdufits.BinTableHDU

A FITS table containing scanning data which must include the columns RA, DEC, AZ, and EL.

headerfits.Header

The primary FITS header. Must contain the keys OBSRA, OBSDEC, SITELON, and SITELAT.

source_modelSimulatedSource
kwargsdict, optional

Optional keyword arguments to be applied to the simulated data.

Returns:
data_hdufits.BinTableHDU

An updated FITS table including the simulated data in the DAC column.

simulated_hdul(object_name='Simulation', ra='17h45m39.60213s', dec='-29d00m22.0000s', site_longitude='-122.0644d', site_latitude='37.4089d', date_obs='2021-12-06T18:48:25.876', scan_id=1, scan_pattern='daisy', source_type='single_gaussian', **kwargs)[source]

Create an HDU list containing simulated data.

Parameters:
object_namestr, optional

The name of the simulated source.

rastr or units.Quantity, optional

The right-ascension of the simulated source. The default is the Galactic center.

decstr or units.Quantity, optional

The declination of the simulated source. The default is the Galactic center.

site_longitudestr or units.Quantity, optional

The site longitude of the simulated observation. The default is NASA Ames.

site_latitudestr or units.Quantity, optional

The site latitude of the simulated observation. The default is NASA Ames.

date_obsstr or Time, optional

The date of the simulated observation. String values should be provided in ISOT format in UTC scale.

scan_idstr or int, optional

The ID of the scan to be pla

scan_patternstr, optional

The scanning pattern type. Available patterns are {‘daisy’, ‘lissajous’}.

source_typestr, optional

The source type. Available types are {‘single_gaussian’, ‘sky’}.

kwargsdict, optional

Optional keyword arguments that are passed into the scan pattern simulation or simulated source data.

Returns:
hdulfits.HDUList

A FITS HDU list where the first (hdul[0]) HDU contains no data and the primary header. The second HDU (hdul[1]) contains a FITS binary table with the following columns: DMJD, LST, RA, DEC, AZ, EL, and DAC.

static simulated_observation_header(object_name='Simulation', ra='17h45m39.60213s', dec='-29d00m22.0000s', site_longitude='-122.0644d', site_latitude='37.4089d', date_obs='2021-12-06T18:48:25.876', scan_id=1, scan_pattern='daisy')[source]

Create a simulated observation primary header.

Parameters:
object_namestr

The name of the observed object.

rastr or units.Quantity or float

The right-ascension of the observation. If a float value is supplied, it should be in degrees.

decstr or units.Quantity or float

The declination of the observation. If a float value is supplied, it should be in degrees.

site_longitudestr or units.Quantity

The site longitude.

site_latitudestr or units.Quantity

The site latitude.

date_obsstr

The date-time of the observation in ISOT format, UTC scale.

scan_idstr or int

The scan identifier.

scan_patternstr

The scan pattern type. Allowable values are {‘daisy’, ‘lissajous’}.

Returns:
headerfits.Header
write_simulated_hdul(filename, object_name='Simulation', ra='17h45m39.60213s', dec='-29d00m22.0000s', site_longitude='-122.0644d', site_latitude='37.4089d', date_obs='2021-12-06T18:48:25.876', scan_id=1, scan_pattern='daisy', source_type='single_gaussian', overwrite=True, **kwargs)[source]

Write a simulated HDU list to file.

Parameters:
filenamestr

The file path to the output file for which to write the simulated HDU list.

object_namestr, optional

The name of the simulated source.

rastr or units.Quantity, optional

The right-ascension of the simulated source. The default is the Galactic center.

decstr or units.Quantity, optional

The declination of the simulated source. The default is the Galactic center.

site_longitudestr or units.Quantity, optional

The site longitude of the simulated observation. The default is NASA Ames.

site_latitudestr or units.Quantity, optional

The site latitude of the simulated observation. The default is NASA Ames.

date_obsstr or Time, optional

The date of the simulated observation. String values should be provided in ISOT format in UTC scale.

scan_idstr or int, optional

The ID of the scan to be pla

scan_patternstr, optional

The scanning pattern type. Available patterns are {‘daisy’, ‘lissajous’, ‘skydip’}.

source_typestr, optional

The source type. Available types are {‘single_gaussian’, ‘sky’}.

overwritebool, optional

If True, allow filename to be overwritten if it already exists.

kwargsdict, optional

Optional keyword arguments that are passed into the scan pattern simulation or simulated source data.

Returns:
None