-
Notifications
You must be signed in to change notification settings - Fork 77
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
Use effective focal length to compute src-dep parameters #1131
Merged
Merged
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e31408b
use effective focal length to compute src-dep parameters
SeiyaNozaki 7c146d4
small bug fix, and update the value for pytest
SeiyaNozaki 8543db8
Use logging instead of print
SeiyaNozaki b9b5b55
update disp parameters using effective focal length to take into acco…
SeiyaNozaki 709219d
small bug fix
SeiyaNozaki 7871b34
small update
SeiyaNozaki a34fcff
update the calculation of assumed source position for proton MC
SeiyaNozaki 500d7b2
Merge branch 'main' into use_effective_focal_length_for_srcdep
moralejo fd6b0ca
correct typo
SeiyaNozaki 0945601
recalculate MC gamma source position inside get_expected_source_pos f…
SeiyaNozaki 09dcf48
remove lstchain_add_source_dependent_parameters.py
SeiyaNozaki 4b95835
update for the calculation of proton MC expected source position
SeiyaNozaki 836030b
remove lstchain_add_source_dependent_parameters from index.rst
SeiyaNozaki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am confused about this.... you add something called "nominal source_{x,y}" to something called az/alt?
This seems wrong, at least if the operation is correct, than the names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This parameter is already there, it specifies the relative position (0.4 deg on x-axis by default) to compute expected source position for proton MC.
cta-lstchain/lstchain/data/lstchain_src_dep_config.json
Lines 62 to 63 in c9e4c4f
Just I found the bug, though it didn't affect the final result much
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What x-axis? In which coordinate system?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, indeed it may be confusing... It assumes in AltAz coordinates (0.4 deg).. This parameter was introduced here:
#247 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u.Quantity(data['mc_az_tel'].values + np.deg2rad(config['mc_nominal_source_y_deg']), u.rad, copy=False),
It is not correct, camera frame's x is "along the altitude axis", but y is definitely not the azimuth axis....
Also, why do you need this? mc_nominal_source_x_deg and mc_nominal_source_y_deg are already the position on the camera (well, in degrees and without aberration) w.r.t. which you want the src-dep reco for protons.
You just have to transform it to meters
expected_src_pos_y_m = np.tan(np.deg2rad(mc_nominal_source_y_deg)) * effective_focal_length
expected_src_pos_x_m = np.tan(np.deg2rad(mc_nominal_source_x_deg)) * effective_focal_length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just resolved the conflict resulting from the azimuth range change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have the ctapipe coordinate systems for this.
The source position is given in AltAz, correct? or where does this
mc_nominal_source_{x,y}_deg
come from?Then:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the "fake position" for the proton analysis is provided in "camera coordinates" x, y, but in degrees and without aberration. So this converts it to true camera coordinates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then it's:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and I think fov_lon = -mc_nominal_source_y_deg and fov_lat = mc_nominal_source_x_deg
It does not matter much, however, because the direction of the "nominal" position chosen for protons is not critical I think.