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

Add MAGIC sensitivity with references #567

Closed
wants to merge 15 commits into from

Conversation

vuillaut
Copy link
Member

@vuillaut vuillaut commented Nov 17, 2020

Following the discussions about having a proper reference for MAGIC sensitivity, here is a PR fixing that.

  • MAGIC sensitivity (lima 5off as default but others available too) with ref from ctaplot
  • plot CRAB spectrum from pyIRF
  • cleanup and fix a few formatting issues
  • add unit tests on changed functions

The result should look like this:

import matplotlib.pyplot as plt
import astropy.units as u
from lstchain.mc.plot_utils import plot_Crab_SED
from  ctaplot.plots import plot_sensitivity_magic_performance
plot_Crab_SED(10*u.GeV, 100*u.TeV)
plot_Crab_SED(10*u.GeV, 100*u.TeV, percentage=1, linestyle='--', color='gray')
plot_sensitivity_magic_performance()
plt.show()

image

@@ -331,23 +336,22 @@ def plot_positions_survived_events(df_gammas,
"""

e_reco_g = 10**df_gammas.mc_energy
e_reco_p = 10**df_protons.mc_energy
e_reco_p = 10 ** df_protons.mc_energy
Copy link
Member

Choose a reason for hiding this comment

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

Wat?

ereco = 10**mc_energy ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I did not write that code but good catch.

Copy link
Member Author

Choose a reason for hiding this comment

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

This had nothing to do with this PR but I updated it nonetheless to take the reco energy from the dataframe

@codecov
Copy link

codecov bot commented Jan 8, 2021

Codecov Report

Merging #567 (4513798) into master (9abd542) will increase coverage by 0.53%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #567      +/-   ##
==========================================
+ Coverage   50.43%   50.96%   +0.53%     
==========================================
  Files          84       85       +1     
  Lines        7317     7335      +18     
==========================================
+ Hits         3690     3738      +48     
+ Misses       3627     3597      -30     
Impacted Files Coverage Δ
lstchain/mc/sensitivity.py 98.51% <ø> (-0.01%) ⬇️
lstchain/spectra/crab.py 59.09% <44.44%> (ø)
lstchain/mc/plot_utils.py 46.34% <64.15%> (+30.55%) ⬆️
lstchain/mc/tests/test_plot_utils.py 100.00% <100.00%> (ø)

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 9abd542...4513798. Read the comment docs.

@moralejo
Copy link
Collaborator

moralejo commented Mar 4, 2021

This is stalled, but still needed, right? - @vuillaut, can you solve the conflicts?

@vuillaut
Copy link
Member Author

vuillaut commented Mar 5, 2021

This is stalled, but still needed, right? - @vuillaut, can you solve the conflicts?

Done

@vuillaut
Copy link
Member Author

vuillaut commented Mar 8, 2021

Merged in #622

@vuillaut vuillaut closed this Mar 8, 2021
@vuillaut vuillaut deleted the magic_sens branch March 8, 2021 10:17
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