Closed tomsail closed 3 months ago
Is this output from Telemac? If yes then the easiest way to add support would be to add an extra "schema" in normalization.py
. I think that this entails defining:
is_telemac()
normalize_telemac
and then updating:infer_format()
NORMALIZE_DISPATCHER
If you can create a small file, then add a test too: https://github.com/ec-jrc/Thalassa/blob/b9d977cd6999e73f5ad884e9e7b96d4041b60827/tests/normalization_test.py
The reason we have triface_nodes
etc is because:
So the idea is that we keep the original mesh connectivity as is, and we create a new variable that holds the triangle-only connectivity. If there are no quads, then the new variable is just a copy of the original. The thalassa code internally uses the new variable everywhere.
WRT CF naming-conventions etc, we can discuss it at https://github.com/ec-jrc/Thalassa/issues/80
Just to make it clear, we could add support for UGRID compliant netcdfs too. I am for sure not against that, but it is probably going to be more work compared to just updating the current setup. But feel free to investigate it if you want. It is for sure going to be useful in the context of seamesh etc.
Is this output from Telemac?
From TELEMAC yes, but through pyPoseidon where I convert from Selafin file to xarray Dataset.
All details from one format to other is in the norm.py
function of the telemac
branch
the easiest way to add support would be to add an extra "schema" in normalization.py.
So there are 2 ways to solve this:
xarray-selafin
in thalassa
to read directly from Selafins. But it might be too much abstraction for the user and also if xarray-selafin
changes the backend, we'd have to adapt the TELEMAC bindings here too. adapt the conversion convention in pyPoseidon
A third option would be a combination of both. The quickest win is clearly option 2 though.
The idea is to try to keep thalassa decoupled from pyposeidon.
If you add the functionality in pyposeidon, then TELEMAC output will be visualizable by thalassa iff you post-process it with pyposeidon. If you add the functionality in thalassa, then TELEMAC output will be visualizable by thalassa regardless of the way you run/post-processed the results.
That being said, if you truly want to make the TELEMAC output compatible with pyPoseidon, you will probably need to rename the TELEMAC variables/dims anyhow in order to make them compatible with the existing pyposeidon functionality (which uses SCHISM names, pretty much ubiquitusly).
I think that this can be closed. Am I wrong?
This issue is more to open a discussion on naming conventions.
My Dataset has the following format:
When I try to plot:
I get the following error:
That is caused by:
I found the solution by making my dataset compliant with the
GENERIC
format:I also understood the convention
face_nodes
/triface_nodes
is before / after the Quad elements test.concerning the connectivity of the mesh:
Would it be possible to skip the quad element test if you know already that the mesh is an unstructured triangle grid? Also, I think ideally the connectivity of mesh should be renamed to
mesh_topology
, according to UGRID and cf_xarray conventionsconcerning the coordinates
Would it acceptable to consider other names for coordinates ? like
Lon
,x
orlongitude
, or should this aspect be dealt by the user?