Core module¶
The core modules contains the core classes used to manipulate Maps.
Experiment¶
This module contains the utilities to describe an experiment.
The main class is edxia.core.experiment.MappingExperiment
.
-
class
edxia.core.experiment.
MappingExperiment
(pattern, label=None, description=None, map_format=None, bse_format=None, map_scale_factor=1, components=None)[source]¶ This class contains the main information describing an experiment, such as the filepaths, the map formats, the list of components… This class is shared between many other classes.
Example:
exp = MappingExperiment(“mymap_{components}.csv”, label=”OPC 28d”)Parameters: - pattern (str) – the pattern of the file paths
- label (str or None) – short, unique label for this set of map
- description (str or None) – optional, longer description
- map_format (edxia.io.raw_io.TextMapFormat) – the file format of the raw EDS maps.
- bse_format (edxia.io.raw_io.TextMapFormat) – the file format of the raw EDS maps.
- components (list[str]) – list of available components for this experiment
-
bse_format
¶ Returns: the format of the raw BSE map Return type: edxia.io.raw_io.TextMapFormat
-
get_path_map
(component)[source]¶ Returns: the filepath to the raw map of ‘component’ Return type: str Raises: RuntimeError – if the component is not valid
-
is_valid
()[source]¶ Check if the experiment describes a valid set of maps.
Returns: True if the experiment is valid, and the exception otherwise Return type: tuple(bool, Exception or None)
-
label
¶ Returns: an identifying label for this experiment Return type: str
-
list_components
¶ Returns: a list of available components Return type: list[str]
-
load_raw_map
(component)[source]¶ Load the map for a component.
This is a low-level function, a loader (
edxia.io.loader
) should be used in normal operationsReturns: a map Return type: a numpy array
-
map_format
¶ Returns: the format of the EDS maps Return type: edxia.io.raw_io.TextMapFormat
-
pattern
¶ Returns: the pattern of filepaths to the maps Return type: str
-
class
edxia.core.experiment.
PartOfExperiment
(parent=None)[source]¶ Base class for a subset of an experiment.
Classes that should have access to the information provided by
edxia.core.experiment.Experiment
should inherit from this class.-
parent
¶ Returns: the experiment from which this effect was created Return type: edxia.core.experiment.Experiment
-
-
class
edxia.core.experiment.
PointsExperiment
(components, label=None, description=None)[source]¶ An experiment describing a EDS point experiment
-
is_valid
()[source]¶ Check if the experiment describes a valid set of maps.
Returns: True if the experiment is valid, and the exception otherwise Return type: tuple(bool, Exception or None)
-
label
¶ Returns: an identifying label for this experiment Return type: str
-
list_components
¶ Returns: a list of available components Return type: list[str]
-
Map¶
-
class
edxia.core.map.
Map
(component, eds_map, parent)[source]¶ A 2D EDS Map
-
component
¶ The map component
-
flat_map
¶ Return the map as a 1D array.
-
map
¶ The map
-
nb_cols
¶ The number of columns
-
nb_rows
¶ The number of rows
-
shape
¶ The shape of the map
-