HERA-Team / hera_pspec

HERA power spectrum estimation code and data formats
http://hera-pspec.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
4 stars 3 forks source link

uvp_noise_error() needs more checking of inputs #349

Open hughbg opened 3 years ago

hughbg commented 3 years ago

Related to #281 and #317.

I had an error in utils.py:uvp_noise_error. It is due to a certain combination of inputs. Here are the lines of code (at the top of the function) and the line where the error can occur:

# type checks
if isinstance(err_type, str):
    err_type = [err_type]

# get metadata if needed
if precomp_P_N is None:
    lsts = np.unique(auto_Tsys.lst_array)   <--- Crashes if auto_Tsys=None, which it could be if user didn’t supply it.
    freqs = auto_Tsys.freq_array[0]