Epochs (craftutils.observation.epoch)

Contains classes representing epochs of observation, as well as functions for managing them. The :cls:`craftutils.observation.epoch.Epoch` class is the primary means by which a pipeline is actuated.

The attribute Epoch.do is a numeric list of pipeline stages, which the Epoch.pipeline() function will attempt to perform. The corresponding numbers can be obtained with Epoch.enumerate_stages(), and will differ for each subclass of Epoch. However, stages listed in Epoch.do will still only be performed if they are default (ie, their entry in Epoch.stages() dictionary has “default”: False) OR they are listed in the parameter YAML for that epoch, with entry True within the do dictionary.

That is, the do list is really a list of steps to check for this particular run, each of which will be performed only if it is specified by the epoch YAML or it is a default stage.

In normal useage, this attribute is set by the craft_optical_pipeline argument –do.

Functions

craftutils.observation.epoch.load_epoch_directory()

Loads the epoch directory yaml file from the param directory. :return: epoch directory as dict.

craftutils.observation.epoch.epoch_from_directory(epoch_name, ...)
craftutils.observation.epoch.write_epoch_directory(directory: dict)

Writes the passed dict to the directory.yaml file in param directory. :param directory: The updated directory as a dict. :return:

craftutils.observation.epoch.add_to_epoch_directory(field_name, ...)

Adds a single epoch to the epoch directory. :param field_name: :param instrument: :param mode: :param epoch_name: :return:

craftutils.observation.epoch.add_many_to_epoch_directory(...)
Parameters
epochs

A nested dictionary, with keys being the epoch names; the value dictionaries should then have: field_name or field, instrument, mode. Any of these values can be overridden by the other arguments.

Returns

craftutils.observation.epoch.expunge_epochs()
craftutils.observation.epoch.best_for_path(image_dict, ...)
craftutils.observation.epoch.detect_edges(file: HDUList | str, ...)

Detects the edges of a rectangular non-zero block, where the frame consists of a single value. For use with background files with an obvious frame. :param file: :param value: the value of the frame. :return:

Classes

class craftutils.observation.epoch.Time(astropy.time.core.TimeBase)

Represent and manipulate times and dates for astronomy.

class craftutils.observation.epoch.Pipeline(craftutils.observation.generic.Generic)
class craftutils.observation.epoch.Instrument
class craftutils.observation.epoch.Epoch(craftutils.observation.epoch.Pipeline)
class craftutils.observation.epoch.SkyCoord(astropy.utils.shapes.ShapedLikeNDArray)

High-level object providing a flexible interface for celestial coordinate representation, manipulation, and transformation between systems.

class craftutils.observation.epoch.StandardEpoch(craftutils.observation.epoch.Epoch)
class craftutils.observation.epoch.ImagingEpoch(craftutils.observation.epoch.Epoch)
class craftutils.observation.epoch.FORS2Filter(craftutils.observation.epoch.Filter)
class craftutils.observation.epoch.Filter
class craftutils.observation.epoch.ESOImagingEpoch(craftutils.observation.epoch.ImagingEpoch)
class craftutils.observation.epoch.FORS2StandardEpoch(craftutils.observation.epoch.StandardEpoch, craftutils.observation.epoch.ImagingEpoch)
class craftutils.observation.epoch.FORS2ImagingEpoch(craftutils.observation.epoch.ESOImagingEpoch)
class craftutils.observation.epoch.HAWKIImagingEpoch(craftutils.observation.epoch.ESOImagingEpoch)
class craftutils.observation.epoch.GSAOIImagingEpoch(craftutils.observation.epoch.ImagingEpoch)

This class works a little differently to the other epochs; instead of keeping track of the files internally, we let DRAGONS do that for us. Thus, many of the dictionaries and lists of files used in other Epoch classes will be empty even if the files are actually being tracked correctly. See eg science_table instead.

class craftutils.observation.epoch.SpectroscopyEpoch(craftutils.observation.epoch.Epoch)
class craftutils.observation.epoch.ESOSpectroscopyEpoch(craftutils.observation.epoch.SpectroscopyEpoch)
class craftutils.observation.epoch.FORS2SpectroscopyEpoch(craftutils.observation.epoch.ESOSpectroscopyEpoch)
class craftutils.observation.epoch.XShooterSpectroscopyEpoch(craftutils.observation.epoch.ESOSpectroscopyEpoch)