Giter VIP home page Giter VIP logo

Comments (6)

pmav99 avatar pmav99 commented on June 9, 2024 1

OK. I guess I will just close the issue.

from thalassa.

pmav99 avatar pmav99 commented on June 9, 2024

Hello Atieh

I am afraid we haven't really looked into 3D output.

Judging from the screenshots, my guess is that there is some issue with the element connectivity.

ds = xr.open_dataset("~/Downloads/stofs_3d_atl.t12z.n001_024.field2d.nc")
ds.dims
ds.SCHISM_hgrid_face_nodes.min().values
ds.SCHISM_hgrid_face_nodes.max().values

outputs

FrozenMappingWarningOnValuesAccess({'time': 24, 'nSCHISM_hgrid_node': 2654153, 'nSCHISM_hgrid_face': 5039151, 'nMaxSCHISM_hgrid_face_nodes': 3})
array(3, dtype=int32)
array(2653944, dtype=int32)

Do notice that the node connectivity only starts from 3 and only reaches up to 2653944 instead of 2654153.

So, it seems that these files don't contain the full mesh for whatever reason.


related: #61

from thalassa.

pmav99 avatar pmav99 commented on June 9, 2024

You can try to copy the mesh connectivity from the schout_adcirc_* file and then it should might work. You will probably need to rename a bunch of dimensions though.

from thalassa.

AtiehAlipour-NOAA avatar AtiehAlipour-NOAA commented on June 9, 2024

@pmav99 Thank you so much for the great suggestion. I tried to use the format and names inside the shout_adcirc file and rename and replace values and dimensions in field2d.nc files.

First I read the nc files.
image

image

Then I renamed and replaced the dimensions and variables in field2d.nc files.

ds2= ds2.rename({'nSCHISM_hgrid_node': 'node', 'nSCHISM_hgrid_face': 'nele', 'nMaxSCHISM_hgrid_face_nodes': 'nvertex'})
ds2 = ds2.drop_dims('nele')
ds2['nele'] = ds['nele']
ds2['nvertex']=ds['nvertex']
ds2['element']= ds['element']
ds2= ds2.rename({'SCHISM_hgrid_node_x': 'x', 'SCHISM_hgrid_node_y': 'y'})
ds2

image

I normalized and cropped the data using Thalassa.

When I plot the data the depth values look OK, but for the rest of variables, there are a lot of missing data.

image

image

image

image

The same happens when I copy each variable to shout_adcirc file.

from thalassa.

pmav99 avatar pmav99 commented on June 9, 2024

Hmm... The missing values seem to be on triangles that are over land. So it could be that some kind of mask is applied on the dataset. Have you checked if there are values there? I suspect that there are nans for elev etc.

Check the original netcdf files. Not the normalized datasets. E.g. with

ds_orig = xr.open_dataset(...)
ds_orig.isel(nSCHISM_hgrid_node=0).elev.values

If this is the case, this should also explain why these files contain a subset of the connectivity. The mask must have been applied there, too.

from thalassa.

AtiehAlipour-NOAA avatar AtiehAlipour-NOAA commented on June 9, 2024

@pmav99, you're correct. I looked into the nodes in the original dataset near the areas that show as nan in the plots, and it seems that most of them are nan. Thanks a lot for your help and time.

image

from thalassa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.