datafile Package¶
datafile
Package¶
interfaces for reading (multichanneled) data from files
atf
Module¶
datafile implementation for atf file format
-
class
AtfFile
(filename=None, dtype=None)[source]¶ Bases:
botmpy.common.datafile.datafile.DataFile
ATF file format - GenePix software
-
get_data
(**kwargs)¶ returns a numpy array of the data with samples on the rows and channels on the columns. channels may be selected via the channels parameter.
Parameters: Return type: ndarray
Returns: requested data
-
datafile
Module¶
interfaces for reading (multichanneled) data from various file formats
-
exception
DataFileError
[source]¶ Bases:
exceptions.Exception
-
class
DataFileMetaclass
[source]¶ Bases:
type
This Metaclass is meant to overwrite doc strings of methods with those defined in the corresponding private methods. Corresponding means there is a public interface entry method and a private implementation method. For the instances object, the call to the public method should present the private methods docstring.
This makes it possible for subclasses implementing the interface to document the usage of public methods, without the need to overwrite the ancestor’s methods.
-
DOC_METHODS
= ['_close', '_closed', '_filename', '_get_data']¶
-
-
class
DataFile
(filename=None, dtype=None, **kwargs)[source]¶ Bases:
object
abstract data file interface
This is an abstract datafile interface. Implementations should implement the private interface as required for that file format! A DataFile manages a file handle to the physical file and should try to hold its contents in memory, and use buffering to reduce filesystem load.
All public methods belong to the interface and relay to their private counter parts, which are provided by the file format implementation.
gdf
Module¶
datafile implementation for gdf file format
-
class
GdfFile
(filename=None, dtype=None, **kwargs)[source]¶ Bases:
botmpy.common.datafile.datafile.DataFile
GDF file format - Chen Sorter
-
static
convert_dict_to_matrix
(gdf)[source]¶ converts a GDF dict representation to a matrix
Parameters: gdf (dict) – mapping unit ids to spike trains Return type: ndarray Returns: first column ids, second column samples
-
static
convert_matrix_to_dict
(gdf)[source]¶ converts a GDF ndarray representation to a dict
Parameters: gdf (ndarray) – first column ids, second column samples Return type: dict Returns: mapping unit ids to spike trains
-
get_data
(**kwargs)¶ returns the GDF data as ndarray
Return type: dict Returns: mapping unit ids to spike trains
-
static
nas
Module¶
datafile implementation for nas file format
-
class
NasFile
(filename=None, dtype=None)[source]¶ Bases:
botmpy.common.datafile.datafile.DataFile
NAS file format - NeuronMeter
-
get_n_data_points
()[source]¶ sample count per waveform
Return type: int Returns: sample count per waveform
-
wri
Module¶
datafile implementation for wri file format
-
class
WriFile
(filename=None, dtype=<type 'numpy.float32'>)[source]¶ Bases:
botmpy.common.datafile.datafile.DataFile
WRI file format - Chen Sorter
-
get_data
(**kwargs)¶ Returns the wri content as a dictionary of numpy arrays :rtype: dict :returns: mapping unit id to spike train
-
xpd
Module¶
datafile implementation for xpd file format
-
class
XpdFile
(filename=None, dtype=None, cache=False)[source]¶ Bases:
botmpy.common.datafile.datafile.DataFile
XPD file from - Matthias Munk Group @ MPI Tübingen
-
get_data
(**kwargs)¶ returns a numpy array of the data with samples on the rows and channels on the columns. channels may be selected via the channels parameter.
get data for one tetrode (default all channels) as ndarray
Parameters: - item (int) – tetrode id. starts at 1!! Default = 1
- chans (list) – Channel list. Default = [0,1,2,3]
-