NCAS-CMS / cf-python

A CF-compliant Earth Science data analysis library
http://ncas-cms.github.io/cf-python
MIT License
126 stars 19 forks source link

New function: `cf.cell_overlaps` #824

Open davidhassell opened 3 weeks ago

davidhassell commented 3 weeks ago

The current cf.cellwi(start, end) only matches cells that lie completely with the closed range [start, end].

Sometimes we would like to match cells that merely overlap the range.

I propose a new function cf.cell_overlaps(start, end) that does just this. It will be a constructor function for <CF Query: [upper_bounds(ge start) & lower_bounds(le end)]>

(Compare this with cf.cellwi, which is a constructor function for <CF Query: [lower_bounds(ge start) & upper_bounds(le end)]>)

The docstrings for the various Query constructor functions could also be improved to more accurately reflect what they do!

davidhassell commented 2 weeks ago

Having chatted about this off-line, we're going to park this until v4.0.0, when we can think about the best approach to bringing other "cell" methods into the fold.