Changeset 14459 for fact/tools/PyDimCtrl/ScriptsForPyDimCtrl.py
- Timestamp:
- 10/03/12 21:45:47 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/PyDimCtrl/ScriptsForPyDimCtrl.py
r14458 r14459 265 265 266 266 267 def TakeDataRun():268 """ Take a 5min Data Run269 """270 # check if all subsystems are in the correct state271 IsReadyForDataTaking()272 273 print ' taking Data:FullTriggerArea 5min Run ...'274 mcp.start( 300, -1, 'data\0')275 276 print '...waiting for FAD to be in state 8: Writing Data'277 fad_control.wait(8) # Writing Data278 print '...waiting for FAD to be in state 4: Connected'279 fad_control.wait(4) # Connected280 print '... done'281 267 282 268 def TakeExtLpRun(): … … 287 273 288 274 print 'taking External Light Pulser with BIAS on 1000 ...' 289 mcp.start(-1, 1000, 'light-pulser-ext\0') 290 291 print '...waiting for FAD to be in state 8: Writing Data' 292 fad_control.wait(8) # Writing Data 293 print '...waiting for FAD to be in state 4: Connected' 294 fad_control.wait(4) # Connected 295 print '... done' 275 Take(-1, 1000, 'light-pulser-ext') 296 276 297 277 def TakePedestalOnRun(): … … 302 282 303 283 print 'taking External Light Pulser with BIAS on 1000 ...' 304 mcp.start(-1, 1000, 'pedestal\0') 305 306 print '...waiting for FAD to be in state 8: Writing Data' 307 fad_control.wait(8) # Writing Data 308 print '...waiting for FAD to be in state 4: Connected' 309 fad_control.wait(4) # Connected 310 print '... done' 311 312 313 def Take( time, num_events, runtype): 284 Take(-1, 1000, 'pedestal') 285 286 287 def Take( time, num_events, runtype, verbose=False): 314 288 """ more general version of e.g. TakePedestalOnRun 315 289 Note: One has to check, if Ready for *Take* by oneself … … 319 293 #IsReadyForDataTaking() 320 294 321 print ' taking', runtype,'. ', num_events, 'events in', time, 'seconds' 295 if verbose: 296 print ' taking', runtype,'. ', num_events, 'events in', time, 'seconds' 322 297 mcp.start(time, num_events, runtype) 323 298 324 print '...waiting for FAD to be in state 8: Writing Data' 299 if verbose: 300 print '...waiting for FAD to be in state 8: Writing Data' 325 301 fad_control.wait(8) # Writing Data 326 print '...waiting for FAD to be in state 4: Connected' 327 fad_control.wait(4) # Connected 328 print '... done' 302 if verbose: 303 print '...waiting for FAD to be in state 4: Connected' 304 fad_control.wait_nice(4) # Connected 305 if verbose: 306 print '... done' 329 307 330 308 … … 344 322 print 'taking data run', run+1, 'out of 4' 345 323 IsTracking() 324 346 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') 333 347 334 348 335 def TakeDrsCalibration(): … … 414 401 print 'DRS-Calibration before Data taking' 415 402 print '----------------------------------------------------' 416 417 def DataTaking1():418 """ Script for taking data when you are tracking wobble position 1419 take a DRS CaLibration and physics Data afterwards420 """421 # Move Telescope to Wobble Position 1422 print '--------------------------------------'423 print 'data taking for Wobble 1'424 print 'starting up...'425 print '--------------------------------------'426 print 'OPERATOR:'427 print 'make sure the telescope is tracking'428 print 'wobble position 1 of the source'429 print '--------------------------------------'430 431 # Take a DRS-Calibration before beginning to take physics Data432 #TakeDrsCalibration()433 434 # check feedback state before switching BIAS ON and ramping up to nominal Voltage435 PrepareBiasForDataTaking()436 437 # taking a Data Set (1x Pedestal 1000 Bias On, 1x LPext 1000, 4x5min DataRun)438 TakeData()439 440 print '--------------------------------------'441 print 'data taking for Wobble 1 finished'442 print '--------------------------------------'443 444 def DataTaking2():445 """ Script for taking data when you are tracking wobble position 2446 """447 # Move Telescope to Wobble Position 2448 print '--------------------------------------'449 print 'data taking for Wobble 2'450 print 'starting up...'451 print '--------------------------------------'452 print '--------------------------------------'453 print 'OPERATOR:'454 print '+ make sure the telescope is tracking'455 print ' wobble position 2 of the source'456 print '+ Measure Sky Brightness'457 print '--------------------------------------'458 459 460 # taking a Data Set (1x Pedestal 1000 Bias On, 1x LPext 1000, 4x5min DataRun)461 TakeData()462 463 print '--------------------------------------'464 print 'data taking for Wobble 2 finished'465 print '--------------------------------------'466 467 def TrackCrabWobble1():468 """ changing tracking to "Crab" Wobble 1469 """470 print 'moving telescope to wobble position 1'471 print '...waiting for DRIVE_CONTROL'472 print ' to be in state 6: Armed'473 474 drive_control.wait(6) #Armed475 print 'DRIVE: ARMED'476 time.sleep(5.)477 478 drive_control.track_source( 0.6, 50, 'Crab\0')479 # we store this command in global vars, so it is increadibly easy, to480 # do this call again, when needed481 last_drive_method = drive_control.track_source482 last_drive_kwargs = { 'wobble_offset' : 0.6,483 'wobble_angle' : 50,484 'source_name' : 'Crab\0' }485 # so in case, this call needs to be repeated, just do486 # last_drive_method(**last_drive_kwargs)487 488 print '...sent tracking command for Crab Wobble 1'489 print 'COMMAND: DRIVE_CONTROL/TRACK_SOURCE 0.6 50 Crab'490 491 def TrackCrabWobble2():492 """ changing tracking to "Crab" Wobble 2493 """494 print 'moving telescope to wobble position 2'495 print '...waiting for DRIVE_CONTROL'496 print ' to be in state 6: Armed'497 498 drive_control.wait(6) #Armed499 print 'DRIVE: ARMED'500 time.sleep(5.)501 502 # we store this command in global vars, so it is increadibly easy, to503 # do this call again, when needed504 last_drive_method = drive_control.track_source505 last_drive_kwargs = { 'wobble_offset' : 0.6,506 'wobble_angle' : -130,507 'source_name' : 'Crab\0' }508 # so in case, this call needs to be repeated, just do509 last_drive_method(**last_drive_kwargs)510 511 print '...sent tracking command for Crab Wobble 2'512 print 'COMMAND: DRIVE_CONTROL/TRACK_SOURCE 0.6 -130 Crab'513 514 403 515 404 … … 611 500 fad_control.start_drs_calibration() 612 501 time.sleep(0.5) 613 mcp.start(-1, 1000, "drs-pedestal\0") 614 615 print "...waiting for FAD to be in state 8: Writing Data" 616 fad_control.wait(8) 617 print "...waiting for FAD to be in state 4: Connected" 618 fad_control.wait_nice(4) 619 print "... done" 502 Take( -1, 1000, 'drs-pedestal') 620 503 621 504 print "taking DRS:Gain 1000 ..." 622 mcp.start(-1, 1000, 'drs-gain\0') 623 print "...waiting for FAD to be in state 8: Writing Data" 624 fad_control.wait(8) 625 print "...waiting for FAD to be in state 4: Connected" 626 fad_control.wait_nice(4) 627 print "... done" 505 Take( -1, 1000, 'drs-gain') 628 506 629 507 time.sleep(2) … … 635 513 636 514 print "taking Pedestal 1000 ..." 637 mcp.start( -1, 1000, 'pedestal\0') 638 print "...waiting for FAD to be in state 8: Writing Data" 639 fad_control.wait(8) 640 print "...waiting for FAD to be in state 4: Connected" 641 fad_control.wait(4) 642 print "... done" 515 Take( -1, 1000, 'pedestal') 643 516 644 517 # okay this is the DRS calibration for the next few runs. … … 648 521 print "taking crosscheck Pedestal 1000 ..." 649 522 fad_control.set_file_format(2) 650 651 mcp.start(-1, 1000, 'pedestal\0') 652 print "...waiting for FAD to be in state 8: Writing Data" 653 fad_control.wait(8) 654 print "...waiting for FAD to be in state 4: Connected" 655 fad_control.wait(4) 656 print "... done" 523 Take(-1, 1000, 'pedestal') 657 524 658 525 # now we want to take a run, with dark counts events … … 693 560 # then the DRS calibration above, and the pedestal run in between have to be changed as well. 694 561 print "taking Pedestal with BIAS on 3000 ..." 695 mcp.start(-1, 3000, 'pedestal\0') 696 print "...waiting for FAD to be in state 8: Writing Data" 697 fad_control.wait(8) 698 print "...waiting for FAD to be in state 4: Connected" 699 fad_control.wait(4) 700 print "... done" 562 Take(-1, 3000, 'pedestal') 701 563 702 564 # at the end the bias voltage should be ramped down, since in a few seconds a shifter wit ha flashlight … … 920 782 return GUII.mean(), GUII.std(), GUII.max(), GUII.min() 921 783 922 def TakeCrab():923 """ Data taking and tracking script for Crab924 """925 print '======================================'926 print 'Data taking and tracking script for'927 print 'Crab'928 print '======================================'929 print 'starting up...'930 931 # changing tracking to Crab Wobble 1932 TrackCrabWobble1()933 934 # Wait for drivectrl to reply that its tracking the given source935 WaitForTracking()936 937 DataTaking1()938 939 # changing tracking to Crab Wobble 2940 TrackCrabWobble2()941 942 # Wait for drivectrl to reply that its tracking the given source943 WaitForTracking()944 945 # data taking to Crab Wobble 2946 DataTaking2()947 948 # Stop tracking949 StopTracking()950 951 print '======================================'952 print 'Data taking and tracking script for'953 print 'Crab FINISHED'954 print '======================================'955 784 956 785 … … 1011 840 1012 841 1013 def TrackCrabWobble1_new():1014 """ changing tracking to "Crab" Wobble 11015 """1016 TrackSourceWobbleX( 'Crab', 1)1017 1018 def TrackCrabWobble2_new():1019 """ changing tracking to "Crab" Wobble 11020 """1021 TrackSourceWobbleX( 'Crab', 2)1022 1023 1024 842 def TakeSource( name ): 1025 843 if name not in sourcedict: … … 1030 848 TrackSourceWobbleX( name, 1) # Track Wobble pos 1 of source 1031 849 WaitForTracking() 1032 DataTaking1() 850 # Take a DRS-Calibration before beginning to take physics Data 851 TakeDrsCalibration() 852 # check feedback state before switching BIAS ON and ramping up to nominal Voltage 853 PrepareBiasForDataTaking() 854 # taking a Data Set (1x Pedestal 1000 Bias On, 1x LPext 1000, 4x5min DataRun) 855 TakeData() 856 StopTracking() 1033 857 1034 858 TrackSourceWobbleX( name, 2) # Track Wobble pos 2 of source 1035 859 WaitForTracking() 1036 DataTaking2() 1037 860 # taking a Data Set (1x Pedestal 1000 Bias On, 1x LPext 1000, 4x5min DataRun) 861 TakeData() 862 1038 863 StopTracking() 1039 864
Note:
See TracChangeset
for help on using the changeset viewer.