This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Tiffany,Have you by chance tried to plot ldadmesonet data with the python DAF?I used the regional surface plot from Unidata as a template and changed the data type to "ldadmesonet" which appears to be available. The issue comes in when running getMetarObs within the script. I know this was made for metar specifically, but when I use the ldadmesonet data, it comes back with an object. The issue "appears" to be finding the actual data within.This is the block of coding I am having an issue with. If you have the opportunity to try it out yourself at a future date, please let me know.# Create envelope geometry
envelope = Polygon([(bbox[0],bbox[2]),(bbox[0],bbox[3]),
(bbox[1], bbox[3]),(bbox[1],bbox[2]),
(bbox[0],bbox[2])])
# New obs request
DataAccessLayer.changeEDEXHost(edexServer)
request = DataAccessLayer.newDataRequest("ldadmesonet", envelope=envelope)
availableProducts = DataAccessLayer.getAvailableParameters(request)
single_value_params = ["timeObs", "StationId", "longitude", "latitude",
"temperature", "dewpoint", "windDir",
"windSpeed", "seaLevelPress"]
multi_value_params = ["presWeather", "skyCover", "skyLayerBase"]
params = single_value_params + multi_value_params
request.setParameters(*(params))
# Time range
lastHourDateTime = datetime.utcnow() - timedelta(minutes = 20)
start = lastHourDateTime.strftime('%Y-%m-%d %H:%M:%S')
end = datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S')
beginRange = datetime.strptime( start , "%Y-%m-%d %H:%M:%S")
endRange = datetime.strptime( end , "%Y-%m-%d %H:%M:%S")
timerange = TimeRange(beginRange, endRange)
# Get response
response = DataAccessLayer.getGeometryData(request,timerange)
# function getMetarObs was added in python-awips 18.1.4
obs = DataAccessLayer.getMetarObs(response)
print("Found " + str(len(response)) + " records")
print("Using " + str(len(obs['temperature'])) + " temperature records")
for ob in obs:
print obFound 144 records Using 0 temperature records windDir temperature dewpoint longitude skyCover windSpeed timeObs stationName latitude presWeather skyLayerBase seaLevelPress