netCDF standard for "no unit"

How do I...?
Post Reply
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

netCDF standard for "no unit"

Post by joleenf »

Hi,

What is the proper way to specify a field without a unit? I though unit: "1" would be fine, but in the latest nightly (1.6), that unit is being listed on the color table:

Screen Shot 2016-01-07 at 8.21.29 AM.png


From the netCDF standard document:
Units are not required for dimensionless quantities. A variable with no units attribute is assumed to be dimensionless. However, a units attribute specifying a dimensionless unit may optionally be included. The Udunits package defines a few dimensionless units, such as percent, but is lacking commonly used units such as ppm (parts per million). This convention does not support the addition of new dimensionless units that are not udunits compatible. The conforming unit for quantities that represent fractions, or parts of a whole, is "1".


If this is a valid way of specifying "no unit", then shouldn't McIDAS-V convert the unit of "1" to no unit before displaying on the color table?

Joleen
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: netCDF standard for "no unit"

Post by bobc »

Hi Joleen -

What kind of data are you working with? Is this a grid or point NetCDF?

If you are working with a grid, and you want to remove a unit from a field that has one (like MSLP), you could try the noUnit function. This is defined in the Grid Routines section of the Jython Library. If working through the GUI, then you would need to create a formula to access this function, since it isn't included as one of the native formulas included with McIDAS-V. This would be a simple formula, just: newUnit(field).

If this noUnit function doesn't work for you, could you please post your data and let me know what field you are trying to set as unitless?

Thanks -
Bob Carp
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: netCDF standard for "no unit"

Post by joleenf »

Hi Bob,

This is GOES-R test data that I have received from Kaba. You might want to check with Will to see if there are any updates. In the CMI band 1 for example, the unit is listed as "1" for the reflectance. The "noUnit" formula will work, but if this is going to be the standard for GOES-R and if it is an okay netCDF standard, then the java netCDF utility should read a unit of "1" as no unit. This is probably something that should be clarified with the netCDF standards group or UNIDATA's netCDF support?

The file I was looking at was
DR_ABI-L2-CMIPC-M3C01_G16_s20152322000151_e20152322002542_c20152322002596.nc

Joleen
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: netCDF standard for "no unit"

Post by bobc »

Hi Joleen -

I agree with you that if a NetCDF file specifies a unit of "1" for a field, then McIDAS-V should recognize that it is unitless.

For me to test this out, is there any way you can get me a sample of the data that uses '1' as a unit?

Thanks -
Bob Carp
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: netCDF standard for "no unit"

Post by bobc »

Thanks for the sample file, Joleen. I'm replicating the behavior of the unit being listed as '1' and not unitless/dimensionless. We are thinking that this is a problem with NetCDF, as the IDV shows the same problem, and running the file through ToolsUI 4.6 (the most recent version available for download on the Unidata website) shows units of '1' for reflectance as well. To document the issue, I wrote up Inquiry 2248.

Thanks for reporting this -
Bob
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: netCDF standard for "no unit"

Post by joleenf »

Hi Bob,

I heard back from Unidata netCDF java support. This is the response from Sean:

From my reading of the CF docs, a unit of 1 indicates that the variable is dimensionless, but
it needs to be clarified by looking at the long_name attribute to gain more clarification (it it a
percentage, is it parts per trillion, a fractional value, etc.). This seems appropriate for
toa_lambertian_equivalent_albedo_multiplied_by_cosine_solar_zenith_angle
as it should always be between 0 and 1 [I think].

If the unit is set to an empty string or not specified, then the value has no unit (like the severe
weather forecasting parameters SWEAT).

In netCDF-java, a unit of 1 will be returned to the user as 1. If the unit attribute is missing, then
there isn't an attribute to check for units and a null will be return, and if it is set as an empty string,
then you will get an empty string back.


So, I think after reading the cf compliance document again, Sean is correct. If the standard_name for a variable does not match any dimensionless parameter in the published standards names table, then the unit should be omitted in the list of parameters for that variable. Yet, is there a time when reporting a unit of "1" makes sense for labeling?

Joleen
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: netCDF standard for "no unit"

Post by bobc »

Hi Joleen -

Thanks for reaching out to NetCDF-java support and letting us know their response. Knowing that in netCDF-java, a unit of 1 will be returned to the user as 1 is good information.

I've been searching online for common units for physical quantities and I'm not seeing anything that has units of 1. However, thinking outside of the box, it's possible that a user could write up their own file that could use units of 1, 2, 3. For example, a file could be made that includes three ensemble members of temperature. To help keep things organized, the user could set ensemble 1 to have units of '1', ensemble 2 to have units of '2', and ensemble '3' to have units of 3. This is a case to show where we probably wouldn't just want to assume that a unit of '1' means missing/null.

One thought that I had is that we could set parameter defaults for this data, making the unit 'missing' nor 'null' if CMI or DQF (from your file) is the shortname of a field. This would assume that these names (CMI and DQF) are the standard names for this ABI data. This idea would need to be passed through programmers though since I'm not seeing a way of passing 'missing', 'null', or an empty string into the Unit field when setting a parameter default since these aren't included in the list of common units in VisAD. I'll add this to the inquiry.

Thanks again -
Bob
User avatar
wstraka
Posts: 66
Joined: Thu Jun 18, 2009 5:05 pm

Re: netCDF standard for "no unit"

Post by wstraka »

Bob, on your "out of the box" idea

However, thinking outside of the box, it's possible that a user could write up their own file that could use units of 1, 2, 3. For example, a file could be made that includes three ensemble members of temperature. To help keep things organized, the user could set ensemble 1 to have units of '1', ensemble 2 to have units of '2', and ensemble '3' to have units of 3. This is a case to show where we probably wouldn't just want to assume that a unit of '1' means missing/null.

is just an incorrect way of doing it, not to mention against what is stated for CF compliance. If you have three variables in a file that are all temperature (for example), then the units for all of the variables should be "K", per CF standards. The unit of "1" should only be used for variables that are fractions of a whole (ex. Reflectance factor, Reflectance). And other number in the units variable is right out.

For variables that are quantities that represent fractions, or parts of a whole (ex. cloud fraction, reflectance factor), thus having that have a unit of "1" in their attributes, if you want to display "null" or not even showing it at all seems like the best idea.
Post Reply