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

add multi-gauge facilitation #10

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

lotruheawea
Copy link

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

Copy link
Member

@MuellerSeb MuellerSeb left a comment

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.

@@ -36,15 +37,15 @@ To get a recent version of GDAL, you can use the ppa of [ubuntugis](https://laun
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
sudo apt install gdal-bin libgdal-dev
pip install wheel numpy
pip install wheel numpy pandas
Copy link
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)

pip install GDAL==$(gdal-config --version)
```

#### MacOS
GDAL can be installed with [homebrew](https://formulae.brew.sh/formula/gdal):
```
brew install gdal
pip install wheel numpy
pip install wheel numpy pandas
Copy link
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)

@@ -60,7 +61,7 @@ pipwin install gdal
It is best to use basinex with conda to have gdal and NetCDF installed properly.
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
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 ;-)

- `AREA = N_cells * res_x * ( cos(LAT) * res_y ) * scaling factor^2`
- `matching:` - **Required**: gauge matching parameters
- **Note**:
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
Member

Choose a reason for hiding this comment

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

good catch

@@ -4,6 +4,9 @@

import numpy as np

# precision for rounding to avoid numerical instabilities
PRECISION = 10
Copy link
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?

@@ -89,6 +90,7 @@ def gridBasinMask(gauge):
fill_value=var.fill_value,
cellsize=nc.cellsize,
)
out._fobj = None
Copy link
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