Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out-of-file topology definition #79

Closed
jay-hennen opened this issue Feb 4, 2016 · 10 comments
Closed

Out-of-file topology definition #79

jay-hennen opened this issue Feb 4, 2016 · 10 comments

Comments

@jay-hennen
Copy link
Contributor

I'm working with a ROMS file for the NJ shore (from here) and I'm trying to get it to load into an SGrid object so I can use it in pygnome. However, since the file is missing the 'grid' variable containing the grid topology, it can't load anything. There doesn't seem to be (or I haven't found) a way to define this externally when loading a netCDF file.

Aside from constructing the object manually or the data source being updated to SGrid compliance, do I have any options as things are now?

@ocefpaf
Copy link
Member

ocefpaf commented Feb 4, 2016

Providing a callback function to fix non-compliant data at load time is under our radar, but I cannot allocate time to implement that anytime soon 😒

Another way is to send rsignell-usgs's yaml2ncml to the data provider and fix the data at the source.

@ocefpaf
Copy link
Member

ocefpaf commented Feb 4, 2016

In a way this is duplicate of #63. Closing to avoid confusion.

@ocefpaf ocefpaf closed this as completed Feb 4, 2016
@rsignell-usgs
Copy link
Contributor

The NJ ROMS dataset in question was created with yaml2ncml and does have a grid variable:

http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/zdefne/run076/his/00_dir_roms_display.ncml.html

It also works okay in sci-wms, which uses pysgrid to read the dataset.
What exactly is the problem you are having?

@jay-hennen
Copy link
Contributor Author

Hmm, must have been my inexperience with the system then! The link you posted has it clearly at the bottom, but I'm not sure how to get a .nc from that page. I don't see it either in the first link and it wasn't included in the download link I got from @hetland

I'm trying to get a local copy of the grids and a few time, u, and v slices to work with.

@rsignell-usgs
Copy link
Contributor

@jay-hennen, can't you access the OPeNDAP link instead of local netcdf?

@jay-hennen
Copy link
Contributor Author

I could, and I have done similar while working on pysgrid. I'm looking for a local file so I don't have to wait for the network when doing pygnome runs during development

@rsignell-usgs
Copy link
Contributor

The best way to grab just a few u,v slices and a few times would be with the NetCDF Subset Service, but unfortunately there is a bug that prevents this from currently working.

You could instead use NCO, however. If you are on mac or linux, we have that packaged for conda:

conda install -c ioos nco

Then you could do extract surface velocity (layer 6) for 5 time steps by typing:

 ncks -d s_rho,6 -d ocean_time,0,4  -v u,v,h,zeta,grid "http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/zdefne/run076/his/00_dir_roms_display.ncml"  small_local.nc

@jay-hennen
Copy link
Contributor Author

Thanks a lot. I'll give it a try.

Surface velocity is layer 6? Does that make 0 the bottom? That's funny, I thought it was the other way around.

@rsignell-usgs
Copy link
Contributor

Yep, in FVCOM and most models, 0 is the surface layer, but in ROMS, 0 is the bottom layer.

@jay-hennen
Copy link
Contributor Author

Well that's confusing! But hey, I'm just the code monkey :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants