## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
Sean Arms
@lesserwhirls
It all comes down to trying to pick which interval to use when a requested time is contained within more than one grid. For example, let's suppose that we have two grids for Total_precipitation_surface_Mixed_intervals_Accumulation valid at 2019-11-30 18Z, but one is a 6 hour accumulation and one is a 3 hour accumulation.
Now, let's say a user uses NCSS requesting a single time, 2019-11-30T18:00:00. What should the server do?
I think the line of thought was that the user supplied one date/time, and generally expects to receive one grid in return. If we go with that assumption, then the question becomes which grid does the server return - the one representing a 3 hour total or the one representing a 12 hour total?
What the server does is compute the mid-point value from the bounds of the two accumulation totals, and chooses the one whose mid-point is closest to the requested time (effectively the one with the smallest accumulation time period).
What if a time range is given instead of a single value? Well, NCSS bombs out and returns a message that basically says "not yet implemented". What should we do there? Probably an extension of the same idea for a single value. But is that right, or should we return any grid that overlaps with the interval requested?
What could help here, for both cases, is for the NCSS API to allow a user to specify an interval size in addition to the time, something like time=2019-11-30T18:00:00&timeInterval=P6h, which would signal a 6 hour duration for the accumulation valid at 2019-11-30 18Z. Then, for a request with a time range, it would return any 6 hour accumulation intersecting the time_start and time_end parameters of the request. We'd still need to decide what to do by default if no timeInterval was specified in the request.
Pete Pokrandt
That might do it. I'm trying to relate what the thredds/ncss is doing when compared to how you'd do it in GEMPAK. In GEMPAK, let's look at the 9h forecast time. There are two variables valid at that forecast hour which are accumulated precip. One is a 3h (6 to 9h accum) and the other is a total (time zero to 9h) accumulation. These both show up as valid at the 9h forecast time, but one is named P03M (that last M means millimeters) and the other is named P09M. Similaraly, at, for example, 48h, there is one that is a 6h accumulation (42 to 48h - don't ask me why NCEP uses 6-hourly accumulations at 6/12/18... and 3h at 3/9/15/21... ) and the other is the total (time zero to 48h) - both are valid at the 48h forecast time - one is named P03M and the other is P48M.
I understand that thredds is trying to be forgiving and give me some data at the time that I requested, but I would like a way to say give me this exact data at this exact time or give me an error.
I think being able to tell ncss the timeInterval might fix that - because I could ask for a Total_precipitation_surface_Mixed_intervals_Accumulation from the 12 UTC 29 Nov, 2019 data set, valid at 21 UTC (9h forecast) and either set timeInterval to 3 to get the 3h accumulation product, or timeInterval to 9h (I guess?) to get the 9h product. Or maybe there's a special time/word that would use the 0 to now accumulation? Is that kind of thing going to be really specific to this data?
Sean Arms
@lesserwhirls
Unfortunately, yes, a lot of this is specific to GRIB. However, I think this particular extension to NCSS is needed, otherwise you cannot uniquely request a known combination of valid time and time interval. The 0-valid time (run total) is a special case, and we'd want to be able to handle that. I've started a github issue at Unidata/tds#55 - let's see what ideas we can come up with.
Pete Pokrandt
Sounds good, thanks! I'm just glad I finally figured out what was happening. Was driving me nuts, because the plots I was making matched my wxp ones for pressure, height, temp, etc, but the precip was always wrong. I'm kind of surprised that people haven't come across this problem already. If you just request a certain time accumulated precip from thredds, it's most likely incorrect..
Sean Arms
@lesserwhirls
For mixed interval variables in which there are multiple grids at the same valid time (but with differing interval widths), then it gets nasty for sure. If there are no overlaps, then the mid-point stuff should not come into play. My guess is people grab from OPeNDAP or cdmremote, although if they don't inspect the bounds attribute to see exactly what they are dealing with, then there will be issues as well. The funkiness of translating a collection of GRIB messages to something that looks like netCDF introduces all kinds of weird stuff. I don't think anyone would write a netCDF file with these kinds of mixed intervals on purpose, at least without a lot of soul searching.
agktogether
@agktogether
hello
dome one is therer
@dcamron
i need help
agktogether
@agktogether
this link for today is not working
this link below is not working for today 12 may 2020
or i can not config this link query ... i use this data it was working for 24 12 2019 but i can not get data today ..some one can help me?
what is root and config page to set these variable to access data of today
i really confused
thank
Sean Arms
@lesserwhirls
(I answered @agktogether via eSupport, but posting here in case others are wondering). The issue was that the NCEI server didn't have data for 12 May yet (only up to the 9th at this point). For the most recent output, https://thredds.ucar.edu/thredds/catalog/grib/NCEP/GFS/Global_0p5deg_ana/catalog.html should work (other servers are available, too).
agktogether
@agktogether
and i thanked you @lesserwhirls there but i post here for appreciating more your answer
hannah
@story645
Hi favorite people - I'm using the unidate education gateway thing this summer (thanks @lesserwhirls ) and have like 4 students who are gonna be working on goes 16/goes 17 and was wondering what's the best way to have them not download that 4 times...also does unidata have a cloud version of the gfs-mos?
Ryan May
@dopplershift
We ourselves don't have any cloud MOS. Maybe Google? It just sounds familiar, but I could be making it up. Don't worry about them hitting it 4 times from us, that's fine. If you really care, you could have them access GOES-16/17 from the noaa-goes16 and noaa-goes17 S3 buckets
I would like to get a version of Siphon that contains the fix in #291 - I am using Anaconda. Do I need to build from src from master, or is there a RC somewhere on conda-forge that I can grab that would include these changes? Thanks!
Ryan May
@dopplershift
Boy we really need to make a release. :sob: In the meanwhile, if you have git available, you could do: python -m pip install git+https://github.com/Unidata/siphon.git
Joleen Feltz
@joleenf

