-
Notifications
You must be signed in to change notification settings - Fork 0
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
Export all layers of the prior in omGeoJSON.py #32
Conversation
|
||
# There is a better way to do this but this will work for now | ||
# Using xarray wasn't straightforward because the layers don't use | ||
# the same attribute names, ie mixing x/y and lat/long. |
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.
That needs to be fixed. The naming is incorrect, but the dimensions are the right size which makes it harder to handle than it should
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.
Agree, but not within the scope of this change. The code here should continue to work after layer names are changed due to its simplicity, so I'd like to leave it as-is for now.
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.
👍
This script is still just used as a debugging script, but exporting all layers gives us more data to debug with.
Instead of writing out identical operations for each layer of the prior, use a list of known layers and apply the same logic to each layer programmatically.
These are aliases of the same function but max is more commonly used and understood.
2c7edba
to
2d500ca
Compare
This typo caused python to construct a list instead of a single value.
By including the max values of each layer once as metadata, each grid cell's relative value can be calculated on the fly. It also makes it easier to understand the relative scale of each layer.
Description
This script is still just used as a debugging script, but exporting all layers gives us more data to debug with.
On one hand, we can visualise each layer distinctly in the front-end, allowing each layer to be checked visually. As a secondary benefit, each layer provides a distinct but realistic example of methane emissions that can be used as mock data for front-end development.
Checklist
Please confirm that this pull request has done the following:
Tests addedDocumentation added (where applicable)Note: I have not added tests, as this file is still only useful for debugging and I do not believe it forms part of the production workflow.
Notes
I attempted to update this script to work more like omDomainJSON.py which uses xarray to select the specific NetCDF layers we're interested in, however that approach wasn't easy because the variables in the prior output file don't all share the same dimensions.