JPK Modules
For decoding and loading .jpk AFM file format into Python Numpy arrays.
load_jpk(file_path, channel, config_path=None, flip_image=True)
Load image from JPK Instruments .jpk files.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path
|
Path | str
|
Path to the .jpk file. |
required |
channel
|
str
|
The channel to extract from the .jpk file. |
required |
config_path
|
Path | str | None
|
Path to a configuration file. If ''None'' (default) then the packages default configuration is loaded from ''default_config.yaml''. |
None
|
flip_image
|
bool
|
Whether to flip the image vertically. Default is |
True
|
Returns:
Type | Description |
---|---|
tuple[NDArray, float]
|
A tuple containing the image and its pixel to nanometre scaling value. |
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If the file is not found. |
KeyError
|
If the channel is not found in the file. |
Examples:
Load height trace channel from the .jpk file. 'height_trace' is the default channel name.
>>> from AFMReader.jpk import load_jpk
>>> image, pixel_to_nanometre_scaling_factor = load_jpk(file_path="./my_jpk_file.jpk",
>>> channel="height_trace",
>>> flip_image=True)
Source code in AFMReader/jpk.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
|