- astro_metadata_translator.fix_header(header: MutableMapping[str, Any], search_path: Optional[Union[str, Sequence[str]]] = None, translator_class: Optional[Type[MetadataTranslator]] = None, filename: Optional[str] = None) bool ¶
Update, in place, the supplied header with known corrections.
Header to correct.
Explicit directory paths to search for correction files. A single directory path can be given as a string.
None, the class to use to translate the supplied headers into standard form. Otherwise each registered translator class will be asked in turn if it knows how to translate the supplied header.
Name of the file whose header is being translated. For some datasets with missing header information this can sometimes allow for some fixups in translations.
Raised if the supplied translation class is not a
In order to determine that a header update is required it is necessary for the header to be handled by the supplied translator class or else support automatic translation class determination. It is also required that the
instrumentbe calculable prior to header fix up. If a translator class can not be found or if there is a problem determining the instrument or observation ID, the function will return without action.
Correction files use names of the form
LATISS-AT_O_20190329_000022.yaml). The YAML file should have the format of:
EXPTIME: 30.0 IMGTYPE: bias
where each key/value pair is copied directly into the supplied header, overwriting any previous values.
This function searches a number of locations for such a correction file. The search order is:
Any paths explicitly supplied through
The contents of the PATH-like environment variable
Any search paths supplied by the matching translator class.
The first file located in the search path is used for the correction.