Ejemplo n.º 1
0
    def __init__(self,
                 name_pattern,
                 directory,
                 scan_range=360,
                 scan_exposure_time=3.6,
                 scan_start_angle=0,
                 zoom=None,
                 frontlight=False):

        experiment.__init__(self,
                            name_pattern=name_pattern,
                            directory=directory)

        self.scan_range = scan_range
        self.scan_exposure_time = scan_exposure_time
        self.scan_start_angle = scan_start_angle
        self.zoom = zoom
        self.frontlight = frontlight

        self.camera = camera()
        self.goniometer = goniometer()
        self.fastshutter = fast_shutter()

        self.md2_task_info = None

        self.images = []

        self.parameter_fields = self.parameter_fields.union(
            film.specific_parameter_fields)
Ejemplo n.º 2
0
 def __init__(
     self,
     scan_range,
     scan_exposure_time,
     scan_start_angle,
     angle_per_frame,
     name_pattern,
     directory,
     image_nr_start,
     position=None,
     photon_energy=None,
     flux=None,
     transmission=None,
 ):
     self.goniometer = goniometer()
     self.detector = detector()
     self.beam_center = beam_center()
     self.energy_motor = energy_motor()
     self.resolution_motor = resolution_motor()
     self.protective_cover = protective_cover()
     self.transmission_motor = transmission_motor()
     self.scan_range = scan_range
     self.scan_exposure_time = scan_exposure_time
     self.scan_start_angle = scan_start_angle
     self.angle_per_frame = angle_per_frame
     self.image_nr_start = image_nr_start
     self.position = position
     self.photon_energy = photon_energy
     self.flux = flux
     self.transmission = transmission
     self.name_pattern = name_pattern
     self.directory = directory
     self._ntrigger = 1
     super(self, experiment).__init__()
Ejemplo n.º 3
0
    def __init__(self,
                 scan_range,
                 scan_exposure_time,
                 scan_start_angles, #this is an iterable
                 angle_per_frame,
                 name_pattern,
                 directory='/nfs/ruchebis/spool/2016_Run3/orphaned_collects',
                 image_nr_start=1):
                     
        self.goniometer = goniometer()
        self.detector = detector()
        self.beam_center = beam_center()
        
        scan_range = float(scan_range)
        scan_exposure_time = float(scan_exposure_time)
        
        nimages = float(scan_range)/angle_per_frame

        frame_time = scan_exposure_time/nimages
        
        self.scan_range = scan_range
        self.scan_exposure_time = scan_exposure_time
        self.scan_start_angles = scan_start_angles
        self.angle_per_frame = angle_per_frame
        
        self.nimages = int(nimages)
        self.frame_time = float(frame_time)
        self.count_time = self.frame_time - self.detector.get_detector_readout_time()
        
        self.name_pattern = name_pattern
        self.directory = directory
        self.image_nr_start = image_nr_start
        self.status = None
    def __init__(self,
                 device_name='i11-ma-cx1/dt/dtc-mca_xmap.1',
                 channel='channel00',
                 sleeptime=0.01):

        self.device = PyTango.DeviceProxy(device_name)
        self.channel = channel
        self.goniometer = goniometer()
        self.sleeptime = sleeptime
        self._calibration = -16.1723871876, 9.93475667754, 0.0
        self.observe = None
Ejemplo n.º 5
0
 def __init__(self,
              vertical_range,
              horizontal_range,
              number_of_rows,
              number_of_columns,
              scan_exposure_time,
              scan_start_angle=None,
              scan_range=0.01,
              image_nr_start=1,
              scan_axis='horizontal', # 'horizontal' or 'vertical'
              direction_inversion=True,
              method='md2', # possible methods: "md2", "helical"
              zoom=None, # by default use the current zoom
              name_pattern='grid_$id',
              directory='/nfs/ruchebis/spool/2016_Run3/orphaned_collects'): 
     
     self.goniometer = goniometer()
     self.detector = detector()
     self.camera = camera()
     self.guillotine = protective_cover()
     self.beam_center = beam_center()
     
     self.scan_axis = scan_axis
     self.method = method
     self.vertical_range = vertical_range
     self.horizontal_range = horizontal_range
     self.shape = numpy.array((number_of_rows, number_of_columns))
     self.number_of_rows = number_of_rows
     self.number_of_columns = number_of_columns
     
     self.frame_time = scan_exposure_time
     self.count_time = self.frame_time - self.detector.get_detector_readout_time()
     
     self.scan_start_angle = scan_start_angle
     self.scan_range = scan_range
     
     if self.scan_axis == 'horizontal':
         self.line_scan_time = self.frame_time * self.number_of_columns
         self.angle_per_frame = self.scan_range / self.number_of_columns
     else:
         self.line_scan_time = self.frame_time * self.number_of_rows
         self.angle_per_frame = self.scan_range / self.number_of_rows
     
     self.image_nr_start = image_nr_start
     
     self.direction_inversion = direction_inversion
     
     self.name_pattern = name_pattern
     self.directory = directory
     
     self.method = method
     self.zoom = zoom
     super(self, experiment).__init__()
