EoRImaging / eppsilon

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

Improve LS implementation #115

Closed bhazelton closed 4 years ago

bhazelton commented 4 years ago

Make the rotation angle calculation more robust against zeros in the denominator.

Also rework the std_power implementation: just don't rotate between sin & cos

bhazelton commented 4 years ago

@nicholebarry I'd like to merge this, are you on board?

nicholebarry commented 4 years ago

@bhazelton I have two comments.

1) I think we can increase the threshold on the what we consider to be rotatable. At the moment, it's at 1e-8 precision, but I think we could increase it based on the number of samples. i.e.

denom = covar_cos - covar_sin
inds_denom_low = where(abs(denom) LT sqrt(n_freq),n_count_denom)
numer = covar_cross
inds_numer_low = where(abs(numer) LT sqrt(n_freq),n_count_numer)

if n_count_denom gt 0 then theta[inds_denom_low] = !dpi / 2.
if n_count_numer gt 0 then theta[inds_numer_low] = 0.

2) Maybe add a printed warning about using the std_power option for EoR upper limits.

bhazelton commented 4 years ago

I think your number one is trying to address a separate problem about having too few frequencies, which could be added in another PR.

bhazelton commented 4 years ago

Nichole signed off on this at the Melbourne busy week.