-
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
Paris formatting #161
Merged
Merged
Paris formatting #161
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…anges for which ukmo mask countries are used
...still needs to be turned into a script... currently only works on my local machine
Previous regex didn't allow underscores in variable names.
This version uses the variable names "x", "bc", "sigma", "mu_bc", and "y", and allows passing in a dimension string or tuple for each random variable ("x", "bc", "sigma")
This class (~InversionOutput~) takes the current (v0.1) RHIME outputs from openghg_inversions and creates: a posterior trace, PyMC model, and contains other info needed for creating PARIS outputs (e.g. basis functions). There is a function to "clean" the raw RHIME dataset, and this is incorporated into ~InversionOutput~ via a class method. There are functions to sample predictive distributions and to output the traces as a dataset with dimensions: site, time, draw, nx, nbc, nsigma_site, nsigma_time.
This class creates a country matrix and optionally restricts it to a selected list of countries. Its main purpose is to provide a method to create country traces from an InversionOutput object. Country objects can be merged, allowing the use of multiple country files. Note: the __init__ method requires a dataset, not a file path, so the country files need to be loaded separately.
units can be specified as pandas period string
to seconds since 1 Jan 1970 instead of days
..instead of all files found
...and added option to run without computing concentration
The species for the country outputs was accidentally hard coded to "sf6". I fixed this bug, and converted country total units to kg/yr from g/yr. The outputs now match what HBMCMC outputs.
This will let us use the EEZ file if we want.
report mode by passing `--mode` flag on command line
need to try/except for bc prior
we still want to use "mode" for country totals and emissions
in flux and country totals
… the template: PARIS_Lagrangian_inversion_concentration_EUROPE.cdl
…ngian_inversion_concentration_EUROPE.cdl
We were assuming that the basis region numbers would always start at 0, but this is only true because we subtract 1 from the basis functions before saving the output in openghg_inversions. There isn't really a reason to modify the basis functions before outputting them, so if we change this in inversions, our assumption would be wrong. This change will avoid this potential problem.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request Template: delete as needed and mark appropriate check boxes [ ] with an x
Description:
Script to create PARIS outputs.
This script requires a venv with
openghg_inversions
installed, as well as thesparse
package (which can be installed usingpip install sparse
).Run using (for instance):
It is assumed that the
-c
argument (for "country_files_path") points to a directory containingcountry_EUROPE.nc
andcountry-ukmo_EUROPE.nc
. This could be changed in the future, but in addition to specifying the country map, we also need to specify which countries we want to use, so passing these as arguments would be unwieldy.Type of Change:
[ ] Bug fix
[ ] New feature
[ ] Code-breaking change
Checklist:
[ ] Code documentation has been updated if needed
[ ] If new tests are needed, they have been added
[ ] All tests pass
[ ] No merge conflicts
[ ] /CHANGELOG.md has been updated if change is significant
Other Comments:
Any additional comments to reviewers not accounted for above