I am currently trying to read Radar Level III storm track information from a THREDDS server using Siphon. One of the data variables is text, the second is a Structure. Is there anything I can do with that second variable? Are there any documentation online regarding these files?

 from siphon.catalog import TDSCatalog
from siphon.cdmr import Dataset
from datetime import datetime, timedelta

query_latest = rs.query()
now = datetime.utcnow()
query_latest.lonlat_box(292.9375, 235.0625, 25.0625, 52.9375).time(now).variables('NST')

query_latest_cat = rs.get_catalog(query_latest)

data_available = list(query_latest_cat.datasets.values())
if len(data_available) > 0:
print (data_available[0].access_urls['CdmRemote'])
data_from_thredds = Dataset(data_available[0].access_urls['CdmRemote'])
else:
print ("Empty query")

print (data_from_thredds)

Ryan May
@dopplershift
Well, one option is to try to use opendap, which translates the structure. I'm not sure if that's more helpful or not:
nc = data_available[0].remote_access(service='OPENDAP')
Joleen Feltz
@joleenf
Hi Ryan, I tried both using opendap with netcdf4 and with xarray, the second variable was available/created? with netcdf4 and I am not sure xarray provided easier access to the variable. Though perhaps presents it differently. xarray creates five data variables. Two are string ndarrays of shape (1,) and three are int16 of shape(1,). I am thinking that this dataset is comprised of table-like data...but I don't really know. I have not found format information for these files, though I am still looking.
Joleen Feltz
@joleenf
@dopplershift Looking a little closer at this through the various tools, siphon, netcdf4, xarray... I think that the problem is that the data in the file does not comply with cdm standards as far as I can tell. I will just try to get the weather and climate toolkit scripting working. Hopefully I can point that to an opendap server via a command line call.
Ryan May
@dopplershift
You can open these using MetPy:
from metpy.io import Level3File
from siphon.catalog import TDSCatalog
from datetime import datetime, timedelta

query_latest = rs.query()
now = datetime.utcnow()
query_latest.stations('GRR').time(now).variables('NST')
query_latest_cat = rs.get_catalog(query_latest)
data_available = list(query_latest_cat.datasets.values())
f = Level3File(data_available[0].remote_open())
The internal data structure isn't great and is pretty low level, but for these products, f.sym_block[0] should give you a collection of what's in the file, in order.
Joleen Feltz
@joleenf
@dopplershift Actually, f.sym_block[0] is very helpful. It at least provides a dictionary so it is easier to work with.

Boy we really need to make a release. :sob: In the meanwhile, if you have git available, you could do: python -m pip install git+https://github.com/Unidata/siphon.git

Thank you so much for this suggestion!

Ryan May
@dopplershift
No problem!
agktogether
@agktogether

Hi sirs ,
I am always here to ask some questions.
but this time the problem is how can i access data of the future time that gfs forecast model predicts..
i know this data is there but i can not find it ,i need geoheight, temp, press , u-wind.v-wind properties in isobaric layers...
i am here https://thredds.ucar.edu/thredds/catalog/catalog.html
but i can not find future data 3 hourly ...
for example i need forecast of 3h or 6h after 00:00 in october 30 2020.last night

thanks

Ryan May
@dopplershift
Apologies on the delayed response. I think what you're looking for should be here: https://thredds.ucar.edu/thredds/catalog/grib/NCEP/GFS/Global_0p25deg/catalog.html
winash12
@winash12
i am not able to get anything out of the IGRA soundings site
i keep getting no dates matching selection
kedoneyes
@kedoneyes
When I downloaded the data of 03005 from the University of Wyoming sounding station at 12:00 on January 5, 2019, I found that the data below was wrong
Ryan May
@dopplershift
@winash12 which site and date/time?
@kedoneyes How was it wrong?
kedoneyes
@kedoneyes
@dopplershift The elevation data of the station is not consistent with the data on the network.
winash12
@winash12
from siphon.simplewebservice.igra2 import IGRAUpperAir
date = datetime(2021, 1, 22, 0) station = 'INM00042369'
winash12
@winash12
df, header = IGRAUpperAir.request_data(date, station)
kedoneyes
@kedoneyes