This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
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 attributes: http://www.unidata.ucar.edu/netcdf/workshops/2011/datamodels/VarsVsAtts.html 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 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