libera_utils.quality_flags#

Quality flag definitions

Classes

FlagBit(*args[, message])

Subclass of int to capture both an integer value and an accompanying message

LiberaFlag(value)

Subclass of Flag that add a method for decomposing a flag into its individual components and a property to return a list of all messages associated with a quality flag

LiberaQualityFlag(value)

TODO: Once these quality flags are well defined, write tests against them

class libera_utils.quality_flags.FlagBit(*args, message=None, **kwargs)#

Subclass of int to capture both an integer value and an accompanying message

Attributes:
denominator

the denominator of a rational number in lowest terms

imag

the imaginary part of a complex number

numerator

the numerator of a rational number in lowest terms

real

the real part of a complex number

Methods

as_integer_ratio(/)

Return integer ratio.

bit_count(/)

Number of ones in the binary representation of the absolute value of self.

bit_length(/)

Number of bits necessary to represent self in binary.

conjugate

Returns self, the complex conjugate of any int.

from_bytes(/, bytes[, byteorder, signed])

Return the integer represented by the given array of bytes.

to_bytes(/[, length, byteorder, signed])

Return an array of bytes representing an integer.

class libera_utils.quality_flags.LiberaFlag(value)#

Subclass of Flag that add a method for decomposing a flag into its individual components and a property to return a list of all messages associated with a quality flag

decompose()#

Return the set of all set flags that form a subset of the queried flag value. Note that this is not the minimum set of quality flags but rather a full set of all flags such that when they are ORed together, they produce self.value

Returns:

A tuple containing (members, not_covered) members is a list of flag values that are subsets of value not_covered is zero if the OR of members recreates value. Non-zero otherwise if bits are set in value that do not exist as named values in cls.

Return type:

tuple

property summary#

Summarize quality flag value

Returns:

(value, message_list) where value is the integer value of the quality flag and message list is a list of strings describing the quality flag bits which are set.

Return type:

tuple

class libera_utils.quality_flags.LiberaQualityFlag(value)#

TODO: Once these quality flags are well defined, write tests against them