TUW-GEO / ismn

Readers for the data from the International Soil Moisture Network
https://ismn.earth/en/
MIT License
32 stars 21 forks source link

Filter depths by depth_from only #29

Closed wpreimes closed 3 years ago

wpreimes commented 4 years ago

@daberer If the option to filter sensors only by their depth_from (and ignoring the depth_to) really makes sense, we should add some option to https://github.com/TUW-GEO/ismn/blob/9e1a358dc5701da0df144d9b500ca183df92c366/src/ismn/interface.py#L707 to do that.

I would suggest either adding an argument to ignore the max_depth or to set a rule (e.g. if max_depth is None it is ignored)

wpreimes commented 4 years ago

Also, maybe raise an Error if depth_from > depth_to and/or use abs values, because as far as I know there are no negative depths in ISMN. Currently if depth_from > depth_to it simply returns no ids after filtering.

wpreimes commented 3 years ago

Here https://github.com/TUW-GEO/ismn/blob/master/src/ismn/interface.py#L767 and here https://github.com/TUW-GEO/ismn/blob/master/src/ismn/interface.py#L424

wpreimes commented 3 years ago

This "feature" is already implemented for https://github.com/TUW-GEO/ismn/blob/9e1a358dc5701da0df144d9b500ca183df92c366/src/ismn/interface.py#L372 but not in https://github.com/TUW-GEO/ismn/blob/9e1a358dc5701da0df144d9b500ca183df92c366/src/ismn/interface.py#L707

I think we should also apply it to the second function and document that None is a valid input. But the default should not be None in the 2nd case.