nu-radio / NuRadioReco

reconstruction framework for radio detectors of high-energy neutrinos
GNU General Public License v3.0
5 stars 3 forks source link

Fixing expected polarization calculation #296

Closed leshanz closed 3 years ago

leshanz commented 3 years ago

Expected polarization calculation is changed from:

exp_pol_angle = np.arctan2(exp_efield_onsky[2], exp_efield_onsky[1])

to

exp_pol_angle = np.arctan2(abs(exp_efield_onsky[2]), abs(exp_efield_onsky[1]))

Namely, taking the absolute values of etheta and ephi before taking the arctan of them. Otherwise, for some cosmic ray events, the expected polarization would be negative, with some extreme ones being even less than -90deg. However, the polarization should stay between 0deg to 90deg.

christophwelling commented 3 years ago

I don't get why a negative polarization angle does not make sense. In principle the electric field vector does have a sign, so negative angles can be well defined. Whether or not one can measure this sign is a different question, but in principle this is possible. If negative angles are a problem, you can always take the absolute value of the angle or use the get_normalized_angle funtion from the radiotools. So I don't think this change is really useful.

cg-laser commented 3 years ago

@christophwelling @iplaisier please correct me if I'm wrong, but doesn't the analyticEfieldConverter reconstruct just the absolute value of the amplitude of the phi and theta component? Then it makes sense to also do the same for the expectation. But in general I agree, the sign makes a difference. And I think you're right that just taking the absolute number of the angle yields the same result. So maybe better just leave it as it is.

iplaisier commented 3 years ago

Yes that's right. The analyticvoltagetoefield converter is not sensitive to the sign of the polarization

leshanz commented 3 years ago

Thank you all for the response.

The reason I wanted to take the absolute value before doing np.arctan2 is that, in the current version where we don't take the absolute value, the expected polarization will be < -90 deg if the electric field vector is in the 3rd quadrant. And taking the absolute value of this angle will give a polarization angle >90 deg. Taking the absolute value of ephi and etheta before doing np.arctan2 forces the vector to be in the 1st quadrant, so that the polarization angle is always less than 90deg.

On Wed, Mar 10, 2021 at 6:17 AM iplaisier @.***> wrote:

Yes that's right. The analyticvoltagetoefield converter is not sensitive to the sign of the polarization

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nu-radio/NuRadioReco/pull/296#issuecomment-795472402, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVW2RIVNJ52WKOTSLSUUGDTC55O7ANCNFSM4YHEXVAA .

cg-laser commented 3 years ago

we decided to leave the prediction as it is, as the sign of the electric field contains information. Only the comparison with reconstructed data can use a different definition if e.g. the reconstruction is not sensitive to the sign of the efield.