Skip to content
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

Feature Requirement: coordinate rounding #2

Closed
truth-quark opened this issue Jun 13, 2024 · 2 comments
Closed

Feature Requirement: coordinate rounding #2

truth-quark opened this issue Jun 13, 2024 · 2 comments

Comments

@truth-quark
Copy link
Collaborator

truth-quark commented Jun 13, 2024

um2nc needs to process UM files which can have issues with coordinate rounding.

TODO is this correct? Some floating point coordinates are not exact values, e.g. the coordinate is 1000.000001 instead of 1000.0. This can be confusing & can prevent some data alignment. Rounding is applied to clean coordinate values.

Requirements:

  • What coordinate rounding fixes are required?
  • Which data files are affected?
  • Locate small data files to use for unit test data
  • Add tests for the cases
    • Tests cover [1.0, 2.0, ...] -- > [1.0, 2.0, ...] case as a baseline
    • Ensure tests cover [1.0000001, 2.0000001, ...] rounding to 0 case
    • Does the tolerance need to be configurable? (then by extension, a cmd line arg)
@MartinDix
Copy link
Contributor

import iris

ta = iris.load_cube('/g/data/tm70/esm15_testing/sample_output/aiihca.paa1jan',  constraint=iris.AttributeConstraint(STASH='m01s30i204'))
print(ta.coord('pressure').points)
print(ta.coord('pressure').points[-1] - 1000.)

[   1.    5.   10.   20.   30.   50.   70.  100.  150.  200.  250.  300.
  400.  500.  600.  700.  850.  925. 1000.]

1.000444171950221e-10

The dimension variables in the netCDF file are 64 bit, so this gets saved as a value different to 1000 which is annoying/confusing and sometimes causes problems comparing with other variables where the level is set exactly.

@truth-quark
Copy link
Collaborator Author

Closed by #94.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants