APS-USAXS / usaxs-bluesky-ended-2023

Bluesky instrument for USAXS
0 stars 0 forks source link

implement preUSAXStune #47

Closed prjemian closed 6 years ago

prjemian commented 6 years ago

SPEC code:

# /home/beams/USAXS/spec/macros/local/usaxs_tuning.mac
def preUSAXStune '
  DCMfeedbackON
  closeCCDshutter                         # close CCD shutter in case we are in Radiography mode
  IfRequestedStopBeforeNextScan           # stop if user chose to do so. 
  useModeUSAXS                            # should be done only in USAXS mode. 
  moveDetector DIODE_DX DIODE_DY          # if user was in Radiography mode, move diode in place
  global useSBUSAXS 
  global useMSstage
  epics_put ("9idcLAX:USAXS:timeStamp",   date())
  epics_put ("9idcLAX:USAXS:state",       "pre-USAXS optics tune")
  openMonoShutter
  usaxs_CheckBeamStandard
  chk_beam_on
  set_USAXS_Slits                        # make sure USAXS slits are set correctly...
  autorange_I0I00amps                    # set correctly the gains for I0 and I00
  tune_mr;                               # tune M stage to monochromator
  tune_m2rp;                             # tune M stage paralelity
  #tune_m2rp_fbe;                         # tune M stage paralelity using feedback
  if(useSBUSAXS==1||useMSstage==1){tune_msrp} # tune msrp stage
  if(useSBUSAXS==1){tune_asrp}           # tune asrp stage and set ASRP0 value
  autorange_UPDI0I00                     # set correctly the ranges for all amplifiers
  tune_ar ;                              # tune up the analyzer crystal pair
  autorange_UPDI0I00                     # set correctly the ranges for all amplifiers
  tune_a2rp ;                            # tune up the analyzer crystal pair
  #tune_a2rp_fbe                         # using the feedback    
  printf ("USAXS count time is %g second(s)\n", USAXS_TIME)
  ct USAXS_TIME
  epics_put ("9idcLAX:USAXS:timeStamp",   date())
  epics_put ("9idcLAX:USAXS:state",       "pre-USAXS optics tuning done")
  set_NumScansFromLastTune 0
  set_RunPreUSAXStuneNext 0
  set_EPOCHTimeOfLastTune time()
'
prjemian commented 6 years ago

not so fast: lots of prerequisites for this

@jilavsky: lowering the priority since step and fly scans must work first

prjemian commented 6 years ago

looks complete, needs testing