Open acrosby opened 6 years ago
I'll let @jay-hennen try to debug this, but as for the canonical datasets, no. But we do have the ones we happen to have tested with. @jay-hennen should be able to point you to those.
But it's a good idea -- we should have a good set for tests and demonstrations. I"d like to see both:
We'd love anyone to help find a comprehensive set to test with.
@ChrisBarker-NOAA I'm happy if to host some data in our AWS S3 buckets with public http access or at least until a better solution can be found.
Can you provide more metadata about the dataset or variable you're trying to open (shape? level or zeta depth?) Also, the function call you used to create the Variable in the first place
What's happening in the first case seems to be a misinterpretation of the data. It's using a zeta-style depth interpolator despite the data being level-depth (right?)
The second might be a straight bug, but I'd need to check the metadata to be sure...
For the first SGrid related error (also same issue using the WHOI BORA dataset found in the example referenced above), Metadata for dataset: https://opendap.co-ops.nos.noaa.gov/thredds/dodsC/NOAA/TBOFS/MODELS/201801/nos.tbofs.fields.f006.20180116.t00z.nc.html
f = "http://opendap.co-ops.nos.noaa.gov/thredds/dodsC/NOAA/TBOFS/MODELS/201801/nos.tbofs.fields.f006.20180116.t00z.nc"
nc = gridded.Dataset(f)
bbox = get_bbox(nc)
var = "salt"
#var = "u"
#var = "zeta" # works
p = nc.variables[var]
time = p.time.get_time_array()
rlon, rlat = np.meshgrid(np.linspace(bbox[0], bbox[2], 1000),
np.linspace(bbox[1], bbox[3], 1000))
rp = p.at(np.vstack((rlon.ravel(),
rlat.ravel())).T,
time[0]).reshape(rlon.shape)
For the second error message (UGrid, possibly related to #19, but in general the api goes seem to know when vars are nodal or not), Metadata: http://opendap.co-ops.nos.noaa.gov/thredds/dodsC/NOAA/NWGOFS/MODELS/201801/nos.nwgofs.fields.f006.20180116.t03z.nc.html
f = "http://opendap.co-ops.nos.noaa.gov/thredds/dodsC/NOAA/NWGOFS/MODELS/201801/nos.nwgofs.fields.f006.20180116.t03z.nc"
nc = gridded.Dataset(f)
bbox = get_bbox(nc)
var = "salinity"
#var = "u"
#var = "zeta" # works
#var = "ua" # works
p = nc.variables[var]
time = p.time.get_time_array()
rlon, rlat = np.meshgrid(np.linspace(bbox[0], bbox[2], 1000),
np.linspace(bbox[1], bbox[3], 1000))
rp = p.at(np.vstack((rlon.ravel(),
rlat.ravel())).T,
time[0]).reshape(rlon.shape)
Looks like in the SGrid case, you aren't using 3D points in the .at call, if I'm reading the code right.
The UGrid problem is that I think that the depth coordinate system described in the metadata isn't actually supported yet. I'll have to look deeper at the siglay and siglev variables to be sure.
Looks like in the SGrid case, you aren't using 3D points in the .at call, if I'm reading the code right.
if that is the case, let's make sure it gives a better error msg! Or was it giving a 2D result OK, just not what you were expecting?
Yeah, it should be able to give a better message than that. It should only give it in the _depth_interp function, since that's when 3D points become required
So am I understanding correctly that the points input should have a third coordinate for depth? What does the depth
kwarg do? --or perhaps the docstring is not up-to-date?
EDIT: Yes this does appear to work for me, very cool! I guess the docstring and example need to be updated?
PRs accepted :-)
@jay-hennen Did you find out if this is the case?
The UGrid problem is that I think that the depth coordinate system described in the metadata isn't actually supported yet. I'll have to look deeper at the siglay and siglev variables to be sure.
Actually, with the warnings being reported in jupyter, I can see that this is probably the case:
/usr/local/lib/python2.7/dist-packages/gridded/depth.py:507: RuntimeWarning: Unable to automatically determine depth system so reverting to surface-only mode. Please verify the index of the surface is correct.
warnings.warn('''Unable to automatically determine depth system so reverting to surface-only mode. Please verify the index of the surface is correct.''', RuntimeWarning)
I am getting the following error trying to access non-zeta (and non-depth avg velocity) parameters from SGrid datasets. This example by @rsignell-usgs (https://github.com/NOAA-ORR-ERD/gridded/blob/master/examples/trajectory_test.ipynb) indicates that the functionality should work, but I have tested with the example BORA dataset and get the same errors.
I have a similar problem with UGrid datasets, but different error. Both issues seem to be occurring in the part of the code that is trying to deal with depth. Which explains the parameters that are being impacted.
Are there canonical SGrid and UGrid datasets that
gridded
is tested against that I can use to rule out issues with the datasets grid/topology/depth identification?