-
Notifications
You must be signed in to change notification settings - Fork 69
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
Loading Grids with properties #485
Conversation
* add default interploationType * add getInterpolationType * add getInterpolationTypeName
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.
Looks overall good to me. Just a few minor comments
if (ipolType == NEAREST_NEIGHBOUR) | ||
return "NEAREST_NEIGHBOUR"; | ||
|
||
return "NOT_UNDERSTOOD"; |
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.
Could you add a more meaningful error message. Something like "ipolType not well defined: should be either TRILINEAR, TRICUBIC, or NEAREST_NEIGHBOUR".
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.
This is not meant to be an error message. It is the conversion from the data-type to a string for saving.
To be consistent with the reading it has to be without spaces.
The alternative would be raising a runtime error at this point. In this case the saving would not run at all.
Dear all,
this PR introduces the loading of grids with given properties in the header.
The first implementation only allows property reading in the TXT files.
An example of the properties in the header looks like this
all units are in SI base units (in this case m). The loading itself has the conversion variable as before.
Loading a grid can now be done as
I also introduce the possibility to store the properties in the
dumpGridToTxt
function and additional tests for this grid reading/dumping.To have an example, I adjusted the notebook with the grid-based glactic gas densities to use the grid property reading. The files on sciebo (additional resources) are already updated (additional line with the properties in the right format).