afmformats.formats.fmt_jpk.jpk_reader
¶
Classes¶
ArchiveCache
: Archive cache for fast access to zip dataJPKReader
: Undocumented.
- class afmformats.formats.fmt_jpk.jpk_reader.ArchiveCache[source]¶
Archive cache for fast access to zip data
If every
JPKReader
has its own instance of ZipFile, then on macOS (and possibly other OSes), we might run into an OSError; [Errno 24] Too many open files (https://github.com/AFM-analysis/afmformats/issues/10). The problem is, that if we don’t leave the ZipFile, we have to re-open it every time we want to access some data. This is a huge overhead.The solution is ArchiveCache, which keeps a reference to the last max_archives=32 archives and closes the ones that were used least.
Inheritance
- class afmformats.formats.fmt_jpk.jpk_reader.JPKReader(path)[source]¶
Inheritance
- get_data(column, index, segment=None)[source]¶
Return data for a given column, index, or segment
- Parameters
column (str) – Valid column from
afmformats.afm_data.known_columns
index (int) – Curve index in the current archive
segment (int or None) – Segment index for chosen curve index
- Returns
data – Column data
- Return type
1d ndarray
- get_index_numbers()[source]¶
Return int array with available index numbers
The numbers is what we refer to as “enum” in afmformats. Sometimes individual curves are missing from JPK files. These have to be correctly indexed.
- get_index_segment_path(index, segment)[source]¶
Return the path in the zip file for a specific index and segment
- property files¶
List of files and folders in the archive
- property hierarchy¶
Format hierarchy (“single” or “indexed”)