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 operations

Returns: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

rc(r, c)[source]

Return the value of the map in the rc coordinates system.

shape

The shape of the map

xy(x, y)[source]

Return the value of the map in the xy coordinates system.

class edxia.core.map.MapsStack(components, shape, parent)[source]

A stack of maps

components

Returns the list of components.

composition(r, c)[source]

Return the composition at a point

index(component)[source]

Returns the index of the component.

map(component)[source]

Return the map for a component.

maps

Returns the numpy array containing the maps

normalize(copy=True)[source]

Normalize the EDS maps, so their sum at each point is 1.

shape

Return the shape of the maps array.

sum_of_oxides_from_mass()[source]

Compute the sum of oxides from a mass map.

to_atomic(copy=True)[source]

Transform the maps to atomic