Ejemplo n.º 6
0
    def __init__(self, *args):
        """
        Description:
        """
        GenericDiffractometer.__init__(self, *args)

        # Hardware objects ----------------------------------------------------
        self.zoom_motor_hwobj = None
        self.omega_reference_motor = None
        self.centring_hwobj = None
        self.minikappa_correction_hwobj = None
        self.nclicks = None
        self.step = None
        self.centring_method = None
        self.collecting = False

        # Channels and commands -----------------------------------------------
        self.chan_calib_x = None
        self.chan_calib_y = None
        self.chan_current_phase = None
        self.chan_head_type = None
        self.chan_fast_shutter_is_open = None
        self.chan_state = None
        self.chan_status = None
        self.chan_sync_move_motors = None
        self.chan_scintillator_position = None
        self.chan_capillary_position = None
        self.cmd_start_set_phase = None
        self.cmd_start_auto_focus = None
        self.cmd_get_omega_scan_limits = None
        self.cmd_save_centring_positions = None
        self.centring_time = None
        # Internal values -----------------------------------------------------
        self.use_sc = False
        self.omega_reference_pos = [0, 0]
        self.reference_pos = [680, 512]

        self.goniometer = goniometer()
        self.camera = camera()
        self.detector = detector()

        self.md2_to_mxcube = dict(
            [(key, value) for key, value in self.motor_name_mapping]
        )
        self.mxcube_to_md2 = dict(
            [(value, key) for key, value in self.motor_name_mapping]
        )

        self.log = logging.getLogger("HWR")
    def __init__(self,
                 directory,
                 name_pattern='pe_%.3feV_ts_%.3fmm_tx_%.3fmm_tz_%.3fmm_$id',
                 photon_energies=None,
                 tss=None,
                 txs=None,
                 tzs=None,
                 scan_range=0.1,
                 scan_exposure_time=0.025,
                 angle_per_frame=0.1,
                 direct_beam=True,
                 analysis=None,
                 handle_detector_beamstop=False):

        experiment.__init__(self,
                            name_pattern=name_pattern,
                            directory=directory,
                            analysis=analysis)

        self.directory = directory
        self.name_pattern = name_pattern
        self.photon_energies = photon_energies
        self.tss = tss
        self.txs = txs
        self.tzs = tzs
        self.scan_range = scan_range
        self.scan_exposure_time = scan_exposure_time
        self.angle_per_frame = angle_per_frame
        self.direct_beam = direct_beam
        self.nimages = int(self.scan_range / self.angle_per_frame)

        #actuators
        self.detector = detector()
        self.goniometer = goniometer()
        self.energy_motor = energy_motor()
        self.transmission_motor = transmission_motor()

        self.capillary_park_position = 80
        self.aperture_park_position = 80
        self.detector_beamstop_park_position = 18.5
        self.handle_detector_beamstop = handle_detector_beamstop

        self.parameter_fields = self.parameter_fields.union(
            beamcenter_calibration.specific_parameter_fields)

        print 'self.parameter_fields', self.parameter_fields
Ejemplo n.º 8
0
 def __init__(self,
              scan_range,
              scan_exposure_time,
              scan_start_angle,
              angle_per_frame,
              name_pattern,
              directory='/nfs/ruchebis/spool/2016_Run3/orphaned_collects',
              image_nr_start=1,
              helical=False):
     
     self.goniometer = goniometer()
     self.detector = detector()
     self.beam_center = beam_center()
     self.protective_cover = protective_cover()
     
     self.detector.set_trigger_mode('exts')
     self.detector.set_nimages_per_file(100)
     self.detector.set_ntrigger(1)
     scan_range = float(scan_range)
     scan_exposure_time = float(scan_exposure_time)
     
     nimages, rest = divmod(scan_range, angle_per_frame)
     
     if rest > 0:
         nimages += 1
         scan_range += rest*angle_per_frame
         scan_exposure_time += rest*angle_per_frame/scan_range
         
     frame_time = scan_exposure_time/nimages
     
     self.scan_range = scan_range
     self.scan_exposure_time = scan_exposure_time
     self.scan_start_angle = scan_start_angle
     self.angle_per_frame = angle_per_frame
     
     self.nimages = int(nimages)
     self.frame_time = float(frame_time)
     self.count_time = self.frame_time - self.detector.get_detector_readout_time()
     
     self.name_pattern = name_pattern
     self.directory = directory
     self.image_nr_start = image_nr_start
     self.helical = helical
     self.status = None
