Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

MRMS from NCSS has both missing_value and _FillValue #1050

Closed
dopplershift opened this issue Mar 3, 2018 · 3 comments
Closed

MRMS from NCSS has both missing_value and _FillValue #1050

dopplershift opened this issue Mar 3, 2018 · 3 comments

Comments

@dopplershift
Copy link
Member

When requesting data from MRMS using NCSS (e.g.
http:https://thredds.ucar.edu/thredds/ncss/grib/NCEP/MRMS/BaseRef/MRMS_BaseReflectivity_20180302_1600.grib2?var=MergedBaseReflectivityQC_altitude_above_msl&horizStride=1&time_start=2018-03-02T16%3A00%3A17Z&time_end=2018-03-02T16%3A58%3A17Z&timeStride=1&vertCoord=&accept=netcdf4) you end up with a file that has both missing_value and _FillValue:

	float MergedBaseReflectivityQC_altitude_above_msl(time, altitude_above_msl, lat, lon) ;
		MergedBaseReflectivityQC_altitude_above_msl:long_name = "MergedBaseReflectivityQC @ Specific altitude above mean sea level" ;
		MergedBaseReflectivityQC_altitude_above_msl:units = "dBZ" ;
		MergedBaseReflectivityQC_altitude_above_msl:description = "Mosaic Base Reflectivity (optimal method)" ;
		MergedBaseReflectivityQC_altitude_above_msl:missing_value = -99.f ;
		MergedBaseReflectivityQC_altitude_above_msl:_FillValue = -999.f ;
		MergedBaseReflectivityQC_altitude_above_msl:grid_mapping = "LatLon_Projection" ;
		MergedBaseReflectivityQC_altitude_above_msl:coordinates = "reftime time altitude_above_msl lat lon " ;
		MergedBaseReflectivityQC_altitude_above_msl:Grib_Variable_Id = "VAR_209-11-0_L102" ;
		MergedBaseReflectivityQC_altitude_above_msl:Grib2_Parameter = 209, 11, 0 ;
		MergedBaseReflectivityQC_altitude_above_msl:Grib2_Parameter_Name = "MergedBaseReflectivityQC" ;
		MergedBaseReflectivityQC_altitude_above_msl:Grib2_Level_Type = 102 ;
		MergedBaseReflectivityQC_altitude_above_msl:Grib2_Level_Desc = "Specific altitude above mean sea level" ;
		MergedBaseReflectivityQC_altitude_above_msl:Grib2_Generating_Process_Type = "Observation" ;

This seems odd and is breaking xarray.

@lesserwhirls
Copy link
Collaborator

In this case, MRMS has both missing and a no coverage parameter in the GRIB2 parameter table. missing is used for the missing_value attribute, and no coverage is used for _FillValue in the translation of GRIB into the CDM by the GRIB IOSP.

_FillValue is what applications first look for in terms of invalid data, but has to be a scalar, so we have to also use missing_value in this case. As a side note, missing_data more flexible and can be a vector, according to the NUG attribute conventions).

I don't see anything in the CF documentation on missing data that would prohibit the use of both, so perhaps this is worth supporting in xarray?

@dopplershift
Copy link
Member Author

dopplershift commented Mar 3, 2018

It might be worth bringing up with xarray, but they specifically catch and error out on this case, so I assume there's a reason--but it doesn't sound like THREDDS is doing anything wrong.

@dopplershift
Copy link
Member Author

We'll fix it over there--see pydata/xarray#1749

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants