Skip to content

add multi-gauge facilitation - #10

Open
lotruheawea wants to merge 7 commits into
mhm-ufz:mainfrom
lotruheawea:feature_cache_input_arrays
Open

add multi-gauge facilitation#10
lotruheawea wants to merge 7 commits into
mhm-ufz:mainfrom
lotruheawea:feature_cache_input_arrays

Conversation

@lotruheawea

Copy link
Copy Markdown

implemented some new features

  • caching of input arrays (flowdirection and flow accumulation), was read for each gauge again previously
  • fixed some bugs preventing correct write out of ASCII files (setting the geoarray._fobj attribute to None)
  • added pandas dependency to create csv table of aggregated reports
  • added warning if gauge is reattributed to same id in flow dir network
  • added mode to create a global (combined) idgauges.asc file instead of one per gauge

@MuellerSeb MuellerSeb 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.

Minor comments. Let's see what CI says.

Comment thread README.md
sudo apt-get update
sudo apt install gdal-bin libgdal-dev
pip install wheel numpy
pip install wheel numpy pandas

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.

you don't need to add pandas here (it's only to install gdal correctly)

Comment thread README.md
```
brew install gdal
pip install wheel numpy
pip install wheel numpy pandas

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.

you don't need to add pandas here (it's only to install gdal correctly)

Comment thread README.md
To use the development version of basinex, download this repository and do the following in your conda environment:

conda install -y gdal netcdf4 pyyaml cxx-compiler
conda install -y gdal netcdf4 pyyaml cxx-compiler pandas

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.

here pandas is correct ;-)

Comment thread README.md
The gauge matching is based on the flowaccumulation data. The value for
any given cell in the flowaccumulation grid is interpreted as the size
[in cells] of a river basin drainig into the respective cell.
[in cells] of a river basin draining into the respective cell.

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.

good catch

import numpy as np

# precision for rounding to avoid numerical instabilities
PRECISION = 10

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.

Maybe make this an optional input in the config.yaml file?

Comment thread src/basinex/main.py
fill_value=var.fill_value,
cellsize=nc.cellsize,
)
out._fobj = None

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.

This is so strange, but thanks for the fix.

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.

3 participants