[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #HPI-640345]: Variable vs attribute

Hi Mike,

> We're defining the metadata for our weather products and in some cases we're 
> using global attributes such as one named:
> "total_number_pixels_for_ash_detection_overall_QF_high", type=int, 
> value=120000
> This global attribute holds a count of the number of pixels for which a data 
> quality flag is set to "high".  It's straightforward.  The units are built 
> into the attribute name ("total_number").
> Would this be better defined using a variable and explicitly specifying the 
> units?

Yes, I think a variable would be better than the global attribute.

> Here's another example:  attribute name="minimum_ash_cloud_height_in 
> kilometers" value="1.5" type="float".
> In this case I feel like a variable might be better, then we could give it a 
> long name, units, valid min and max, etc.

I agree.

> Is there a rule of thumb when a variable is necessary vs. when a global 
> attribute will suffice?  Or did I answer my own question with the second 
> example?

Here's the guidelines we provide in our workshop for when to use variables 
versus when to use 


But I think the most important consideration in this case is that you want to 
attach units to 
the value, which means you have to use a variable, because attributes can't 
have attributes in 
the netCDF data model.


Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu

Ticket Details
Ticket ID: HPI-640345
Department: Support netCDF
Priority: Normal
Status: Closed

NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.