-
Notifications
You must be signed in to change notification settings - Fork 0
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
Tickets/DM-47497 Adding CBP to MTCalsys #177
base: develop
Are you sure you want to change the base?
Changes from 4 commits
7ec9b9e
eca9df5
b8249d4
6a17b0c
56f6da2
2d78c13
adf36dd
c933b5e
a3aa397
9adfbf8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,3 +87,20 @@ laser_functional: | |
use_fiberspectrograph_blue: false | ||
exposure_times: | ||
- 15.0 | ||
|
||
cbp_calibration: | ||
calib_type: CBPCalibration | ||
use_camera: false | ||
wavelength: 700 | ||
wavelength_width: 800 | ||
wavelength_resolution: 50 | ||
use_cbpelectrometer: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose we should rename the other electrometer to be flatfieldelectrometer or something like that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, |
||
use_cbpcalelectrometer: true | ||
use_fiberspectrograph_red: false | ||
use_fiberspectrograph_blue: false | ||
electrometer_integration_time: 0.001 | ||
electrometer_mode: CHARGE | ||
electrometer_range: 2e-6 | ||
laser_mode: BURST | ||
optical_configuration: F1_SCU | ||
exposure_times: 30 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know it it will be unhappy unless you put it in this format. It might be fine.
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,12 +130,15 @@ def __init__( | |
) -> None: | ||
|
||
self.electrometer_projector_index = 103 | ||
self.electrometer_cbp_index = 101 | ||
self.electrometer_cbpcal_index = 102 | ||
self.fiberspectrograph_blue_index = 1 | ||
self.fiberspectrograph_red_index = 2 | ||
self.linearstage_led_select_index = 1 | ||
self.linearstage_led_focus_index = 2 | ||
self.linearstage_laser_focus_index = 3 | ||
self.linearstage_select_index = 4 | ||
self.cbp_index = 1 | ||
|
||
super().__init__( | ||
components=[ | ||
|
@@ -144,10 +147,13 @@ def __init__( | |
f"FiberSpectrograph:{self.fiberspectrograph_blue_index}", | ||
f"FiberSpectrograph:{self.fiberspectrograph_red_index}", | ||
f"Electrometer:{self.electrometer_projector_index}", | ||
f"ElectrometerCBP:{self.electrometer_cbp_index}", | ||
f"ElectrometerCBPCal:{self.electrometer_cbpcal_index}", | ||
f"LinearStage:{self.linearstage_led_select_index}", | ||
f"LinearStage:{self.linearstage_led_focus_index}", | ||
f"LinearStage:{self.linearstage_laser_focus_index}", | ||
f"LinearStage:{self.linearstage_select_index}", | ||
f"CBP:{self.cbp_index}", | ||
], | ||
domain=domain, | ||
log=log, | ||
|
@@ -200,6 +206,27 @@ 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I mentioned above, I thinks CalibrationType should remain the "light input" and we should create a new variable for the CBP vs. FlatField |
||
): | ||
await self.setup_cbp( | ||
config_data["cbp_azimuth"], | ||
config_data["cbp_elevation"], | ||
config_data["cbp_mask"], | ||
config_data["cbp_focus"], | ||
config_data["cbp_rotation"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you want to add this to the mtcalsys.yaml file? |
||
) | ||
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 | ||
|
@@ -339,6 +366,47 @@ async def setup_laser( | |
await self.change_laser_optical_configuration(optical_configuration) | ||
await self.change_laser_wavelength(wavelength, use_projector) | ||
|
||
async def setup_cbp( | ||
self, | ||
azimuth: float, | ||
elevation: float, | ||
mask: typing.Optional[int] = None, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want this to be optional or have a default here? I think every time we move the CBP it would be good to confirm the mask, focus and rotation. |
||
focus: typing.Optional[float] = None, | ||
rotation: typing.Optional[int] = None, | ||
) -> None: | ||
"""Perform all steps for preparing the CBP for measurements. | ||
|
||
Parameters | ||
---------- | ||
az : `float` | ||
Azimuth of CBP in degrees | ||
el : `float` | ||
Elevation of CBP in degrees | ||
mask : `int` | ||
Mask number to use | ||
focus: `float` | ||
Focus position in um | ||
rot: `int` | ||
Rotator position of mask in degrees | ||
Default 0 | ||
use_projector : `bool` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can remove this. |
||
identifies if you are using the projector while | ||
changing the wavelength | ||
Default True | ||
""" | ||
timeout = 60 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, don't use local timeout variable, we define some default timeouts in the base class. Chose one of those or make a custom one at the class level. |
||
await self.rem.cbp.cmd_move.set_start( | ||
azimuth=azimuth, elevation=elevation, timeout=timeout | ||
) | ||
if focus is not None: | ||
await self.rem.cbp.cmd_setFocus.set_start(focus=focus, timeout=timeout) | ||
if mask is not None: | ||
await self.rem.cmd_changeMask.set_start(mask=mask, timeout=timeout) | ||
if rotation is not None: | ||
await self.rem.cmd_changeMaskRotation.set_start( | ||
mask_rotation=rotation, timeout=timeout | ||
) | ||
|
||
async def get_laser_parameters(self) -> tuple: | ||
"""Get laser configuration | ||
|
||
|
@@ -854,6 +922,14 @@ async def take_fiber_spectrum( | |
def electrometer(self) -> salobj.Remote: | ||
return getattr(self.rem, f"electrometer_{self.electrometer_projector_index}") | ||
|
||
@property | ||
def electrometerCBP(self) -> salobj.Remote: | ||
return getattr(self.rem, f"electrometer_{self.electrometer_cbp_index}") | ||
|
||
@property | ||
def electrometerCBPCal(self) -> salobj.Remote: | ||
return getattr(self.rem, f"electrometer_{self.electrometer_cbpcal_index}") | ||
|
||
@property | ||
def fiberspectrograph_red(self) -> salobj.Remote: | ||
return getattr( | ||
|
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 is defined as an enum in
ts_observatorycontrol/utils/enums.py
.calib_type
identifies the light source. So let's keep this asMono
and introduce a new variable calleduse_cbp
or something like that.