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

Obs error clean up #144

Merged
merged 20 commits into from
Jul 1, 2024
Merged

Obs error clean up #144

merged 20 commits into from
Jul 1, 2024

Conversation

brendan-m-murphy
Copy link
Contributor

@brendan-m-murphy brendan-m-murphy commented Jun 21, 2024

  • Summary of changes

Cleaned up code that adds averaging error, using the mf_variability variable that is created by OpenGHG's get_obs_surface function.

A new variable mf_error is created:

  • if "add averaging error" is true, then mf_error is the sqrt root of the sum of squares of repeatability and variability
  • otherwise, mf_error is repeatability if it is present, otherwise, it is variability.

The output file now includes the variables:

  • Yerror_repeatability containing the combined mf_repeatability for all sites
  • Yerror_variatability containing the combined mf_variatability for all sites

These output variables are needed for the PARIS outputs

  • Please check if the PR fulfills these requirements

The obs uncertainty that will be used for the
inversions is stored as "mf_error". The variables
"mf_repeatability" and "mf_variability" are retained
(and filled with zeros if they were not present initially)
Also added a test. Needed to update merged test data,
which necessitated some other updates to the tests.
also fixed some tests, added logger
...to help with debugging issues when uncertainty
in likelihood function is zero
This is replaced by the code in `get_data.add_obs_error`
...only used once, could be replaced by `xr.load_dataset`
@brendan-m-murphy brendan-m-murphy marked this pull request as ready for review June 27, 2024 06:57
Copy link
Contributor

@joe-pitt joe-pitt left a comment

Choose a reason for hiding this comment

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

Looks good! I have successfully run inversions on the min_error_by_site_plus_robust branch after this branch was merged in at commit fe0cc36. I haven't run any inversions to test the changes to this branch since that point, but they look fine to me.

@brendan-m-murphy brendan-m-murphy merged commit d5e369e into devel Jul 1, 2024
3 checks passed
@brendan-m-murphy brendan-m-murphy deleted the obs-error-clean-up branch July 1, 2024 15:00
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

Successfully merging this pull request may close these issues.

addaveragingerror doesn't actually do anything due to functionality in get_obs_surface
2 participants