bird-house / flyingpigeon

WPS processes for climate model data, indices and extreme events
http://flyingpigeon.readthedocs.io/en/latest/
Apache License 2.0
19 stars 15 forks source link

Process for averaging over a polygon #315

Open huard opened 4 years ago

huard commented 4 years ago

Overview

This PR fixes #314

Changes:

Related Issue / Discussion

Additional Information

Links to other issues or sources.

huard commented 4 years ago

This needs some more testing.

nilshempelmann commented 4 years ago

@huard Is there a public WFS to run this process if no local WFS is available, or could a polygon shapefile be used in stead, or the flyingpigeon intern polygon data (./flyingpigeon/data/shapefiles)

huard commented 4 years ago

Started working on a shapefile polygon version.

Do you think shapefile and WFS inputs should be two independent processes, or the same process with different options to call it ?

We could use our own geoserver instance to test, but open to other suggestions.

nilshempelmann commented 4 years ago

personally I prefer different processes and keep the complexity userfriendly. So two processes for shapefile and WFS input. the " own geoserver " is usable from outside? could be default than.

nilshempelmann commented 4 years ago

@huard should we merge this? Test are failing caused by eggshell dependencies. The second PR should solve eggshell issues. feel free to merge if you like

huard commented 4 years ago

No, still working on it.

nilshempelmann commented 4 years ago

OK. great. I am going to write tutorial-examples the next days, so take your time. Keep the second PR (eggshell) in mind.

Zeitsperre commented 4 years ago

@huard Anything I can do to help here?

huard commented 4 years ago

@Zeitsperre I still have messy changes in that branch. Hope to find some time to push a clean version you'd be able to work from.

This current PR uses ocgis, I think you could work on an alternative version within xclim. Start with a lit. review, document options and propose implementation plan in a new issue.

Zeitsperre commented 4 years ago

@huard I'm not sure if I follow. I feel like this already exists in xclim as a set of operations (import DataSet -> subset_shape -> averaging operations using xarray/Pandas-like interface). Something like that should be available in finch at the moment.

huard commented 4 years ago

@Zeitsperre I'd like the averaging to be part of the WPS, not an operation to be done by the user, otherwise you need to download the data to your computer, average it, then send it back to the Raven server for modeling.

Zeitsperre commented 4 years ago

OK. I imagine that this could be integrated into Finch, based on https://github.com/bird-house/finch/blob/master/finch/processes/wps_xsubset_polygon.py. In that case we just need an averaging process?

huard commented 4 years ago

Yes, but that accounts for the variable grid size and percent area where the grid overlaps the region.