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

Documentation: Misleading default value in gammapy.estimators.SensitivityEstimator of spectrum=None #4659

Closed
mdpunch opened this issue Jul 14, 2023 · 1 comment · Fixed by #4661
Labels

Comments

@mdpunch
Copy link
Contributor

mdpunch commented Jul 14, 2023

Gammapy version
gammapy v1.1

Bug description
In the documentation of gammapy.estimators.SensitivityEstimator:
https://docs.gammapy.org/1.1/api/gammapy.estimators.SensitivityEstimator.html
... the default for spectrum is given as None

But as can be seen in the source code, this becomes:

        if spectrum is None:
            spectrum = PowerLawSpectralModel(index=2, amplitude="1 cm-2 s-1 TeV-1")

This might mislead, for the unaware, that the sensitivity could be applied to very soft spectrum sources.

Expected behavior

It would be clearer to specify what the default behaviour for spectrum is, e.g. by changing

   Parameters
    ----------
    spectrum : `SpectralModel`
        Spectral model assumption

to

   Parameters
    ----------
    spectrum : `SpectralModel`
        Spectral model assumption, default Power Law with index 2

(note, some CTA papers have used other assumptions, e.g. https://arxiv.org/pdf/1509.01943.pdf "Real-Time Analysis sensitivity evaluation of the Cherenkov Telescope Array" which has "The MC simulation assumes a source with a power law spectrum and a Crab-like index located at the center of the field of view and observed at a zenith angle of 20 degrees.")

@mdpunch mdpunch added the bug label Jul 14, 2023
mdpunch added a commit to mdpunch/gammapy that referenced this issue Jul 15, 2023
@mdpunch
Copy link
Contributor Author

mdpunch commented Jul 15, 2023

Made a pull request with this...

registerrier added a commit that referenced this issue Jul 17, 2023
Change to address Misleading doc for `Sensitivity Estimator` #4659
meeseeksmachine pushed a commit to meeseeksmachine/gammapy that referenced this issue Jul 17, 2023
meeseeksmachine pushed a commit to meeseeksmachine/gammapy that referenced this issue Jul 17, 2023
registerrier added a commit that referenced this issue Jul 17, 2023
…1-on-v1.0.x

Backport PR #4661 on branch v1.0.x (Change to address Misleading doc for `Sensitivity Estimator` #4659)
registerrier added a commit that referenced this issue Jul 17, 2023
…1-on-v1.1.x

Backport PR #4661 on branch v1.1.x (Change to address Misleading doc for `Sensitivity Estimator` #4659)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant