I think this is caused by line 660 of fhd_file_setup.pro:
if j eq 0 then vis_noise = fltarr(npol, nfiles, n_freq)
vis_noise[pol_i, file_i, *] = sqrt(total(vis_noise_arr^2.*n_vis_freq_arr, 1)/total(n_vis_freq_arr, 1))
wh_zero = where(total(n_vis_freq_arr, 1) eq 0, count_zero)
if count_zero gt 0 then vis_noise_arr[wh_zero] = 0
This line is meant to account for times when total(n_vis_freq_arr,1) = 0, and set those NaNs to zero, but it instead operates on the vis_noise_arr (which is not used again), whereas vis_noise keeps those NaN values. Those NaN values then pass along into vis_sigma_ian, ultimately raising an error on line 54 of ps_power.
This came up when I turned off neighboring channel averaging.
I think this is caused by line 660 of fhd_file_setup.pro:
This line is meant to account for times when total(n_vis_freq_arr,1) = 0, and set those NaNs to zero, but it instead operates on the vis_noise_arr (which is not used again), whereas vis_noise keeps those NaN values. Those NaN values then pass along into
vis_sigma_ian
, ultimately raising an error on line 54 of ps_power.This came up when I turned off neighboring channel averaging.