JEOL Analyst Station (ASW, …)#

This is the file format used by the JEOL Analysist Station software for which RosettaSciIO can read the .asw, .pts, .map and .eds format. To read the calibration, it is required to load the .asw file, which will load all others files automatically.

Note

To load EDS data, the optional dependency sparse is required.

API functions#

rsciio.jeol.file_reader(filename, lazy=False, rebin_energy=1, sum_frames=True, SI_dtype=<class 'numpy.uint8'>, cutoff_at_kV=None, downsample=1, only_valid_data=True, read_em_image=False, frame_list=None, frame_shifts=None, frame_start_index=None)#

File reader for JEOL Analysist Station software format.

Parameters:
filenamestr, pathlib.Path

Filename of the file to read or corresponding pathlib.Path.

lazybool, default=False

Whether to open the file lazily or not.

rebin_energyint, default=1

Factor used to rebin the energy dimension. It must be a divisor of the number of channels, typically 4096.

sum_framesbool, default=True

If False, each individual frame (sweep in JEOL software jargon) is loaded. Be aware that loading each individual frame will use a lot of memory. However, it can be used in combination with rebin_energy, cutoff_at_kV and downsample to reduce memory usage.

SI_dtypenumpy.dtype, default=np.uint8

Set the dtype of the eds dataset. Useful to adjust memory usage and maximum number of X-rays per channel.

cutoff_at_kVint, float, None, default=None

If set (>= 0), use to crop the energy range up to the specified energy. If None, the whole energy range is loaded. Useful to reduce memory usage.

downsampleint, default=1

The downsample ratio of the navigation dimension of an EDS dataset. It can be an integer or a tuple of length 2 to define x and y separetely and it must be a divisor of the size of the navigation dimension.

only_valid_databool, default=True

For .pts files only. Ignore incomplete and partly acquired last frame, which typically occurs when the acquisition was interrupted. When loading incomplete data (only_valid_data=False), the missing data are filled with zeros. If sum_frames=True, this argument will be ignored to enforce consistent summing over the mapped area.

read_em_imagebool, default=False

For .pts files only. If True, read SEM/STEM image from .pts file if available. In this case, both the spectrum Image and SEM/STEM Image will be returned as list.

frame_listlist of int, None, default=None

For .pts files only. Frames in frame_list will be loaded. For example, frame_list=[1,3] means second and forth frame will be loaded. If None, all frames are loaded.

frame_shiftslist of [int, int], list of [int, int, int], None, default=None

For .pts files only. Each frame will be loaded with offset of [dy, dx (, and optionary dEnergy)]. Units are pixels/channels. The result of estimate_shift2D() can be used as a parameter of frame_shifts. This is useful for express drift correction. Not suitable for accurate analysis.

frame_start_indexlist, None, default=None

The list of offset pointers of each frame in the raw data. The pointer for frame0 is 0.

Returns:
list of dict

List of dictionaries containing the following fields:

  • ‘data’ – multidimensional numpy.ndarray or dask.array.Array

  • ‘axes’ – list of dictionaries describing the axes containing the fields ‘name’, ‘units’, ‘index_in_array’, and either ‘size’, ‘offset’, and ‘scale’ or a numpy array ‘axis’ containing the full axes vector

  • ‘metadata’ – dictionary containing the parsed metadata

  • ‘original_metadata’ – dictionary containing the full metadata tree from the input file

When the file contains several datasets, each dataset will be loaded as separate dictionary.

Reading examples#

HyperSpy example of loading data downsampled and with cropped energy range, where the original navigation dimension is 512 x 512 and the EDS range 40 keV over 4096 channels:

>>> import hyperspy.api as hs
>>> hs.load("sample40kv.asw", downsample=8, cutoff_at_kV=10)
[<Signal2D, title: IMG1, dimensions: (|512, 512)>,
 <Signal2D, title: C K, dimensions: (|512, 512)>,
 <Signal2D, title: O K, dimensions: (|512, 512)>,
 <EDSTEMSpectrum, title: EDX, dimensions: (64, 64|1096)>]

Load the same file without extra arguments:

>>> hs.load("sample40kv.asw")
[<Signal2D, title: IMG1, dimensions: (|512, 512)>,
 <Signal2D, title: C K, dimensions: (|512, 512)>,
 <Signal2D, title: O K, dimensions: (|512, 512)>,
 <EDSTEMSpectrum, title: EDX, dimensions: (512, 512|4096)>]