pmlmodelling / nctoolkit

A Python package for netCDF analysis and post-processing
https://nctoolkit.readthedocs.io/en/latest/
GNU General Public License v3.0
76 stars 10 forks source link

[JOSS] Clarify that you cannot deal with unstructured #71

Closed platipodium closed 11 months ago

platipodium commented 1 year ago

I tried unstructured CF-compliant data with "Conventions = "CF-1.7, UGRID-1.0".

Nctoolkit failed on loading the dataset, ultimately resulting in

ValueError: Unable to parse coordinates. Please check if dataset has a lonlat grid!

after lots of CDO warnings:


The variable(s) Mesh2_edge_bc,Mesh2_edge_nodes,Mesh2_edge_faces,Mesh2_face_nodes,Mesh2_face_edges,Mesh2_face_colour,Mesh2_face_bc,SubMesh2_face_SubPolygon_Maske_2d,SubMesh2_edge_SubKanten_Maske_2d have integer data type. Consider setting data type to float 'F64' or 'F32' using set_precision.
CDO warning: cdi  warning (cdf_set_var): inconsistent variable definition for submesh2_face_area!
CDO warning: cdi  warning (cdf_set_var): inconsistent variable definition for mesh2_face_wasserflaeche_2d!
CDO warning: cdi  warning (cdf_set_var): inconsistent variable definition for mesh2_edge_mit_hor_durchstroemte_kantenflaeche_2d!
CDO warning: cdi  warning (cdf_set_var): inconsistent variable definition for mesh2_face_mit_ver_durchstroemte_zellenflaeche_2d!
This variable's structure is not supported by CDO: mesh2_tracerklassen_2d. Full CDO warning: cdi  warning (cdf_check_variables): unsupported data type (char/string), skipped variable mesh2_tracerklassen_2d!
This variable's structure is not supported by CDO: md5sum_m_untrim2009_steer. Full CDO warning: cdi  warning (cdf_check_variables): unsupported data type (char/string), skipped variable md5sum_m_untrim2009_steer!
This variable's structure is not supported by CDO: md5sum_m_utromp2009_steer. Full CDO warning: cdi  warning (cdf_check_variables): unsupported data type (char/string), skipped variable md5sum_m_utromp2009_steer!
This variable's structure is not supported by CDO: contents_m_untrim2009_steer_untrim2009_main. Full CDO warning: cdi  warning (cdf_check_variables): unsupported data type (char/string), skipped variable contents_m_untrim2009_steer_untrim2009_main!
This variable's structure is not supported by CDO: contents_m_untrim2009_steer_utromp2009. Full CDO warning: cdi  warning (cdf_check_variables): unsupported data type (char/string), skipped variable contents_m_untrim2009_steer_utromp2009!
This variable's structure is not supported by CDO: contents_m_untrim2009_steer_eqs. Full CDO warning: cdi  warning (cdf_check_variables): unsupported data type (char/string), skipped variable contents_m_untrim2009_steer_eqs!
This variable's structure is not supported by CDO: contents_m_untrim2009_steer_sedimorph. Full CDO warning: cdi  warning (cdf_check_variables): unsupported data type (char/string), skipped variable contents_m_untrim2009_steer_sedimorph!
This variable's structure is not supported by CDO: contents_m_untrim2009_steer_sv. Full CDO warning: cdi  warning (cdf_check_variables): unsupported data type (char/string), skipped variable contents_m_untrim2009_steer_sv!
This variable's structure is not supported by CDO: contents_m_utromp2009_steer_z_layer. Full CDO warning: cdi  warning (cdf_check_variables): unsupported data type (char/string), skipped variable contents_m_utromp2009_steer_z_layer!
This variable's structure is not supported by CDO: dmqs_steering. Full CDO warning: cdi  warning (cdf_check_variables): unsupported data type (char/string), skipped variable dmqs_steering!
This variable's structure is not supported by CDO: dmqs_data_path_file. Full CDO warning: cdi  warning (cdf_check_variables): unsupported data type (char/string), skipped variable dmqs_data_path_file!
This variable's structure is not supported by CDO: dmqs_method. Full CDO warning: cdi  warning (cdf_check_variables): unsupported data type (char/string), skipped variable dmqs_method!
This variable's structure is not supported by CDO: dmqs_execution_start. Full CDO warning: cdi  warning (cdf_check_variables): unsupported data type (char/string), skipped variable dmqs_execution_start!
CDO warning: cdi  warning (cdfinqcontents): coordinates variable mesh2_face_z_face_2d can't be assigned!
CDO warning: cdi  warning (cdfinqcontents): coordinates variable mesh2_edge_z_edge_2d can't be assigned!
This variable's structure is not supported by CDO: mesh2_max_subedgeclass_depth. Full CDO warning: cdi  warning (cdf_read_xcoord): unsupported array structure, skipped variable mesh2_max_subedgeclass_depth!
This variable's structure is not supported by CDO: mesh2_max_subfaceclass_depth. Full CDO warning: cdi  warning (cdf_read_xcoord): unsupported array structure, skipped variable mesh2_max_subfaceclass_depth!
This variable's structure is not supported by CDO: submesh2_face_depth. Full CDO warning: cdi  warning (cdf_read_ycoord): unsupported array structure, skipped variable submesh2_face_depth!
This variable's structure is not supported by CDO: submesh2_edge_depth. Full CDO warning: cdi  warning (cdf_read_ycoord): unsupported array structure, skipped variable submesh2_edge_depth!
This variable's structure is not supported by CDO: submesh2_face_contact. Full CDO warning: cdi  warning (cdf_read_xcoord): unsupported array structure, skipped variable submesh2_face_contact!
This variable's structure is not supported by CDO: submesh2_edge_contact. Full CDO warning: cdi  warning (cdf_read_xcoord): unsupported array structure, skipped variable submesh2_edge_contact!
This variable's structure is not supported by CDO: submesh2_face_class_contact. Full CDO warning: cdi  warning (cdf_read_xcoord): unsupported array structure, skipped variable submesh2_face_class_contact!
This variable's structure is not supported by CDO: submesh2_edge_class_contact. Full CDO warning: cdi  warning (cdf_read_xcoord): unsupported array structure, skipped variable submesh2_edge_class_contact!
This variable's structure is not supported by CDO: mesh2_face_tracer_2d. Full CDO warning: cdi  warning (cdf_read_ycoord): unsupported array structure, skipped variable mesh2_face_tracer_2d!
This variable's structure is not supported by CDO: mesh2_face_tracervolumen_2d. Full CDO warning: cdi  warning (cdf_read_ycoord): unsupported array structure, skipped variable mesh2_face_tracervolumen_2d!
This variable's structure is not supported by CDO: mesh2_face_tracer_einleitungs_entnahme_rate_2d. Full CDO warning: cdi  warning (cdf_read_ycoord): unsupported array structure, skipped variable mesh2_face_tracer_einleitungs_entnahme_rate_2d!
This variable's structure is not supported by CDO: mesh2_edge_hor_adv_tracertransport_kantenflaeche_2d. Full CDO warning: cdi  warning (cdf_read_ycoord): unsupported array structure, skipped variable mesh2_edge_hor_adv_tracertransport_kantenflaeche_2d!
This variable's structure is not supported by CDO: mesh2_edge_hor_dif_tracertransport_kantenflaeche_2d. Full CDO warning: cdi  warning (cdf_read_ycoord): unsupported array structure, skipped variable mesh2_edge_hor_dif_tracertransport_kantenflaeche_2d!
This variable's structure is not supported by CDO: mesh2_face_divergenz_tracertransport_2d. Full CDO warning: cdi  warning (cdf_read_ycoord): unsupported array structure, skipped variable mesh2_face_divergenz_tracertransport_2d!
CDO warning: cdi  warning (cdfinqcontents): coordinates variable mesh2_face_y can't be assigned!
CDO warning: cdi  warning (cdfinqcontents): coordinates variable mesh2_face_x can't be assigned!
CDO warning: cdi  warning (cdfinqcontents): coordinates variable submesh2_edge_y can't be assigned!
CDO warning: cdi  warning (cdfinqcontents): coordinates variable submesh2_edge_x can't be assigned!
CDO warning: cdi  warning (cdfinqcontents): coordinates variable submesh2_face_y can't be assigned!
CDO warning: cdi  warning (cdfinqcontents): coordinates variable submesh2_face_x can't be assigned!
CDO warning: cdi  warning (cdfinqcontents): coordinates variable mesh2_edge_y can't be assigned!
CDO warning: cdi  warning (cdfinqcontents): coordinates variable mesh2_edge_x can't be assigned!
This variable's structure is not supported by CDO: mesh2_subedgeclass_length. Full CDO warning: cdi  warning (cdf_read_xcoord): unsupported array structure, skipped variable mesh2_subedgeclass_length!
platipodium commented 1 year ago

