rileyhales/saber-hbc

prep.observed_data not able to compute_fdc

Closed this issue · 0 comments

When I run the observed_data function on my Mid-Atlantic data, the following error is returned:

Traceback (most recent call last):
File "/Users/joshogden/PycharmProjects/regional-bias-correction/examples/US-MidAtlantic/NorthAmerica_Mid-Atlantic/main.py", line 25, in
rbc.prep.observed_data(obsdir, workdir)

File "/Users/joshogden/PycharmProjects/regional-bias-correction/rbc/prep.py", line 87, in observed_data
compute_fdc(

File "/Users/joshogden/PycharmProjects/regional-bias-correction/rbc/utils.py", line 39, in compute_fdc
flows = np.nanpercentile(flows, percentiles)

File "<array_function internals>", line 5, in nanpercentile

File "/Users/joshogden/opt/miniconda3/envs/bias/lib/python3.9/site-packages/numpy/lib/nanfunctions.py", line 1249, in nanpercentile
return _nanquantile_unchecked(

File "/Users/joshogden/opt/miniconda3/envs/bias/lib/python3.9/site-packages/numpy/lib/nanfunctions.py", line 1374, in _nanquantile_unchecked
r, k = function_base._ureduce(

File "/Users/joshogden/opt/miniconda3/envs/bias/lib/python3.9/site-packages/numpy/lib/function_base.py", line 3564, in _ureduce
r = func(a, **kwargs)

File "/Users/joshogden/opt/miniconda3/envs/bias/lib/python3.9/site-packages/numpy/lib/nanfunctions.py", line 1393, in _nanquantile_ureduce_func
result = _nanquantile_1d(part, q, overwrite_input, interpolation)

File "/Users/joshogden/opt/miniconda3/envs/bias/lib/python3.9/site-packages/numpy/lib/nanfunctions.py", line 1413, in _nanquantile_1d
arr1d, overwrite_input = _remove_nan_1d(arr1d,

File "/Users/joshogden/opt/miniconda3/envs/bias/lib/python3.9/site-packages/numpy/lib/nanfunctions.py", line 164, in _remove_nan_1d
c = np.isnan(arr1d)

TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

Not sure why the types are not valid for the isnan() function