lezargus.library.flags module

lezargus.library.flags module#

Functions to deal with quality flag tracking, masks, and other information.

Flags and masks is the primary backbone of how the quality of data can be communicated. Here, we package all of the different functions regarding flags and masks.

lezargus.library.flags.combine_flags(*flags: ndarray) ndarray[source]#

Combine two or more flag arrays.

The flag values here follow the Lezargus convention, see [[TODO]].

Parameters:

*flags (ndarray) – The set of flags to combine.

Returns:

combined_flags – The combined mask.

Return type:

ndarray

lezargus.library.flags.combine_masks(*masks: ndarray) ndarray[source]#

Combine two or more masks.

The masks follow the Numpy convention; a True value means that the data is considered masked.

Parameters:

*masks (ndarray) – The set of masks to combine.

Returns:

combined_mask – The combined mask.

Return type:

ndarray

lezargus.library.flags.reduce_flags(flag_array: ndarray) ndarray[source]#

Reduce the flag value to the minimum it can be.

Flags, based on the Lezargus convention (see [[TODO]]), rely on the prime factors to determine the total flags present. As multiplication is how flags propagate, the value can get big quickly. We reduce the values within a flag array to the lowest it can be.

Parameters:

flag_array (ndarray) – The flag array to be reduced into its lowest form.

Returns:

lowest_flag_array – The flags, reduced to the lowest value.

Return type:

ndarray