So I guess while your claim ".. useful for oceanographers" must be toned down to explicitly refer to structured (logically rectangular?) grids.

https://github.com/openjournals/joss-reviews/issues/5494

robertjwilson commented 1 year ago

Hmm. That error message isn't quite right, as it's the data structure of the variable that CDO dislikes not the grid necessarily. I need to tweak some code so that it provides a better error message in this case.

Strictly speaking, half of the time CDO does work with unstructured grids. So it's tricky to provide clear guidance on this in the nctoolkit website.

Which claim are you referring to? The word "oceanographer" does not appear in the paper. Is this claim on the website?

platipodium commented 1 year ago

You're right, not "oceanographer" but quoting from your statement of need:

"... oceanic model output .. irregular vertical grids"

Having the irregular vertical capability is of great help and sets your package apart from other software solutions. But in oceanography we not only have irregular vertical grids but also irregular horizontal grids. This has been (more or less) tackled by the psyplot package (also a JOSS paper, https://www.theoj.org/joss-papers/joss.00363/10.21105.joss.00363.pdf), but that one can't deal with irregular horizontal AFAIK

robertjwilson commented 11 months ago

I've now added a "Data supported" section to the website that hopefully clarifies these issues.

https://nctoolkit.readthedocs.io/en/latest/supported.html

platipodium commented 11 months ago

Thanks for addressing this. The statement clarifies this, indeed, sufficiently. If you have the chance, I'd suggest you add some simple unstructured grids from typical ocean model outputs to your test suite and list support models.

robertjwilson commented 11 months ago

Good suggestion. We use nctoolkit for fvcom analysis locally, so that should be added to the test suite. I've just raised an issue: https://github.com/pmlmodelling/nctoolkit/issues/93