keyword_lookup

The purpose of the keyword_lookup utility is to act as a lookup-reference in the code for specific SOXS FITS Header keywords.

When initiated keyword_lookup reads the keywords from a Keyword Dictionary file and can later serve the keywords names to the soxspipe code when requested.

class keyword_lookup(log, instrument=False, settings=False)[source]

The worker class for the keyword_lookup module

Key Arguments:
  • log – logger

  • settings – the settings dictionary. Default False

  • instrument – 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 kw function:

kw("PROV", 9)
> 'PROV09'

If a tag is not in the list of FITS Header keyword aliases in the configuration file a LookupError will be raised.

get(tag, index=False)[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