We shouldn't be overriding anything implicitly, simply error out and
inform the user, and let them deal with it.
if station['provider'] == 'nrcs':
station['source'] = 'https://www.wcc.nrcs.usda.gov/awdbWebService/services?WSDL'
station['station_id'] = config['station']['station_id']
if station['provider'] == 'nrcs':
station['source'] = 'https://www.wcc.nrcs.usda.gov/awdbWebService/services?WSDL'
station['station_id'] = config['station']['station_id']
-
- try:
- station['desired_data'] = config['station']['desired_data'].split(',')
- except:
- # desired_data malformed or missing, setting default
- station['desired_data'] = [
- 'TOBS', # AIR TEMPERATURE OBSERVED (degF)
- 'SNWD', # SNOW DEPTH (in)
- 'PREC' # PRECIPITATION ACCUMULATION (in)
- ]
+ station['desired_data'] = config['station']['desired_data'].split(',')
# XXX: For NRCS, we're manually overriding units for now! Once
# unit conversion is supported for NRCS, REMOVE THIS!
# XXX: For NRCS, we're manually overriding units for now! Once
# unit conversion is supported for NRCS, REMOVE THIS!
station['source'] = 'https://api.synopticdata.com/v2/stations/timeseries'
station['station_id'] = config['station']['station_id']
station['units'] = config['station']['units']
station['source'] = 'https://api.synopticdata.com/v2/stations/timeseries'
station['station_id'] = config['station']['station_id']
station['units'] = config['station']['units']
-
- try:
- station['desired_data'] = config['station']['desired_data']
- except:
- # desired_data malformed or missing, setting default
- station['desired_data'] = 'air_temp,snow_depth'
+ station['desired_data'] = config['station']['desired_data']
# construct full API URL (sans start/end time, added later)
station['source'] = station['source'] + '?token=' + config['station']['token'] + '&within=60&units=' + station['units'] + '&stid=' + station['station_id'] + '&vars=' + station['desired_data']
# construct full API URL (sans start/end time, added later)
station['source'] = station['source'] + '?token=' + config['station']['token'] + '&within=60&units=' + station['units'] + '&stid=' + station['station_id'] + '&vars=' + station['desired_data']