stcorp / harp

Data harmonization toolset for scientific earth observation data
http://stcorp.github.io/harp/doc/html/index.html
BSD 3-Clause "New" or "Revised" License
55 stars 18 forks source link

Support `or` in operations #250

Closed zxdawn closed 2 years ago

zxdawn commented 2 years ago

Let's say I have three conditions: cond1, cond2, and cond3. I wanna create an operation which is cond1 | (cond2 & cond3). This is equal to merging two products:

# product_1
harp.import_product(filename, cond1)

# product_2
harp.import_product(filename, cond2 & cond3)

I read through the Doc and both of them aren't supported yet.

zxdawn commented 2 years ago

Ha, I see. The second method has been added:

harp.concatenate([product_1, product_2])
svniemeijer commented 2 years ago

As long as cond1 and cond2 & cond3 are fully distinct sets, you can indeed ingest them individually and concatenate the results. cond2 & cond3 is also already possible by using cond2;cond3.

Having a more elaborate combination of filters would actually require the solution that is mentioned in #249. So I am closing this issue in favor of that one.