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

Update some functions for DL3 Tool #752

Merged
merged 10 commits into from
Dec 15, 2021
Merged

Update some functions for DL3 Tool #752

merged 10 commits into from
Dec 15, 2021

Conversation

chaimain
Copy link
Contributor

@chaimain chaimain commented Oct 28, 2021

Update pyirf dependency, and some restructuring of functions relevant for DL3 Tool to accommodate future PRs

Functions changes -

  1. Two functions in irf/hdu_table.py.

From create_event_list, create some separate functions -

  • get_timing_params: Get a dict of timing parameters to be added in the DL3
  • get_pointing_params: Get telescope pointing in ICRS, source pointing angular position from camera centre and the respective observation mode for DL3
  • add_icrs_position_params: Transform the reconstructed position from Alt/Az system to RA/Dec and use astropy.erfa_astrom Interpolation for a fast transformation, and to also get the theta angle with respect to the source position provided. These parameters are added to the DL2 file as separate columns and the create_event_list uses it to fill the EVENTS HDU. NOTE: erfa_astrom interpolation method might need to be updated for an even quicker but also accurate process to transform the coordinates. Hence it is essential to separate this functionality, to be able to test more easily.

In create_hdu_index_hdu function, all IRF HDUs are added by iterating over a given list of HDU names. For energy-dependent cuts, 2 extra HDUs are added - "RAD_MAX" and "GH CUTS". "GH CUTS" HDU is a new temporary HDU being added in PR#709.

  1. 1 function in reco/utils.py

To calculate the orthogonal geomagnetic angle (delta). The geomagnetic parameters are calculated using values for LST1 location in https://www.ngdc.noaa.gov/geomag/calculators/magcalc.shtml?#igrfwmm and by using the predicted change as per the IGRF model, for a given time between 2020-2025. This will be used in PR#711

This modification is necessary so that once the 2 PRs are merged, it will be smoother to integrate, and also for any future update on the DL3 Tools.

Also, 1 more filter on event selection for DL3 is added, to select only cosmic events (event_type=32), to be more accurate in our choice of event selection.

…table/create_event_list function for clarity and usage beyond the earlier function.
…fferent functionalities, which might be used for different purposes, and add calculation of orthogonal geomagnetic angle, used for IRF interpolation with updated geomagnetic parameters
@codecov
Copy link

codecov bot commented Oct 28, 2021

Codecov Report

Merging #752 (e67d553) into master (f49becb) will decrease coverage by 0.06%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #752      +/-   ##
==========================================
- Coverage   83.52%   83.45%   -0.07%     
==========================================
  Files          72       72              
  Lines        5541     5568      +27     
==========================================
+ Hits         4628     4647      +19     
- Misses        913      921       +8     
Impacted Files Coverage Δ
lstchain/io/event_selection.py 100.00% <ø> (ø)
lstchain/reco/utils.py 70.45% <44.44%> (-2.97%) ⬇️
lstchain/irf/hdu_table.py 92.18% <95.55%> (+0.64%) ⬆️
lstchain/irf/__init__.py 100.00% <100.00%> (ø)
lstchain/irf/tests/test_hdus.py 100.00% <100.00%> (ø)
lstchain/reco/tests/test_utils.py 100.00% <100.00%> (ø)
lstchain/tools/lstchain_create_dl3_file.py 90.62% <100.00%> (+0.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f49becb...e67d553. Read the comment docs.

moralejo
moralejo previously approved these changes Oct 29, 2021
Copy link
Collaborator

@moralejo moralejo left a comment

Choose a reason for hiding this comment

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

Looks ok to me - assuming it has been tested on the usual reference data samples

docs/examples/dl3_tool_config.json Show resolved Hide resolved
lstchain/reco/utils.py Outdated Show resolved Hide resolved
@moralejo moralejo merged commit 25820b1 into master Dec 15, 2021
@moralejo moralejo deleted the update_dl3 branch December 15, 2021 14:20
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.

3 participants