PYME.IO.tabular module

import filters for localisation microscopy results. These masquerade as dictionaries which can be looked up to yield the desired data. The visualisation routines expect at least ‘x’ and ‘y’ to be defined as keys, and may also understand additional values, e.g. ‘error_x’

class PYME.IO.tabular.TabularBase

Bases: object

Methods

toDataFrame([keys])
to_hdf(filename[, tablename, keys, metadata])
to_recarray([keys]) Converts tabular data types into record arrays, which is useful for e.g.
toDataFrame(keys=None)
to_hdf(filename, tablename='Data', keys=None, metadata=None)
to_recarray(keys=None)

Converts tabular data types into record arrays, which is useful for e.g. saving as an hdf table. In order to be converted, the tabular data source must be able to be flattened.

Parameters:keys : list of fields to be copied into output. Defaults to all existing keys.
Returns:numpy recarray version of self
class PYME.IO.tabular.cachingResultsFilter(resultsSource, **kwargs)

Bases: PYME.IO.tabular.TabularBase

Class to permit filtering of fit results - masquarades as a dictionary. Takes item ranges as keyword arguments, eg: f = resultsFliter(source, x=[0,10], error_x=[0,5]) will return an object that behaves like source, but with only those points with an x value in the range [0, 10] and a x error in the range [0, 5].

The filter class does not have any explicit knowledge of the keys supported by the underlying data source.

Methods

keys()
toDataFrame([keys])
to_hdf(filename[, tablename, keys, metadata])
to_recarray([keys]) Converts tabular data types into record arrays, which is useful for e.g.
keys()
class PYME.IO.tabular.cloneSource(resultsSource, keys=None)

Bases: PYME.IO.tabular.TabularBase

Creates an in memory copy of a (filtered) data source

Methods

keys()
toDataFrame([keys])
to_hdf(filename[, tablename, keys, metadata])
to_recarray([keys]) Converts tabular data types into record arrays, which is useful for e.g.
keys()
class PYME.IO.tabular.colourFilter(resultsSource, currentColour=None)

Bases: PYME.IO.tabular.TabularBase

Class to permit filtering by colour

Attributes

index

Methods

getColourChans()
get_channel_column(chan, keys)
get_channel_ds(chan)
get_colour_chans(resultsSource)
keys()
setColour(colour)
toDataFrame([keys])
to_hdf(filename[, tablename, keys, metadata])
to_recarray([keys]) Converts tabular data types into record arrays, which is useful for e.g.
getColourChans()
get_channel_column(chan, keys)
get_channel_ds(chan)
classmethod get_colour_chans(resultsSource)
index
keys()
setColour(colour)
class PYME.IO.tabular.concatenateFilter(source0, source1)

Bases: PYME.IO.tabular.TabularBase

Class which concatenates two tabular data sources. The data sources should have the same keys.

The filter class does not have any explicit knowledge of the keys supported by the underlying data source.

Methods

keys()
toDataFrame([keys])
to_hdf(filename[, tablename, keys, metadata])
to_recarray([keys]) Converts tabular data types into record arrays, which is useful for e.g.
keys()
class PYME.IO.tabular.fitResultsSource(fitResults, sort=True)

Bases: PYME.IO.tabular.TabularBase

Methods

close()
getInfo()
keys()
setResults(fitResults[, sort])
toDataFrame([keys])
to_hdf(filename[, tablename, keys, metadata])
to_recarray([keys]) Converts tabular data types into record arrays, which is useful for e.g.
close()
getInfo()
keys()
setResults(fitResults, sort=True)
class PYME.IO.tabular.h5rDSource(h5fFile)

Bases: PYME.IO.tabular.h5rSource

Data source for use with h5r files as saved by the PYME analysis component

Methods

close()
getInfo()
keys()
toDataFrame([keys])
to_hdf(filename[, tablename, keys, metadata])
to_recarray([keys]) Converts tabular data types into record arrays, which is useful for e.g.
getInfo()
class PYME.IO.tabular.h5rSource(h5fFile, tablename='FitResults')

Bases: PYME.IO.tabular.TabularBase

Data source for use with h5r files as saved by the PYME analysis component. Takes either an open h5r file or a string filename to be opened.

Methods

close()
getInfo()
keys()
toDataFrame([keys])
to_hdf(filename[, tablename, keys, metadata])
to_recarray([keys]) Converts tabular data types into record arrays, which is useful for e.g.
close()
getInfo()
keys()
class PYME.IO.tabular.hdfSource(h5fFile, tablename='FitResults')

Bases: PYME.IO.tabular.h5rSource

