Info¶
- class sofia_redux.scan.info.info.Info(configuration_path=None)[source]¶
Bases:
ABC
Initialize an Info object.
The information object contains multiple
InfoBase
objects pertaining to specific types of information. It is one of the most high-level classes in the reduction, containing all the necessary configuration options and information from scans, and should therefore be used to direct the reduction process.- Parameters:
- configuration_pathstr, optional
An alternate directory path to the configuration tree to be used during the reduction. The default is <package>/data/configurations.
Attributes Summary
Return all available specialized information.
Return the configuration path for this information.
Return the data unit of the channel data.
Return the instrument frequency.
Return the overall instrument gain.
Return the instrument integration time.
Return the Jansky's per beam.
Return the instrument temperature in Kelvin.
Return the point size of the instrument.
Return a set of attribute names that should be referenced during copy.
Return the instrument resolution (spatial size)
Return the instrument sampling interval (time).
Return the size unit for the instrument.
Return the source size of the observation.
Return the name of the telescope.
Methods Summary
add_history
(header[, scans])Add HISTORY messages to a FITS header.
Apply a configuration to the information.
copy
()Create and return a copy of the Info object.
edit_image_header
(header[, scans])Add or edit image information in a FITS header.
edit_scan_header
(header[, scans])Add or edit scan information in a FITS header.
Returns a Channels instance for a given instrument.
Return the appropriate ChannelData class for a given instrument.
Returns the appropriate ChannelGroup class for a given instrument.
Return a Channels instance for this information.
get_focus_string
(focus)Return a string representing the focus.
get_name
()Return the name of the information.
Returns the appropriate Scan class for a given instrument.
get_source_model_instance
(scans[, reduction])Return the source model applicable to the channel type.
instance_from_instrument_name
(name[, ...])Return an Info instance given an instrument name.
parse_header
(header)Parse and apply a FITS header to the instrument information.
parse_image_header
(header)Parse an image header and apply a new header.
perform_reduction
(reduction, filenames)Fully reduce a given reduction and set of files.
read_configuration
([configuration_file, ...])Read and apply a configuration file.
register_config_file
(filename)Register that a configuration file has been read.
set_date_options
(mjd)Set the configuration options for a given date (in MJD).
set_fits_header_options
(header[, extension])Set the configuration FITS options from a FITS header.
set_mjd_options
(mjd)Set the configuration options for a given date (in MJD).
set_name
(name)Set the name for the information.
set_object_options
(source_name)Set the configuration object options for a given source.
Set the output directory based on the configuration.
set_parent
(owner)Set the owner of the information.
set_serial_options
(serial)Set the configuration options for a given serial number.
Create and set a separate copy of the configuration.
Create and set a separate copy of the scan.
validate
()Validate all information following a read of scans/integrations.
Ensure that all configuration files are registered.
validate_scan
(scan)Validate a scan.
validate_scans
(scans)Validate a list of scans specific to the instrument
Attributes Documentation
- available_info¶
Return all available specialized information.
Returns all contained
InfoBase
objects and their name as a dictionary of the form {name (str
): info (InfoBase
)}.- Returns:
- dict
- config_path¶
Return the configuration path for this information.
- Returns:
- file_pathstr
- data_unit¶
Return the data unit of the channel data.
- Returns:
- astropy.units.Unit
- frequency¶
Return the instrument frequency.
- Returns:
- astropy.units.Quantity
- gain¶
Return the overall instrument gain.
- Returns:
- float
- integration_time¶
Return the instrument integration time.
- Returns:
- astropy.units.Quantity
The instrument integration time in seconds.
- jansky_per_beam¶
Return the Jansky’s per beam.
- Returns:
- astropy.units.Quantity
- kelvin¶
Return the instrument temperature in Kelvin.
- Returns:
- astropy.units.Quantity
- point_size¶
Return the point size of the instrument.
- Returns:
- units.Quantity
- referenced_attributes¶
Return a set of attribute names that should be referenced during copy.
- Returns:
- set (str)
- resolution¶
Return the instrument resolution (spatial size)
- Returns:
- astropy.units.Quantity
- sampling_interval¶
Return the instrument sampling interval (time).
- Returns:
- astropy.units.Quantity
- size_unit¶
Return the size unit for the instrument.
- Returns:
- astropy.units.Unit
- source_size¶
Return the source size of the observation.
- Returns:
- units.Quantity
- telescope_name¶
Return the name of the telescope.
- Returns:
- namestr
Methods Documentation
- add_history(header, scans=None)[source]¶
Add HISTORY messages to a FITS header.
- Parameters:
- headerastropy.io.fits.header.Header
The header to update with HISTORY messages.
- scanslist (Scan), optional
A list of scans to add HISTORY messages from if necessary.
- Returns:
- None
- apply_configuration()[source]¶
Apply a configuration to the information.
This should be once the FITS information from a scan file has been applied to the information via
parse_header
.- Returns:
- None
- copy()[source]¶
Create and return a copy of the Info object.
The ‘applied_scan’ and ‘configuration’ attributes are referenced. All other attributes are copied using their
copy
method, or deepcopy.- Returns:
- Info
- edit_image_header(header, scans=None)[source]¶
Add or edit image information in a FITS header.
- Parameters:
- headerastropy.io.fits.header.Header
The FITS header to edit.
- scanslist (Scan), optional
A list of scans to use during editing.
- Returns:
- None
- edit_scan_header(header, scans=None)[source]¶
Add or edit scan information in a FITS header.
- Parameters:
- headerastropy.io.fits.header.Header
The FITS header to edit.
- scanslist (Scan), optional
A list of scans to use during editing.
- Returns:
- None
- get_channel_data_class()[source]¶
Return the appropriate ChannelData class for a given instrument.
- Returns:
- channel_dataclass (ChannelData)
- get_channel_group_class()[source]¶
Returns the appropriate ChannelGroup class for a given instrument.
- Returns:
- class (ChannelGroup)
- classmethod get_focus_string(focus)[source]¶
Return a string representing the focus.
- Parameters:
- focusInstantFocus
- Returns:
- str
- get_scan_class()[source]¶
Returns the appropriate Scan class for a given instrument.
- Returns:
- class (ChannelGroup)
- get_source_model_instance(scans, reduction=None)[source]¶
Return the source model applicable to the channel type.
- Parameters:
- scanslist (Scan)
A list of scans for which to create the source model.
- reductionReduction, optional
The reduction to which the model will belong.
- Returns:
- Map
- classmethod instance_from_instrument_name(name, configuration_path=None)[source]¶
Return an Info instance given an instrument name.
- Parameters:
- namestr
The name of the instrument
- configuration_pathstr, optional
An alternate directory path to the configuration tree to be used during the reduction. The default is <package>/data/configurations.
- Returns:
- Info
- parse_header(header)[source]¶
Parse and apply a FITS header to the instrument information.
- Parameters:
- headerfits.Header
- Returns:
- None
- parse_image_header(header)[source]¶
Parse an image header and apply a new header.
- Parameters:
- headerastropy.fits.Header
The FITS header to apply.
- Returns:
- None
- perform_reduction(reduction, filenames)[source]¶
Fully reduce a given reduction and set of files.
While it is possible for the reduction object to fully reduce a set of files, certain special considerations may be required for certain instruments. Therefore, the instrument specific Info object is given control of how a reduction should progress.
- Parameters:
- reductionReduction
The reduction object.
- filenamesstr or list (str)
A single file (str) or list of files to be included in the reduction.
- Returns:
- None
- read_configuration(configuration_file='default.cfg', validate=True)[source]¶
Read and apply a configuration file.
- Parameters:
- configuration_filestr, optional
Path to, or name of, a configuration file.
- validatebool, optional
If
True
(default), validate information read from the configuration file.
- Returns:
- None
- register_config_file(filename)[source]¶
Register that a configuration file has been read.
- Parameters:
- filenamestr
- Returns:
- None
- set_date_options(mjd)[source]¶
Set the configuration options for a given date (in MJD).
- Parameters:
- mjdfloat
- Returns:
- None
- set_fits_header_options(header, extension=0)[source]¶
Set the configuration FITS options from a FITS header.
- Parameters:
- headerfits.Header
- extensionint, optional
The HDUL extension of the header. This is only stored for reference and is not used.
- Returns:
- None
- set_mjd_options(mjd)[source]¶
Set the configuration options for a given date (in MJD).
- Parameters:
- mjdfloat
- Returns:
- None
- set_object_options(source_name)[source]¶
Set the configuration object options for a given source.
- Parameters:
- source_namestr
- Returns:
- None
- set_outpath()[source]¶
Set the output directory based on the configuration.
If the configuration path does not exist, it will be created if the ‘outpath.create’ option is set. Otherwise, an error will be raised.
- Returns:
- None
- set_serial_options(serial)[source]¶
Set the configuration options for a given serial number.
- Parameters:
- serialint or str
- Returns:
- None
- unlink_configuration()[source]¶
Create and set a separate copy of the configuration.
Ensures that the configuration is not referenced so that any changes that occur do not impact other reduction objects unintentionally.
- Returns:
- None
- unlink_scan()[source]¶
Create and set a separate copy of the scan.
Ensures that the scan associated with this information is not referenced by any other reduction object in cases where we do not want any updates to occur outside of the info scope.
- Returns:
- None
- validate()[source]¶
Validate all information following a read of scans/integrations.
At this point the astrometry can be verified.
- Returns:
- None