Ejemplo n.º 9
0
 def __init__(self,
              scan_range,
              scan_exposure_time,
              scan_start_angle,
              angle_per_frame,
              name_pattern,
              directory='/nfs/ruchebis/spool/2016_Run3/orphaned_collects',
              image_nr_start=1,
              helical=False):
     
     self.goniometer = goniometer()
     self.detector = detector()
     self.beam_center = beam_center()
     
     self.detector.set_trigger_mode('exts')
     self.detector.set_nimages_per_file(100)
     self.detector.set_ntrigger(1)
     scan_range = float(scan_range)
     scan_exposure_time = float(scan_exposure_time)
     
     nimages, rest = divmod(scan_range, angle_per_frame)
     
     if rest > 0:
         nimages += 1
         scan_range += rest*angle_per_frame
         scan_exposure_time += rest*angle_per_frame/scan_range
         
     frame_time = scan_exposure_time/nimages
     
     self.scan_range = scan_range
     self.scan_exposure_time = scan_exposure_time
     self.scan_start_angle = scan_start_angle
     self.angle_per_frame = angle_per_frame
     
     self.nimages = int(nimages)
     self.frame_time = float(frame_time)
     self.count_time = self.frame_time - self.detector.get_detector_readout_time()
     
     self.name_pattern = name_pattern
     self.directory = directory
     self.image_nr_start = image_nr_start
     self.helical = helical
     self.status = None
