[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[python #NQM-651440]: Question about extracting sonde output from a forecast model



Greetings!

You can use Siphon to access the full RAP output on THREDDS and pull out a 
profile for a single point:

    from datetime import datetime
    from siphon.catalog import TDSCatalog

    cat = 
TDSCatalog('https://thredds.ucar.edu/thredds/catalog/grib/NCEP/RAP/CONUS_13km/catalog.xml')
    ncss = cat.datasets['Best Rapid Refresh CONUS 13km Time Series'].subset()

    point_query = ncss.query()
    point_query.time(datetime.utcnow())
    point_query.accept('csv') # Or netcdf4 if you prefer
    point_query.variables('Temperature_isobaric', 'Relative_humidity_isobaric')
    point_query.variables('u-component_of_wind_isobaric', 
'v-component_of_wind_isobaric')
    point_query.lonlat_point(-104.65, 39.85) # DIA

    # Save CSV to sounding.csv
    with open('sounding.csv', 'wb') as outfile:
        outfile.write(ncss.get_data_raw(point_query))

That will download the data to a CSV file, with data points spaced 25mb apart. 
You could tweak it to use netCDF3/4 instead.

Cheers!

Ryan


> Hello,
> Every day I run the AERMOD dispersion model to calculate dispersion from
> the Suncor refinery in Commerce City, CO. I had been successfully using
> siphon to automatically download the Denver sonde data from the Univ. of
> Wyoming, to be ingested by the model. Since the NWS ran out of helium in
> July, I've been downloading a morning sonde from model output from this web
> page:  Soundings from GSL (noaa.gov) <https://rucsoundings.noaa.gov/>. I
> started doing this because I thought the sonde launches would resume soon,
> but now it looks like they won't. They have to switch from using helium to
> hydrogen to launch the balloons, and it's going to take awhile for the
> Denver sonde launches to resume. AERMOD requires sonde data to run.
> 
> My question to you is - is there a way to automatically download a sonde
> from model output? Is THREDDS an option? Is there another potential source
> for this? I've been doing some google searches, but I am not having much
> luck. I thought maybe the MetPy folks would know of a good option. I'm
> thinking I can't be the only person who needs Denver sonde data on a
> regular basis.


Ticket Details
===================
Ticket ID: NQM-651440
Department: Support Python
Priority: Low
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.