Skip to content

Commit

Permalink
Use full column name
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Oct 27, 2023
1 parent 7fa6a73 commit d11ecd3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ctapipe/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,8 @@ class TelescopePointingContainer(Container):
between camera and sky coordinates.
"""

default_prefix = "telescope_pointing"

azimuth = Field(nan * u.rad, "Azimuth, measured N->E", unit=u.rad)
altitude = Field(nan * u.rad, "Altitude", unit=u.rad)

Expand Down
4 changes: 2 additions & 2 deletions ctapipe/io/pointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ def _read_pointing_table(self, tel_id):
pointing_table.sort("time")
mjd = pointing_table["time"].tai.mjd

az = pointing_table["azimuth"].quantity.to_value(u.rad)
az = pointing_table["telescope_pointing_azimuth"].quantity.to_value(u.rad)
# prepare azimuth for interpolation "unwrapping", i.e. turning 359, 1 into 359, 361
az = np.unwrap(az)
alt = pointing_table["altitude"].quantity.to_value(u.rad)
alt = pointing_table["telescope_pointing_altitude"].quantity.to_value(u.rad)

self._az_interpolators[tel_id] = interp1d(mjd, az, **self.interp_options)
self._alt_interpolators[tel_id] = interp1d(mjd, alt, **self.interp_options)
Expand Down
8 changes: 7 additions & 1 deletion ctapipe/io/tests/test_table_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,13 @@ def test_interpolate_pointing(dl1_file, tmp_path):
alt = (69 + 2 * dt / dt[-1]) * u.deg
az = (180 + 5 * dt / dt[-1]) * u.deg

table = Table({"time": time_mon, "azimuth": az, "altitude": alt})
table = Table(
{
"time": time_mon,
"telescope_pointing_azimuth": az,
"telescope_pointing_altitude": alt,
}
)

for tel_id in subarray.tel:
write_table(table, path, f"/dl0/monitoring/telescope/pointing/tel_{tel_id:03d}")
Expand Down

0 comments on commit d11ecd3

Please sign in to comment.