EoRImaging / eppsilon

eppsilon - error propagated power spectrum with interleaved observed noise
BSD 2-Clause "Simplified" License
5 stars 4 forks source link

Missing visibilities cause weights to be NaN #29

Closed aelanman closed 6 years ago

aelanman commented 6 years ago

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.

isullivan commented 6 years ago

Thanks for digging into this, and finding the likely root of the problem. I can look at this tomorrow and hopefully have it fixed soon.

bhazelton commented 6 years ago

fixed in latest PR