IO classes to read files in the different format Asari lab is acquiring from: hdf5, rhd, raw, npy, all adapted from the SpykingCircus project by Pierre Yger and Olivier Marre https://spyking-circus.readthedocs.io/en/latest/
filter_per_extension
(files
, extension
)
print_and_log
(to_print
, level
='info'
, logger
=None
, display
=True
)
print_info
(lines
)
Prints informations messages, enhanced graphical aspects.
print_error
(lines
)
Prints errors messages, enhanced graphical aspects.
get_offset
(data_dtype
, dtype_offset
)
DataFile
(file_name
, params
, is_empty
=False
, stream_mode
=None
)
A generic class that will represent how the program interacts with the data. Such an abstraction
layer should allow people to write their own wrappers, for several file formats, with or without
parallel write, streams, and so on. Note that depending on the complexity of the datastructure,
this extra layer can slow down the code.
read_header
(fid
)
Reads the Intan File Format header from the given file.
get_bytes_per_data_block
(header
)
Calculates the number of bytes in each 60-sample datablock.
read_qstring
(fid
)
Read Qt style QString.
The first 32-bit unsigned number indicates the length of the string (in bytes).
If this number equals 0xFFFFFFFF, the string is null.
Strings are stored as unicode.
RHDFile
(file_name
, params
, is_empty
=False
, stream_mode
=None
) :: DataFile
A generic class that will represent how the program interacts with the data. Such an abstraction
layer should allow people to write their own wrappers, for several file formats, with or without
parallel write, streams, and so on. Note that depending on the complexity of the datastructure,
this extra layer can slow down the code.
H5File
(file_name
, params
, is_empty
=False
, stream_mode
=None
) :: DataFile
A generic class that will represent how the program interacts with the data. Such an abstraction
layer should allow people to write their own wrappers, for several file formats, with or without
parallel write, streams, and so on. Note that depending on the complexity of the datastructure,
this extra layer can slow down the code.
RawBinaryFile
(file_name
, params
, is_empty
=False
, stream_mode
=None
) :: DataFile
A generic class that will represent how the program interacts with the data. Such an abstraction
layer should allow people to write their own wrappers, for several file formats, with or without
parallel write, streams, and so on. Note that depending on the complexity of the datastructure,
this extra layer can slow down the code.
NumpyFile
(file_name
, params
, is_empty
=False
, stream_mode
=None
) :: RawBinaryFile
A generic class that will represent how the program interacts with the data. Such an abstraction
layer should allow people to write their own wrappers, for several file formats, with or without
parallel write, streams, and so on. Note that depending on the complexity of the datastructure,
this extra layer can slow down the code.
load_all_data
(datafile
:DataFile
)
Read all the data contained by a file. For rhd and hdf5, correspond to the ephy channels. To read the ADC
data, see load_all_data_adc
load_all_data_adc
(datafile
:DataFile
, channel_idx
=0
)
Read all the data contained by a file. For rhd and hdf5, correspond to the adc channels. To read the ephy
data, see load_all_data
load_all_data_dig_in
(datafile
:DataFile
, channel_idx
=0
)
Read all the data contained by a file. For rhd and hdf5, correspond to the adc channels. To read the ephy
data, see load_all_data
load_all_data_both
(datafile
:DataFile
)
Read all the data contained by a file. For rhd and hdf5, correspond to the adc channels. To read the ephy
data, see load_all_data
export_adc_raw
(datafile
:DataFile
, output_fn
=''
, channel_idx
=0
)
Exports a datafile adc channel to a single raw binary file. Useful to reduce disk usage after that
spike sorting is done.
export_dig_in_raw
(datafile
:DataFile
, output_fn
=''
, channel_idx
=0
)
Exports a datafile adc channel to a single raw binary file. Useful to reduce disk usage after that
spike sorting is done.
export_raw
(datafile
:DataFile
, output_fn
=''
)
Exports a datafile adc channel to a single raw binary file. Useful to reduce disk usage after that
spike sorting is done.
export_both_raw
(datafile
:DataFile
)
Exports a both raw data, adc and ephy.
load_adc_raw
(filepath
, sampling_rate
=30000
)
Loads adc raw data, in the format exported by export_adc_raw
load_digin_raw
(filepath
, sampling_rate
=30000
)
Loads adc raw data, in the format exported by export_adc_raw
load_sync_raw
(filepath
, sampling_rate
=10000
)
Loads the sync files made by labview for Asari Lab 2P setup