Package qubx :: Module dataGTK
[hide private]
[frames] | no frames]

Module dataGTK

source code

Specialized scope for qub data.

Copyright 2008-2014 Research Foundation State University of New York This file is part of QUB Express.

QUB Express is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QUB Express is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License, named LICENSE.txt, in the QUB Express program directory. If not, see <http://www.gnu.org/licenses/>.


Version: 1.11.0

Classes [hide private]
  CacheTile
  DataSource
Provides sampled and idealized data to the user's specification.
  DoseResponse_Properties
  DoseResponse_Task
  KeyMessageBox
  Layer_Lists
  QubDataView_Base
Specialized Scope for qub data files.
  QubDataView_Hi
High-resolution data view
  QubDataView_Lo
Low-resolution data view
  QubData_BaseTool
  QubData_BaselineTool
Edits baseline nodes; draws them as an overlay.
  QubData_BaumWelchTool
  QubData_CloneTool
  QubData_ExcludeTool
  QubData_HiTool
  QubData_JoinTool
  QubData_ListReplaceTool
  QubData_MeasureTool
  QubData_PanTool
  QubData_SelTool
Handles mouse interactions that involve highlighting a region of data and acting immediately.
  ShowMeasurementsTool
  SubLayer_DisplayMenu
Display menu.
  SubLayer_List
  TileCache
  TimeControlLayer
Floating controls for which/how many segments to show, and what time range.
Functions [hide private]
 
BaumWelchList(item) source code
 
DoseResponse_FindStim(view, model) source code
 
ExcludeList(item) source code
 
ExtractList(menuitem) source code
 
IncludeList(item) source code
 
MeasureDoseResponse(measure=None, filter=None, filter_kHz=None, mean_dur=None, mean_from=None, normalize=None, output_name=None, wait=True, receiver=<__builtin__.function object>)
Measures current v.
source code
 
NbSubTrace(name='SubTable', fields=[])
Returns a function(QubDataView), which returns an NbTable with only the specified columns.
source code
 
NbSubTrace_Hi(name='SubTable', fields=[])
Returns a function(QubDataView_Hi), which returns an NbTable with only the specified columns.
source code
 
RequestBinaryParams(sampling, scaling, floating, bytes, signals) source code
 
RequestSampling(sampling) source code
 
acceptBytes(s) source code
 
action_nothing(l, r) source code
 
after_measure(segments, table, row_offset) source code
 
before_measure(segments, table, row_offset) source code
 
dblclick_nothing(x, y, e) source code
 
draw_baseline_nodes_icon(cr, w, h, appearance) source code
 
line_isect(l0, r0, l1, r1) source code
 
measure_selection(segment, signals, source_signal, inclusion_mask, measured) source code
 
measure_selection_idealized(segment, signal, measured) source code
 
measure_selection_one_signal(segment, signal, inclusion_mask, measured) source code
 
minrange(lo, hi, diff)
Returns the interval (lo, hi), possibly modified to ensure (hi - lo) >= diff.
source code
 
scroll_nothing(x, y, e, o) source code
 
