Skip to content

Classes and code organization

Joe Futrelle edited this page May 5, 2017 · 2 revisions

Bin classes

IFCB bins are represented as classes that provide dict-like behavior and encapsulate access to IFCB data regardless of how the data is represented or where it was read from.

All bin classes are derived from ifcb.data.bins.BaseBin, which extends ifcb.data.utils.BaseDictlike.

Note: Python's UserDict is not used because it copies all data; BaseDictlike is implemented instead to provide reasonable default behavior for most dict operations as long as iteration and item fetching is supported.

PID parsing

PID and filename parsing is provided by the ifcb.data.identifiers.Pid class. Parsing is performed lazily and access to selected parsed fields is performed through attributes of the Pid class. A lower-level function that just performs basic parsing of PIDs is provided in ifcb.data.identifiers

Files and filesets

Raw filesets are accessed using the ifcb.data.files.FilesetBin class. This encapsulates a Fileset object describing the raw data files (and providing access to existence checks, file sizes, etc.) along with AdcFile and RoiFile objects holding the ADC and ROI data.

Other formats

Other bin classes and associated functions are provided for translating IFCB data to and from non-native formats, and these are provided in the following packages:

  • ifcb.data.matlab - MATLAB format support
  • ifcb.data.zip - Zip format support
  • ifcb.data.hdf - HDF5 support

Top-level API

Selected classes and functions from the ifcb.data module are exported to the top-level ifcb module. See ifcb/__init__.py for details.