Skip to content

Fix arctic_hydrology climatology Blaskey-adjusted JSON vs. original GCM CSV discrepancies - #737

Merged
charparr merged 2 commits into
mainfrom
json_csv_discrepancy
Aug 11, 2026
Merged

Fix arctic_hydrology climatology Blaskey-adjusted JSON vs. original GCM CSV discrepancies#737
charparr merged 2 commits into
mainfrom
json_csv_discrepancy

Conversation

@cstephen

@cstephen cstephen commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

This PR fixes the discrepancy in values between outputs of these two URLs (for example):

http://localhost:5000/arctic_hydrology/modeled_climatology/81009008
http://localhost:5000/arctic_hydrology/modeled_climatology/81009008?format=csv

The problem was that the gcm_diff_applied_to_blaskey adjustment was being done after the CSV export code, not before, for both the modeled_climatology and wt_modeled_climatology endpoints.

I've also added a couple chunks of code to move the "historical" model above the projected models in the CSVs to make them more intuitive and consistent with our other CSVs.

To test, I pointed the hydroviz webapp at this json_csv_discrepancy Data API branch and disabled LOWESS smoothing + enabled hovermode to cross reference values from the hydrographs & water temperature hydrographs with their corresponding CSVs to make sure that the same values appear on the same dates. I also cross-referenced a handful of flow & temperature stat table values against their corresponding CSVs. Everything is as expected!

@cstephen
cstephen marked this pull request as draft July 31, 2026 19:36
@cstephen
cstephen marked this pull request as ready for review August 4, 2026 20:25
@charparr
charparr self-requested a review August 11, 2026 18:20

@charparr charparr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've tested the JSON and CSV routes for a few different IDs, both CONUS and AK, and can verify they are aligned in terms or structure, numerical content, and associated metadata.

@charparr

Copy link
Copy Markdown
Member

Note the test failures here are just referencing missing env vars for kuti, so can disregard.

@charparr
charparr removed the request for review from brucecrevensten August 11, 2026 18:27
@charparr
charparr merged commit 5293617 into main Aug 11, 2026
1 check failed
@charparr
charparr deleted the json_csv_discrepancy branch August 11, 2026 18:27
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.

2 participants