Ejemplo n.º 10
0
    def __init__(self,
                 name_pattern,
                 directory,
                 step=36,
                 orientations=[],
                 analysis=True,
                 conclusion=True):

        experiment.__init__(self,
                            name_pattern,
                            directory,
                            analysis=analysis,
                            conclusion=conclusion)
        
        self.goniometer = goniometer()
        self.camera = camera()
        
        self.step = step
        self.orientations = orientations
        self.observations = []
        self.observe = False
    def __init__(self,
                 name_pattern,
                 directory,
                 position=None,
                 photon_energy=None,
                 resolution=None,
                 detector_distance=None,
                 detector_vertical=None,
                 detector_horizontal=None,
                 transmission=None,
                 flux=None,
                 ntrigger=1,
                 snapshot=False,
                 zoom=None,
                 diagnostic=None,
                 analysis=None,
                 conclusion=None,
                 simulation=None,
                 monitor_sleep_time=0.05):

        experiment.__init__(self,
                            name_pattern=name_pattern,
                            directory=directory,
                            diagnostic=diagnostic,
                            analysis=analysis,
                            conclusion=conclusion,
                            simulation=simulation)

        self.position = position
        self.photon_energy = photon_energy
        self.resolution = resolution
        self.detector_distance = detector_distance
        self.detector_vertical = detector_vertical
        self.detector_horizontal = detector_horizontal
        self.transmission = transmission
        self.flux = flux
        self.ntrigger = ntrigger
        self.snapshot = snapshot
        self.zoom = zoom
        self.monitor_sleep_time = monitor_sleep_time

        # Necessary equipment
        self.goniometer = goniometer()
        try:
            self.beam_center = beam_center()
        except:
            from beam_center import beam_center_mockup
            self.beam_center = beam_center_mockup()
        try:
            self.detector = detector()
        except:
            from detector_mockup import detector_mockup
            self.detector = detector_mockup()
        try:
            self.energy_motor = energy_motor()
        except:
            from energy import energy_mockup
            self.energy_motor = energy_mockup()
        try:
            self.resolution_motor = resolution_motor()
        except:
            from resolution import resolution_mockup
            self.resolution_motor = resolution_mockup()
        try:
            self.transmission_motor = transmission_motor()
        except:
            from transmission import transmission_mockup
            self.transmission_motor = transmission_mockup()
        try:
            self.machine_status = machine_status()
        except:
            from machine_status import machine_status_mockup
            self.machine_status = machine_status_mockup()

        try:
            self.undulator = undulator()
        except:
            from motor import undulator_mockup
            self.undulator = undulator_mockup()

        try:
            self.monochromator_rx_motor = monochromator_rx_motor()
        except:
            from motor import monochromator_rx_motor_mockup
            self.monochromator_rx_motor_mockup = monochromator_rx_motor_mockup(
            )

        self.safety_shutter = safety_shutter()

        try:
            self.fast_shutter = fast_shutter()
        except:
            self.fast_shutter = fast_shutter_mockup()

        try:
            self.camera = camera()
        except:
            self.camera = None

        if self.photon_energy == None and self.simulation != True:
            self.photon_energy = self.get_current_photon_energy()

        self.wavelength = self.resolution_motor.get_wavelength_from_energy(
            self.photon_energy)

        try:
            self.slits1 = slits1()
        except:
            self.slits1 = slits_mockup(1)

        try:
            self.slits2 = slits2()
        except:
            self.slits2 = slits_mockup(2)

        try:
            self.slits3 = slits3()
        except:
            self.slits3 = slits_mockup(3)

        try:
            self.slits5 = slits5()
        except:
            self.slits5 = slits_mockup(5)

        try:
            self.slits6 = slits6()
        except:
            self.slits6 = slits_mockup(6)

        try:
            self.xbpm1 = xbpm('i11-ma-c04/dt/xbpm_diode.1-base')
        except:
            self.xbpm1 = xbpm_mockup('i11-ma-c04/dt/xbpm_diode.1-base')
        try:
            self.cvd1 = xbpm('i11-ma-c05/dt/xbpm-cvd.1-base')
        except:
            self.cvd1 = xbpm_mockup('i11-ma-c05/dt/xbpm-cvd.1-base')
        try:
            self.xbpm5 = xbpm('i11-ma-c06/dt/xbpm_diode.5-base')
        except:
            self.xbpm5 = xbpm_mockup('i11-ma-c06/dt/xbpm_diode.5-base')
        try:
            self.psd5 = xbpm('i11-ma-c06/dt/xbpm_diode.psd.5-base')
        except:
            self.psd5 = xbpm_mockup('i11-ma-c06/dt/xbpm_diode.psd.5-base')
        try:
            self.psd6 = xbpm('i11-ma-c06/dt/xbpm_diode.6-base')
        except:
            self.psd6 = xbpm_mockup('i11-ma-c06/dt/xbpm_diode.6-base')

        self.eiger_en_out = eiger_en_out()
        self.trigger_eiger_on = trigger_eiger_on()
        self.trigger_eiger_off = trigger_eiger_off()
        self.fast_shutter_open = fast_shutter_open()
        self.fast_shutter_close = fast_shutter_close()

        self.monitor_names = [
            'xbpm1',
            'cvd1',
            #'xbpm5',
            'psd5',
            'psd6',
            'machine_status',
            'fast_shutter',
            'eiger_en_out',
            'trigger_eiger_on',
            'trigger_eiger_off',
            'fast_shutter_open',
            'fast_shutter_close'
        ]

        self.monitors = [
            self.xbpm1,
            self.cvd1,
            #self.xbpm5,
            self.psd5,
            self.psd6,
            self.machine_status,
            self.fast_shutter,
            self.eiger_en_out,
            self.trigger_eiger_on,
            self.trigger_eiger_off,
            self.fast_shutter_open,
            self.fast_shutter_close
        ]

        self.monitors_dictionary = {
            'xbpm1': self.xbpm1,
            'cvd1': self.cvd1,
            #'xbpm5': self.xbpm5,
            'psd5': self.psd5,
            'psd6': self.psd6,
            'machine_status': self.machine_status,
            'fast_shutter': self.fast_shutter,
            'eiger_en_out': self.eiger_en_out,
            'trigger_eiger_on': self.trigger_eiger_on,
            'trigger_eiger_off': self.trigger_eiger_off,
            'fast_shutter_open': self.fast_shutter_open,
            'fast_shutter_close': self.fast_shutter_close
        }

        self.parameter_fields = self.parameter_fields.union(
            xray_experiment.specific_parameter_fields)
Ejemplo n.º 12
0
	def __init__(self):
		super(film, self).__init__()
		camera = camera()
		goniometer = goniometer()
Ejemplo n.º 13
0
#!/usr/bin/env python
from detector import detector
from goniometer import goniometer
from sweep import sweep
from reference_images import reference_images
from beam_center import beam_center
from raster import raster
from protective_cover import protective_cover
from camera import camera
from resolution import resolution

if __name__ == '__main__':
    import optparse
    parser = optparse.OptionParser() 
    # testbed ip 62.12.151.50
    parser.add_option('-i', '--ip', default="172.19.10.26", type=str, help='IP address of the server')
    parser.add_option('-p', '--port', default=80, type=int, help='port on which to which it listens to')
    
    options, args = parser.parse_args()
     
    d = detector(host=options.ip, port=options.port)
    g = goniometer()