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

Notebook for quick simulation of LST1 observations #1313

Merged
merged 16 commits into from
Nov 17, 2024
Merged

Conversation

moralejo
Copy link
Collaborator

The telescope performance is stored in the csv files The background is obtained from good-quality real data, the gamma IRF from MC

The telescope performance is stored in the csv files
The background is obtained from good-quality real data, the gamma IRF from MC
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link

codecov bot commented Oct 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.50%. Comparing base (cfd9a7f) to head (3770609).
Report is 28 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1313   +/-   ##
=======================================
  Coverage   73.50%   73.50%           
=======================================
  Files         134      134           
  Lines       14211    14211           
=======================================
  Hits        10446    10446           
  Misses       3765     3765           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Replaced gauss by skewnorm for migration matrix parametrization
Added example spectra
Pulsar mode
@moralejo moralejo marked this pull request as ready for review October 30, 2024 11:00
@jsitarek

This comment was marked as resolved.

@jsitarek

This comment was marked as resolved.

@jsitarek

This comment was marked as resolved.

@jsitarek

This comment was marked as resolved.

@jsitarek

This comment was marked as resolved.

morcuended

This comment was marked as resolved.

morcuended and others added 2 commits November 14, 2024 10:56
(gammapy/gammapy-datasets/1.1/ebl/ebl_dominguez11.fits.gz)

Improved SED plot

Added plot on relative uncertainty of SED measurements
@moralejo
Copy link
Collaborator Author

in the integrate function, why not passing the dFdE function as a parameter and computing dfde1 and dfde2 inside the integrate function?

Because in this way it is obvious, at the very moment you call the function, that the integral is some sort of approximation (specifically, a power-law). I really see no advantage in passing the function.

@moralejo
Copy link
Collaborator Author

I am not sure if it is a good idea to randomize the position of the true energies when you calculate the energy migration. If I understand the code correctly this means that from one execution to another you will have a different number of times you sample a given true energy bin, and this will shift the events back and forth. Maybe best to have the fine binning in Etrue uniform and only randomize (or also use constant fine binning) in the migration factor

No, that randomization is done inside each Etrue bin, you will always have the same number of events (with slightly different distribution within the bin). As for reproducibility, I will just fix the random seed. But effect of that randomization, for this kind of estimator, is negligible.
Using just the Etrue at the bin center produced some artifacts near threshold, so I think this randomization is better. To improve upon this we would have to go for finer Etrue bins, interpolating Aeffs and migration matrices, and that is really not worth I think.

@moralejo moralejo marked this pull request as draft November 15, 2024 11:45
@moralejo
Copy link
Collaborator Author

As the final plot of the notebook will likely end up in many of the proposals, I would recommend to made some changes to it to unify how they look like: increase the marker size (the middle range points for a strong source are not visible) add some basic information that were used during the calculation into the legend of the plot (observation time, zenith angle, maybe also if pulsar mode or extension were defined) add somewhere in the corner of the figure the version number of the macro

Done:

image

@moralejo moralejo marked this pull request as ready for review November 15, 2024 14:05
morcuended
morcuended previously approved these changes Nov 15, 2024
Copy link
Member

@morcuended morcuended left a comment

Choose a reason for hiding this comment

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

I left some last minor comments, but overall it looks good.

@moralejo moralejo merged commit 95f7227 into main Nov 17, 2024
9 checks passed
@moralejo moralejo deleted the observation_simulator branch November 17, 2024 21:48
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