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

Addition of an ExtensionEstimator #4419

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

registerrier
Copy link
Contributor

Description

This pull request proposes an ExtensionEstimator based on the parameter estimator.

A possible improvement compared to the typical functionalities of the ParameterEstimator would be to handle a case where the extension parameter is kept fixed between all energies and then released to test the energy dependent morphology.

Dear reviewer

Signed-off-by: Régis Terrier <rterrier@apc.in2p3.fr>
@registerrier registerrier marked this pull request as draft March 24, 2023 12:36
@registerrier registerrier changed the title Add the ExtensionEstimator Addition of an ExtensionEstimator Mar 24, 2023
# find extension parameter
model = datasets.models[self.source].spatial_model

if hasattr(model, "sigma"):
Copy link
Member

Choose a reason for hiding this comment

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

I think this code block should go into the estimate_size() function instead and use the size parameter just as local variable.

@adonath
Copy link
Member

adonath commented Mar 27, 2023

Thanks @registerrier, this is very interesting and covers an important use case. As this is still a draft I just have a few preliminary comments:

  • Depending on the parametrization of the model there is typically a strong correlation between the amplitude and the size parameter. So I think the default behavior here should be to always re-fit the amplitude, when varying the size parameter.
  • In general we could think about having an (optional) Map, that stores the size parameter and size scan in FluxMaps as well.

@registerrier registerrier added this to the 1.2 milestone May 4, 2023
@bkhelifi
Copy link
Member

@registerrier, should you update your branch such that the tests pass?

Edges of the energy intervals where the extension is estimated.
source : str or int
For which source in the model to compute the extension.
size_min : float
Copy link
Member

Choose a reason for hiding this comment

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

Maybe the default values should be added in the docstring...


def __init__(
self,
energy_edges=[1, 10] * u.TeV,
Copy link
Member

Choose a reason for hiding this comment

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

Maybe these default values should be removed... to be generic and to force the user to add edges

Copy link
Member

@bkhelifi bkhelifi left a comment

Choose a reason for hiding this comment

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

Beyond the few comments on the docstring and initial values, it seems OK to be merged...

@bkhelifi
Copy link
Member

@registerrier can you update your code from the main?

@registerrier registerrier modified the milestones: 1.2, 1.3 Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants