-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fixed broken regridding code in file_regrid.py; Updated GCPy regridding documentation #253
Conversation
This file contains 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
docs/source/Regridding.rst - "23" -> "24" in gridspec command in Example 1. Signed-off-by: Bob Yantosca <[email protected]>
gcpy/file_regrid.py - Ignore any FutureWarnings - Trimmed trailing whitespace, updated commments - Remove pandas import (suggested by Pylint) - Refactored code out of the big if/elif block in the file_regrid routine into separate functions - Updated PyDoc comments - Add "with xr.set_options(keep_attrs=True):" blocks to preserve DataSet and DataArray attributes - Add calls to reformat_dims in the refactored functions that regrid to and/or from cubed-sphere/stretched-grid - Replaced hardwired code to save to diagnostic/checkpoint with calls to reformat_dims - Add "lat_bnds" and "lon_bnds" to drop_and_rename_classic_vars - Added function "drop_lon_and_lat" We have verified that file_regrid now works properly when regridding from LL -> CS/SG, LL -> LL, CS/SG -> LL, and CS/SG -> CS/SG. Signed-off-by: Bob Yantosca <[email protected]>
docs/source/Regridding.rst - Updated text and examples for routines in file_regrid.py - Updated text and examples for routines in regrid_restart_file.py - Confirmed that examples work as advertised Signed-off-by: Bob Yantosca <[email protected]>
Perhaps we can resolve the issue in #167 with the knowledge gained from fixing |
This merge brings PR #253 (Fixed broken regridding code in file_regrid.py; Updated GCPy regridding documentation, by @yantosca) into the GCPy 1.4.0 development stream. We have fixed several issues in the current gcpy/file_regrid.py script, so that LL -> CS/SG, LL -> LL, CS/SG -> CS/SG, and CS/SG -> LL regridding now work. Furthermore, we have refactored the code in file_regrid.py for clarity. We have updated the Regridding.rst file and have added some extra examples using file_regrid.py. We have also verified that all examples using file_regrid.py and regrid_restart_file.py work as advertised. This will not affect benchmark code as the plotting routines compare_zonal_mean() and compare_single_level() use the routine regrid_comparison_data from gcpy/regrid.py. Perhaps we can resolve the issue reported in #167 with the knowledge thus gained in preparing this PR. Signed-off-by: Bob Yantosca <[email protected]>
hannahnesser
pushed a commit
to hannahnesser/gcpy
that referenced
this pull request
Jan 22, 2024
This merge brings PR geoschem#253 (Fixed broken regridding code in file_regrid.py; Updated GCPy regridding documentation, by @yantosca) into the GCPy 1.4.0 development stream. We have fixed several issues in the current gcpy/file_regrid.py script, so that LL -> CS/SG, LL -> LL, CS/SG -> CS/SG, and CS/SG -> LL regridding now work. Furthermore, we have refactored the code in file_regrid.py for clarity. We have updated the Regridding.rst file and have added some extra examples using file_regrid.py. We have also verified that all examples using file_regrid.py and regrid_restart_file.py work as advertised. This will not affect benchmark code as the plotting routines compare_zonal_mean() and compare_single_level() use the routine regrid_comparison_data from gcpy/regrid.py. Perhaps we can resolve the issue reported in geoschem#167 with the knowledge thus gained in preparing this PR. Signed-off-by: Bob Yantosca <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
category: Bug
Something isn't working
TODO: Documentation
Related to manual pages or other documentation
topic: Regridding
Issues pertaining to horizontal & vertical regridding
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 has introduced several updates into the
gcpy/file_regrid.py
script (see 0bb6ace):if/elif
blocks into separate routinesAlso rewrote the
docs/source/Regridding.rst
page (see 2b160b6 and dddf513) to be consistent with the updates ingcpy/file_regrid.py
. Also confirmed that all regridding examples with online and offline regridding weights work as advertised.