Example #1
0
def set_mono_scan_points(numpoints):
    mono_mot_code = beamline_support.get_motor_code(
        beamline_support.motor_code_from_descriptor("monochromator"))
    step_inc = beamline_support.get_scanstepsize(mono_mot_code)
    scan_width = step_inc * (float(float(numpoints) - 1))
    half_scan_width = scan_width / 2.0
    beamline_support.set_scanpoints(mono_mot_code, int(float(numpoints)))
    beamline_support.set_scanstart(mono_mot_code, 0.0 - half_scan_width)
    beamline_support.set_scanend(mono_mot_code, half_scan_width)
Example #2
0
def set_mono_scan_points(numpoints):
  mono_mot_code = beamline_support.get_motor_code(beamline_support.motor_code_from_descriptor("monochromator"))
  step_inc = beamline_support.get_scanstepsize(mono_mot_code)
  scan_width = step_inc * (float(float(numpoints) - 1))
  half_scan_width = scan_width/2.0
#  daq_lib.set_field("mono_scan_points",int(float(numpoints)))
  beamline_support.set_scanpoints(mono_mot_code,int(float(numpoints)))
  beamline_support.set_scanstart(mono_mot_code,0.0 - half_scan_width)
  beamline_support.set_scanend(mono_mot_code,half_scan_width)
Example #3
0
def monscn():   # for now, not sure if this should go in macros
  mono_mot_code = beamline_support.get_motor_code(beamline_support.motor_code_from_descriptor("monochromator"))  
  beamline_support.newfile("spectrum")
  current_filename = nowfile()
  daq_lib.open_shutter()
#  align(mono_mot_code)
  beamline_support.dscan(mono_mot_code)
  daq_lib.close_shutter()    
  command_string = "ln -sf %s spectrum.dat" % current_filename
  os.system(command_string)
  beamline_support.newfile("scandata")      
Example #4
0
def monscn():  # for now, not sure if this should go in macros
    mono_mot_code = beamline_support.get_motor_code(
        beamline_support.motor_code_from_descriptor("monochromator"))
    beamline_support.newfile("spectrum")
    current_filename = nowfile()
    daq_lib.open_shutter()
    beamline_support.dscan(mono_mot_code)
    daq_lib.close_shutter()
    command_string = "ln -sf %s spectrum.dat" % current_filename
    os.system(command_string)
    beamline_support.newfile("scandata")
Example #5
0
def set_mono_energy_scan_step(stepsize):
  mono_mot_code = beamline_support.get_motor_code(beamline_support.motor_code_from_descriptor("monochromator"))  
  try:
    mono_stepsize_steps = float(stepsize)
#    daq_lib.set_field("mono_energy_scan_step",mono_stepsize_steps)
    numpoints = beamline_support.get_scan_points(mono_mot_code)
    scan_width = float(mono_stepsize_steps) * float(numpoints-1)
    half_scan_width = scan_width/2.0
    beamline_support.set_scanstart(mono_mot_code,0.0 - half_scan_width)
    beamline_support.set_scanend(mono_mot_code,half_scan_width)
  except ValueError:
    pass
Example #6
0
def set_mono_energy_scan_step(stepsize):
    mono_mot_code = beamline_support.get_motor_code(
        beamline_support.motor_code_from_descriptor("monochromator"))
    try:
        mono_stepsize_steps = float(stepsize)
        numpoints = beamline_support.get_scan_points(mono_mot_code)
        scan_width = float(mono_stepsize_steps) * float(numpoints - 1)
        half_scan_width = scan_width / 2.0
        beamline_support.set_scanstart(mono_mot_code, 0.0 - half_scan_width)
        beamline_support.set_scanend(mono_mot_code, half_scan_width)
    except ValueError:
        pass
Example #7
0
def move_mono(energy):  # for now, not sure if this should go in macros
  mono_mot_code = beamline_support.get_motor_code(beamline_support.motor_code_from_descriptor("monochromator"))
  if (daq_utils.beamline == "x25a"):
###    return
    max_needed = 0    
    if (get_epics_pv("crue","VAL") != 1):
      daq_lib.destroy_gui_message()    
      daq_lib.gui_message("Gap not enabled. Will continue.&")
    if (abs(float(get_mono_energy())-float(energy)) > 100):      
#    if (abs(float(daq_lib.get_field("mono_energy_current"))-float(energy)) > 100):
      max_needed=1      
    if (max_needed):
      max_needed = 0
      daq_lib.gui_message("The wavelength change requires a beamlign realign. Please push the Realign button.&")      
#      daq_macros.realign()
  if (abs(float(get_mono_energy())-float(energy)) > .1):
    mva(mono_mot_code,float(energy))
Example #8
0
def get_mono_energy():
  if (daq_utils.has_beamline == 0):
    return 12398.5
  else:
    mono_mot_code = beamline_support.get_motor_code(beamline_support.motor_code_from_descriptor("monochromator"))
    return beamline_support.get_motor_pos(mono_mot_code)
Example #9
0
def move_mono(energy):  # for now, not sure if this should go in macros
  mono_mot_code = beamline_support.get_motor_code(beamline_support.motor_code_from_descriptor("monochromator"))
  if (abs(float(get_mono_energy())-float(energy)) > .1):
    mva(mono_mot_code,float(energy))
Example #10
0
def move_mono(energy):  # for now, not sure if this should go in macros
    mono_mot_code = beamline_support.get_motor_code(
        beamline_support.motor_code_from_descriptor("monochromator"))
    if (abs(float(get_mono_energy()) - float(energy)) > .1):
        mva(mono_mot_code, float(energy))