From 779f67941bf7ce6481cd5a95807f91d2ae0340bf Mon Sep 17 00:00:00 2001 From: bnb32 Date: Mon, 30 Oct 2023 13:36:40 -0600 Subject: [PATCH] ignore case for bc adder/scalar lookup --- sup3r/bias/bias_transforms.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sup3r/bias/bias_transforms.py b/sup3r/bias/bias_transforms.py index 71d74f568..3995a0f3b 100644 --- a/sup3r/bias/bias_transforms.py +++ b/sup3r/bias/bias_transforms.py @@ -58,7 +58,11 @@ def get_spatial_bc_factors(lat_lon, feature_name, bias_fp, threshold=0.1): raise RuntimeError(msg) msg = (f'Either {dset_scalar} or {dset_adder} not found in {bias_fp}.') - assert dset_scalar in res.dsets and dset_adder in res.dsets, msg + dsets = [dset.lower() for dset in res.dsets] + check = dset_scalar.lower() in dsets and dset_adder.lower() in dsets + assert check, msg + dset_scalar = res.dsets[dsets.index(dset_scalar.lower())] + dset_adder = res.dsets[dsets.index(dset_adder.lower())] scalar = res[dset_scalar, slice_y, slice_x] adder = res[dset_adder, slice_y, slice_x] return scalar, adder