DateRangeOptions

class sofia_redux.scan.configuration.dates.DateRangeOptions(allow_error=False, verbose=True)[source]

Bases: Options

Initialize the date range options.

Date range options contain configuration settings that should be applied if the provided date falls within a certain range.

Parameters:
allow_errorbool, optional

If True, allow poorly formatted options to be skipped rather than raising an error.

verbosebool, optional

If True, issues a warning when a poorly option is encountered.

Attributes Summary

append_keys

Methods Summary

clear()

Clear all options.

copy()

Return a copy of the date range options.

get(date[, default, unalias])

Retrieve configuration options for a given date.

set(key, options)

Set options in the date range options for a certain date-time.

set_date(configuration, date[, validate])

Apply options for a given date to a configuration.

update(configuration_options)

Update the stored date options from a supplied configuration.

Attributes Documentation

append_keys = ('blacklist', 'whitelist', 'forget', 'recall', 'lock', 'unlock', 'add', 'config')

Methods Documentation

clear()[source]

Clear all options.

Returns:
None
copy()[source]

Return a copy of the date range options.

Returns:
DateRangeOptions
get(date, default=None, unalias=True)[source]

Retrieve configuration options for a given date.

Parameters:
datestr or int or float

The observation date. If a string is used, it should be in ISOT format in UTC scale. Integers and floats will be parsed as MJD times in the UTC scale.

defaultdict or ConfigObj, optional

A value to return if no results are found. Must be of dict or ConfigObj type to be returned.

unaliasbool, optional

Not used to the DateRangeOptions.

Returns:
optionsConfigObj
set(key, options)[source]

Set options in the date range options for a certain date-time.

Parameters:
keystr

A date key of the form start–stop where start and stop can be either * indicating no value, an ISOT str or mjd number value, both in the UTC scale.

optionsdict or ConfigObj

The configuration options for the given date range key.

Returns:
None
set_date(configuration, date, validate=True)[source]

Apply options for a given date to a configuration.

Parameters:
configurationConfiguration
datestr or int or float

The date for which to retrieve and apply options. If a string is used, it should be in ISOT format in UTC scale. Integers and floats will be parsed as MJD times in the UTC scale.

validatebool, optional

If True, validate the configuration once options have been applied.

Returns:
None
update(configuration_options)[source]

Update the stored date options from a supplied configuration.

Parameters:
configuration_optionsdict or ConfigObj

The configuration options to read and parse for any date settings. Note that for any updates to occur, configuration_options must contain a “date” key.

Returns:
None