Changeset 14460 for fact/tools


Ignore:
Timestamp:
10/03/12 22:08:30 (12 years ago)
Author:
neise
Message:
deleted more overhead
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/PyDimCtrl/ScriptsForPyDimCtrl.py

    r14459 r14460  
    1010
    1111bias_calibration = {}
     12
     13report_length = None
    1214
    1315def wait_nice(self, state_num, timeout=None):                           
     
    2325    time.sleep(0.1)
    2426    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)
    2633      intermed = time.time()
    2734   
    2835    if time.time() >= start+timeout:
     36      print
    2937      return False
     38  print
    3039  return True
    3140
     
    246255
    247256
    248 def waitForTracking():
     257def WaitForTracking( verbose = False):
    249258  """ Wait for drivectrl to reply that its tracking the given source
    250259  """
    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"
    254263  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"
    259270  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"
    264277  time.sleep(10)
    265278
    266 
    267 
    268 def TakeExtLpRun():
    269   """ Take a external Lightpulser Run
    270   """
    271   # check if all subsystems are in the correct state
    272   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 ON
    279   """
    280   # check if all subsystems are in the correct state
    281   IsReadyForDataTaking()
    282 
    283   print 'taking External Light Pulser with BIAS on 1000 ...'
    284   Take(-1, 1000, 'pedestal')
    285279
    286280
     
    312306  # take a Pedestal run
    313307  IsTracking()
    314   TakePedestalOnRun()
     308  IsReadyForDataTaking()
     309  print 'taking External Light Pulser with BIAS on 1000 ...'
     310  Take(-1, 1000, 'pedestal')
    315311 
    316312  # take a ExtLP run
    317313  IsTracking()
    318   TakeExtLpRun()
     314  IsReadyForDataTaking()
     315  print 'taking External Light Pulser with BIAS on 1000 ...'
     316  Take(-1, 1000, 'light-pulser-ext')
    319317
    320318  #Data Taking with Full Trigger Area (4x5min)
     
    322320    print 'taking data run', run+1, 'out of 4'
    323321    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')
    333324
    334325
     
    868859    print time.strftime('%d %b %Y %H:%M:%S UTC', time.gmtime()), GetBiasCurrent()
    869860
    870 def WaitForTracking():
    871   drive_control.wait(7) #Moving
    872   drive_control.wait(8) #Tracking
    873   time.sleep(10)
    874 
    875861
    876862if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.