Ouranosinc / xscen

A climate change scenario-building analysis framework.
https://xscen.readthedocs.io/
Apache License 2.0
17 stars 2 forks source link

Add the possibility to create the mask in extract_dataset #183

Open juliettelavoie opened 1 year ago

juliettelavoie commented 1 year ago

Addressing a Problem?

Now, the mask argument takes an already formed mask.

I could be useful to have a way to create the mask and apply it.

Potential Solution

If mask is a dict, pass it as argument to the xs.create_mask to create the mask and then apply it to the data.

ex. mask_args = { "variable": "sftlf", "where_operator": ">=", "where_threshold": 95, "mask_nans": True, }

The call to xs.create_mask needs the data. It could be extracted from the catalog similarly to how the mask is extracted now.

Additional context

No response

Contribution

juliettelavoie commented 1 year ago

Creep_fill could also be added to create_mask to allow for the creation of more complex masks.