methods getRadarProductIDs(), getRadarProductNames() added to DataAccessLayer

This commit is contained in:
Michael James 2018-10-17 11:03:28 -06:00
parent 72b3dedd23
commit 8af937a344

View file

@ -40,6 +40,45 @@ else:
USING_NATIVE_THRIFT = True USING_NATIVE_THRIFT = True
def getRadarProductIDs(availableParms):
"""
Get only the numeric idetifiers for NEXRAD3 products.
Args:
availableParms: Full list of radar parameters
Returns:
List of filtered parameters
"""
productIDs = []
for p in list(availableParms):
try:
if isinstance(int(p), int):
productIDs.append(str(p))
except ValueError:
pass
return productIDs
def getRadarProductNames(availableParms):
"""
Get only the named idetifiers for NEXRAD3 products.
Args:
availableParms: Full list of radar parameters
Returns:
List of filtered parameters
"""
productNames = []
for p in list(availableParms):
if len(p) > 3:
productNames.append(p)
return productNames
def getMetarObs(response): def getMetarObs(response):
""" """
Processes a DataAccessLayer "obs" response into a dictionary, Processes a DataAccessLayer "obs" response into a dictionary,