Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix definition of "true disp_sign" parameter #1027

Merged
merged 12 commits into from
Oct 21, 2022
Merged

Fix definition of "true disp_sign" parameter #1027

merged 12 commits into from
Oct 21, 2022

Conversation

moralejo
Copy link
Collaborator

No description provided.

@moralejo
Copy link
Collaborator Author

WIP, have to change calls to the modified functions.

# reconstructed image axis (with direction defined by the versor cos(hillas_psi), sin(hillas_psi))
# we must move from cog_x, cog_y to get closest to the true direction (src_x, src_y)

sqrdist_plus = (cog_x + disp_norm*np.cos(hillas_psi) - src_x)**2 + (cog_y + disp_norm*np.sin(hillas_psi) - src_y)**2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@maxnoe maxnoe Oct 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks different and more complicated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same result, but ok, the approach you mention is simpler. Will change it.

Simplified calculation of disp. Also, disp_norm slightly changes meaning. Before it was just "dist" (true distance cog to source), now it is distance along reconstructed axis from cog to the point in the axis closest to the source. This is more what we are looking for, so it should be better (difference is likely minimal).
lstchain/reco/disp.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 20, 2022

Codecov Report

Base: 71.62% // Head: 71.62% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (ef43342) compared to base (a329cd1).
Patch coverage: 87.50% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1027   +/-   ##
=======================================
  Coverage   71.62%   71.62%           
=======================================
  Files         120      120           
  Lines       11301    11302    +1     
=======================================
+ Hits         8094     8095    +1     
  Misses       3207     3207           
Impacted Files Coverage Δ
lstchain/reco/r0_to_dl1.py 92.69% <ø> (ø)
lstchain/scripts/lstchain_dl1ab.py 81.92% <ø> (ø)
lstchain/reco/disp.py 92.30% <87.50%> (+0.20%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@moralejo moralejo marked this pull request as ready for review October 20, 2022 07:50
lstchain/reco/disp.py Outdated Show resolved Hide resolved
lstchain/reco/disp.py Outdated Show resolved Hide resolved
lstchain/reco/disp.py Outdated Show resolved Hide resolved
@@ -123,7 +133,7 @@ def disp_parameters_event(hillas_parameters, source_pos_x, source_pos_y):
disp_container.sign = d[4]
disp_container.miss = miss(disp_container.dx.value,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the result is multiplied with u.m, dx and dy must be u.m, right? So I would add replace value with to_value(u.m), which will save us some headache once we switch to all parameters in telescope frame (degrees) because it will fail instead of silently attach the wrong unit.

@moralejo moralejo merged commit adb789d into master Oct 21, 2022
@moralejo moralejo deleted the disp_sign_fix branch October 21, 2022 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants