playnano.io.formats.read_aris module

Load Asylum Research .aris high-speed AFM files as an AFMImageStack.

ARIS files are HDF5 files. Frames can differ in scan size, so each frame’s pixel size is stored in its frame_metadata entry as frame_pixel_size_nm; the stack’s pixel_size_nm is that of the first frame.

Channels with a length unit (heights, and amplitude, which ARIS files store in metres) are converted to nm, like the other readers. Other channels, such as phase in degrees, are returned in the units stored in the file.

playnano.io.formats.read_aris.load_aris(file_path: Path | str, channel: str) → AFMImageStack[source]

Load an Asylum Research .aris file.

Parameters:
  • file_path (str or pathlib.Path) – The .aris file.

  • channel (str) – Channel to load, for example "HeightTrace", "HeightRetrace", "AmplitudeRetrace" or "PhaseRetrace"; the names depend on the file.

Returns:

The stack. Channels with a length unit are in nm; others (such as phase) are in the units stored in the file. If the file gives no unit for the channel, it is guessed from the data range and a warning is logged. Each frame_metadata entry holds timestamp (s from the first frame), frame_pixel_size_nm, line_rate (the global scan rate, in lines per second) and start_epoch_ms (if the file records its start time).

Return type:

AFMImageStack

Raises:

ValueError – If the channel is not in the file, or the number of frame times does not match the number of frames.

playnano.io.formats.read_aris.load_frames_and_scaling(data: Group, info: Group, selected_ch: str) → tuple[ndarray, list[float]][source]

Read every frame of one channel and work out each frame’s pixel size.

Parameters:
  • data (h5py.Group) – The /DataSet/Resolution 0 group, holding one group per frame.

  • info (h5py.Group) – The /DataSetInfo group, holding the scan parameters and any changes made to them during the recording.

  • selected_ch (str) – Channel to read.

Returns:

  • image_stack (numpy.ndarray) – Frames in time order, shape (n_frames, height, width), in the units stored in the file.

  • pixel_sizes_nm (list of float) – Pixel size of each frame, in nm. Frames without their own scan size use the global one.