exorad.tasks.instrumentHandler module
- class BuildChannels[source]
Bases:
Task
Initialize and build all the channels in the payload
- Parameters:
- Returns:
return a dict of built Instrument classes
- Return type:
Examples
>>> buildChannels = BuildChannels() >>> channels = buildChannels(payload=payload, write=False, output=None)
Class initialisation, needed to prepare the task inputs reader
- class BuildInstrument[source]
Bases:
Task
Initialize and build an instrument
- Parameters:
- Returns:
return the built instrument class
- Return type:
- Raises:
KeyError – if the indicated instrument class is not supported
Examples
>>> buildInstrument = BuildInstrument() >>> instrument = buildInstrument(type='photometer', name='Phot', >>> description=payload['channel']['Phot'], >>> payload=payload, write=False, output=None)
Class initialisation, needed to prepare the task inputs reader
- class GetChannelList[source]
Bases:
Task
Returns a list of the channels of the specific type that are contained in the instrument options file
- Parameters:
options (object) – payload description
channel_type (string) – type of channel to find
- Returns:
list of strings with channel names
- Return type:
Examples
>>> from exorad.tasks.loadOptions import LoadOptions >>> loadOptions = LoadOptions() >>> options = loadOptions(filename = 'path/to/file.xml') >>> getDetectorList = GetChannelList() >>> photometers_list = getDetectorList(options = options, channel_type = 'Photometer') >>> spectrometers_list = getDetectorList(options = options, channel_type = 'Spectrometer')
Class initialisation, needed to prepare the task inputs reader
- class LoadPayload[source]
Bases:
Task
Loads payload and channels from dict
- Parameters:
input (dict) – main dictionary
- Returns:
dict – payload dict
dict – return a dict of built Instrument classes
Examples
>>> loadPayload = LoadPayload() >>> channels = loadPayload(input=input)
Class initialisation, needed to prepare the task inputs reader
- class MergeChannelsOutput[source]
Bases:
Task
Merges the channels output tables
- Parameters:
channels (dict)
- Return type:
Table
Class initialisation, needed to prepare the task inputs reader
- class PreparePayload[source]
Bases:
Task
It loads the payload information and returns a dictionary containing the payload, a dictionary with the channels already built, and a couple with minimum and maximum wavelength investigated by the payload
- Parameters:
- Returns:
dict – payload dictionary
dict – channels dictionary
couple – minimum and maximum investigated wavelength
Examples
>>> preparePayload = PreparePayload() >>> payload, channels, (wl_min, wl_max) = PreparePayload(payload_file=payload, output=output)
Class initialisation, needed to prepare the task inputs reader