hdcheck¶
- sofia_redux.instruments.forcast.hdcheck.hdcheck(filelist, dohdcheck=None, dripconf=False, kwfile=None)[source]¶
Checks file headers against validity criteria
Checks if the headers of the input files satisfy criteria described in a separate file: input-key-definitions.txt, kept in the calibration data directory. This file should have columns keyname, condition, type, enum, format, min, max. The condition should be Boolean, indicating whether the keyword is required to be present. Type should be a string specifying the Python data type required for the value. Enum indicates the specific values the keyword is allowed to have. Format describes the format requirement for a string value. Min and max indicate the minimum and maximum values allowed for a numerical value. For any of these fields, a ‘.’ indicates no requirement.
- Parameters:
- filelistlist or str
File paths to check
- dohdcheckstr
Configuration keyword to check. If provided, this keyword will be read from sofia_redux.instruments.forcast.configuration; if set to 1, the headers will be checked. Otherwise, the check will be aborted and this function will return True.
- dripconfbool
If True, will check the configuration file for the required parameter before checking headers (using getpar).
- kwfilestr
Keyword definition file to use. If not provided, the default file will be used (input-key-definition.yxy, in the calibration data directory.
- Returns:
- bool
True if headers of all files are correct; False otherwise