11import time
22
33import sorunlib as run
4- from sorunlib ._internal import check_response , check_running
4+ from sorunlib ._internal import check_response , check_running , stop_smurfs
55
66EL_DIFF_THRESHOLD = 0.5 # deg diff from target that its ok to run calibration
77BORESIGHT_DIFF_THRESHOLD = 0.5 # deg
@@ -322,7 +322,7 @@ def calibrate(continuous=False, elevation_check=True, boresight_check=True,
322322 eject ()
323323 finally :
324324 # Stop SMuRF streams
325- run . smurf . stream ( 'off' )
325+ stop_smurfs ( )
326326
327327
328328def time_constant (num_repeats = 1 ):
@@ -381,7 +381,7 @@ def time_constant(num_repeats=1):
381381 insert ()
382382 time .sleep (5 )
383383 finally :
384- run . smurf . stream ( 'off' )
384+ stop_smurfs ( )
385385
386386 for i in range (num_repeats ):
387387 if current_hwp_direction == 'ccw' :
@@ -404,7 +404,7 @@ def time_constant(num_repeats=1):
404404 # Run stepwise rotation
405405 rotate (continuous = False )
406406 finally :
407- run . smurf . stream ( 'off' )
407+ stop_smurfs ( )
408408
409409 # Stop the HWP while streaming
410410 try :
@@ -413,7 +413,7 @@ def time_constant(num_repeats=1):
413413 run .smurf .stream ('on' , tag = stream_tag , subtype = 'cal' )
414414 run .hwp .stop (active = True )
415415 finally :
416- run . smurf . stream ( 'off' )
416+ stop_smurfs ( )
417417
418418 # Reverse the HWP while streaming
419419 try :
@@ -430,7 +430,7 @@ def time_constant(num_repeats=1):
430430 run .hwp .set_freq (freq = - 2.0 )
431431 current_hwp_direction = target_hwp_direction
432432 finally :
433- run . smurf . stream ( 'off' )
433+ stop_smurfs ( )
434434
435435 # Run stepwise rotation after changing the HWP rotation
436436 try :
@@ -441,7 +441,7 @@ def time_constant(num_repeats=1):
441441 # Run stepwise rotation
442442 rotate (continuous = False )
443443 finally :
444- run . smurf . stream ( 'off' )
444+ stop_smurfs ( )
445445
446446 # Bias step (the wire grid is on the window)
447447 # After changing the HWP rotation
@@ -458,7 +458,7 @@ def time_constant(num_repeats=1):
458458 eject ()
459459 time .sleep (5 )
460460 finally :
461- run . smurf . stream ( 'off' )
461+ stop_smurfs ( )
462462
463463 # Bias step (the wire grid is off the window)
464464 bs_tag = 'wiregrid, wg_time_constant, wg_ejected, ' + \
0 commit comments