erlab.io.plugins.lorea

Data loader for beamline 20 LOREA at ALBA.

Classes

class erlab.io.plugins.lorea.LOREALoader[source]

Bases: LoaderBase

name: str = 'lorea'

Name of the loader. Using a unique and descriptive name is recommended. For easy access, it is recommended to use a name that passes str.isidentifier().

Notes

  • Changing the name of a loader is not recommended as it may break existing code. Pick a simple, descriptive name that is unlikely to change.

  • Loaders with the name prefixed with an underscore are not registered.

description: str = 'ALBA Beamline 20 LOREA'

A short description of the loader shown to users.

Added in version 3.3.0.

extensions: ClassVar[set[str]] = {'.krx', '.nxs'}

File extensions supported by the loader in lowercase with the leading dot.

An UnsupportedFileError is raised if a file with an unsupported extension is passed to the loader. If None, the loader will attempt to load any file passed to it.

If the loader supports directories, the extension should be an empty string.

Added in version 3.5.1.

aliases: Iterable[str] | None = ('alba_bl20',)

Alternative names for the loader.

Deprecated since version 3.3.0: Accessing loaders with aliases is deprecated and will be removed in a future version. Use the loader name instead.

name_map: ClassVar[dict] = {'alpha': ['instrument.analyser.angles', 'angles'], 'beta': ['instrument.analyser.defl_angles', 'defl_angles'], 'chi': 'instrument.manipulator.sapolar', 'delta': 'instrument.manipulator.saazimuth', 'eV': ['instrument.analyser.energies', 'energies'], 'hv': 'instrument.monochromator.energy', 'sample_temp': 'sample.temperature', 'x': 'instrument.manipulator.sax', 'xi': 'instrument.manipulator.satilt', 'y': 'instrument.manipulator.say', 'z': 'instrument.manipulator.saz'}

Dictionary that maps new coordinate or attribute names to original coordinate or attribute names. If there are multiple possible names for a single attribute, the value can be passed as an iterable.

Note

  • Non-dimension coordinates in the resulting data will try to follow the order of the keys in this mapping.

  • Original coordinate names included in this mapping will be replaced by the new names. However, original attribute names will be duplicated with the new names so that both the original and new names are present in the data after loading. This is to keep track of the original names for reference.

coordinate_attrs: tuple[str, ...] = ('beta', 'delta', 'chi', 'xi', 'hv', 'x', 'y', 'z')

Attribute names (after renaming) that should be treated as coordinates.

Put any attributes that should be propagated when concatenating data here.

Notes

  • If a listed attribute is not found, it is silently skipped.

  • The attributes given here, both before and after renaming, are removed from the attributes to avoid conflicting values.

  • If an existing coordinate with the same name is already present, the existing coordinate takes precedence and the attribute is silently dropped.

See also

process_keys

additional_attrs: ClassVar[dict] = {'configuration': 3}

Additional attributes to be added to the data after loading.

If a callable is provided, it will be called with the data as the only argument.

Notes

  • The attributes are added after renaming with process_keys, so keys will appear in the data as provided.

  • If an attribute with the same name is already present in the data, it is skipped unless the key is listed in overridden_attrs.

skip_validate: bool = True

If True, validation checks will be skipped. If False, data will be checked with validate.

always_single: bool = True

Setting this to True disables implicit loading of multiple files for a single scan. This is useful for setups where each scan is always stored in a single file.

property file_dialog_methods
load_single(file_path, **kwargs)[source]
identify(num, data_dir, **kwargs)[source]