Skip to content

Commit

Permalink
Change schema and parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
elanaku committed Nov 11, 2024
1 parent 56f6da2 commit 2d78c13
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 45 deletions.
9 changes: 6 additions & 3 deletions python/lsst/ts/observatory/control/data/mtcalsys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,20 @@ laser_functional:
use_camera: false
optical_configuration: SCU
wavelength: 500.0
use_electrometer: false
use_flatfieldelectrometer: false
use_fiberspectrograph_red: false
use_fiberspectrograph_blue: false
exposure_times:
- 15.0

cbp_calibration:
calib_type: CBPCalibration
calib_type: Mono
use_cbp: true
use_camera: false
wavelength: 700
wavelength_width: 800
wavelength_resolution: 50
use_flatfieldelectrometer: false
use_cbpelectrometer: true
use_cbpcalelectrometer: true
use_fiberspectrograph_red: false
Expand All @@ -103,4 +105,5 @@ cbp_calibration:
electrometer_range: 2e-6
laser_mode: BURST
optical_configuration: F1_SCU
exposure_times: 30
exposure_times:
- 30.0
42 changes: 39 additions & 3 deletions python/lsst/ts/observatory/control/data/mtcalsys_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,22 @@ properties:
focus the laser light from the fiber.
type: number
default: 15.380
use_electrometer:
description: Identifies if the electrometer will be used in the exposure.
use_cbp:
description: Identifies if the CBP will be used.
type: boolean
default: false
use_flatfieldelectrometer:
description: Identifies if the flatfield electrometer will be used in the exposure.
type: boolean
default: true
use_cbpelectrometer:
description: Identifies if the cbp electrometer will be used in the exposure.
type: boolean
default: false
use_cbpcalelectrometer:
description: Identifies if the cbpcal electrometer will be used in the exposure.
type: boolean
default: false
use_fiberspectrograph_red:
description: >-
Identifies if the fiberspectrograph for red color will be used in the
Expand Down Expand Up @@ -138,11 +150,35 @@ properties:
- F2_SCU
- F2_NO_SCU
- F1_NO_SCU
cbp_elevation:
description: CBP elevation in degrees.
type: number
default: 0
cbp_azimuth:
description: CBP azimuth in degrees.
type: number
default: 0
cbp_mask:
description: CBP azimuth in degrees.
type: integer
default: 3
minimum: 1
maximum: 5
cbp_rotation:
description: CBP mask rotator angle in degrees.
type: number
default: 0
cbp_focus:
description: CBP focus position in um.
type: number
default: 6000
minimum: 0
maximum: 13000
required:
- calib_type
- wavelength
- use_camera
- use_electrometer
- use_flatfieldelectrometer
- use_fiberspectrograph_red
- use_fiberspectrograph_blue
- exposure_times
Expand Down
65 changes: 28 additions & 37 deletions python/lsst/ts/observatory/control/maintel/mtcalsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,34 +206,29 @@ async def setup_calsys(self, sequence_name: str) -> None:
await self.linearstage_projector_select.cmd_moveAbsolute.set_start(
distance=self.ls_select_led_location, timeout=self.long_timeout
)
elif (calibration_type == CalibrationType.CBPCalibration) or (
calibration_type == CalibrationType.CBP
):
await self.setup_cbp(
config_data["cbp_azimuth"],
config_data["cbp_elevation"],
config_data["cbp_mask"],
config_data["cbp_focus"],
config_data["cbp_rotation"],
)
await self.setup_electrometers(
mode=str(config_data["electrometer_mode"]),
range=float(config_data["electrometer_range"]),
integration_time=float(config_data["electrometer_integration_time"]),
)
await self.setup_laser(
config_data["laser_mode"],
config_data["wavelength"],
config_data["optical_configuration"],
)
await self.laser_start_propagate()
else:
await self.linearstage_led_select.cmd_moveAbsolute.set_start(
distance=self.led_rest_position, timeout=self.long_timeout
)
await self.linearstage_projector_select.cmd_moveAbsolute.set_start(
distance=self.ls_select_laser_location, timeout=self.long_timeout
)
if config_data["use_cbp"]:
await self.setup_cbp(
config_data["cbp_azimuth"],
config_data["cbp_elevation"],
config_data["cbp_mask"],
config_data["cbp_focus"],
config_data["cbp_rotation"],
)
await self.setup_electrometers(
mode=str(config_data["electrometer_mode"]),
range=float(config_data["electrometer_range"]),
integration_time=float(
config_data["electrometer_integration_time"]
),
)
else:
await self.linearstage_led_select.cmd_moveAbsolute.set_start(
distance=self.led_rest_position, timeout=self.long_timeout
)
await self.linearstage_projector_select.cmd_moveAbsolute.set_start(
distance=self.ls_select_laser_location, timeout=self.long_timeout
)
await self.setup_laser(
config_data["laser_mode"],
config_data["wavelength"],
Expand Down Expand Up @@ -370,9 +365,9 @@ async def setup_cbp(
self,
azimuth: float,
elevation: float,
mask: typing.Optional[int] = None,
focus: typing.Optional[float] = None,
rotation: typing.Optional[int] = None,
mask: int,
focus: float,
rotation: float,
) -> None:
"""Perform all steps for preparing the CBP for measurements.
Expand All @@ -389,10 +384,6 @@ async def setup_cbp(
rot: `int`
Rotator position of mask in degrees
Default 0
use_projector : `bool`
identifies if you are using the projector while
changing the wavelength
Default True
"""
timeout = 60
await self.rem.cbp.cmd_move.set_start(
Expand Down Expand Up @@ -646,7 +637,7 @@ async def calculate_optimized_exposure_times(
electrometer_integration_time=config_data[
"electrometer_integration_time"
],
use_electrometer=config_data["use_electrometer"],
use_electrometer=config_data["use_flatfieldelectrometer"],
)
fiberspectrograph_exptimes_red = (
await self._calculate_fiberspectrograph_exposure_times(
Expand Down Expand Up @@ -923,11 +914,11 @@ def electrometer(self) -> salobj.Remote:
return getattr(self.rem, f"electrometer_{self.electrometer_projector_index}")

@property
def electrometerCBP(self) -> salobj.Remote:
def electrometer_cbp(self) -> salobj.Remote:
return getattr(self.rem, f"electrometer_{self.electrometer_cbp_index}")

@property
def electrometerCBPCal(self) -> salobj.Remote:
def electrometer_cbp_cal(self) -> salobj.Remote:
return getattr(self.rem, f"electrometer_{self.electrometer_cbpcal_index}")

@property
Expand Down
2 changes: 0 additions & 2 deletions python/lsst/ts/observatory/control/utils/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ class CalibrationType(enum.IntEnum):

WhiteLight = 1
Mono = 2
CBP = 3
CBPCalibration = 4


# TODO: (DM-46168) Revert workaround for TunableLaser XML changes
Expand Down

0 comments on commit 2d78c13

Please sign in to comment.