Closed jstvdk closed 10 months ago
@jstvdk Actually, I just made the opposite fix in #2464
Transforming the CameraGeometry
is the correct thing to do, you don't want to essentially re-implement the transformation in the muon code.
I guess that the differences you are seeing is due to effective vs. equivalent focal length.
The code in processor uses the effective focal length by default, which is correct.
Due to doing the transformation "by hand" instead of using the transformation of the CameraGeometry
, the muon code was always using the equivalent focal length.
So in short, your issue should be fixed by #2464 but in the opposite way you asked here.
@maxnoe Thanks for the explanation. I have one more comment, please. I see the changes only in the intensity_fitter.py
, but what about processor.py
? If I correctly understand, there is a similar transformation in the class MuonProcessor
which immediately has an influence on the ring fit itself, because transformed coordinates are used in the ring_fitter
method.
@jstvdk the fix in #2464 makes it so that the intensity fitter does the same as the processor was already doing.
Basically, the fitter was wrong (due to being written before we introduced CameraGeometry.transform_to
and the switch to TelescopeFrame
for image parameters), everything else was already correct.
@jstvdk the fix in #2464 makes it so that the intensity fitter does the same as the processor was already doing.
Ah, sorry, now I get it. So the problem was because of the different values for focal_length
in processor
and intensity_fitter
, and we should use effective_focal_length
in both cases, which is implemented now. Thank you very much for the explanation.
Describe the bug I think the coordinate transformation in
ctapipe.image.muon.MuonProcessor
is not properly calculated. To be consistent with the User Guide about Coordinates usage in ctapipe, before performing transformation coordinates to theTelescopeFrame
, one should createSkyCoord
object inCameraFrame
with these coordinates. But in theMuonProcessor
we immediately transform thecamera.geometry
to theTelescopeFrame
, and miss the steps of creating theCameraFrame
object.To Reproduce Steps to reproduce the behavior:
MuonProcessor
for the muonic event.fov_lon
andfov_lat
- they are not consistent with calculations as in the User Guide.In the current realisation of
MuonProcessor
they are created in the next way:Expected behavior There should be the step of creating the
CameraFrame
andSkyCoord
objects before transformation to theTelescopeFrame
, e.g.and then we can
Additional context
This small coordinate discrepancy leads to the difference in
optical_efficiency
calculations with two methods up to 25%