afmformats.formats
Submodules
afmformats.formats.fmt_hdf5afmformats.formats.fmt_igorafmformats.formats.fmt_jpkafmformats.formats.fmt_ntmdt_txtafmformats.formats.fmt_tabafmformats.formats.fmt_workshop
Functions
find_data(): Recursively find valid AFM data filesget_recipe(): Return the file format recipe for a given pathload_data(): Load AFM data
- afmformats.formats.find_data(path, modality=None)[source]
Recursively find valid AFM data files
- Parameters:
path (str or pathlib.Path) – file or directory
modality (str) – modality of the measurement (“force-distance”)
- Returns:
file_list – list of valid AFM data files
- Return type:
list of pathlib.Path
- afmformats.formats.get_recipe(path, modality=None)[source]
Return the file format recipe for a given path
- Parameters:
path (str or pathlib.Path) – file or directory
modality (str) – modality of the measurement (see
IMAGING_MODALITIES)
- Returns:
recipe – file format recipe
- Return type:
- afmformats.formats.load_data(path, meta_override=None, modality=None, data_classes_by_modality=None, diskcache=False, callback=None)[source]
Load AFM data
- Parameters:
path (str or pathlib.Path) – Path to AFM data file
meta_override (dict) – Metadata dictionary that overrides experimental metadata
modality (str) – Which acquisition modality to use (e.g. “force-distance”)
data_classes_by_modality (dict) – Override the default AFMData class to use for managing the data (see
default_data_classes_by_modality): This is e.g. used by index to pass Indentation (which is a subclass of the default AFMForceDistance) for handling “force-indentation” data.diskcache (bool) – Whether to use caching (not implemented)
callback (callable) – A method that accepts a float between 0 and 1 to externally track the process of loading the data
- Returns:
afm_list – List where each element is on AFMData curve
- Return type:
Classes
AFMFormatRecipe: Undocumented.
- class afmformats.formats.AFMFormatRecipe(recipe)[source]
A wrapper class for file format recipes
- Parameters:
recipe (dict) – file format recipe
Inheritance
digraph inheritance844fbc32e2 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "AFMFormatRecipe" [URL="#afmformats.formats.AFMFormatRecipe",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; }- detect(path)[source]
Determine whether path can be opened with this recipe
- Returns:
valid – True if path is openable, False otherwise.
- Return type:
Notes
If the underlying recipe does not implement a “detect” function, then only the file extension is checked.
- get_modality(path)[source]
Determine modality of a path
If a recipe provides several modalities, load the dataset and get the modality from the metadata.
- property descr
description of file format
- property loader
method for loading the data
- property maker
who introduced the file format
- property modalities
list of supported AFM imaging modalities
- property suffix
file format suffix
Variables
- afmformats.formats.default_data_classes_by_modality
dictionary with default data classes for each modality
{'creep-compliance': <class 'afmformats.mod_creep_compliance.AFMCreepCompliance'>, 'force-distance': <class 'afmformats.mod_force_distance.AFMForceDistance'>, 'stress-relaxation': <class 'afmformats.mod_stress_relaxation.AFMStressRelaxation'>}
- afmformats.formats.formats_available
available/supported file formats
[<AFMFormatRecipe from 'afmformats.formats.fmt_hdf5' at 0x7ff151127690>, <AFMFormatRecipe from 'afmformats.formats.fmt_igor' at 0x7ff151c31810>, <AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff151190310>, <AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff151190410>, <AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff151190490>, <AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff1511905d0>, <AFMFormatRecipe from 'afmformats.formats.fmt_ntmdt_txt' at 0x7ff151190650>, <AFMFormatRecipe from 'afmformats.formats.fmt_tab' at 0x7ff1511906d0>, <AFMFormatRecipe from 'afmformats.formats.fmt_workshop.ws_map' at 0x7ff151190750>, <AFMFormatRecipe from 'afmformats.formats.fmt_workshop.ws_single' at 0x7ff151190590>]
- afmformats.formats.formats_by_suffix
available file formats in a dictionary with suffix keys
{'.csv': [<AFMFormatRecipe from 'afmformats.formats.fmt_workshop.ws_single' at 0x7ff151190590>], '.h5': [<AFMFormatRecipe from 'afmformats.formats.fmt_hdf5' at 0x7ff151127690>], '.ibw': [<AFMFormatRecipe from 'afmformats.formats.fmt_igor' at 0x7ff151c31810>], '.jpk-force': [<AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff151190310>], '.jpk-force-map': [<AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff151190410>], '.jpk-qi-data': [<AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff151190490>], '.jpk-qi-series': [<AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff1511905d0>], '.tab': [<AFMFormatRecipe from 'afmformats.formats.fmt_tab' at 0x7ff1511906d0>], '.txt': [<AFMFormatRecipe from 'afmformats.formats.fmt_ntmdt_txt' at 0x7ff151190650>], '.zip': [<AFMFormatRecipe from 'afmformats.formats.fmt_workshop.ws_map' at 0x7ff151190750>]}
- afmformats.formats.formats_by_modality
available file formats in a dictionary for each modality
{'creep-compliance': [<AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff151190310>, <AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff151190410>, <AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff151190490>, <AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff1511905d0>], 'force-distance': [<AFMFormatRecipe from 'afmformats.formats.fmt_hdf5' at 0x7ff151127690>, <AFMFormatRecipe from 'afmformats.formats.fmt_igor' at 0x7ff151c31810>, <AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff151190310>, <AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff151190410>, <AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff151190490>, <AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff1511905d0>, <AFMFormatRecipe from 'afmformats.formats.fmt_ntmdt_txt' at 0x7ff151190650>, <AFMFormatRecipe from 'afmformats.formats.fmt_tab' at 0x7ff1511906d0>, <AFMFormatRecipe from 'afmformats.formats.fmt_workshop.ws_map' at 0x7ff151190750>, <AFMFormatRecipe from 'afmformats.formats.fmt_workshop.ws_single' at 0x7ff151190590>], 'stress-relaxation': [<AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff151190310>, <AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff151190410>, <AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff151190490>, <AFMFormatRecipe from 'afmformats.formats.fmt_jpk' at 0x7ff1511905d0>]}
- afmformats.formats.supported_extensions
list of supported extensions
['.csv', '.h5', '.ibw', '.jpk-force', '.jpk-force-map', '.jpk-qi-data', '.jpk-qi-series', '.tab', '.txt', '.zip']