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