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

Feature/post dl2 analysis #509

Merged
merged 32 commits into from
Feb 3, 2021

Conversation

mexanick
Copy link
Collaborator

@mexanick mexanick commented Sep 7, 2020

Draft implementation of the Fast Analysis LST Plots (fast alps) analysis framework.
It aims to provide a common framework for DL2-level analysis implementation and simplify the integration of other analyses by:

  • Provide common data mangling utilities
  • Provide common infrastructure for documentation (TBA)
  • Provide common infrastructure for correctness and performance tests (TBA)

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

Review Jupyter notebook visual diffs & provide feedback on notebooks.


Powered by ReviewNB

Copy link
Member

@vuillaut vuillaut left a comment

Choose a reason for hiding this comment

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

Hi.

Thank you for your contribution, this will be useful!
Before we can make a proper review, please address the unit tests issues and the two bugs I noted here (the comment on the data_path is more of an improvement feature).

lstchain/analysis/fast_alps.py Outdated Show resolved Hide resolved
docs/examples/fast_alps/config_on_off.toml Outdated Show resolved Hide resolved
lstchain/io/io.py Outdated Show resolved Hide resolved
@vuillaut
Copy link
Member

vuillaut commented Sep 7, 2020

Also, as this is completely part of lstchain, I would rename the submodule as analysis.dl2 or something similar. fast_alps would not make much sense to a newcomer.

@rlopezcoto rlopezcoto marked this pull request as draft September 14, 2020 09:06
@codecov
Copy link

codecov bot commented Sep 28, 2020

Codecov Report

Merging #509 (bc8a4a4) into master (6800e27) will decrease coverage by 1.02%.
The diff coverage is 5.35%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #509      +/-   ##
==========================================
- Coverage   38.54%   37.52%   -1.03%     
==========================================
  Files          80       82       +2     
  Lines        7116     7339     +223     
==========================================
+ Hits         2743     2754      +11     
- Misses       4373     4585     +212     
Impacted Files Coverage Δ
lstchain/analysis/post_dl2.py 0.00% <0.00%> (ø)
lstchain/scripts/lstchain_post_dl2.py 0.00% <0.00%> (ø)
lstchain/visualization/plot_dl2.py 49.14% <8.33%> (-5.72%) ⬇️
lstchain/reco/utils.py 66.08% <18.18%> (-7.08%) ⬇️
lstchain/io/io.py 77.19% <22.72%> (-3.24%) ⬇️

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 6800e27...bc8a4a4. Read the comment docs.

@mexanick mexanick requested a review from vuillaut October 1, 2020 11:29
@mexanick mexanick changed the title [WIP] Feature/post dl2 analysis Feature/post dl2 analysis Oct 12, 2020
@mexanick
Copy link
Collaborator Author

Looks like the CI is stalled for some reason. Does anyone know what could be the reason?

@morcuended
Copy link
Member

Looks like the CI is stalled for some reason. Does anyone know what could be the reason?

Could it be the conflicting files?
lstchain/io/io.py
lstchain/reco/utils.py

@rlopezcoto
Copy link
Contributor

@mexanick if the PR is ready, you should mark the "Ready for review" button. In any case and as @morcuended pointed out, you need to solve the conflicts with those two files.

- Data mangling utilities added to lstchain.io module
- Camera-related utilities are placed under lstchain.reco.utils module
- launching script and anlaysis routines are added too
- TODO: reshuffle plotting utilities and offload statistics to gammapy
- Fix memory-efficient data reading and subrun merging
- Provide configuration examples
- Minor bugfixes in plotting
@mexanick mexanick force-pushed the feature/post-DL2-analysis branch from f039e1f to e910a2b Compare October 13, 2020 07:51
@mexanick
Copy link
Collaborator Author

I'm not sure if that was because of the conflict (honestly, I doubt it, looks like some travis glitch), but I have resolved it.

@mexanick mexanick marked this pull request as ready for review October 13, 2020 07:53
@maxnoe
Copy link
Member

maxnoe commented Oct 13, 2020

@mexanick Travis cannot run the PR build of there are conflicts. The PR build (unlike the "branch" build) is done by merging the PR branch into master and then running the tests.

This is not possible when there are conflicts.

https://docs.travis-ci.com/user/pull-requests/#my-pull-request-isnt-being-built

@mexanick
Copy link
Collaborator Author

@mexanick Travis cannot run the PR build of there are conflicts. The PR build (unlike the "branch" build) is done by merging the PR branch into master and then running the tests.

This is not possible when there are conflicts.

https://docs.travis-ci.com/user/pull-requests/#my-pull-request-isnt-being-built

Thanks! I'm used more to gitlab CI which would just build the branch first, so it goes through anyway.

@vuillaut
Copy link
Member

@mexanick once the tests are passing I can do the review

@mexanick
Copy link
Collaborator Author

@mexanick once the tests are passing I can do the review

Actually, the failed test is radec to camera function which failed being unable to resolve the url, I'm not sure how I can fix it... I'm afraid that's a systematic issue which affects all the on-going PRs. And considering the Codacy review, it is about unused variable fig in fig, axes = plt.subplot(...)
Please, advise on how to proceed

@mexanick mexanick closed this Dec 9, 2020
@mexanick mexanick force-pushed the feature/post-DL2-analysis branch from 0e9203e to 745c824 Compare December 9, 2020 12:11
mexanick and others added 3 commits December 9, 2020 13:49
Implementing some comments
- Update documentation
- Passing the telescope focal length as a parameter (can be retrieved from data, but this is not implemented. Can be done in user scripts if needed)
  - Conversion factor for theta2 calculation is left as is (parameter). Can also be sourced from DL2 file but requires reading in the complete geometry
  to get the distance between pixel centers and focal length
- Update the statistics to conform with latest gammapy release
- Provide the interface to store the resulting images through configuration file
@mexanick mexanick reopened this Dec 10, 2020
- Update jupyter notebook to represent interactive and non-interactive modes
- Fix theta2 computation w.r.t. dimensional data
- Minor logging and plotting updates
@vuillaut
Copy link
Member

Hi @mexanick
If you can comment on the requests I had, I think we can work this PR out to finalize it.

@mexanick
Copy link
Collaborator Author

mexanick commented Jan 5, 2021

hi @vuillaut
Most of your comments are implemented except conversion factor in theta2 calculation (it is possible to do, but will require a certain overhead as mentioned in the corresponding commit message).

@mexanick mexanick requested a review from vuillaut January 12, 2021 08:49
@vuillaut
Copy link
Member

I still think that some things could be improved but it works and would be useful to have as long as we don't have a proper DL3 pipeline so I will approve

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.

5 participants