Enhance CF flag definitions to support bit fields
|Reported by:||gregr||Owned by:||russ|
Bit field enhancement to CF Flags definition
CF ought to provide a flag expression for multiple conditions, typically Boolean (binary), that describes one or more status conditions associated with a data variable.
4. Initial Statement of Technical Proposal
A new CF flag attribute, named "flag_masks", would enhance the current CF flags capabilities to describe multiple, independent status conditions using bit fields to define unique conditions or status codes.
Bit field flag attributes are best suited for describing data variables possessing a number of status conditions that typically occur independently of each other.
Bit field attributes would simplify the description of status flags that don't conveniently map to a unique set of mutually exclusive status codes, currently defined with flag_values attributes.
For example, when describing a precipitation measurement within a particular geo-spatial grid, a bit field flag value may be defined to contain four possible binary status conditions, occupying the four least significant bits, whose values would be defined as follows:
1 to indicate no sensor coverage at the grid location,
2 to indicate observation impairment at that grid location,
4 to indicate mixed-phase precipitation at the grid location,
8 to indicate snow precipitation at the grid location.
6. Status Quo
Current flag values could be defined for every OR'ed combination of bit settings that define all possible status conditions, but the result would be inefficient compared to simple bit field definitions.