soxspipe.commonutils.keyword_lookup¶
Given a keyword token and instrument name return the exact FITS Header keyword
- Author
David Young & Marco Landoni
- Date Created
February 26, 2020
Module Contents¶
Classes¶
The worker class for the keyword_lookup module |
API¶
- class soxspipe.commonutils.keyword_lookup.keyword_lookup(log, instrument=False, settings=False)[source][source]¶
Bases:
objectThe worker class for the keyword_lookup module
Key Arguments:
log– loggersettings– the settings dictionary. Default Falseinstrument– can directly add the instrument if settings file is not avalable. Default False
Usage
To initalise the keyword lookup object in your code add the following:
from soxspipe.commonutils import keyword_lookup kw = keyword_lookup( log=log, settings=settings, instrument=False, ).get
After this it’s possible to either look up a single keyword using it’s alias:
kw("DET_NDITSKIP") > "ESO DET NDITSKIP"
or return a list of keywords:
kw(["PROV", "DET_NDITSKIP"]) > ['PROV', 'ESO DET NDITSKIP']
For those keywords that require an index it’s possible to also pass the index to the
kwfunction:kw("PROV", 9) > 'PROV09'
If a tag is not in the list of FITS Header keyword aliases in the configuration file a
LookupErrorwill be raised.Initialization
- get(tag, index=False)[source][source]¶
given a tag, and optional keyword index, return the FITS Header keyword for the selected instrument
Key Arguments:
tag– the keyword tag as set in the yaml keyword dictionary (e.g. ‘SDP_KEYWORD_TMID’ returns ‘TMID’). Can be string or list of sttings.index– add an index to the keyword if not False (e.g. tag=‘PROV’, index=3 returns ‘PROV03’) Default False
Return:
keywords– the FITS Header keywords. Can be string or list of sttings depending on format of tag argument
Usage
See docstring for the class