Repository navigation
Add GloFAS river discharge as an alternative inflow source - #34
Draft
Asdominet34 wants to merge 5 commits into
Draft
Asdominet34 wants to merge 5 commits into
Asdominet34 wants to merge 5 commits into
Conversation
New option inflow.source (era5 | glofas, default era5). With glofas: - download_glofas_discharge: daily GloFAS v4.0 discharge from the EWDS via cdsapi (url set explicitly, so ~/.cdsapirc can keep pointing to the CDS for ERA5) - download_glofas_uparea: static GloFAS v4.0 upstream area map - powerplants_get_inflow_m3 (glofas): each plant takes the discharge of the cell with the largest upstream area within +-search_window_cells (default 1, i.e. 3x3); no smoothing The rest of the pipeline (normalisation, aggregation) is unchanged. cdsapi, xarray and netcdf4 are now explicit module dependencies. ERA5 outputs of the integration test are unchanged; the integration test runs a second, GloFAS instance.
Daily means are placed at noon and hours are linearly interpolated between them, instead of constant steps within each day. Annual volumes are unchanged.
This file contains hidden or 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
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.
Part of #25
Summary of changes in this pull request
inflow.source: era5 | glofas(defaultera5, so existing configurations are unchanged).glofas: daily river discharge from the GloFAS v4.0 historical reanalysis (Copernicus EWDS, downloaded withcdsapi), taken at one GloFAS cell per powerplant instead of ERA5 runoff aggregated over HydroBASINS.inflow.glofas.search_window_cells(default 1, i.e. 3 × 3 cells) of the powerplant. This is a simple placeholder for proper river snapping (River snapping #26). The chosen cells are saved toglofas_cells.parquet.download_glofas_discharge(one request per year, cropped to the shapes) anddownload_glofas_uparea(GloFAS v4.0 upstream area).cdsapi,xarray,netcdf4; lock file and conda environments re-exported.atlitestays at 0.4.0.glofas. README updated (usage, Copernicus account note, citations).Results (Montenegro, 2015)
Comparison with real HydroBASINS (not the synthetic test basins), after normalisation:
Notes for reviewers
cdsapiuses the EWDS URL explicitly, so the same key works for CDS (ERA5) and EWDS.mainon the Montenegro test case.pre-commithooks could not be installed locally, so I ran ruff, snakefmt, codespell and the YAML checks by hand.Reviewer checklist
pipdependencies in the module's environment files (workflow/envs/).pathvars(e.g.,<results>) in their inputs and outputs.pre-commit.citests pass.INTERFACE.yamlmentions all relevantpathvarsandwildcards.README.mddescribes how to use the module and has the necessary citations.Developed with the help of Claude Code; all changes reviewed and tested by me.