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

 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()
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. numpy recarray version of self
class PYME.IO.tabular.cachingResultsFilter(resultsSource, **kwargs)

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)

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)

Class to permit filtering by colour

Attributes

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)

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)

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)

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')

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')

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.idFilter(resultsSource, id_column, valid_ids)

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.mappingFilter(resultsSource, **kwargs)

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.matfileColumnSource(filename)

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.matfileSource(filename, columnnames, varName='Orte')

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.randomSelectionFilter(resultsSource, num_Samples)

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.randomSource(xmax, ymax, nsamps)

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)

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)

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)

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='')