Data source for use with h5r files as saved by the PYME analysis component. Takes either an open h5r file or a string filename to be opened.

Methods

close()
getInfo()
keys()
toDataFrame([keys])
to_hdf(filename[, tablename, keys, metadata])
to_recarray([keys]) Converts tabular data types into record arrays, which is useful for e.g.
close()
getInfo()
keys()
class PYME.IO.tabular.mappingFilter(resultsSource, **kwargs)

Bases: PYME.IO.tabular.TabularBase

Class to permit transformations (e.g. drift correction) of fit results - masquarades as a dictionary. Takes mappings as keyword arguments, eg: f = resultsFliter(source, xp=’x + a*tIndex’, yp=compile(‘y + b*tIndex’, ‘/tmp/test1’, ‘eval’), a=1, b=2) will return an object that behaves like source, but has additional members xp and yp.

the mappings should either be code objects, strings (which will be compiled into code objects), or something else (which will be turned into a local variable - eg constants in above example)

Methods

addColumn(name, values) Adds a column of values to the mapping.
addVariable(name, value) Adds a scalar variable to the mapping object.
getMappedResults(key, sl)
keys()
setMapping(key, mapping)
toDataFrame([keys])
to_hdf(filename[, tablename, keys, metadata])
to_recarray([keys]) Converts tabular data types into record arrays, which is useful for e.g.
addColumn(name, values)

Adds a column of values to the mapping.

Parameters:

name : str

The new column name

values : array-like

The values. This should be the same length as the existing columns.

addVariable(name, value)

Adds a scalar variable to the mapping object. This will be accessible from mappings. An example usage might be to define a scaling parameter for one of our column variables.

Parameters:

name : string

The name we want to be able to access the variable by

value : float (or something which can be cast to a float)

The value

getMappedResults(key, sl)
keys()
setMapping(key, mapping)
class PYME.IO.tabular.matfileSource(filename, columnnames, varName='Orte')

Bases: PYME.IO.tabular.TabularBase

Input filter for use with matlab data. Need to provide a variable name and a list of column names in the order that they appear in the file. Using ‘x’, ‘y’ and ‘error_x’ for the position data and it’s error should ensure that this functions with the visualisation backends

Methods

getInfo()
keys()
toDataFrame([keys])
to_hdf(filename[, tablename, keys, metadata])
to_recarray([keys]) Converts tabular data types into record arrays, which is useful for e.g.
getInfo()
keys()
class PYME.IO.tabular.randomSource(xmax, ymax, nsamps)

Bases: PYME.IO.tabular.TabularBase

Uniform random source, for testing and as an example

Methods

getInfo()
keys()
toDataFrame([keys])
to_hdf(filename[, tablename, keys, metadata])
to_recarray([keys]) Converts tabular data types into record arrays, which is useful for e.g.
getInfo()
keys()
class PYME.IO.tabular.recArrayInput(recordArray)

Bases: PYME.IO.tabular.TabularBase

Methods

getInfo()
keys()
toDataFrame([keys])
to_hdf(filename[, tablename, keys, metadata])
to_recarray([keys]) Converts tabular data types into record arrays, which is useful for e.g.
getInfo()
keys()
class PYME.IO.tabular.resultsFilter(resultsSource, **kwargs)

Bases: PYME.IO.tabular.TabularBase

Class to permit filtering of fit results - masquarades as a dictionary. Takes item ranges as keyword arguments, eg: f = resultsFliter(source, x=[0,10], error_x=[0,5]) will return an object that behaves like source, but with only those points with an x value in the range [0, 10] and a x error in the range [0, 5].

The filter class does not have any explicit knowledge of the keys supported by the underlying data source.

Methods

keys()
toDataFrame([keys])
to_hdf(filename[, tablename, keys, metadata])
to_recarray([keys]) Converts tabular data types into record arrays, which is useful for e.g.
keys()
class PYME.IO.tabular.textfileSource(filename, columnnames, delimiter=None, skiprows=0)

Bases: PYME.IO.tabular.TabularBase

Input filter for use with delimited text data. Defaults to whitespace delimiter. need to provide a list of variable names in the order that they appear in the file. Using ‘x’, ‘y’ and ‘error_x’ for the position data and it’s error should ensure that this functions with the visualisation backends

Methods

getInfo()
keys()
toDataFrame([keys])
to_hdf(filename[, tablename, keys, metadata])
to_recarray([keys]) Converts tabular data types into record arrays, which is useful for e.g.
getInfo()
keys()
PYME.IO.tabular.unNestDtype(descr, parent='')
PYME.IO.tabular.unNestNames(nameList, parent='')