ioos / comt

IOOS Coastal and Ocean Modeling Testbed. See:
https://github.com/ioos/comt/wiki
MIT License
1 stars 7 forks source link

python/pyugrid_test.py example plots zero elevations from WW3 model or faults on ADCIRC #34

Closed drf5n closed 9 years ago

drf5n commented 9 years ago

comt/python/pyugrid_test.py plots sea_surface_height_above_geoid for a WW3 model at https://github.com/ioos/comt/blob/master/python/pyugrid_test.py#L32 The results appear to be all zeros.

If you comment that line out and try the ADCIRC run at https://github.com/ioos/comt/blob/master/python/pyugrid_test.py#L23 then this line errors:

 cube = iris.load_cube(url,'sea_surface_height_above_geoid')

It appears that Iris tries to combine all the variables with the matching standard name into one datacube, but it chokes on pasting the zeta(time,node) data with the zeta_max(node) See http://comt.sura.org/thredds/dodsC/comt_1_archive_full/inundation_tropical/UND_ADCIRC/Hurricane_Ike_2D_final_run_with_waves/00_dir.ncml.html for the data.

rsignell-usgs commented 9 years ago

@ocefpaf, do you have a recommendation here?

ocefpaf commented 9 years ago

The zeros in WW3 appear to be real, I am not familiar with that model to say. But the ADCIRC failure is because you are using the restrictive iris.load_cube() instead of the less restrictive iris.load() or iris.load_raw(). See the notebook:

http://nbviewer.ipython.org/urls/gist.githubusercontent.com/ocefpaf/21cad6661c4ff1691ae8/raw/c5635d92742c9d0026b4f030e0d240f8472837f6/UGRID.ipynb

as @drf5n noted iris cannot merge the two sea_surface_height_above_geoid because they are not the same shape. There are several ways to get the right data in this case:

rsignell-usgs commented 9 years ago

@ocefpaf, wow, that's embarrassing. Indeed, I had forgotten that I (with help) came up with a solution before. But your solutions are very informative as well.

@drf5n, this should definitely get you going. Okay to close?

ocefpaf commented 9 years ago

Hold on just a sec, cooking a notebook that load all the models in that list to add it here as an example:

http://nbviewer.ipython.org/urls/gist.githubusercontent.com/ocefpaf/21cad6661c4ff1691ae8/raw/43a740825172b1c94c9e3569d71cd2957ac874f8/UGRID.ipynb

drf5n commented 9 years ago

Maybe close after someone can update the sample code demonstrating pyugrid with ocefpaf's new notebook.

rsignell-usgs commented 9 years ago

Do you mean the instructions here? https://github.com/ioos/comt/wiki/Accessing%20COMT%20data%20with%20Python

rsignell-usgs commented 9 years ago

@drf5n , ah, you mean add here: https://github.com/ioos/comt/tree/master/python @ocefpaf, would you mind adding your cool UGRID notebook http://nbviewer.ipython.org/urls/gist.githubusercontent.com/ocefpaf/21cad6661c4ff1691ae8/raw/43a740825172b1c94c9e3569d71cd2957ac874f8/UGRID.ipynb You could use the simple edit + cut+and+paste PR method on github!

ocefpaf commented 9 years ago

Done: https://github.com/ioos/comt/pull/35

drf5n commented 9 years ago

Cool. Thanks.