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

Fix inconsistent representation for Grib Level #855

Merged
merged 1 commit into from
Jun 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions grib/src/main/java/ucar/nc2/grib/collection/Grib2Iosp.java
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,11 @@ protected void addVariableAttributes(Variable v, GribCollectionImmutable.Variabl
Grib2Customizer.Parameter entry = cust.getParameter(vindex.getDiscipline(), vindex.getCategory(), vindex.getParameter());
if (entry != null) v.addAttribute(new Attribute("Grib2_Parameter_Name", entry.getName()));

if (vindex.getLevelType() != GribNumbers.MISSING) {
String levelTypeName = cust.getLevelName(vindex.getLevelType());
if (levelTypeName != null)
v.addAttribute(new Attribute("Grib2_Level_Type", levelTypeName));
else
v.addAttribute(new Attribute("Grib2_Level_Type", vindex.getLevelType()));
}
if (vindex.getLevelType() != GribNumbers.MISSING)
v.addAttribute(new Attribute("Grib2_Level_Type", vindex.getLevelType()));
String ldesc = cust.getLevelName(vindex.getLevelType());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be cust.getLevelDescription

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, it looks like that method doesn't exist on Grib2Customizer like it does on Grib1Customizer. Weird.

if (ldesc != null)
v.addAttribute(new Attribute("Grib2_Level_Desc", ldesc));

if (vindex.getEnsDerivedType() >= 0)
v.addAttribute(new Attribute("Grib2_Ensemble_Derived_Type", vindex.getEnsDerivedType()));
Expand Down