Table Of Contents

Previous topic

terapy.core package

Next topic

terapy.filters package

This Page

terapy.files package

Submodules

terapy.files.base module

Generic file filter class

class terapy.files.base.FileFilter

Generic file filter class

read(fname)

Read given file name.

Parameters:
fname - file name (str)
Output:
data (DataArray)
save(fname, data)

Save data to given file name.

Parameters:
fname - file name (str) data - data (DataArray)
strip(fname)

Strip file name of extension.

Parameters:
fname - file name (str)
Output:
stripped file name (str)
wildcard()

Return wildcards associated with filter.

Output:
list of wildcards (list of str)

terapy.files.hdf5 module

HDF5 file filter

class terapy.files.hdf5.HDF5

Bases: terapy.files.base.FileFilter

HDF5 file filter

read(fname)
save(fname, arr, name='M_0')

terapy.files.origin module

Origin OPJ file filter

class terapy.files.origin.Column(name='')
AddValue(value)
SetValues(values)
class terapy.files.origin.OPJ

Bases: terapy.files.base.FileFilter

Origin OPJ file filter

Parsing routine adapted from SciDAVis project (http://sourceforge.net/projects/scidavis/)

get_version(f)
read(fname)
readFolderTree(f)
read_block(f, sz=0)
read_blocksize(f)
save(fname, arr, name='M_0')
write_block(f, block)
class terapy.files.origin.Spreadsheet(name='')
AddValue(value)
AppendColumn(name='')
GetColumnByName(name)
GetDataArray()
SetValues(values)

terapy.files.text module

Text file filter

class terapy.files.text.Text

Bases: terapy.files.base.FileFilter

Text file filter

read(fname)
read1D(fname, tname)
read1Dv(fname, tname)
read2D(fname, tname)
save(fname, arr)

terapy.files.xls module

Excel file filter

class terapy.files.xls.XLS

Bases: terapy.files.base.FileFilter

Excel file filter

read(fname)
read_sheet(s)
save(fname, arr, name='M_0')
save1D(sheet, arr)
save2D(sheet, arr)

Module contents

File parsing functions

Properties:
modules - list of available file filters

Each parsing method must be implemented as a FileFilter class (see base.py). FileFilter classes contained in Python scripts within this folder will be automatically recognized and added to file filter list.

terapy.files.read_wildcards(allfiles=True)

Build a list of wildcards associated with available file filters with read ability.

Parameters:
allfiles - if True, add generic “All files (.)” entry to list
Output:
wildcard list (list)
terapy.files.save_wildcards(allfiles=True)

Build a list of wildcards associated with available file filters with save ability.

Parameters:
allfiles - if True, add generic “All files (.)” entry to list
Output:
wildcard list (list)
terapy.files.wildcards(allfiles=True)

Build a list of wildcards associated with available file filters.

Parameters:
allfiles - if True, add generic “All files (.)” entry to list
Output:
wildcard list (list)