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

Standardized Streamflow Index and Standardized Groundwater level Index #1877

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

LamAdr
Copy link
Collaborator

@LamAdr LamAdr commented Aug 8, 2024

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
  • Tests for the changes have been added (for bug fixes / features)
    • (If applicable) Documentation has been added / updated (for bug fixes / features)
  • CHANGELOG.rst has been updated (with summary of main changes)
    • Link to issue (:issue:number) and pull request (:pull:number) has been added

What kind of change does this PR introduce?

  • 2 new indices/indicators : SSI and SGI

Does this PR introduce a breaking change?

No

Other information:

  • SSI will use GEV or log-logistic (scipy does not support tweedie)
  • SGI will use log-normal, gamma or GEV

@github-actions github-actions bot added the indicators Climate indices and indicators label Aug 8, 2024
@LamAdr LamAdr marked this pull request as draft August 9, 2024 13:38
@LamAdr LamAdr changed the title Standardised Streamflow Index and Standardised Groundwater level Index Standardized Streamflow Index and Standardized Groundwater level Index Aug 9, 2024
@@ -751,6 +751,54 @@ def test_standardized_precipitation_evapotranspiration_index(

np.testing.assert_allclose(spei.values, values, rtol=0, atol=diff_tol)

# reference results: Obtained with R package `standaRdized`
Copy link
Collaborator Author

@LamAdr LamAdr Aug 12, 2024

Choose a reason for hiding this comment

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

@SarahG-579462 @coxipi
I couldn't find any other reference to test against for SSI (same for SGI I think). I could only replicate two conditions out of many. When the values get too far from zero, standaRdized outputs lots of NaNs and the non-NaNs are far away from us. Also in these replicable values, the offset is somewhat constant.

It looks like the problem is on their side?

Do you think this is still a valuable test then?

I'll also add a couple tests against ourselves.

@github-actions github-actions bot added the docs Improvements to documenation label Aug 13, 2024
tests/test_hydrology.py Outdated Show resolved Hide resolved
xclim/indicators/land/_streamflow.py Outdated Show resolved Hide resolved
xclim/indicators/land/_streamflow.py Show resolved Hide resolved
xclim/indices/_hydrology.py Outdated Show resolved Hide resolved
xclim/indices/_hydrology.py Show resolved Hide resolved
xclim/indices/_hydrology.py Outdated Show resolved Hide resolved
xclim/indices/stats.py Outdated Show resolved Hide resolved
@LamAdr
Copy link
Collaborator Author

LamAdr commented Aug 23, 2024

Where things stand
SSI is completed
SGI

  • needs tests (xclim-testdata lacks groundwater data. Maybe we can get some here.)
  • I am not sure about the APP for lognorm

@Zeitsperre
Copy link
Collaborator

Just an FYI, but some tests are expected to fail until #1889 is merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements to documenation indicators Climate indices and indicators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New standardized indices
2 participants