akrherz / iem

Code that makes the Iowa Environmental Mesonet run, or run into the ground.
MIT License
135 stars 63 forks source link

Additional Sounding/RAOB JSON endpoints #117

Open akrherz opened 7 years ago

akrherz commented 7 years ago

Currently, we have /json/raob.py?station=XXXX&ts=YYYYMMDDHH24MI JSON service that emits a profile for a given station and time (why didn't I do ISO timestamps, sigh). Lets implement some more.

Currently, the service returns a JSON object like so:

{"profiles": [{"station": "", "valid": "", "profile": []}]
}

So lets extend the above and in the case of metadata requests, not include the profile:[]

{"profiles": [{"station": "", "valid": "", "name": "", 
                   "latitude": 99.99, "longitude": 99.99, "profile_href": "/uri-fordata"}]
}
jthielen commented 6 years ago

How difficult would it be to allow for multiple simultaneous station requests?

akrherz commented 6 years ago

Hi @jthielen it is probably more a matter of being practical than difficult. Are you hoping to get all stations for a given time or period of time?

jthielen commented 6 years ago

Indeed, what I've been looking to do is request all stations at a given time, in order to make an upper air chart example with siphon/metpy.

akrherz commented 6 years ago

@jthielen you can now make a request http://mesonet.agron.iastate.edu/json/raob.py?ts=2018-06-26T12:00:00Z&pressure=500 to get all my 500 hPa values for a given timestamp. Dropping the pressure parameter yields all profiles for all stations :)

jthielen commented 6 years ago

Very nice! Thank you for helping with this so quickly!