Skip to content

XIA

Overview

Xia controllers can run in single point or continuous (aka mapping) acquisitions.

Supported controllers:

  • Mercury
  • FalconX

Todo

  • LIVE, EVENTS, TRIGGERS preset modes
  • USER and SYNC advance modes

Mosca to XIA

The conversion from mosca parameters to xia parameter is done in the function mosca.devices.xia.xia.Xia.apply_mosca.

Source code in mosca/devices/xia/xia.py
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
def apply_mosca(self,
            acq_nb_points=None,
            acq_realtime=None,
            acq_nb_triggers=None,
            spectrum_size=None,
            run_mode=None,
            gate_mode=None,
            start_trigger=None,
            stop_trigger=None,
            block_size=None,
            resume=False,
            **kwargs):
    # TODO, check that params are correctly set?
    if self.is_running():
        raise RuntimeError('Cannot apply_mosca, an acquisition is already running. Stop it first.')
    # if self._poller is not None:
    #     
    # if resume and self._poller is not None:
    #     return

    self._poller = None

    mapping_mode = 0.
    input_logic_polarity = 0.
    gate_ignore = 1. if gate_mode == GateModes.IGNORE else 0.
    preset_type = RunMode2Preset[run_mode.name].value

    if acq_nb_points != 1:
        if run_mode != RunModes.FREERUN:
            raise ValueError(f"XIA doesn't support {run_mode.name} run mode with acq_nb_points != 1.")
        if stop_trigger not in (ControlTriggers.RISING, ControlTriggers.FALLING):
            raise ValueError(f"XIA doesn't support acq_nb_points != 1. with stop trigger set to {stop_trigger.name}.")
        input_logic_polarity = 0. if stop_trigger == ControlTriggers.FALLING else 1.
        mapping_mode = 1.
    else:
        if stop_trigger != ControlTriggers.NONE:
            mapping_mode = 1.

    self.mapping_mode = mapping_mode
    self.gate_ignore = gate_ignore
    self.preset_type = preset_type
    self.number_mca_channels = spectrum_size
    self.pixels_per_buffer = block_size
    self.input_logic_polarity = input_logic_polarity

    # only supported advance mode at the moment is GATE
    xia_advance_mode = XiaAdvanceModes.GATE
    self.pixel_advance_mode = xia_advance_mode.value

    if mapping_mode:
        self.num_map_pixels = acq_nb_points

    if preset_type == XiaPresets.XIA_PRESET_FIXED_REAL.value:
        self.preset_value = acq_realtime

enum values

The given values for preset_value and gate_polarity settings are based on the enumeration defined in the XIA headers at the time of writing the documentation (and code...).

Single point acquisition

To configure the hardware to run a single point acquisition, acq_nb_points must be set to 1.

  • realtime: the acquisition starts when the hardware is started, and runs for the given number of seconds (acq_realtime, measured by the hardware).
  • freerun: the acquisition start as when the hardware is started, and runs until a stop is requested.

In both cases the acquisition can be inhibited with the gate (gate_mode).

Realtime run

Starts acquiring as soon as the hardware is started.

Mosca Value
acq_nb_points 1
run_mode REALTIME
acq_realtime time in s
gate_mode
  • HIGH
  • LOW
  • IGNORE

This translates into the following XIA settings:

XIA Value
mapping_mode 0.0
preset_type 1.0 (XIA_PRESET_FIXED_REAL)
preset_value acq_realtime
gate_ignore
  • 0.0 if gate_mode is HIGH or LOW
  • 1.0 if gate_mode is IGNORE
input_logic_polarity
  • 0.0 if gate_mode is HIGH (XIA_GATE_COLLECT_HI)
  • 1.0 if gate_mode is LOW (XIA_GATE_COLLECT_LO)

Free run

The acquisition time is controller by the user (start/stop).

Mosca Value
acq_nb_points 1
run_mode FREERUN
gate_mode
  • HIGH
  • LOW
  • IGNOGRE

This translates into the following XIA settings:

XIA Value
mapping_mode 0.0
preset_type 0.0 (XIA_PRESET_NONE)
gate_ignore
  • 0.0 if gate_mode is HIGH or LOW
  • 1.0 if gate_mode is IGNORE
input_logic_polarity
  • 0.0 if gate_mode is HIGH (XIA_GATE_COLLECT_HI)
  • 1.0 if gate_mode is LOW (XIA_GATE_COLLECT_LO)

Continuous (mapping) acquisition

To configure the hardware to run in mapping mode, acq_nb_points must be higher than 1.

Individual points (aka pixel) are completed ("advanced") either when a rising or falling edge is detector.

WIP: advance modes

XIA also support USER and SYNC advance modes, they are not supported yet.

Mosca Value
acq_nb_points >1
gate_mode
  • HIGH
  • LOW
  • IGNORE
stop_trigger
  • RISING
  • FALLING
block_size >=1

This translates into the following XIA settings:

XIA Value
mapping_mode 1.0
num_map_pixels acq_nb_points
gate_ignore
  • 0.0 if gate_mode is HIGH or LOW
  • 1.0 if gate_mode is IGNORE
input_logic_polarity
  • 0.0 if gate_mode is HIGH (XIA_GATE_COLLECT_HI)
  • 1.0 if gate_mode is LOW (XIA_GATE_COLLECT_LO)
pixels_per_buffer block_size

Controller specific settings

FalconX

At the time of writing the documentation, the maximum value for nump_map_pixels is 1020. The FalconX has mca_refresh setting that can be set directly through the controller instance.

Mercury

n/a

Tango

The DS has three optional properties:

  • default_ini_dir: default folder (ini_dir) into which look for ini files. If not provided, the default_ini_file directory will be used (if provided). If default_ini_file is not provided either, the current working directory is used.
  • default_ini_file: default ini file (ini_file) to load at DS startup, if provided.
  • lib_dir: folder containing the handel.dll library. If not provided, the one found (if any) in the system path will be used. If none is found, the DS will fail to start.

The DS has an attribute named ini_dir. It is used when available_configs is called.

When setting ini_file with a relative path, the DS will try to find it relative to ini_dir.

When setting ini_file with an absolute path, ini_dir will not be used.