Open marack opened 5 years ago
We could change status_xml to status_str. I think 'status' is a bit too short and not descriptive enough. I prefer status_xml, but its not a big deal for me, so making it more flexible is fine with me. For legends, having values and labels is OK, but Ken may have some ideas about how to do this with CF conventions in mind. The advantage of XML for thresholding is that it allows for complex structures. But once again, we could specify a string instead of XML. This is new for CfRadial2.
I am not a big fan of XML but I don't see a reason to exclude any format or choose a specific format. I would prefer to find a way to encode the information in netCDF native format as Mark noted. If we take _xml off I'm concerned that the user will not know what format to use to extract the information. Putting "XML" in the string may be difficult to then parse. I would suggest keeping the format of the sting values if the users need to use another parser (XML, JSON, YAML, ...) so the paring can be known right away. If there is no indication of the format it will be difficult to guess correctly. I don't know much about the data required in these variables and would need to spend some time digging in to it before making a suggestion.
There are three places where we specify the use of XML packed into strings. These are
status_xml
,thresholding_xml
andlegend_xml
. Having XML packed into strings introduces an extra language that must be parsed by users and makes the format more complex that needed.It would be nice to remove XML entirely and just rely on the built in metadata functionality already provided by NetCDF. Here's my thoughts:
status_xml
:status
legend_xml
:legend_values
andlegend_labels
legend_values
is an integer arrayint[]
and stores the values for each entrylegend_labels
is a string arraystring[]
and stores the labels for each entrythresholding_xml
:threshold_field
,threshold_min
andthreshold_max
. Each would be an array which give the name of the field used to threshold this field along with the min/max limits.note
field of the XML example ("NCP only checked if DBZ > 40"). On the other hand, since this note is stored as a comment it's also not well represented in the XML (and is using an illegal '>' character).thresholding
attribute as a simple string. The example would encourage using basic mathematical syntax to combine values from the fields. So the value from the example would be "SNR > -3.0 and (DBZ < 40 or NCP > 0.15)".