-
Notifications
You must be signed in to change notification settings - Fork 271
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
PSF model #2643
base: main
Are you sure you want to change the base?
Conversation
Quick question: are these models applicable for both gamma-ray and optical PSF? If not, maybe call it OpticalPSFModel to be more clear where it should be used. |
I think this is purely optical, not IRF. Also, I think the appropriate place would be in |
The model accounts for coma abbarations and the default parameters i have would be for photons in the optical range. With different parameters this should work with gamma photons, but i am not sure. I could call the ComeModel OpticalComaModel and keep the parent class as is. Then later models specifically for gamma photons can be added. |
Makes sense. I will move it to optics. |
Side note: we should check with what is used in SimPipe's instrument model, to ensure what is output here is compatible with what the simulations expect. |
I don't think there is a model like this in SimPipe, but @orelgueta or @GernotMaier can confirm. Rather coma is naturally resulting from the definition of the mirror facets. |
The Edit: to be more clear, I would expect something like this to work: psf : Optional[PSFModel] = subarray.tel[tel_id].optics.psf
if psf:
plot_psf(psf) # some general function that plots any PSFModel |
if it is okay then i will open an issue for this |
Here it is: #2647 |
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
You are right, it comes out naturally through ray tracing with mirror roughness and misalignment. |
This comment has been minimized.
This comment has been minimized.
Analysis Details0 IssuesCoverage and DuplicationsProject ID: cta-observatory_ctapipe_AY52EYhuvuGcMFidNyUs |
def test_psf(example_subarray): | ||
@pytest.fixture(scope="session") | ||
def asymmetry_params(): | ||
return [0.49244797, 9.23573115, 0.15216096] |
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.
Fixtures are not really meant for simple data like this.
You could just enter them in the test itself.
Also: why these highly specific values just for a unit test? Wouldn't nice round values in the right order of magnitude be easier on the eyes?
src/ctapipe/instrument/optics.py
Outdated
|
||
Parameters | ||
---------- | ||
r : float |
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.
These docstrings are confusing to me. I don't know how to understand the "from where / at where" distinction.
One is the position of the point source and one the position where the PSF is evaluated, right?
Also: We don't really have anything that is using radial coordinates in the camera plane yet.
For the API, I think I'd prefer taking CameraFrame
coordinate instances or x / y values. The conversions to polar coordinates can then be done for methods where this is needed for evaluation.
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.
i changed the API to use carthesian coordinates and fixed the docustrings to be more clear. I also changed the parameters to round numbers that give reasonable values for some LST-sized camera.
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.
Here it still has r,f,r0,f0
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.
And if meters are required, then this should probably use u.quantity_input(..)
with astropy units
src/ctapipe/instrument/optics.py
Outdated
f, *self.azimuthal_pdf_params | ||
) | ||
|
||
def check_model_parameters(self): |
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.
This should use the traitlets.validate
decorator, one for each traitlet instead of being called manually:
See https://traitlets.readthedocs.io/en/stable/api.html#validating-proposed-changes
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.
Sounds good. I will get to it in about an hour.
src/ctapipe/instrument/optics.py
Outdated
|
||
Parameters | ||
---------- | ||
r : float |
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.
Here it still has r,f,r0,f0
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.
Looks ok for the moment. I've posted one more suggestion of change, but this can be addressed in the future PR.
I am adding PSF models to ctapipe.image.psf_model. I made a parent class called PSFModel and a PSF model based on pure coma abberation called ComaModel.
This will be used in the pointing calculation using star tracking and PSF fitting using stars.