-
Notifications
You must be signed in to change notification settings - Fork 41
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
[POC] implement scalar metrics #551
Comments
Ok for the need of scalar metrics, the issue is clear. Will it be possible to choose a metric from a calling pipeline with a configuration file as demcompare ? For example here to call the scalar metrics from the pipeline: https://demcompare.readthedocs.io/en/stable/userguide/statistics/metrics.html and the following example of input json configuration to explain my question ?
Will this be possible with the development here and we may need an evolution ou wrapper on existing API to generalize metrics ? |
Based on my limited experience with xdem, I believe it's possible. I will create an issue for the metrics in the CLI before developing this one, just to be sure. |
From @adehecq : "In fact, the other functions are not specifically implemented because they are available with NumPy (e.g., min, max, std, var, etc.). The interface with NumPy (https://geoutils.readthedocs.io/en/stable/core_array_funcs.html) makes these calculations direct and intuitive. In this sense, xdem seems more advanced because we have access to any existing metric in NumPy or SciPy." |
One more note in addition to @adehecq's that might be relevant here: Xarray has exactly the same NumPy array interface as we have for the Raster object (can call any Usually the critical point when deriving those metrics through an array interface is the behaviour with nodata values:
|
Overall, I agree with adding functionalities to address certain scalar metrics. Just a few remarks/questions:
@duboise-cnes, I can't really answer your question as I didn't understand the meaning of this line
|
One more note that @adehecq's comment reminded me of on the MAD: See details in our issue here: #349. |
An another approach has been discuss, i close for #567 |
Context
This ticket aims to propose an initial implementation of scalar metrics in xDEM.
We assume that these metrics can be an attribute of DEM just like the slope, and that users can retrieve them as follows:
dem_mean = xdem.scalar_metric.mean(dem)
. If this API is validated, here is our proposal:Code
Create the file
scalar_metrics.py
(inspired byterrain.py
)List of metrics to implement:
Implement the
get_scalar_metric
function with all the options from the above list:spatialstats
file.nmad = xdem.scalar_metric.nmad(dem)
affine.py
base.py
workflows.py
spatialstats.py
Tests
test_scalar_metrics.py
test_nmad
function fromtest_spatial_stats
totest_scalar_metrics.py
Example
basic
folder that displays the scalar metrics of a DEM using the new APIsDocumentation
scalar_metrics.md
file in the xdem documentation inspired by theterrain.md
documentationEstimation
5 days
The text was updated successfully, but these errors were encountered: