NCAR / cesm-lens-aws

Examples of analysis of CESM LENS data publicly available on Amazon S3 (us-west-2 region) using xarray and dask
https://doi.org/10.26024/wt24-5j82
BSD 3-Clause "New" or "Revised" License
43 stars 23 forks source link

Substring matches? #48

Closed jeffdlb closed 4 years ago

jeffdlb commented 4 years ago

Hi @andersy005:

I hope all is well with you in these strange times.

I believe with intake-esm one can search the collection only for entire column values, not substrings. E.g., I can find TAUX, TAUX2, or TAUY, but not "TAU*".

jeffdlb commented 4 years ago

Unless I am mistaken, it seems that substring matching would be a one-line code change. In _get_subset() at https://github.com/NCAR/intake-esm/blob/master/intake_esm/core.py, on line 633 replace (df[key] == val_i) with (val_i in df[key])

This would be a case-sensitive match, so a bit of additional logic would be needed to ignore case.