Skip to content

transforming geometry loses frame attributes #2277

Open
@kosack

Description

@kosack

Describe the bug

Transforming a CameraGeometry that has a focal_length attribute to EngineeringCameraFrame resets that frame attribute.

To Reproduce

from ctapipe.instrument import SubarrayDescription
from ctapipe.coordinates import EngineeringCameraFrame

subarray = SubarrayDescription.read("dataset://gamma_prod5.simtel.zst")
geom = subarray.tel[100].camera.geometry
print("OLD", geom.frame)
new_geom = geom.transform_to(EngineeringCameraFrame())
print("NEW", new_geom.frame)
OLD <CameraFrame Frame (focal_length=16.445049285888672 m, rotation=0.0 rad, telescope_pointing=None, obstime=None, location=None)>
NEW <EngineeringCameraFrame Frame (focal_length=0.0 m, rotation=0.0 rad, telescope_pointing=None, obstime=None, location=None, n_mirrors=1)>

Expected behavior
Frame attributes are retained, so further transforms (like back to TelescopeFrame) work

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmodule:instrumentissues with the instrument description (ctapipe.instrument)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions