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

Environment class does not support weather files with negative longitudes #24

Closed
giovaniceotto opened this issue Jan 31, 2019 · 1 comment
Assignees
Labels
Bug Something isn't working Environment Enviroment Class related features Good first issue Good for newcomers

Comments

@giovaniceotto
Copy link
Member

The current implementation of the Environment class raises an error whenever weather files which make use of negative values for longitude are imported. This error happens in the processNetCDFFile method.

Both longitude ranges, from 0 to 360 and from -180 to 180 should be supported.

One alternative is to try using the 0-360 range and except the -180 to 180 range if an error is raised. This order is motivated by the fact that global models generally use 0-360 ranges, where regional models from the left hemisphere generally use -180 to 180.

@giovaniceotto giovaniceotto self-assigned this Jan 31, 2019
@giovaniceotto giovaniceotto added Bug Something isn't working Good first issue Good for newcomers labels Jan 31, 2019
giovaniceotto added a commit that referenced this issue Jan 31, 2019
@giovaniceotto
Copy link
Member Author

Simple fix applied in the last commit.

The solution was to verify if a file used the range from -180 to 180 by detecting negative values in its longitude list. If so, an appropriate conversion is made to the input longitude to fall into this range (if bigger than 180). If not, the previous method is used, which was made for files ranging from 0 to 360.

giovaniceotto added a commit that referenced this issue Feb 1, 2019
@Gui-FernandesBR Gui-FernandesBR added the Environment Enviroment Class related features label Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Environment Enviroment Class related features Good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants