validate_condition

sofia_redux.instruments.forcast.hdcheck.validate_condition(header, condition, dripconf=False)[source]

Return if a keyword header value meets a condition

Retrieves the keyword named in the condition from the header. The value from the condition is converted to the same type as that in the header before a comparison is performed using the comparison operator from the condition in the following order:

<header value> <condition operator> <condition value>

The result of the equality is returned

Parameters:
headerastropy.io.header.Header
condition3-tuple

of the form (KEYWORD, comparison operator, value)

dripconfbool, optional

Will check the configuration file for the keyword in addition to the header

Returns:
bool

True if the condition is met, False otherwise