For variables in a NetcdfFile object that is populated from a GRIB file, they have a Grib Level Type attribute, named Grib1_Level_Type and Grib2_Level_Type for GRIB-1 and GRIB-2 files, respectively.
The issue is that the data type of the attribute's value is different.
For Grib1_Level_Type attribute, the value is of an Integer, i.e. the level type code. The corresponding string representation is held by another attribute Grib1_Level_Desc.
For Grib2_Level_Type, the value is of a String, i.e. the corresponding text for the level type code. The Integer value of the level type is simply NOT available.
For our usage purpose, we'd like both attributes to have Integer values. So maybe a possible solution is to store Integer code to Grib2_Level_Type and add a new Grib2_Level_Desc to store its string form.
For variables in a
NetcdfFile
object that is populated from a GRIB file, they have a Grib Level Type attribute, namedGrib1_Level_Type
andGrib2_Level_Type
for GRIB-1 and GRIB-2 files, respectively.The issue is that the data type of the attribute's value is different.
Grib1_Level_Type
attribute, the value is of an Integer, i.e. the level type code. The corresponding string representation is held by another attributeGrib1_Level_Desc
.Grib2_Level_Type
, the value is of a String, i.e. the corresponding text for the level type code. The Integer value of the level type is simply NOT available.For our usage purpose, we'd like both attributes to have Integer values. So maybe a possible solution is to store Integer code to
Grib2_Level_Type
and add a newGrib2_Level_Desc
to store its string form.