Difference between revisions of "PITA scan"

From PREX Wiki
Jump to navigationJump to search
Line 65: Line 65:
 
# Read the origin EPICS read variable and origin scandata1 values
 
# Read the origin EPICS read variable and origin scandata1 values
 
# Set cleandata to NOT CLEAN(0)  
 
# Set cleandata to NOT CLEAN(0)  
# Set the scandata1 value to the new PITA voltage through the socket
+
# Set the scandata1 value to the new PITA/IA voltage through the socket
 
# Set cleandata to CLEAN(1)
 
# Set cleandata to CLEAN(1)
 
# Wait for wait_time (set by user)
 
# Wait for wait_time (set by user)
 
# Set cleandata to NOT CLEAN(0)
 
# Set cleandata to NOT CLEAN(0)
# Set PITA1 and PITA2 to the new PITA voltage
+
# Set PITA Scan:PITA1,PITA2 or AIA scan:DAC03,DAC04,DAC05,DAC06 or CIA scan:DAC11,DAC12,DAC13,DAC14 to the new set point
 
# Check if the set value is updated
 
# Check if the set value is updated
 
# Set APPLY TO CELL variable to 1 (click the button)  
 
# Set APPLY TO CELL variable to 1 (click the button)  

Revision as of 15:30, 21 July 2019

In the process of editing and updating this page. Please contact Juliette Mammei crowder@jlab.org with questions or suggestions.

PREX Main<< Information for Shift Takers << Shift Leader << HOW TOs << Expert Tools

This page will tell you step-by-step how to run a PITA/IA scan.

Getting Started

Do NOT test this script - it actually changes the EPICS variables!

  • You need to be logged on to the adaq account:
    •  ssh apar@adaq1 
  • Analysis macros are located in
    •  /adaqfs/home/apar/yufan/scan 
  • If you'd like to move the pita scan files to another directory:
    1. Move the ENTIRE /scan FOLDER. The code uses other python classes that you will need in the scan directory.
    2. Go to the directory where you moved the files, and type
      •  chmod +x scan.py 

How to Run the PITA Scan

  1. Open the file parameters_PITA.txt
    • Changes to make
      1. Change the crate_number to
        • Counting House: 0
        • Injector: 3
      2. Change wait_time to how long (in seconds) you'd like to take data for each PITA value
      3. Change PITA_step_size to how much you would like to increment the PITA voltage for each step
      4. Change max_step to the number of steps you would like the program to run
      5. Change beam_current to the beam current you use in the PITA scan
      6. Example
        • If you set PITA_step = 100 and max_step = 3, and the original PITA read value was 371, then PITA1 and PITA2 will go as: 371+100, 371-100, 371+200, 371-200, 371+300, 371-300
  2. Run the PITA scan by typing
    •  ./scan.py pita 
  3. If the scan finished successfully, you will see "pita SCAN finished" printed to the terminal
  4. If the scan had an error, you will see "Something went wrong! Check the error.txt file" printed to the terminal
    • Errors will be printed in the error.txt file
  5. You can double-check the behavior of the script by looking at the log.txt file

How to Run the Hall A/C IA Scan

  1. Open the file parameters_AIA.txt/parameters_CIA.txt
    • Changes to make
      1. Change the crate_number to
        • Counting House: 0
        • Injector: 3
      2. Change wait_time to how long (in seconds) you'd like to take data for each IA value
      3. Change step_size to how much you would like to increase/decrease the IA value for each step
      4. Change max_step to the number of steps you would like the program to run
      5. Change beam_current to the beam current you use in the scan script Double check if it matches the current during the script, otherwise it won't work
      6. Example
        • If you set step_size = 10000 and max_step = 3, and the original IA read value was default, then all the 4 IA will go as: default+10000, default-10000, default+20000, default-20000, default+30000, default-30000
  2. Run the IA scan by typing
    • Hall A IA
    •  ./scan.py aia 
    • Hall C IA
    •  ./scan.py cia 
  3. If the scan finished successfully, you will see "aia/cia SCAN finished" printed to the terminal
  4. If the scan had an error, you will see "Something went wrong! Check the error.txt file" printed to the terminal
    • Errors will be printed in the error.txt file
  5. You can double-check the behavior of the script by looking at the log.txt file


How does it work?

The script does the following:

  1. Read the origin EPICS read variable and origin scandata1 values
  2. Set cleandata to NOT CLEAN(0)
  3. Set the scandata1 value to the new PITA/IA voltage through the socket
  4. Set cleandata to CLEAN(1)
  5. Wait for wait_time (set by user)
  6. Set cleandata to NOT CLEAN(0)
  7. Set PITA Scan:PITA1,PITA2 or AIA scan:DAC03,DAC04,DAC05,DAC06 or CIA scan:DAC11,DAC12,DAC13,DAC14 to the new set point
  8. Check if the set value is updated
  9. Set APPLY TO CELL variable to 1 (click the button)
  10. Check the readback value of PITA1 and PITA2
  11. Set the scandata1 value1 to the new PITA voltage through the socket
  12. Set cleandata to CLEAN(1)
  13. Wait for wait_time (set by user)
  14. Repeat as next values
  15. After setting all the set points
  16. Set cleandata to NOT CLEAN(0)
  17. Change PITA1, PITA2 and scandata1 to their original values
  18. Set cleandata to CLEAN(1)
  19. Finish