Changeset 14460 for fact/tools/PyDimCtrl
- Timestamp:
- 10/03/12 22:08:30 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/PyDimCtrl/ScriptsForPyDimCtrl.py
r14459 r14460 10 10 11 11 bias_calibration = {} 12 13 report_length = None 12 14 13 15 def wait_nice(self, state_num, timeout=None): … … 23 25 time.sleep(0.1) 24 26 if time.time() - intermed >= 1.: 25 print fad_control.events()[0], 'events @', ftm_control.trigger_rates()[3], 'Hz' 27 report = str(fad_control.events()[0]) + ' events @ ' + 28 str( ftm_control.trigger_rates()[3]) + ' Hz' 29 if report_length: 30 print '\b'*report_length, 31 print report, 32 report_length = len(report) 26 33 intermed = time.time() 27 34 28 35 if time.time() >= start+timeout: 36 print 29 37 return False 38 print 30 39 return True 31 40 … … 246 255 247 256 248 def waitForTracking():257 def WaitForTracking( verbose = False): 249 258 """ Wait for drivectrl to reply that its tracking the given source 250 259 """ 251 252 print "...waiting for DRIVE_CONTROL"253 print " to be in state 7: Moving"260 if verbose: 261 print "...waiting for DRIVE_CONTROL" 262 print " to be in state 7: Moving" 254 263 drive_control.wait(7) 255 print "...moving" 256 257 print "...waiting for DRIVE_CONTROL" 258 print " to be in state 8: Tracking" 264 if verbose: 265 print "...moving" 266 267 if verbose: 268 print "...waiting for DRIVE_CONTROL" 269 print " to be in state 8: Tracking" 259 270 drive_control.wait(8) 260 print "...tracking requested wobble position" 261 262 print "waiting 10 sec for drive to calm down" 263 print "and tracking beeing stable" 271 if verbose: 272 print "...tracking requested wobble position" 273 274 if verbose: 275 print "waiting 10 sec for drive to calm down" 276 print "and tracking beeing stable" 264 277 time.sleep(10) 265 278 266 267 268 def TakeExtLpRun():269 """ Take a external Lightpulser Run270 """271 # check if all subsystems are in the correct state272 IsReadyForDataTaking()273 274 print 'taking External Light Pulser with BIAS on 1000 ...'275 Take(-1, 1000, 'light-pulser-ext')276 277 def TakePedestalOnRun():278 """ Take a Pedestal 1000 run with Bias ON279 """280 # check if all subsystems are in the correct state281 IsReadyForDataTaking()282 283 print 'taking External Light Pulser with BIAS on 1000 ...'284 Take(-1, 1000, 'pedestal')285 279 286 280 … … 312 306 # take a Pedestal run 313 307 IsTracking() 314 TakePedestalOnRun() 308 IsReadyForDataTaking() 309 print 'taking External Light Pulser with BIAS on 1000 ...' 310 Take(-1, 1000, 'pedestal') 315 311 316 312 # take a ExtLP run 317 313 IsTracking() 318 TakeExtLpRun() 314 IsReadyForDataTaking() 315 print 'taking External Light Pulser with BIAS on 1000 ...' 316 Take(-1, 1000, 'light-pulser-ext') 319 317 320 318 #Data Taking with Full Trigger Area (4x5min) … … 322 320 print 'taking data run', run+1, 'out of 4' 323 321 IsTracking() 324 325 TakeDataRun() 326 327 def TakeDataRun(): 328 """ Take a 5min Data Run 329 """ 330 # check if all subsystems are in the correct state 331 IsReadyForDataTaking() 332 Take( 300, -1, 'data') 322 IsReadyForDataTaking() 323 Take( 300, -1, 'data') 333 324 334 325 … … 868 859 print time.strftime('%d %b %Y %H:%M:%S UTC', time.gmtime()), GetBiasCurrent() 869 860 870 def WaitForTracking():871 drive_control.wait(7) #Moving872 drive_control.wait(8) #Tracking873 time.sleep(10)874 875 861 876 862 if __name__ == '__main__':
Note:
See TracChangeset
for help on using the changeset viewer.