task_exception_to_console(task, typ, val, tb) source code
Variables [hide private]
  ALLOW_THREADS = 1
  BUFSIZE = 8192
  BW_HINT_EXPIRE_SEC = 60
  CLIP = 0
  CLONE_MODE_DEST = 1
  CLONE_MODE_RESTORE = 2
  CLONE_MODE_SOURCE = 0
  COLOR = defaultdict(<function <lambda> at 0x7fd137b1e1b8>, {0:...
  COLOR_BASELINE_NODES = ('dataGTK.baseline.nodes', (0.5, 0.5, 1...
  COLOR_CLEAR = ('toolspace.clear', (0, 0, 0, 0))
  COLOR_CLONE_DEST = ('dataGTK.clone.dest', (1, 0, 0, 0.22))
  COLOR_CLONE_DEST_OTHER = ('dataGTK.clone.dest.other', (0.8, 0....
  COLOR_CLONE_SOURCE = ('dataGTK.clone.source', (0, 1, 0, 0.22))
  COLOR_DATA_LAYER_FG = ('dataGTK.layer.fg', (0.1, 1, 0.1, 0.9))
  COLOR_DATA_LAYER_HOVER = ('dataGTK.layer.hover', (0.1, 1, 0.1,...
  COLOR_FITS = ('dataGTK.fit', (0.8, 0, 0.2, 0.8))
  COLOR_LIST = ('dataGTK.list', (0.7, 0, 0.7, 0.22))
  COLOR_LIST_ALPHA = 0.22
  COLOR_LIST_BEAD = ('dataGTK.list.bead', (0.8, 0.4, 0.7, 0.9))
  COLOR_LIST_BEAD_LABEL = ('dataGTK.list.bead.label', (1, 1, 1, 1))
  COLOR_LIST_CHECKED = ('dataGTK.list.checked', (1, 0.7, 0, 0.8))
  COLOR_LIST_LBL_BG = ('dataGTK.list.lbl.bg', (0, 0, 0, 1))
  COLOR_LIST_LBL_FG = ('dataGTK.list.lbl.fg', (0, 1, 0, 1))
  COLOR_LIST_NAME = ('dataGTK.list.name', (0.7, 0, 0.7, 0.7))
  COLOR_LIST_SEL = ('dataGTK.list.sel', (1, 1, 1, 0.8))
  COLOR_MAG = ('dataGTK.popup.mag', (0, 1, 0, 1))
  COLOR_MAG_HOVER = ('dataGTK.popup.mag.hover', (1, 1, 1, 1))
  COLOR_RULER_BASELINE = ('dataGTK.ruler.baseline', (0.85, 0.15,...
  COLOR_SEL = ('dataGTK.sel', (0.3, 0.3, 1, 0.3))
  COLOR_TIMECTL = ('dataGTK.timectl', (1, 1, 1, 0.8))
  COLOR_TIMECTL_HOVER = ('dataGTK.timectl.hover', (1, 0.5, 0.5, 1))
  COLOR_TOOLS_LABEL = ('dataGTK.tools.label', (0.4, 0.8, 1, 1))
  COLOR_ZOOM_BG = ('dataGTK.zoom.bg', (1, 1, 1, 0.84))
  COPY_ROWS_ALL = 0
  COPY_ROWS_CHECKED = 3
  COPY_ROWS_CRITERIA = 2
  COPY_ROWS_GROUP = 1
  ColorInfo = defaultdict(<function <lambda> at 0x7fd123474500>,...
  DATASOURCE_FILE = 0
  DATASOURCE_LIST = 2
  DATASOURCE_SCREEN = 1
  DOSERESPONSE_MAX_RESULTS = 100
  DOSERESPONSE_MEASURE_EQUIL = 2
  DOSERESPONSE_MEASURE_MEAN = 1
  DOSERESPONSE_MEASURE_PEAK = 0
  DOT_DIVISIONS = 64
  DOWNSAMPLE_ALL_LOGCOUNT = 2.0
  DOWNSAMPLE_LOGSLOPE = 3.0
  ERR_CALL = 3
  ERR_DEFAULT = 521
  ERR_IGNORE = 0
  ERR_LOG = 5
  ERR_PRINT = 4
  ERR_RAISE = 2
  ERR_WARN = 1
  FLOATING_POINT_SUPPORT = 1
  FPE_DIVIDEBYZERO = 1
  FPE_INVALID = 8
  FPE_OVERFLOW = 2
  FPE_UNDERFLOW = 4
  False_ = False
  GAUSS_ALPHA_MAX = 0.8
  Inf = inf
  Infinity = inf
  LORES_PIX_PER_DIV = 25.0
  MAXDIMS = 32
  MAX_BOOLS = 16
  MAX_DEFAULT_DISPLAY_POINTS = 2000000
  MAX_FIELDS = 256
  MAX_SAFENAME_LEN = 32
  MAY_SHARE_BOUNDS = 0
  MAY_SHARE_EXACT = -1
  NAN = nan
  NINF = -inf
  NZERO = -0.0
  NaN = nan
  PINF = inf
  PZERO = 0.0
  QUBDATA_SEL_THRESH_MS = 300
  RAISE = 2
  RULER_BASELINE_CONST = 0
  RULER_BASELINE_IN_SEG = 1
  RULER_BASELINE_IN_SEL = 2
  Readers = {'.acquire': {'pattern': '*.acquire', 'create': <cla...
  SAVEBUFLEN = 262144
  SHIFT_DIVIDEBYZERO = 0
  SHIFT_INVALID = 9
  SHIFT_OVERFLOW = 3
  SHIFT_UNDERFLOW = 6
  SIGNAL_CENTER_HIDDEN = -1000000000.0
  STIM_LABELS = ('Constant', 'Signal', 'Expression')
  STIM_TYPES = (0, 1, 2)
  STIM_TYPE_CONST = 0
  STIM_TYPE_EXPR = 2
  STIM_TYPE_SIGNAL = 1
  ScalarType = (<type 'int'>, <type 'float'>, <type 'complex'>, ...
  ShowDropped = False
  TILE_THRESH = 4.0
  TOO_MANY_LIST_ITEMS_TO_DRAW = 2048
  TheKeyMessageBox = <KeyMessageBox object at 0x7fd12aca1050 (Gt...
  Tools = <qubx.util_types.ToolRegistry object>
  True_ = True
  UFUNC_BUFSIZE_DEFAULT = 8192
  UFUNC_PYVALS_NAME = 'UFUNC_PYVALS'
  UNSET_IDL = 1543209.75
  UNSET_VALUE = 86738.82583
  WRAP = 1
  Writers = {'.csv': {'pattern': '*.csv', 'ext': '.csv', 'save':...
  __package__ = 'qubx'
  absolute = <ufunc 'absolute'>
  add = <ufunc 'add'>
  arccos = <ufunc 'arccos'>
  arccosh = <ufunc 'arccosh'>
  arcsin = <ufunc 'arcsin'>
  arcsinh = <ufunc 'arcsinh'>
  arctan = <ufunc 'arctan'>
  arctan2 = <ufunc 'arctan2'>
  arctanh = <ufunc 'arctanh'>
  bitwise_and = <ufunc 'bitwise_and'>
  bitwise_not = <ufunc 'invert'>
  bitwise_or = <ufunc 'bitwise_or'>
  bitwise_xor = <ufunc 'bitwise_xor'>
  c_ = <numpy.lib.index_tricks.CClass object>
  cast = {<type 'numpy.bool_'>: <function <lambda> at 0x7fd1396e...
  cbrt = <ufunc 'cbrt'>
  ceil = <ufunc 'ceil'>
  conj = <ufunc 'conjugate'>
  conjugate = <ufunc 'conjugate'>
  copysign = <ufunc 'copysign'>
  cos = <ufunc 'cos'>
  cosh = <ufunc 'cosh'>
  deg2rad = <ufunc 'deg2rad'>
  degrees = <ufunc 'degrees'>
  divide = <ufunc 'divide'>
  e = 2.71828182846
  equal = <ufunc 'equal'>
  euler_gamma = 0.577215664902
  exp = <ufunc 'exp'>
  exp2 = <ufunc 'exp2'>
  expm1 = <ufunc 'expm1'>
  fabs = <ufunc 'fabs'>
  false = False
  floor = <ufunc 'floor'>
  floor_divide = <ufunc 'floor_divide'>
  fmax = <ufunc 'fmax'>
  fmin = <ufunc 'fmin'>
  fmod = <ufunc 'fmod'>
  frexp = <ufunc 'frexp'>
  greater = <ufunc 'greater'>
  greater_equal = <ufunc 'greater_equal'>
  hypot = <ufunc 'hypot'>
  index_exp = <numpy.lib.index_tricks.IndexExpression object>
  inf = inf
  infty = inf
  invert = <ufunc 'invert'>
  isfinite = <ufunc 'isfinite'>
  isinf = <ufunc 'isinf'>
  isnan = <ufunc 'isnan'>
  ldexp = <ufunc 'ldexp'>
  left_shift = <ufunc 'left_shift'>
  less = <ufunc 'less'>
  less_equal = <ufunc 'less_equal'>
  little_endian = True
  log = <ufunc 'log'>
  log10 = <ufunc 'log10'>
  log1p = <ufunc 'log1p'>
  log2 = <ufunc 'log2'>
  logaddexp = <ufunc 'logaddexp'>
  logaddexp2 = <ufunc 'logaddexp2'>
  logical_and = <ufunc 'logical_and'>
  logical_not = <ufunc 'logical_not'>
  logical_or = <ufunc 'logical_or'>
  logical_xor = <ufunc 'logical_xor'>
  maximum = <ufunc 'maximum'>
  mgrid = <numpy.lib.index_tricks.nd_grid object>
  minimum = <ufunc 'minimum'>
  mod = <ufunc 'remainder'>
  modf = <ufunc 'modf'>
  multiply = <ufunc 'multiply'>
  name_float = 'a number'
  name_int = 'an integer'
  nan = nan
  nbytes = {<type 'numpy.bool_'>: 1, <type 'numpy.timedelta64'>:...
  negative = <ufunc 'negative'>
  newaxis = None
hash(x)
  nextafter = <ufunc 'nextafter'>
  not_equal = <ufunc 'not_equal'>
  ogrid = <numpy.lib.index_tricks.nd_grid object>
  pi = 3.14159265359
  power = <ufunc 'power'>
  r_ = <numpy.lib.index_tricks.RClass object>
  rad2deg = <ufunc 'rad2deg'>
  radians = <ufunc 'radians'>
  rdbk = 'Expired.'
  rdbreak = 'supporting'
  rdname = 'qubfast.txt'
  reciprocal = <ufunc 'reciprocal'>
  remainder = <ufunc 'remainder'>
  right_shift = <ufunc 'right_shift'>
  rint = <ufunc 'rint'>
  s_ = <numpy.lib.index_tricks.IndexExpression object>
  sctypeDict = {0: <type 'numpy.bool_'>, 1: <type 'numpy.int8'>,...
  sctypeNA = {'?': 'Bool', 'B': 'UInt8', 'Bool': <type 'numpy.bo...
  sctypes = {'complex': [<type 'numpy.complex64'>, <type 'numpy....
  sign = <ufunc 'sign'>
  signbit = <ufunc 'signbit'>
  sin = <ufunc 'sin'>
  sinh = <ufunc 'sinh'>
  spacing = <ufunc 'spacing'>
  sqrt = <ufunc 'sqrt'>
  square = <ufunc 'square'>
  subtract = <ufunc 'subtract'>
  tan = <ufunc 'tan'>
  tanh = <ufunc 'tanh'>
  true = True
  true_divide = <ufunc 'true_divide'>
  trunc = <ufunc 'trunc'>
  typeDict = {0: <type 'numpy.bool_'>, 1: <type 'numpy.int8'>, 2...
  typeNA = {'?': 'Bool', 'B': 'UInt8', 'Bool': <type 'numpy.bool...
  typecodes = {'All': '?bhilqpBHILQPefdgFDGSUVOMm', 'AllFloat': ...
  valid_identifier = re.compile(r'^[A-Za-z_][A-Za-z_0-9]*$')
Function Details [hide private]

MeasureDoseResponse(measure=None, filter=None, filter_kHz=None, mean_dur=None, mean_from=None, normalize=None, output_name=None, wait=True, receiver=<__builtin__.function object>)

source code 

Measures current v. stimulus; plots in QubX.Charts and fits to the Hill equation.

Parameters:
  • measure - method for finding response; one of HILL_MEASURE_PEAK, HILL_MEASURE_MEAN, HILL_MEASURE_EQUIL
  • filter - True to apply low-pass filter to current signal
  • filter_kHz - low-pass filter freq
  • mean_dur - if measure == HILL_MEASURE_MEAN, number of milliseconds of data to average each segment
  • mean_from - if measure == HILL_MEASURE_MEAN, number of milliseconds to skip at the beginning of each segment
  • normalize - True to divide current measurements by peak current
  • output_name - name of Table for measurements
  • wait - True to return the output Table upon completion; False to return immediately, and pass the Table upon completion to receiver
  • receiver - function(qubx.table.SimpleTable)

Variables Details [hide private]

COLOR

Value:
defaultdict(<function <lambda> at 0x7fd137b1e1b8>, {0: (0, 0, 0), 1: (\
1, 0, 0), 2: (0, 0, 1), 3: (0, 1, 0), 4: (0, 1, 1), 5: (1, 1, 0), 6: (\
1, 0, 1), 7: (0.5, 0.0, 0.0), 8: (0.525, 0.32025, 0.013125000000000012\
), 9: (0.44550000000000006, 0.55, 0.027500000000000028), 10: (0.149499\
99999999994, 0.575, 0.04312499999999997), 11: (0.059999999999999984, 0\
.6, 0.2759999999999999), 12: (0.078125, 0.625, 0.625), 13: (0.09750000\
000000002, 0.3185, 0.65), 14: (0.22949999999999962, 0.1181250000000000\
4, 0.675), 15: (0.5879999999999999, 0.13999999999999996, 0.7), 16: (0.\
...

COLOR_BASELINE_NODES

Value:
('dataGTK.baseline.nodes', (0.5, 0.5, 1, 0.9))

COLOR_CLONE_DEST_OTHER

Value:
('dataGTK.clone.dest.other', (0.8, 0.5, 0.5, 0.22))

COLOR_DATA_LAYER_HOVER

Value:
('dataGTK.layer.hover', (0.1, 1, 0.1, 0.9))

COLOR_RULER_BASELINE

Value:
('dataGTK.ruler.baseline', (0.85, 0.15, 0.6, 0.3))

ColorInfo

Value:
defaultdict(<function <lambda> at 0x7fd123474500>, {'qubx.cube.other.m\
enu': {'label': 'Other panel menu'}, 'scope.signal.bg': {'label': 'Dat\
a signal background'}, 'scope.mean.line': {'label': 'Data center line'\
}, 'toolspace.layer.bg': {'label': 'Default layer background'}, 'list_\
figure.fit': {'label': 'ListFigure fit curves'}, 'data_fit.button': {'\
label': 'Data curvefit buttons'}, 'toolspace.focused': {'label': 'Pane\
l border focused'}, 'modelGTK.state.label': {'label': 'Model state lab\
el'}, 'scope.units.hover': {'label': 'Data units mouseover'}, 'dataGTK\
...

Readers

Value:
{'.acquire': {'pattern': '*.acquire', 'create': <class 'qubx.data_acqu\
ire.QubData_ACQ'>, 'ext': '.acquire', 'description': 'Acquire files'},
 '.csv': {'pattern': '*.csv', 'create': <function OpenTXT at 0x7fd1298\
320c8>, 'ext': '.csv', 'description': 'Comma-separated files'},
 '.dat': {'pattern': '*.dat', 'create': <function QubData_PUL_Open at \
0x7fd121749b18>, 'ext': '.dat', 'description': 'DAT files'},
 '.dwt': {'pattern': '*.dwt', 'create': <function OpenDWT at 0x7fd1298\
32140>, 'ext': '.dwt', 'description': 'QuB idealized data'},
...

ScalarType

Value:
(<type 'int'>,
 <type 'float'>,
 <type 'complex'>,
 <type 'long'>,
 <type 'bool'>,
 <type 'str'>,
 <type 'unicode'>,
 <type 'buffer'>,
...

TheKeyMessageBox

Value:
<KeyMessageBox object at 0x7fd12aca1050 (GtkWindow at 0x30d8090)>

Writers

Value:
{'.csv': {'pattern': '*.csv', 'ext': '.csv', 'save': <function Save at\
 0x7fd12982e8c0>, 'description': 'Comma-separated ext files'},
 '.float32': {'pattern': '*.float32', 'ext': '.float32', 'save': <func\
tion Save_Float32 at 0x7fd12982e6e0>, 'description': 'Raw binary (floa\
t32)'},
 '.int16': {'pattern': '*.int16', 'ext': '.int16', 'save': <function S\
ave_Int16 at 0x7fd12982e758>, 'description': 'Raw binary (int16)'},
 '.qdf': {'pattern': '*.qdf', 'ext': '.qdf', 'save': <function Save_QD\
...

cast

Value:
{<type 'numpy.bool_'>: <function <lambda> at 0x7fd1396ed758>, <type 'n\
umpy.timedelta64'>: <function <lambda> at 0x7fd1396ed7d0>, <type 'nump\
y.float16'>: <function <lambda> at 0x7fd1396ed848>, <type 'numpy.uint8\
'>: <function <lambda> at 0x7fd1396ed8c0>, <type 'numpy.int8'>: <funct\
ion <lambda> at 0x7fd1396ed938>, <type 'numpy.object_'>: <function <la\
mbda> at 0x7fd1396ed9b0>, <type 'numpy.datetime64'>: <function <lambda\
> at 0x7fd1396eda28>, <type 'numpy.uint64'>: <function <lambda> at 0x7\
fd1396edaa0>, <type 'numpy.int64'>: <function <lambda> at 0x7fd1396edb\
...

nbytes

Value:
{<type 'numpy.bool_'>: 1, <type 'numpy.timedelta64'>: 8, <type 'numpy.\
float16'>: 2, <type 'numpy.uint8'>: 1, <type 'numpy.int8'>: 1, <type '\
numpy.object_'>: 8, <type 'numpy.datetime64'>: 8, <type 'numpy.uint64'\
>: 8, <type 'numpy.int64'>: 8, <type 'numpy.void'>: 0, <type 'numpy.co\
mplex256'>: 32, <type 'numpy.float128'>: 16, <type 'numpy.uint64'>: 8,\
 <type 'numpy.int64'>: 8, <type 'numpy.unicode_'>: 0, <type 'numpy.com\
plex128'>: 16, <type 'numpy.float64'>: 8, <type 'numpy.uint32'>: 4, <t\
ype 'numpy.int32'>: 4, <type 'numpy.string_'>: 0, <type 'numpy.complex\
...

sctypeDict

Value:
{0: <type 'numpy.bool_'>,
 1: <type 'numpy.int8'>,
 2: <type 'numpy.uint8'>,
 3: <type 'numpy.int16'>,
 4: <type 'numpy.uint16'>,
 5: <type 'numpy.int32'>,
 6: <type 'numpy.uint32'>,
 7: <type 'numpy.int64'>,
...

sctypeNA

Value:
{'?': 'Bool',
 'B': 'UInt8',
 'Bool': <type 'numpy.bool_'>,
 'Complex128': <type 'numpy.complex256'>,
 'Complex32': <type 'numpy.complex64'>,
 'Complex64': <type 'numpy.complex128'>,
 'D': 'Complex64',
 'Datetime64': <type 'numpy.datetime64'>,
...

sctypes

Value:
{'complex': [<type 'numpy.complex64'>,
             <type 'numpy.complex128'>,
             <type 'numpy.complex256'>],
 'float': [<type 'numpy.float16'>,
           <type 'numpy.float32'>,
           <type 'numpy.float64'>,
           <type 'numpy.float128'>],
 'int': [<type 'numpy.int8'>, <type 'numpy.int16'>, <type 'numpy.int32\
...

typeDict

Value:
{0: <type 'numpy.bool_'>,
 1: <type 'numpy.int8'>,
 2: <type 'numpy.uint8'>,
 3: <type 'numpy.int16'>,
 4: <type 'numpy.uint16'>,
 5: <type 'numpy.int32'>,
 6: <type 'numpy.uint32'>,
 7: <type 'numpy.int64'>,
...

typeNA

Value:
{'?': 'Bool',
 'B': 'UInt8',
 'Bool': <type 'numpy.bool_'>,
 'Complex128': <type 'numpy.complex256'>,
 'Complex32': <type 'numpy.complex64'>,
 'Complex64': <type 'numpy.complex128'>,
 'D': 'Complex64',
 'Datetime64': <type 'numpy.datetime64'>,
...

typecodes

Value:
{'All': '?bhilqpBHILQPefdgFDGSUVOMm',
 'AllFloat': 'efdgFDG',
 'AllInteger': 'bBhHiIlLqQpP',
 'Character': 'c',
 'Complex': 'FDG',
 'Datetime': 'Mm',
 'Float': 'efdg',
 'Integer': 'bhilqp',
...