-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[utils] netCDF converter #2654
[utils] netCDF converter #2654
Conversation
Is there a test for the command line tool? |
No, there isn't. The smallest nc-file I have is ~170 mb. From what I understand, this is too large for our tests? |
That's too large. There must be small files. As usual, the reason is to have working examples, s.t. in case of code changes the utility is covered. |
std::array<std::size_t, 4> const& dim_idx_map, | ||
bool is_time_dep) | ||
{ | ||
std::size_t const temp_offset = (is_time_dep) ? 1 : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temp means temperature?
why no simply offset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temporal offset ... in contrast to the spatial offset checked further on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rename the variable for readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's the same to you I'll keep it as it is because the UI explicitely says "temporal dimension".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::size_t const temp_offset = (is_time_dep) ? 1 : 0; | |
std::size_t const temporal_offset = (is_time_dep) ? 1 : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The converter looks to be very specific for a given input type and relies on series of inputs from the user.
It is not a generic netcdf converter/extractor, so I'd recommend to rename it to the specific actions it does for that particular file format.
What do you mean by "very specific for a given input type"? It uses arbitrary 2D/3D/4D rasters (gives an error msg for 1D) and creates a mesh out of these. That's the data netCDF contains. I could add a conversion for 1D, too, but it wouldn't make much sense since that is usually diagrams from my experience. What do you think is specific about that? What other data does netCDF contain that you are aware of? In what sense is it not generic? |
I understand but don't have a small file. Unidata offers a number of test files ... I've seen a 22 mb test example for surface data. Would that be acceptable? There might be smaller files but I'd have to check it's not just 1D data. There's also the license issue ... Unidata software is offered under 3 clause BSD but there's no mention if the same rules apply for their example data sets. What's your opinion on that? |
https://www.unidata.ucar.edu/software/netcdf/examples/files.html has several files smaller than 10MiB, e.g. the testrh.nc (only 90KiB). |
Yes, but I need a file containing a 2D, 3D, or 4D array. That is why I said I'd have to check for a small file with a 2D array assuming you think the license automatically extends to datasets as well. |
…urns values, and comment
@endJunction @rinkk Ready to merge, everything is green! |
OpenGeoSys development has been moved to GitLab. |
Command line utility to conver netCDF-files into OGS meshes. Works for both 2d and 3d meshes + time. Multiple time steps can be saved as seperate meshes or as one mesh with one scalar array per time step.
(A follow-up PR will move all non-ui functionality into FileIO and adjust the DataExplorer interface to use that as well.)
Please note:
1.20
, dopip install --upgrade conan
!