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:
- filename
str,pathlib.Path Filename of the file to read or corresponding pathlib.Path.
- lazybool, default=False
Whether to open the file lazily or not. The file will stay open until closed in
compute()or closed manually.get_file_handle()can be used to access the file handler and close it manually.- rebin_energy
int, 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 withrebin_energy,cutoff_at_kVanddownsampleto reduce memory usage.- SI_dtype
numpy.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_kV
int,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.- downsample
int, 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
xandyseparetely and it must be a divisor of the size of the navigation dimension.- only_valid_databool, default=True
For
.ptsfiles 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. Ifsum_frames=True, this argument will be ignored to enforce consistent summing over the mapped area.- read_em_imagebool, default=False
For
.ptsfiles only. IfTrue, read SEM/STEM image from.ptsfile if available. In this case, both the spectrum Image and SEM/STEM Image will be returned as list.- frame_list
listofint,None, default=None For
.ptsfiles only. Frames inframe_listwill be loaded. For example,frame_list=[1,3]means second and forth frame will be loaded. IfNone, all frames are loaded.- frame_shifts
listof [int,int],listof [int,int,int],None, default=None For
.ptsfiles 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_index
list,None, default=None The list of offset pointers of each frame in the raw data. The pointer for frame0 is 0.
- filename
- Returns:
listofdictList of dictionaries containing the following fields:
‘data’ – multidimensional
numpy.ndarrayordask.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)>]