cloudsci / cloudmetrics

Toolkit for computing 15+ metrics characterising 2D cloud patterns
16 stars 8 forks source link

Statistical reductions of per-object statistical reductions of scalar fields #48

Open leifdenby opened 2 years ago

leifdenby commented 2 years ago

This is a hair-brained idea, but came up on https://github.com/cloudsci/cloudmetrics/issues/34#issuecomment-1016419003 so I want to keep a reference to it (since I'm closing the other issue):

what if you want to compute the mean (across all objects) of say the per-object skewness of a scalar field? We might add that with the following interface cloudmetrics.scalar.mean_per_object_skewness(cloud_mask=..., scalar_field=...). Is this even a good idea @martinjanssens?

martinjanssens commented 2 years ago

Good point. We should definitely not exclude the possibility of doing this with what we give the user. I wonder (and you'll be able to assess this much better than me) if this is easy to do in the cloudmetrics-pipeline you've been building, since it essentially is a sequence of actions:

  1. You have a scalar field (e.g. of lwp)
  2. You calculate its cloud mask
  3. You calculate that cloud mask's objects
  4. You compute the statistical reduction for each object
  5. You compute some statistical reduction on the result

Do we need a special function for step four? I think we have all other steps covered, right? I'm also happy with additional functions that just do everything for you, just wondering how you would think it works best in practice.

leifdenby commented 2 years ago

Do we need a special function for step four?

Yes, I think you're right. I was thinking http://image.dask.org/en/latest/dask_image.ndmeasure.html would be good for this.

I wonder (and you'll be able to assess this much better than me) if this is easy to do in the cloudmetrics-pipeline you've been building

Yes, you may be right... Let's leave this open for now and see if anyone gets need for this :) If I do then I'll add it