FESOM / pyfesom2

FESOM2 tools https://pyfesom2.readthedocs.io
MIT License
15 stars 10 forks source link

Feat/ascii to netcdf #202

Closed JanStreffing closed 1 year ago

JanStreffing commented 1 year ago

Third times a charm. I hope!

This is the translation of @helgegoessling routines for spheRlab , which can read the FESOM ascii mesh files, compute a number of useful mesh characteristics, such as polygon neighborhood info, and save it all as a CDO conform netCDF file. I'd be happy to get feedback. I realize there is quite some duplication with the normal load_mesh function. I started with the file reading, and at the time I did not think about adding this to pyfesom2, but rather to ocp_tool2. However, I think in pyfesom2 it might be better fitting and available to more users.

Let me know what you think of the style. Functionality seems to work. I'm planning to add some more soon, so that we get a description of the cavity in the netcdf file. That was in fact the reason I started with this.

I tried using dask delayed on another branch: https://github.com/FESOM/pyfesom2/tree/25868585c3972a46db461e003a7334173b43bd96. While it worked, I saw virtually no speedup. Which is strange, because I normally get a between x10 and x20, e.g. when loading files in parallel with dask delayed. Maybe too many operations, each of which is not expensive enough in itself?

koldunovn commented 1 year ago

@JanStreffing as the #203 is merged there is no need to merge this on, right?

JanStreffing commented 1 year ago

correct! ty