Permalink
Browse files

add support for parsing KYMN data

  • Loading branch information...
1 parent c8edf59 commit b69a71a8482cdae02627d10f4a1df88de836ff34 @akrherz committed Oct 1, 2012
Showing with 12 additions and 5 deletions.
  1. +7 −2 scripts/ingestors/madis/sync_stations.py
  2. +5 −3 scripts/ingestors/madis/to_iemaccess.py
@@ -34,16 +34,21 @@
MY_PROVIDERS = ["MNDOT", "KSDOT", "WIDOT", "INDOT", "NDDOT",
"NEDOR", "WYDOT", "OHDOT", "MDDOT", "NHDOT", "WVDOT", "NVDOT",
"AKDOT", "VTDOT", "WIDOT", "MEDOT", "VADOT","CODOT", "FLDOT",
- "GADOT", "KYTC-RWIS"]
+ "GADOT", "KYTC-RWIS", "KYMN"]
+def provider2network(p):
+ """ Convert a MADIS network ID to one that I use, here in IEM land"""
+ if p in ['KYMN']:
+ return p
+ return '%s_RWIS' % (p[:2],)
for recnum in range(len(providers)):
thisProvider = providers[recnum].tostring().replace('\x00','')
if not thisProvider in MY_PROVIDERS:
continue
stid = stations[recnum].tostring().replace('\x00','')
name = names[recnum].tostring().replace("'", "").replace('\x00','')
- network = '%s_RWIS' % (thisProvider[:2],)
+ network = provider2network(thisProvider)
mcursor.execute("""SELECT * from stations where id = %s and network = %s""",
(stid, network))
if mcursor.rowcount > 0:
@@ -1,6 +1,5 @@
"""
Suck in MADIS data into the iemdb
-$Id: $:
"""
import netCDF4
import string, re, mx.DateTime, os, sys
@@ -54,11 +53,14 @@ def sanityCheck(val, lower, upper, rt):
MY_PROVIDERS = ["MNDOT", "KSDOT", "WIDOT", "INDOT", "NDDOT",
"NEDOR", "WYDOT", "OHDOT", "MDDOT", "NHDOT", "WVDOT", "NVDOT",
"AKDOT", "VTDOT", "WIDOT", "MEDOT", "VADOT", "CODOT", "FLDOT",
- "GADOT", "KYTC-RWIS"]
+ "GADOT", "KYTC-RWIS", "KYMN"]
def provider2network(p):
- return '%s_RWIS' % (p[:2],)
+ """ Convert a MADIS network ID to one that I use, here in IEM land"""
+ if p in ['KYMN']:
+ return p
+ return '%s_RWIS' % (p[:2],)
for recnum in range(len(providers)):
thisProvider = providers[recnum].tostring().replace('\x00','')

0 comments on commit b69a71a

Please sign in to comment.