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

Add rescale filter and tests #12

Merged
merged 2 commits into from
Nov 23, 2024

Conversation

OpheliaMiralles
Copy link
Contributor

Add Rescale / Convert filters. Rescale allows an operation of type scale*x+offset (and back). Convert takes unit_in, unit_out as arguments and performs a Rescale with adjusted offset and scale (and back).

Added tests using earthkit data mars "2t". Testing that the data min value is changed by the offset value, that the std is unchanged when scale=1, and multiplied by scale when it is different from 1. Test conversion from K to deg Celsius, Celsius to Fahreneit and back to K "manually" (using Rescale with the right constants). Then test conversion from K to deg Celsius using Convert.

Add cfunits dependency.

@FussyDuck
Copy link

FussyDuck commented Nov 18, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@b8raoult b8raoult left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move the "import cfunits" in the method, so we only load it when needed.

@OpheliaMiralles
Copy link
Contributor Author

Done

@b8raoult b8raoult merged commit 9538397 into ecmwf:develop Nov 23, 2024
5 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants