@@ -113,14 +113,20 @@ def get_schema(cls) -> dict:
113113 properties:
114114 az:
115115 description: Azimuth position to point to.
116- type: number
117- minimum: 0
118- maximum: 360
116+ anyOf:
117+ - type: number
118+ minimum: 0
119+ maximum: 360
120+ - type: "null"
121+ default: null
119122 el:
120123 description: Elevation position to point to.
121- type: number
122- minimum: 0
123- maximum: 90
124+ anyOf:
125+ - type: number
126+ minimum: 0
127+ maximum: 90
128+ - type: "null"
129+ default: null
124130 filter:
125131 description: Filter name or ID; if omitted the filter is not changed.
126132 anyOf:
@@ -261,7 +267,7 @@ async def configure(self, config: types.SimpleNamespace) -> None:
261267 self .range = config .range
262268 self .n_steps = config .n_steps
263269 self .step_sequence = np .linspace (
264- - self .range , self .range , self .n_steps
270+ - self .range / 2 , self .range / 2 , self .n_steps
265271 ).tolist ()
266272
267273 if hasattr (config , "rotation_sequence" ):
@@ -393,11 +399,11 @@ async def parameter_march(self) -> None:
393399 if self .rotation_sequence is not None :
394400 await self .track_target_with_rotation (self .rotation_sequence [0 ])
395401
396- await self .take_images ()
402+ rot_offsets = [
403+ rot - self .rotation_sequence [0 ] for rot in self .rotation_sequence
404+ ]
397405
398- rot_offsets = [
399- rot - self .rotation_sequence [0 ] for rot in self .rotation_sequence
400- ]
406+ await self .take_images ()
401407
402408 for self .iterations_executed in range (1 , self .n_steps ):
403409 await self .checkpoint (f"Step { self .iterations_executed + 1 } /{ self .n_steps } ." )
@@ -416,18 +422,19 @@ async def parameter_march(self) -> None:
416422 # Store the total offset
417423 self .total_offset += offset
418424
419- rotation = await self .tcs .rem .mtrotator .tel_rotation .next (
420- flush = True , timeout = self .tcs .long_timeout
421- )
422- rot_tracking_correction = (
423- rotation .actualPosition
424- - self .rotation_sequence [self .iterations_executed - 1 ]
425- )
425+ if self .rotation_sequence is not None :
426+ rotation = await self .tcs .rem .mtrotator .tel_rotation .next (
427+ flush = True , timeout = self .tcs .long_timeout
428+ )
429+ rot_tracking_correction = (
430+ rotation .actualPosition
431+ - self .rotation_sequence [self .iterations_executed - 1 ]
432+ )
426433
427- await self .tcs .offset_rot (
428- rot_offsets [self .iterations_executed ] - rot_tracking_correction
429- )
430- await self .tcs .check_tracking (track_duration = 1.0 )
434+ await self .tcs .offset_rot (
435+ rot_offsets [self .iterations_executed ] - rot_tracking_correction
436+ )
437+ await self .tcs .check_tracking (track_duration = 1.0 )
431438
432439 # Take images at the current dof position
433440 await self .take_images ()
@@ -480,7 +487,8 @@ async def cleanup(self):
480487 for i , dof_offset in enumerate (self .dofs * - self .total_offset ):
481488 offset_dof_data .value [i ] = dof_offset
482489 await self .tcs .rem .mtaos .cmd_offsetDOF .start (data = offset_dof_data )
483- await self .tcs .offset_rot (0.0 )
490+ if self .rotation_sequence is not None :
491+ await self .tcs .offset_rot (0.0 )
484492
485493 except Exception :
486494 self .log .exception (
0 commit comments