-
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
GCGridObj tools for cubed-sphere grids #239
Merged
Merged
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
The new tools file, cstools.py, includes an example of how to extract cubed-sphere grid indexes (nf, Ydim, Xdim) given a target latitude and longitude, and how to use them to extract data for a specific lat-lon box. Using this tool requires python package pyproj not previously required. GCPy will still function without this package. However, you will not be able to call function find_index. The code added was originally developed by Liam Bindle and Sebastian Eastham and was taken directly from the gcgridobj repository. I made a minor change to remove np.int (deprecated) and add example and header. Signed-off-by: Lizzie Lundgren <[email protected]>
docs/environment_files/environment.yml - The updates to the cubed-sphere tools require the pyproj library. We have now added pyproj==3.6.0 as a PyPi dependency. Signed-off-by: Bob Yantosca <[email protected]>
gcpy/cstools.py - Ran through the Pylint linter and adopted several style suggestions: - Updated Pydoc strings / Added missing Pydoc strings - Redefined variable names to adhere to snake_case style - Now define radians to degrees & vice versa constants at the top of the module - Make sure most lines are within 80 characters
yantosca
added
the
topic: Cubed-Sphere Grid
Pertains to cubed-sphere grids and/or regridding
label
Jul 25, 2023
CHANGELOG.py - Added sentence about adding gcpy/cstools.py Signed-off-by: Bob Yantosca <[email protected]>
CHANGELOG.md - Add sentence about the environment.yml file being updated to install pyproj version 3.6.0 via pip. Signed-off-by: Bob Yantosca <[email protected]>
yantosca
approved these changes
Jul 25, 2023
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.
Good to merge! Thanks @lizziel!
hannahnesser
pushed a commit
to hannahnesser/gcpy
that referenced
this pull request
Jan 22, 2024
This merge brings PR geoschem#239 (GCGridObj tools for cubed-sphere grids, by @lizziel) into GCPy. This adds several utility functions for working with data on cubed-sphere grids. These were from the GcGridObj repository by Liam Bindle and Sebastian Eastham, but had never been formally merged into GCPy. Of note, there is now a function find_index, which will allow a user to find the indices of a cubed-sphere grid box given the lat & lon values. This is necessary in several benchmarking contexts. 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: Feature Request
New feature or request
topic: Cubed-Sphere Grid
Pertains to cubed-sphere grids and/or 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 brings in several cubed-sphere utilities that were never formally added to GCPy.
A new module
gcpy/cstools.py
has been added. This module contains cubed-sphere grid functions from Liam Bindle and Sebastian Easatham. Most importantly, a new function to compute the cubed-sphere grid indices corresponding to a given (lat,lon) location has been added.The
gcpy/cstools.py
module was incorporated into GCPy by Lizzie Lundgren and Bob Yantosca. Several Python style updates suggested by Pylint were applied as well. The resulting code has a Pylint score of 9.43/10.