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

Update USLE C parameter with planted forest and orchard values #234

Merged
merged 11 commits into from
May 7, 2024
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Added
- New setup method for the **KsatHorFrac** parameter **setup_ksathorfarc** to up-downscale existing ksathorfrac maps. `PR #255 <https://github.com/Deltares/hydromt_wflow/pull/255>`_
- new function **setup_pet_forcing** to reproject existing pet data rather than computing from other meteo data. PR #257
- Workflow to compute brooks corey c for the wflow layers based on soilgrids data, soilgrids_brooks_corey. PR #242
- **setup_lulcmaps** for wflow_sediment: if planted forest data is available, it can be used to update the values of the USLE C parameter. PR #234
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- **setup_lulcmaps** for wflow_sediment: if planted forest data is available, it can be used to update the values of the USLE C parameter. PR #234
- **setup_lulcmaps** for wflow_sediment: if planted forest data is available, it can be used to update the values of the USLE C parameter. `PR #234 <https://github.com/Deltares/hydromt_wflow/pull/234>`_

PR link? I notice that we sometimes do and sometimes don't.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So we should be consistent but in hydromt we only put the PR number and not the link anymore. Let's do that in the release PR.

There are two pages where the changes appear:

  • release tag: there if you just put the PR number the link appear automatically but the rst link really does not.
  • changelog doc: there the links do not appear.

What do you think is best? I think for the release, we generate the note automatically from the changelog so I don't know if we can update the links easily unless we decide to generate it manually again? If not then we should just put the Pr number and not the link.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The site we can regenerate. The links in the release when can just edit afterwards. But maybe it becomes a bit of a hassle so we could opt to leave the link out.

- better support for WflowModel states with new methods: **read_states**, **write_states** and **clip_states**. PR #252
- new function **setup_cold_states** to prepare cold states for WflowModel. PR #252
- new utils method **get_grid_from_config** to get the right wflow staticmaps variable based on the TOML configuration (e.g. detects name in netcdf, value, scale and offset). Only applied now to prepare cold states (e.g. not yet in read_grid). PR #252
Expand Down
8 changes: 4 additions & 4 deletions hydromt_wflow/wflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,12 @@ def setup_rivers(
df = self.data_catalog.get_dataframe(rivman_mapping_fn)
# max streamorder value above which values get the same N_River value
max_str = df.index[-2]
nodata = df.index[-1]
# if streamorder value larger than max_str, assign last value
strord = strord.where(strord <= max_str, max_str)
# handle missing value (last row of csv is mapping of missing values)
strord = strord.where(strord != strord.raster.nodata, -999)
strord.raster.set_nodata(-999)
strord = strord.where(strord != strord.raster.nodata, nodata)
strord.raster.set_nodata(nodata)
ds_nriver = workflows.landuse(
da=strord,
ds_like=self.grid,
Expand Down Expand Up @@ -911,8 +912,7 @@ def setup_lulcmaps(
fn_map = f"{lulc_fn}_mapping_default"
else:
fn_map = lulc_mapping_fn
if not isfile(fn_map) and fn_map not in self.data_catalog:
raise ValueError(f"LULC mapping file not found: {fn_map}")

# read landuse map to DataArray
da = self.data_catalog.get_rasterdataset(
lulc_fn, geom=self.region, buffer=2, variables=["landuse"]
Expand Down
Loading
Loading