def testGetGeometryData(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier("reportType", self.reporttype) req.setLocationNames(params.OBS_STATION) req.setParameters("temperature", "pressure", "specHum", "sfcPress", "temp2", "q2") print("Testing getGeometryData()") geomData = DAL.getGeometryData(req) print("Number of geometry records: " + str(len(geomData))) print("Sample geometry data:") for record in geomData[:self.sampleDataLimit]: print("level=" + record.getLevel(), end="") # One dimensional parameters are reported on the 0.0UNKNOWN level. # 2D parameters are reported on MB levels from pressure. if record.getLevel() == "0.0UNKNOWN": print(" sfcPress=" + record.getString("sfcPress") + record.getUnit("sfcPress"), end="") print(" temp2=" + record.getString("temp2") + record.getUnit("temp2"), end="") print(" q2=" + record.getString("q2") + record.getUnit("q2"), end="") else: print(" pressure=" + record.getString("pressure") + record.getUnit("pressure"), end="") print(" temperature=" + record.getString("temperature") + record.getUnit("temperature"), end="") print(" specHum=" + record.getString("specHum") + record.getUnit("specHum"), end="") print(" geometry=" + str(record.getGeometry())) print("getGeometryData() complete\n\n")
def testGetVectorGridData(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier('parmId.dbId.modelName', 'Fcst') req.addIdentifier('parmId.dbId.siteId', params.SITE_ID) req.setParameters('Wind') times = DAL.getAvailableTimes(req) if not(times): raise unittest.SkipTest('No Wind Data available for testing') gridData = DAL.getGridData(req, [times[0]]) rawWind = None rawDir = None for grid in gridData: if grid.getParameter() == 'Wind': self.assertEqual(grid.getUnit(),'kts') rawWind = grid.getRawData() elif grid.getParameter() == 'WindDirection': self.assertEqual(grid.getUnit(),'deg') rawDir = grid.getRawData() self.assertIsNotNone(rawWind, 'Wind Magnitude grid is not present') self.assertIsNotNone(rawDir, 'Wind Direction grid is not present') # rawWind and rawDir are numpy.ndarrays so comparison will result in boolean ndarrays. self.assertTrue((rawWind >= 0).all(), 'Wind Speed should not contain negative values') self.assertTrue((rawDir >= 0).all(), 'Wind Direction should not contain negative values') self.assertTrue((rawDir <= 360).all(), 'Wind Direction should be less than or equal to 360') self.assertFalse((rawDir == rawWind).all(), 'Wind Direction should be different from Wind Speed')
def getSounding(modelName, weatherElements, levels, samplePoint, timeRange=None): """ Performs a series of Data Access Framework requests to retrieve a sounding object based on the specified request parameters. Args: modelName: the grid model datasetid to use as the basis of the sounding. weatherElements: a list of parameters to return in the sounding. levels: a list of levels to sample the given weather elements at samplePoint: a lat/lon pair to perform the sampling of data at. timeRange: (optional) a list of times, or a TimeRange to specify which forecast hours to use. If not specified, will default to all forecast hours. Returns: A _SoundingCube instance, which acts a 3-tiered dictionary, keyed by DataTime, then by level and finally by weather element. If no data is available for the given request parameters, None is returned. """ (locationNames, parameters, levels, envelope, timeRange) = \ __sanitizeInputs(modelName, weatherElements, levels, samplePoint, timeRange) requestArgs = {'datatype': 'grid', 'locationNames': locationNames, 'parameters': parameters, 'levels': levels, 'envelope': envelope} req = DataAccessLayer.newDataRequest(**requestArgs) response = DataAccessLayer.getGeometryData(req, timeRange) soundingObject = _SoundingCube(response) return soundingObject
def testGetGeometryData(self): req = DAL.newDataRequest(self.datatype) req.setLocationNames(self.location) req.addIdentifier("reportType", "2020") req.setParameters("sfcPressure", "staName", "rptType", "tdMan") print("Testing getGeometryData()") geomData = DAL.getGeometryData(req) self.assertIsNotNone(geomData) print("Number of geometry records: " + str(len(geomData))) print("Sample geometry data:") for record in geomData[:self.sampleDataLimit]: print("level=", record.getLevel(), end="") # One dimensional parameters are reported on the 0.0UNKNOWN level. # 2D parameters are reported on MB levels from pressure. if record.getLevel() == "0.0UNKNOWN": print(" sfcPressure=" + record.getString("sfcPressure") + record.getUnit("sfcPressure"), end="") print(" staName=" + record.getString("staName"), end="") print(" rptType=" + record.getString("rptType") + record.getUnit("rptType"), end="") else: print(" tdMan=" + str(record.getNumber("tdMan")) + record.getUnit("tdMan"), end="") print(" geometry=", record.getGeometry()) print("getGeometryData() complete\n\n")
def runGetIdValuesTest(self, identifiers): for identifier in identifiers: if identifier.lower() == 'datauri': continue req = DAL.newDataRequest(self.datatype) idValues = DAL.getIdentifierValues(req, identifier) self.assertTrue(hasattr(idValues, '__iter__'))
def testFilterOnInvalidLocationThrowsIncompatibleRequestException(self): req = DAL.newDataRequest() req.setDatatype(self.datatype) req.setParameters('id') req.setLocationNames(') and 0=1') with self.assertRaises(Exception) as cm: DAL.getGeometryData(req) self.assertIn('IncompatibleRequestException', str(cm.exception))
def testGetGeometryDataWithEnvelope(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier("reportType", self.reporttype) req.setEnvelope(params.ENVELOPE) req.setParameters("temperature", "pressure", "specHum", "sfcPress", "temp2", "q2") print("Testing getGeometryData()") data = DAL.getGeometryData(req) for item in data: self.assertTrue(params.ENVELOPE.contains(item.getGeometry()))
def testGetGeometryDataWithLocationSpecified(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier('table', 'fcstheight') locs = DAL.getAvailableLocationNames(req) if locs: req.setLocationNames(locs[0]) req.setParameters('probability', 'value') data = self.runGeometryDataTest(req) self.assertNotEqual(len(data), 0)
def testNoDuplicateData(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier('table', 'public.cli_asos_monthly') req.setLocationNames('KOMA') req.setParameters('maxtemp_day1') rows = DAL.getGeometryData(req, DAL.getAvailableTimes(req)[0:5]) for i in range(len(rows)): for j in range(len(rows)): if i != j: self.assertNotEqual(rows[i].__dict__, rows[j].__dict__)
def setEDEXHost(host): """ Changes the EDEX host the Data Access Framework is communicating with. Args: host: the EDEX host to connect to """ if host: DataAccessLayer.changeEDEXHost(str(host))
def testRequestingTooMuchDataThrowsResponseTooLargeException(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier("group", "/") req.addIdentifier("dataset", "full") points = ((-180, 90), (180, 90), (180, -90), (-180, -90)) poly = shapely.geometry.LinearRing(points) req.setEnvelope(poly) with self.assertRaises(ThriftRequestException) as cm: DAL.getGridData(req) self.assertIn('ResponseTooLargeException', str(cm.exception))
def testGetDataWithTimeRange(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier('table', 'height') req.addIdentifier('ts', 'RG') req.setParameters('value', 'lid', 'quality_code') times = DAL.getAvailableTimes(req) limitTimes = times[-self.numTimesToLimit:] startTime = datetime.datetime.utcfromtimestamp(limitTimes[0].getRefTime().getTime()/1000) endTime = datetime.datetime.utcnow() tr = TimeRange(startTime, endTime) self.runGeometryDataTestWithTimeRange(req, tr)
def testGetIdentifierValues(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier('info.datasetId', 'ENSEMBLE') req.setLevels('2FHAG') req.setParameters('T') idValues = DAL.getIdentifierValues(req, 'info.ensembleId') self.assertTrue(hasattr(idValues, '__iter__')) if idValues: self.assertIn('ctl1', idValues) self.assertIn('p1', idValues) self.assertIn('n1', idValues) else: raise unittest.SkipTest("no data available")
def testFilterOnLocationName(self): allLocationNames = self._getLocationNames() if len(allLocationNames) == 0: errmsg = "No {0} data exists on {1}. Try again with {0} data." raise unittest.SkipTest(errmsg.format(self.datatype, DAL.THRIFT_HOST)) testCount = 3 # number of different location names to test for locationName in allLocationNames[:testCount]: req = DAL.newDataRequest() req.setDatatype(self.datatype) req.setParameters('id') req.setLocationNames(locationName) geomData = DAL.getGeometryData(req) for geom in geomData: self.assertEqual(geom.getLocationName(), locationName)
def testGetGridData(self): req = DAL.newDataRequest(self.datatype) req.setEnvelope(params.ENVELOPE) req.setLocationNames(self.radarLoc) req.setParameters(*self.parameterList) # Don't test shapes since they may differ. self.runGridDataTest(req, testSameShape=False)
def _runConstraintTest(self, key, operator, value): req = DAL.newDataRequest(self.datatype) constraint = RequestConstraint.new(operator, value) req.setParameters("temperature", "reportType") req.setLocationNames(params.OBS_STATION) req.addIdentifier(key, constraint) return self.runGeometryDataTest(req)
def testGetGeometryDataWithEnvelope(self): req = DAL.newDataRequest(self.datatype) req.setParameters("staName", "rptType") req.setEnvelope(params.ENVELOPE) data = self.runGeometryDataTest(req) for item in data: self.assertTrue(params.ENVELOPE.contains(item.getGeometry()))
def _runConstraintTest(self, key, operator, value): req = DAL.newDataRequest(self.datatype) constraint = RequestConstraint.new(operator, value) req.addIdentifier(key, constraint) req.setParameters("Imager 11 micron IR") req.setLocationNames("West CONUS") return self.runGridDataTest(req)
def __cloneRequest(request): return DataAccessLayer.newDataRequest(datatype = request.getDatatype(), parameters = request.getParameters(), levels = request.getLevels(), locationNames = request.getLocationNames(), envelope = request.getEnvelope(), **request.getIdentifiers())
def runGridDataTest(self, req, testSameShape=True): """ Test that we are able to successfully retrieve grid data for the given request. Args: req: the grid request testSameShape: whether or not to verify that all the retrieved data have the same shape (most data don't change shape) """ times = DafTestCase.getTimesIfSupported(req) gridData = DAL.getGridData(req, times[:self.numTimesToLimit]) self.assertIsNotNone(gridData) if not gridData: raise unittest.SkipTest("No data available") print("Number of grid records: " + str(len(gridData))) if len(gridData) > 0: print("Sample grid data shape:\n" + str(gridData[0].getRawData().shape) + "\n") print("Sample grid data:\n" + str(gridData[0].getRawData()) + "\n") print("Sample lat-lon data:\n" + str(gridData[0].getLatLonCoords()) + "\n") if testSameShape: correctGridShape = gridData[0].getLatLonCoords()[0].shape for record in gridData: rawData = record.getRawData() self.assertIsNotNone(rawData) self.assertEqual(rawData.shape, correctGridShape) return gridData
def _runConstraintTest(self, key, operator, value): req = DAL.newDataRequest(self.datatype) req.addIdentifier('table', 'cli_asos_monthly') constraint = RequestConstraint.new(operator, value) req.addIdentifier(key, constraint) req.setParameters('station_code', 'avg_daily_max') return self.runGeometryDataTest(req)
def _runConstraintTest(self, key, operator, value): req = DAL.newDataRequest(self.datatype) constraint = RequestConstraint.new(operator, value) req.addIdentifier(key, constraint) req.setLocationNames(params.SITE_ID) req.setParameters('T') return self.runGridDataTest(req)
def _runConstraintTest(self, key, operator, value): req = DAL.newDataRequest(self.datatype) constraint = RequestConstraint.new(operator, value) req.setParameters('dataURI') req.setLocationNames(params.OBS_STATION, 'KORD', 'KOFK', 'KLNK') req.addIdentifier(key, constraint) return self.runGeometryDataTest(req)
def testSuccessfulQuery(self): req = DAL.newDataRequest('grid') req.setLocationNames('RUC130') req.setParameters('T','GH') req.setLevels('300MB', '500MB','700MB') times = CTQ.getAvailableTimes(req); self.assertNotEqual(len(times), 0)
def testGetGeometryDataInvalidParamRaisesIncompatibleRequestException(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier('source', self.source) req.setParameters('blahblahblah') with self.assertRaises(ThriftRequestException) as cm: self.runGeometryDataTest(req) self.assertIn('IncompatibleRequestException', str(cm.exception))
def runConstraintTest(self, key, operator, value): req = DAL.newDataRequest(self.datatype) constraint = RequestConstraint.new(operator, value) req.addIdentifier(key, constraint) req.setParameters(*self.parameterList) # Don't test shapes since they may differ. return self.runGridDataTest(req, testSameShape=False)
def testGetGeometryDataWithLocNamesAndGroupsThrowException(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier(self.siteIdKey, params.SITE_ID) req.setLocationNames(*self.editAreaNames) req.addIdentifier(self.groupKey, RequestConstraint.new('in', self.groups)) with self.assertRaises(ThriftRequestException): self.runGeometryDataTest(req)
def testGetGeometryDataWithEnvelope(self): req = DAL.newDataRequest(self.datatype) req.setEnvelope(params.ENVELOPE) req.setParameters("temperature", "seaLevelPress", "dewpoint") data = self.runGeometryDataTest(req) for item in data: self.assertTrue(params.ENVELOPE.contains(item.getGeometry()))
def _runConstraintTest(self, key, operator, value): req = DAL.newDataRequest(self.datatype) constraint = RequestConstraint.new(operator, value) req.addIdentifier(key, constraint) # As an identifier it is "reportType" but as a parameter it is # "rptType"... this is weird... req.setParameters("staName", "rptType") return self.runGeometryDataTest(req)
def _runConstraintTest(self, key, operator, value): req = DAL.newDataRequest(self.datatype) constraint = RequestConstraint.new(operator, value) req.addIdentifier(key, constraint) req.addIdentifier('table', 'height') req.addIdentifier('ts', 'RG') req.setParameters('value', 'lid', 'quality_code') return self.runGeometryDataTest(req)
def testGetOptionalIdentifiers(self): req = DAL.newDataRequest(self.datatype) optional = DAL.getOptionalIdentifiers(req) self.assertIsNotNone(optional) print("Optional identifiers:", optional)
def getData(self, time, model_vars, mdl2stnd, previous_data=None): ''' Name: awips_model_base Purpose: A function to get data from NAM40 model to create HDWX products Inputs: request : A DataAccessLayer request object time : List of datatime(s) for data to grab model_vars : Dictionary with variables/levels to get mdl2stnd : Dictionary to convert from model variable names to standardized names Outputs: Returns a dictionary containing all data Keywords: previous_data : Dictionary with data from previous time step ''' log = logging.getLogger(__name__) # Set up function for logger initTime, fcstTime = get_init_fcst_times(time[0]) data = { 'model': self._request.getLocationNames()[0], 'initTime': initTime, 'fcstTime': fcstTime } # Initialize empty dictionary log.info('Attempting to download {} data'.format(data['model'])) for var in model_vars: # Iterate over variables in the vars list log.debug('Getting: {}'.format(var)) self._request.setParameters(*model_vars[var]['parameters']) # Set parameters for the download request self._request.setLevels(*model_vars[var]['levels']) # Set levels for the download request response = DAL.getGridData(self._request, time) # Request the data for res in response: # Iterate over all data request responses varName = res.getParameter() # Get name of the variable in the response varLvl = res.getLevel() # Get level of the variable in the response varName = mdl2stnd[varName] # Convert variable name to local standarized name if varName not in data: data[varName] = {} # If variable name NOT in data dictionary, initialize new dictionary under key data[varName][varLvl] = res.getRawData() # Add data under level name try: # Try to unit = units(res.getUnit()) # Get units and convert to MetPy units except: # On exception unit = '?' # Set units to ? else: # If get units success data[varName][varLvl] *= unit # Get data and create MetPy quantity by multiplying by units log.debug( 'Got data for:\n Var: {}\n Lvl: {}\n Unit: {}'.format( varName, varLvl, unit)) data['lon'], data['lat'] = res.getLatLonCoords() # Get latitude and longitude values data['lon'] *= units('degree') # Add units of degree to longitude data['lat'] *= units('degree') # Add units of degree to latitude # Absolute vorticity dx, dy = lat_lon_grid_deltas(data['lon'], data['lat']) # Get grid spacing in x and y uTag = mdl2stnd[model_vars['wind']['parameters'][0]] # Get initial tag name for u-wind vTag = mdl2stnd[model_vars['wind']['parameters'][1]] # Get initial tag name for v-wind if (uTag in data) and ( vTag in data): # If both tags are in the data structure data['abs_vort'] = {} # Add absolute vorticity key for lvl in model_vars['wind'][ 'levels']: # Iterate over all leves in the wind data if (lvl in data[uTag]) and ( lvl in data[vTag] ): # If given level in both u- and v-wind dictionaries log.debug('Computing absolute vorticity at {}'.format(lvl)) data['abs_vort'][ lvl ] = \ absolute_vorticity( data[uTag][lvl], data[vTag][lvl], dx, dy, data['lat'] ) # Compute absolute vorticity # 1000 MB equivalent potential temperature if ('temperature' in data) and ( 'dewpoint' in data): # If temperature AND depoint data were downloaded data['theta_e'] = {} T, Td = 'temperature', 'dewpoint' if ('1000.0MB' in data[T]) and ( '1000.0MB' in data[Td] ): # If temperature AND depoint data were downloaded log.debug( 'Computing equivalent potential temperature at 1000 hPa') data['theta_e']['1000.0MB'] = equivalent_potential_temperature( 1000.0 * units('hPa'), data[T]['1000.0MB'], data[Td]['1000.0MB']) return data # MLCAPE log.debug('Computing mixed layer CAPE') T_lvl = list(data[T].keys()) Td_lvl = list(data[Td].keys()) levels = list(set(T_lvl).intersection(Td_lvl)) levels = [float(lvl.replace('MB', '')) for lvl in levels] levels = sorted(levels, reverse=True) nLvl = len(levels) if nLvl > 0: log.debug( 'Found {} matching levels in temperature and dewpoint data' .format(nLvl)) nLat, nLon = data['lon'].shape data['MLCAPE'] = np.zeros(( nLat, nLon, ), dtype=np.float32) * units('J/kg') TT = np.zeros(( nLvl, nLat, nLon, ), dtype=np.float32) * units('degC') TTd = np.zeros(( nLvl, nLat, nLon, ), dtype=np.float32) * units('degC') log.debug('Sorting temperature and dewpoint data by level') for i in range(nLvl): key = '{:.1f}MB'.format(levels[i]) TT[i, :, :] = data[T][key].to('degC') TTd[i, :, :] = data[Td][key].to('degC') levels = np.array(levels) * units.hPa depth = 100.0 * units.hPa log.debug('Iterating over grid boxes to compute MLCAPE') for j in range(nLat): for i in range(nLon): try: _, T_parc, Td_parc = mixed_parcel( levels, TT[:, j, i], TTd[:, j, i], depth=depth, interpolate=False, ) profile = parcel_profile(levels, T_parc, Td_parc) cape, cin = cape_cin(levels, TT[:, j, i], TTd[:, j, i], profile) except: log.warning( 'Failed to compute MLCAPE for lon/lat: {}; {}'. format(data['lon'][j, i], data['lat'][j, i])) else: data['MLCAPE'][j, i] = cape return data
def __init__(self, modelName, EDEX="edex-cloud.unidata.ucar.edu"): DAL.changeEDEXHost(EDEX) self._request = DAL.newDataRequest() self._request.setDatatype("grid") self._request.setLocationNames(modelName)
def testGetRequiredIdentifiers(self): req = DAL.newDataRequest(self.datatype) required = DAL.getRequiredIdentifiers(req) self.assertIsNotNone(required) print("Required identifiers:", required)
def _runConstraintTest(self, key, operator, value): req = DAL.newDataRequest(self.datatype) constraint = RequestConstraint.new(operator, value) req.addIdentifier(key, constraint) req.setParameters('intensity') return self.runGeometryDataTest(req, checkDataTimes=False)
def runTimesTest(self, req): times = DAL.getAvailableTimes(req) self.assertIsNotNone(times) print("Number of times: " + str(len(times))) strTimes = [str(t) for t in times[:self.sampleDataLimit]] print("Sample times:\n" + str(strTimes))
def setUp(cls): host = os.environ.get('DAF_TEST_HOST') if host is None: host = 'localhost' DAL.changeEDEXHost(host)
def runNonexistentIdValuesTest(self): with self.assertRaises(ThriftRequestException) as cm: req = DAL.newDataRequest(self.datatype) idValues = DAL.getIdentifierValues(req, 'idthatdoesnotexist')
def runLevelsTest(self, req): levels = DAL.getAvailableLevels(req) self.assertIsNotNone(levels) print("Number of levels: " + str(len(levels))) strLevels = [str(t) for t in levels[:self.sampleDataLimit]] print("Sample levels:\n" + str(strLevels))
def testGetAvailableTimes(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier("reportType", "ETA") req.setLocationNames(params.OBS_STATION) self.runTimesTest(req)
def runGetIdValuesTest(self, identifiers): for id in identifiers: req = DAL.newDataRequest(self.datatype) idValues = DAL.getIdentifierValues(req, id) self.assertTrue(hasattr(idValues, '__iter__'))
def testGetAvailableLocations(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier("reportType", "ETA") self.runLocationsTest(req)
def testGetAvailableTimes(self): req = DAL.newDataRequest(self.datatype) req.setLocationNames(self.location) req.addIdentifier("reportType", "2020") self.runTimesTest(req)
def testGetGeometryData(self): req = DAL.newDataRequest(self.datatype) req.setParameters("flightLevel", "tailNumber") self.runGeometryDataTest(req)
def testGetAvailableTimes(self): req = DAL.newDataRequest(self.datatype) self.runTimesTest(req)
def testGetAvailableTimes(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier("source", "NLDN") self.runTimesTest(req)
def runInvalidIdValuesTest(self): badString = 'id from ' + self.datatype + '; select 1;' with self.assertRaises(ThriftRequestException) as cm: req = DAL.newDataRequest(self.datatype) idValues = DAL.getIdentifierValues(req, badString)
def testGetAvailableLocations(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier("country", ["US", "CN"]) self.runLocationsTest(req)
def runParametersTest(self, req): params = DAL.getAvailableParameters(req) self.assertIsNotNone(params) print(params)
def testGetGeometryData(self): req = DAL.newDataRequest(self.datatype) req.setEnvelope(params.ENVELOPE) req.setParameters("name", "stationid") self.runGeometryDataTest(req, checkDataTimes=False)
def runLocationsTest(self, req): locs = DAL.getAvailableLocationNames(req) self.assertIsNotNone(locs) print("Number of location names: " + str(len(locs))) print("Sample location names:\n" + str(locs[:self.sampleDataLimit]))
def testRequestingTimesThrowsTimeAgnosticDataException(self): req = DAL.newDataRequest(self.datatype) self.runTimeAgnosticTest(req)
def runTimeAgnosticTest(self, req): with self.assertRaises(ThriftRequestException) as cm: times = DAL.getAvailableTimes(req) self.assertIn('TimeAgnosticDataException', str(cm.exception))
def testGetGeometryDataSingleSourceAllParameters(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier("source", "NLDN") req.setParameters(*DAL.getAvailableParameters(req)) self.runGeometryDataTest(req, checkDataTimes=False)
def testDatatypeIsSupported(self): allSupported = (item.lower() for item in DAL.getSupportedDatatypes()) self.assertIn(self.datatype.lower(), allSupported)
def testGetIdentifierValues(self): req = DAL.newDataRequest(self.datatype) optionalIds = set(DAL.getOptionalIdentifiers(req)) requiredIds = set(DAL.getRequiredIdentifiers(req)) self.runGetIdValuesTest(optionalIds | requiredIds)
def testGetAvailableParameters(self): req = DAL.newDataRequest(self.datatype) self.runParametersTest(req)
def testGetGridData(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier('modelName', 'Fcst') req.addIdentifier('siteId', 'OAX') req.setParameters('T') self.runGridDataTest(req)
def testGetGeometryDataSingleSourceSingleParameter(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier("source", "NLDN") req.setParameters('intensity') self.runGeometryDataTest(req, checkDataTimes=False)
def testGetAvailableLocations(self): req = DAL.newDataRequest(self.datatype) self.runLocationsTest(req)