-
Notifications
You must be signed in to change notification settings - Fork 269
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 algorithm to compute image parameters via fitting the light distribution #2275
Open
clara-escanuela
wants to merge
35
commits into
cta-observatory:main
Choose a base branch
from
clara-escanuela:image-fitting
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
daf07f3
first step towards new image parametrization algorithm
clara-escanuela 81e9e4d
Added condition for fitting
clara-escanuela 5e1e186
solved problem
clara-escanuela b41fba6
add extra information from the fit
clara-escanuela adc7271
added the three different models and changed the definition of pdfs (…
clara-escanuela 390a685
improved descriptions
clara-escanuela db3e58c
added details of the model
clara-escanuela cb68a2d
added test
clara-escanuela 7c86a6e
rebase main branch and reformatting
clara-escanuela 02774fe
add docs/changes/2275.*.rst file
clara-escanuela 20b0b0d
added more tests and made some changes in the method
clara-escanuela 36eae9a
solved issues with tests
clara-escanuela 2f6e677
solved issues with tests
clara-escanuela 242d90a
added simple test on boundaries
clara-escanuela 35648fa
added one test
clara-escanuela 9f6897f
added a test on the skewness of the Skewed and Cauchy
clara-escanuela 03d9877
replaced Cauchy function by Laplace, seems to be a better match
clara-escanuela 6b5d8ed
added PDFType instances and removed not needed line in dilation
clara-escanuela 22e1247
solved problem with skewness boundaries
clara-escanuela e9a9d4a
removed no needed containers and repeated lines of code
clara-escanuela 198832d
reduce code duplications
clara-escanuela 6b1b70d
added one test and adapted code
clara-escanuela 0a239ca
improved documentation
clara-escanuela 0043aad
added goodness of fit
clara-escanuela c9bef50
removed unnecesary function and repetitions
clara-escanuela 329a772
removed unnecesary function and repetitions
clara-escanuela 09beba4
fixed single pixel unit test
clara-escanuela e07d947
removed dilation function
clara-escanuela 790ab1f
fixed unit tests for toymodel
clara-escanuela f81e7d5
added telescope frame
clara-escanuela fd22cf0
changed variable names
clara-escanuela dec2e6d
removed Laplace model
clara-escanuela 6a08f04
test changes
clara-escanuela 879c18f
more unit tests
clara-escanuela 12d3738
removed camera frame
clara-escanuela File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,8 @@ | |
"MorphologyContainer", | ||
"BaseHillasParametersContainer", | ||
"CameraHillasParametersContainer", | ||
"CameraImageFitParametersContainer", | ||
"ImageFitParametersContainer", | ||
"CameraTimingParametersContainer", | ||
"ParticleClassificationContainer", | ||
"PedestalContainer", | ||
|
@@ -280,6 +282,37 @@ class CameraHillasParametersContainer(BaseHillasParametersContainer): | |
psi = Field(nan * u.deg, "rotation angle of ellipse", unit=u.deg) | ||
|
||
|
||
class CameraImageFitParametersContainer(CameraHillasParametersContainer): | ||
""" | ||
Hillas Parameters after fitting. The cog position | ||
is given in meter from the camera center. | ||
""" | ||
|
||
skewness_uncertainty = Field(nan, "measure of skewness uncertainty") | ||
likelihood = Field(nan, "measure of likelihood") | ||
goodness_of_fit = Field( | ||
nan, "measure of goodness of fit, mean likelihood subtracted to the likelihood" | ||
) | ||
n_pixels = Field(nan, "number of pixels used in the fit") | ||
free_parameters = Field(nan, "number of free parameters") | ||
is_valid = Field(False, "True if the fit is valid") | ||
is_accurate = Field( | ||
False, "returns True if the fit is accurate. If False, the fit is not reliable." | ||
) | ||
|
||
x_uncertainty = Field(nan * u.m, "centroid x uncertainty", unit=u.m) | ||
y_uncertainty = Field(nan * u.m, "centroid y uncertainty", unit=u.m) | ||
r_uncertainty = Field(nan * u.m, "centroid r uncertainty", unit=u.m) | ||
phi_uncertainty = Field( | ||
nan * u.deg, "polar coordinate of centroid uncertainty", unit=u.deg | ||
) | ||
psi_uncertainty = Field( | ||
nan * u.deg, "Uncertainty in rotation angle of ellipse", unit=u.deg | ||
) | ||
amplitude = Field(nan, "Amplitude of the fitted model") | ||
amplitude_uncertainty = Field(nan, "error in amplitude from the fit") | ||
|
||
|
||
class HillasParametersContainer(BaseHillasParametersContainer): | ||
""" | ||
Hillas Parameters in a spherical system centered on the pointing position | ||
|
@@ -308,6 +341,37 @@ class HillasParametersContainer(BaseHillasParametersContainer): | |
psi = Field(nan * u.deg, "rotation angle of ellipse", unit=u.deg) | ||
|
||
|
||
class ImageFitParametersContainer(HillasParametersContainer): | ||
""" | ||
Hillas Parameters after fitting. The cog position | ||
is given in meter from the camera center. | ||
""" | ||
|
||
skewness_uncertainty = Field(nan, "measure of skewness uncertainty") | ||
likelihood = Field(nan, "measure of likelihood") | ||
goodness_of_fit = Field( | ||
nan, "measure of goodness of fit, mean likelihood subtracted to the likelihood" | ||
) | ||
n_pixels = Field(nan, "number of pixels used in the fit") | ||
free_parameters = Field(nan, "number of free parameters") | ||
is_valid = Field(False, "True if the fit is valid") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the difference between |
||
is_accurate = Field( | ||
False, "returns True if the fit is accurate. If False, the fit is not reliable." | ||
) | ||
|
||
fov_lon_uncertainty = Field(nan * u.deg, "centroid x uncertainty", unit=u.deg) | ||
fov_lat_uncertainty = Field(nan * u.deg, "centroid y uncertainty", unit=u.deg) | ||
r_uncertainty = Field(nan * u.deg, "centroid r uncertainty", unit=u.deg) | ||
phi_uncertainty = Field( | ||
nan * u.deg, "polar coordinate of centroid uncertainty", unit=u.deg | ||
) | ||
psi_uncertainty = Field( | ||
nan * u.deg, "Uncertainty in rotation angle of ellipse", unit=u.deg | ||
) | ||
amplitude = Field(nan, "Amplitude of the fitted model") | ||
amplitude_uncertainty = Field(nan, "error in amplitude from the fit") | ||
|
||
|
||
class LeakageContainer(Container): | ||
""" | ||
Fraction of signal in 1 or 2-pixel width border from the edge of the | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Positive integer values should have defaults of the correct type, e.g. -1