afmformats.formats
¶
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 (“force-distance”)
- 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 (currently only “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 nanite: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
list of afmformats.afm_data.AFMData
Classes¶
AFMFormatRecipe
: Undocumented.
- class afmformats.formats.AFMFormatRecipe(recipe)[source]¶
A wrapper class for file format recipes
- Parameters
recipe (dict) – file format recipe
Inheritance
- 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.
- property descr¶
description of file format
- property loader¶
method for loading the data
- property maker¶
who introduced the file format
- property modality¶
key describing the AFM recording modality
- property suffix¶
file format suffix
Variables¶
- afmformats.formats.default_data_classes_by_modality¶
dictionary with default data classes for each modality
{'force-distance': <class 'afmformats.mod_force_distance.AFMForceDistance'>}
- afmformats.formats.formats_available¶
available/supported file formats
[<AFMFormatRecipe from 'afmformats.fmt_hdf5' at 0x7f5d476a6198>, <AFMFormatRecipe from 'afmformats.fmt_igor' at 0x7f5d476a6be0>, <AFMFormatRecipe from 'afmformats.fmt_jpk' at 0x7f5d476706a0>, <AFMFormatRecipe from 'afmformats.fmt_jpk' at 0x7f5d476706d8>, <AFMFormatRecipe from 'afmformats.fmt_jpk' at 0x7f5d47670710>, <AFMFormatRecipe from 'afmformats.fmt_ntmdt_txt' at 0x7f5d47670748>, <AFMFormatRecipe from 'afmformats.fmt_tab' at 0x7f5d47670780>, <AFMFormatRecipe from 'afmformats.fmt_workshop.ws_map' at 0x7f5d476707b8>, <AFMFormatRecipe from 'afmformats.fmt_workshop.ws_single' at 0x7f5d476707f0>]
- afmformats.formats.formats_by_suffix¶
available file formats in a dictionary with suffix keys
{'.csv': [<AFMFormatRecipe from 'afmformats.fmt_workshop.ws_single' at 0x7f5d476707f0>], '.h5': [<AFMFormatRecipe from 'afmformats.fmt_hdf5' at 0x7f5d476a6198>], '.ibw': [<AFMFormatRecipe from 'afmformats.fmt_igor' at 0x7f5d476a6be0>], '.jpk-force': [<AFMFormatRecipe from 'afmformats.fmt_jpk' at 0x7f5d476706a0>], '.jpk-force-map': [<AFMFormatRecipe from 'afmformats.fmt_jpk' at 0x7f5d476706d8>], '.jpk-qi-data': [<AFMFormatRecipe from 'afmformats.fmt_jpk' at 0x7f5d47670710>], '.tab': [<AFMFormatRecipe from 'afmformats.fmt_tab' at 0x7f5d47670780>], '.txt': [<AFMFormatRecipe from 'afmformats.fmt_ntmdt_txt' at 0x7f5d47670748>], '.zip': [<AFMFormatRecipe from 'afmformats.fmt_workshop.ws_map' at 0x7f5d476707b8>]}
- afmformats.formats.formats_by_modality¶
available file formats in a dictionary for each modality
{'force-distance': [<AFMFormatRecipe from 'afmformats.fmt_hdf5' at 0x7f5d476a6198>, <AFMFormatRecipe from 'afmformats.fmt_igor' at 0x7f5d476a6be0>, <AFMFormatRecipe from 'afmformats.fmt_jpk' at 0x7f5d476706a0>, <AFMFormatRecipe from 'afmformats.fmt_jpk' at 0x7f5d476706d8>, <AFMFormatRecipe from 'afmformats.fmt_jpk' at 0x7f5d47670710>, <AFMFormatRecipe from 'afmformats.fmt_ntmdt_txt' at 0x7f5d47670748>, <AFMFormatRecipe from 'afmformats.fmt_tab' at 0x7f5d47670780>, <AFMFormatRecipe from 'afmformats.fmt_workshop.ws_map' at 0x7f5d476707b8>, <AFMFormatRecipe from 'afmformats.fmt_workshop.ws_single' at 0x7f5d476707f0>]}
- afmformats.formats.supported_extensions¶
list of supported extensions
['.csv', '.h5', '.ibw', '.jpk-force', '.jpk-force-map', '.jpk-qi-data', '.tab', '.txt', '.zip']