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.
Description Of Changes
So this is a first attempt to get in the spherical correction terms as discussed in #893. List of calculations modified:
These changes are effective for global datasets that use a lat/lon coordinate. In some testing with NAM data, the correction is not needed or will need a different type of correction. I'll update the issue with a bit more information about this for the ongoing discussion.
Current implementation adds latitude to the list of keyword arguments for affected calculations (some already had it) and a flag for whether to apply the spherical correction (default to True). The reason to default to True is that users are more likely to need it. It would be best if we could programmatically figure out if it is needed based on the CRS, but this placeholder will do for this initial draft of a PR. Therefore, I did not add documentation about the spherical_correction keyword argument figuring we can wait to see how the final implementation goes.
I updated some of the tests where we won't want the correction (made up data that is not associated with lat/lon values). A number of tests will fail as I have not attempted to go through and update values based on the corrected calculations.
We should add some tests based on a non-GFS actual data file (e.g., NAM) for these specific calculations.
Checklist