Skip to content

feat(soilgrids): support other/local soil data than SoilGrids (#105)#775

Open
michaelohanrahan wants to merge 1 commit into
Deltares:mainfrom
michaelohanrahan:soilgrids_flex
Open

feat(soilgrids): support other/local soil data than SoilGrids (#105)#775
michaelohanrahan wants to merge 1 commit into
Deltares:mainfrom
michaelohanrahan:soilgrids_flex

Conversation

@michaelohanrahan

Copy link
Copy Markdown

Probably closes #105 but a separate issue is required for the discussion on vector soil setup report. #105 originally opened identifying the restrictions of using soil_fn=="soilgrids_2020" branching to identify block or trapezoidal layer averaging of soil properties. This limited the flexibility in using non soilgrids datasources.

Simultaneously closes #772, where some sources require an averaging to 2m where the information in the source doesnt exist and is filled to the max required depth.

Issue addressed

Fixes #105 and #772

Explanation

#105

  1. ** Resampling switch by parameter type ** - introduce an input dataset attribute soil_layer_type: point or interval (accessible via ds.attrs["soil_layer_type"]) to switch between trapezoidal or block averaging, respectively. Removing soilgrids_2020 branching, but for now retains fallback for legacy datasets that do not have the attribute.

  2. ** Varying soil layer depths as input ** - ideally sources self-describe via dataset attribute soil_depth_edges_cm combined with soil_layer_type so any n-layer source should work (similarly with fallback for legacy datasets)

#772
solving soil average dilution in the case that soil property layer limits <2m the soil property is assumed homogeneous from the last point of information to the base of the column. i.e. for a dataset with deepest property layer 60cm to 1m, the column to 2m is equal to the property values in that last layer.

Checklist

  • Updated tests or added new tests
  • [x ] Branch is up to date with main
  • Tests & pre-commit hooks pass
  • [] Updated documentation if needed

Additional Notes (optional)

New issue required for #105 where vector support is identified moved to new issue #774

… metadata

Generalize the soilgrids workflow beyond hardcoded SoilGrids 2017/2020 so any layered soil source works (e.g. 3-layer OpenLandMap, SLGA).

Legacy soilgrids registry acts as fallback, but new sources can contain soil_depth_edges_cm in dataset attributes, and the averaging scheme of point/interval to remove stiff soil_fn=="soilgrids_2020" branching.

For soil properties that are less than the column max depth assume homogeneous propertied from deepest available observation
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.

soilgrids.py: Soil property information less than 2m not allowed Support other/local soil data than Soilgrids

1 participant