-
Notifications
You must be signed in to change notification settings - Fork 168
Implementing convert.nemo_to_sgrid()
#2460
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
Merged
VeckoTheGecko
merged 44 commits into
Parcels-code:v4-dev
from
VeckoTheGecko:fieldset_from_nemo-nick
Jan 14, 2026
Merged
Implementing convert.nemo_to_sgrid()
#2460
VeckoTheGecko
merged 44 commits into
Parcels-code:v4-dev
from
VeckoTheGecko:fieldset_from_nemo-nick
Jan 14, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
And update of tutorial_nemo_curvilinear
And updating tutorial
ANd expading comments on loading in the dataset
To use same ordering as in XLinear
This requires smaller selection_dict for the isel, so hopefully faster code
And also separating offset calculation into its own helper function
It's not clear why this is here, nor why removing it causes a test failure. To be investigated another time. EDIT: This was introduced in Parcels-code@c311fba - though we're investigating if this can be implemented another way since there should be no particular difference with NEMO
Gradually reducing the dependency on the `mesh` param
Updates the API for conversion to be more closely aligned with the input data. Also handles the U and V fields separately - correctly assigning the dimension naming before merging into a single dataset.
Update tests
Avoid assuming there's a U and V field. Maybe this should be refactored later...
Co-authored-by: Erik van Sebille <[email protected]>
Avoiding a FutureWarning: The return type of `Dataset.dims` will be changed to return a set of dimension names in future, in order to be more consistent with `DataArray.dims`. To access a mapping from dimension names to lengths, please use `Dataset.sizes`.
This comment was marked as outdated.
This comment was marked as outdated.
VeckoTheGecko
commented
Jan 13, 2026
Remove **fields and replace with normal arg
Contributor
Author
Fixed in f726363 |
Contributor
Author
|
I'm happy with the state of this - happy to merge and iterate in future PRs. @erikvansebille let me know if you have more feedback before merging. |
erikvansebille
approved these changes
Jan 14, 2026
This was referenced Jan 15, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR supercedes #2447
implementing the following additional functionality:
FieldSet.from_nemo()functionality into aconvert.pymodule with anemo_to_sgrid()function. Also added corresponding tests.nemo_to_sgridfunction more closely align with the input datasetsFieldSet.from_sgrid_conventionsto infermeshfrom the metadata included in the datasetget_value_by_id()function toGrid*DMetadataclasses allowing to easily refer to parts of the SGRID metadata modelFuture work:
convert.py- its important that we refactor this module so that its clearer, and have logging so that changes to the input dataset are communicated to the user. To support this, we needI'll make an issue to track this future work.