AStcherbinine/omegapy

vir smear correction saturation indexing

Closed this issue · 2 comments

vis_tmp[i_sat] = 0

Could you please check if this is definitely working as intended? I think potentially when i_sat is used to index vis_tmp it is actually zeroing out the wrong bands (since i_sat is found on Line 585 using vis_tmp[85:] not vis_tmp). Also, why 85 when comment on Line 592 says 90:95? Great package - thanks.

Thanks for pointing that!
Indeed it was zeroing the wrong wavelengths, it has been fixed with commit 4e2720d

# Check for saturation in the 85:95 channels
vis_tmp = np.swapaxes(vis, 0, 1) # Inversions axes pour calcul (lam, npix, nscan)
means = np.mean(vis_tmp[0:85], axis=0)
i_sat = np.where(vis_tmp[85:] > means)
i_sat1, i_sat2, i_sat3 = i_sat
i_sat1 += 85
i_sat = (i_sat1, i_sat2, i_sat3)
vis_tmp[i_sat] = 0
vis = np.swapaxes(vis_tmp, 0, 1) # On remet dans l'ordre

And regarding the 90 vs 85 in the comment, it is a typo from the IDL file that has not been fixed when porting to Python, now corrected.

Thanks Aurélien. I have made some efficiency improvements in my local version of your code (e.g., getting rid of all loops in _readomega) - I will share these with you soon but maybe it's no longer a faithful translation of the IDL code.