-
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
Fix issue where wrong GCHP grid boxes were being looked up in models vs. obs plots #240
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
benchmark/modules/benchmark_models_vs_obs.py - Convert longitudes and latitudes from xarray.DataArray to numpy.ndarray before computing x_idx and y_idx. This will ensure that x_idx and y_idx are returned as numpy.int64 values. NOTE: There is an issue with the search algorithm for GCHP data. We will rectify this soon. Signed-off-by: Bob Yantosca <[email protected]>
benchmark/modules/run_1yr_fullchem_benchmark.py - gcc_vs_gcc_models_vs_obs_dir, gchp_vs_gcc_models_vs_obs_dir, and gchp_vs_gchp_models_vs_obs_dir now use directory name "ModelVsObs" instead of "Models_vs_Observations". Signed-off-by: Bob Yantosca <[email protected]>
gcpy/util.py - Added utility function verify_variable_type. This will return a TypeError if a variable is not of the expected type or types that are provided. Useful for function argument error checking. Signed-off-by: Bob Yantosca <[email protected]>
gcpy/util.py - Function verify_variable_type now accepts a single type or a tuple of types. These are the allowable types to be passed to isinstance. gcpy/cstools.py - Convert lists of types to tuples in function calls to verify_variable_type - Also remove src_var argument in extract_grid function Signed-off-by: Bob Yantosca <[email protected]>
benchmark_models_vs_obs.py - Now use verify_variable_type to error check function arguments - Replaced find_nearest_3d function with separate functions for returning the model data nearest to the observation site for cubed-sphere and lat-lon grids - Updated PyDoc comments - For cubed-sphere grids, cap the lookup latitude at +/- 89.75 so that the a GCHP grid box can be found for a given (lon,lat) - Cap the y-axis range at 80 ppbv - Set y-axis tickmarks at 0, 20, 40, 60, 80 ppbv gcpy/cstools.py - Update PyDoc and comments with a better description of jitter_size Signed-off-by: Bob Yantosca <[email protected]>
gcpy/grid.py - Remove inaccurate coment in verify_variable_type gcpy/util.py - Add "import numpy as np" instead of just importing individual numpy functions Signed-off-by: Bob Yantosca <[email protected]>
CHANGELOG.md - Added blurb about new verify_variable_type function - Minor edits to fix typos Signed-off-by: Bob Yantosca <[email protected]>
yantosca
added
category: Bug
Something isn't working
topic: Benchmark Plots and Tables
Issues pertaining to generating plots/tables from benchmark output
labels
Jul 27, 2023
msulprizio
approved these changes
Jul 27, 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.
Looks good to merge
yantosca
added
category: Bug Fix
Fixes a bug that was previously reported
and removed
category: Bug
Something isn't working
labels
Aug 1, 2023
hannahnesser
pushed a commit
to hannahnesser/gcpy
that referenced
this pull request
Jan 22, 2024
This merge brings PR geoschem#240 (Fix issue where wrong GCHP grid boxes were being looked up in models vs. obs plots, by @yantosca) into the GCPy 1.4.0 development stream. This fixes an issue with the models vs. observations benchmark plots where the wrong GCHP grid box was being looked up for a given (lon, lat, alt) value. We now use the cubed-sphere functions in gcpy/cstools.py to do the lookup properly. 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 Fix
Fixes a bug that was previously reported
topic: Benchmark Plots and Tables
Issues pertaining to generating plots/tables from benchmark output
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 fixes the models vs observations benchmark plots for GCHP. Previously, an incorrect algorithm was used to retrieve the GCHP grid box nearest to the observational site. We now use the proper algorithm from the
gcpy/cstools.py
module.Before the fix, the GCHP plots showed very high concentrations at high-latitude sites like Villum Nord and Eureka. (NOTE: The green line in this plot is actually GCHP despite the label):
which is now corrected: