Skip to content

Commit

Permalink
ENH: Add value for GINI field Percent Normal TPW
Browse files Browse the repository at this point in the history
This was found based on information in SCN20-03; channel 60 was
previously unknown, and not even found by Unidata's ingest code.
dopplershift committed Oct 1, 2020
1 parent 92c134e commit 3b9904c
Showing 4 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/metpy/io/gini.py
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ def _name_lookup(names):
mapper = dict(zip(range(len(names)), names))

def lookup(val):
return mapper.get(val, 'Unknown')
return mapper.get(val, 'UnknownValue')
return lookup


@@ -101,7 +101,8 @@ class GiniFile(AbstractDataStore):
'Sounder (9.71 micron)', 'Sounder (7.43 micron)', 'Sounder (7.02 micron)',
'Sounder (6.51 micron)', 'Sounder (4.57 micron)', 'Sounder (4.52 micron)',
'Sounder (4.45 micron)', 'Sounder (4.13 micron)', 'Sounder (3.98 micron)',
'Sounder (3.74 micron)', 'Sounder (Visible)']
# Percent Normal TPW found empirically from Service Change Notice 20-03
'Sounder (3.74 micron)', 'Sounder (Visible)', 'Percent Normal TPW']

prod_desc_fmt = NamedStruct([('source', 'b'),
('creating_entity', 'b', _name_lookup(crafts)),
1 change: 1 addition & 0 deletions src/metpy/static-data-manifest.txt
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ Level2_KFTG_20150430_1419.ar2v 77c3355c8a503561eb3cddc3854337e640d983a4acdfc27bd
Level3_Composite_dhr_1km_20180309_2225.gini 19fcc0179c9d3e87c462262ea817e87f52f60db4830314b8f936baa3b9817a44
NAM_test.nc 12338ad06d5bd223e99e2872b20a9c80d58af0c546731e4b00a6619adc247cd0
NHEM-MULTICOMP_1km_IR_20151208_2100.gini c144b29284aa915e6fd1b8f01939c656f2c72c3d7a9e0af5397f93067fe0d952
PR-NATIONAL_1km_PCT_20200320_0446.gini 7a868670beeb037da10510e5ae8c53199b57a0efa8cc080dafd92d0d1dc8280e
SFC_obs.csv 582d434442880f8414a555f22f7faf9b07b1170f390628e68c5c182e4431f426
TDAL20191021021543V08.raw.gz db299c0f31f1396caddb92ed1517d30494a6f47ca994138f85c925787176a0ef
UPA_obs.csv 106fa93db40f32cf7cb5e969e5dacb3d4e3387f7a3379ba90cc15149754fc640
Binary file not shown.
7 changes: 7 additions & 0 deletions tests/io/test_gini.py
Original file line number Diff line number Diff line change
@@ -175,3 +175,10 @@ def test_unidata_composite():

# Check data value
assert 66 == f.data[2160, 2130]


def test_percent_normal():
"""Test reading PCT products properly."""
f = GiniFile(get_test_data('PR-NATIONAL_1km_PCT_20200320_0446.gini'))

assert f.prod_desc.channel == 'Percent Normal TPW'

0 comments on commit 3b9904c

Please sign in to comment.