playNano.io.formats package

Submodules

playNano.io.formats.read_asd module

Module to decode and load .asd high speed AFM data files into Python NumPy arrays.

Files containing multiple image frames are read together. Converts the height data into nm from another metric unit (e.g. m).

playNano.io.formats.read_asd.load_asd_file(file_path: Path | str, channel: str) AFMImageStack[source]

Load image stack from an .asd file scaled to nanometers.

Parameters:
  • file_path (Path | str) – Path to the .asd file.

  • channel (str) – Channel to extract.

Returns:

Loaded AFM image stack with metadata and per-frame info.

Return type:

AFMImageStack

playNano.io.formats.read_h5jpk module

Module to decode and load .h5-jpk high speed AFM data files into Python NumPy arrays.

Files containing multiple image frames are read together. Converts the height data into nm from another metric unit (e.g. m).

playNano.io.formats.read_h5jpk.apply_z_unit_conversion(images: ndarray, channel_group: Group, channel: str = 'height_trace') ndarray[source]

Apply z unit conversion to nanometers if needed, or guess if unknown.

playNano.io.formats.read_h5jpk.load_h5jpk(file_path: Path | str, channel: str, flip_image: bool = True) AFMImageStack[source]

Load image stack from a JPK .h5-jpk file, scaled to nanometers.

The images are loaded, reshaped into frames, and have timestamps generated.

Parameters:
  • file_path (Path | str) – Path to the .h5-jpk file.

  • channel (str) – Channel to extract.

  • flip_image (bool, optional) – Flip each image vertically if True.

Returns:

Loaded AFM image stack with metadata and per-frame info.

Return type:

AFMImageStack

playNano.io.formats.read_jpk_folder module

Module to load .jpk AFM data files from a folder into Python NumPy arrays.

Files contained within the same folder are read together. Files read with the height data in nm.

playNano.io.formats.read_jpk_folder.load_jpk_folder(folder_path: Path | str, channel: str, flip_image: bool = True) AFMImageStack[source]

Load an AFM video from a folder of individual .jpk image files.

AFMReader converts “height”, “measuredHeight” and “amplitude” channels to nm.

Parameters:
  • folder_path (Path | str) – Path to folder containing .jpk files.

  • channel (str) – Channel to extract.

  • flip_image (bool, optional) – Flip each image vertically if True.

Returns:

Loaded AFM image stack with metadata and per-frame info.

Return type:

AFMImageStack

playNano.io.formats.read_spm_folder module

Placeholder for a functional script to load a folder containing .spm frames.

playNano.io.formats.read_spm_folder.load_spm_folder(folder_path: Path | str, channel: str) AFMImageStack[source]

Load an AFM video from a folder of individual .spm image files.

Parameters:
  • folder_path (Path | str) – Path to folder containing .spm files.

  • channel (str) – Channel to extract.

Returns:

Loaded AFM image stack with metadata and per-frame info.

Return type:

AFMImageStack

playNano.io.formats.read_spm_folder.parse_spm_header(file_path, max_bytes=65536)[source]

Extract ASCII header key-value pairs from a .spm file.

Parameters:
  • file_path (str or Path) – Path to the .spm file.

  • max_bytes (int, default=65536) – Number of bytes to read from the start of the file.

Returns:

Mapping of header keys to values as strings.

Return type:

dict

Module contents

Public package initialization.