Package MDSplus :: Module mdsdata :: Class Data
[frames | no frames]

Type Data

object --+
         |
        Data

Known Subclasses:
Apd, Array, Compound, Dictionary, EmptyData, Ident, List, Scalar, TreeNode, TreeNodeArray

Superclass used by most MDSplus objects. This provides default methods if not provided by the subclasses.
Method Summary
Data __init__(self, *value)
Cannot create instances of class Data objects.
Data __abs__(self)
Absolute value: x.__abs__() <==> abs(x)
Data __add__(self, y)
Add: x.__add__(y) <==> x+y
Data __and__(self, y)
And: x.__and__(y) <==> x&y
Data __div__(self, y)
Divide: x.__div__(y) <==> x/y
Bool __eq__(self, y)
Equals: x.__eq__(y) <==> x==y
Data __float__(self)
Float: x.__float__() <==> float(x)
Data __floordiv__(self, y)
Floordiv: x.__floordiv__(y) <==> x//y
Bool __ge__(self, y)
Greater or equal: x.__ge__(y) <==> x>=y
Data __getitem__(self, y)
Subscript: x.__getitem__(y) <==> x[y]
Bool __gt__(self, y)
Greater than: x.__gt__(y) <==> x>y
int __int__(self)
Integer: x.__int__() <==> int(x)
Data __invert__(self)
Binary not: x.__invert__() <==> ~x
Bool __le__(self, y)
Less than or equal: x.__le__(y) <==> x<=y
Data __len__(self)
Length: x.__len__() <==> len(x)
long __long__(self)
Convert this object to python long
Data __lshift__(self, y)
Lrft binary shift: x.__lshift__(y) <==> x<<y
Bool __lt__(self, y)
Less than: x.__lt__(y) <==> x<y
Data __mod__(self, y)
Modulus: x.__mod__(y) <==> x%y
Data __mul__(self, y)
Multiply: x.__mul__(y) <==> x*y
Data __ne__(self, y)
Not equal: x.__ne__(y) <==> x!=y
Data __neg__(self)
Negation: x.__neg__() <==> -x
Bool __nonzero__(self)
Not equal 0: x.__nonzero__() <==> x != 0
Data __or__(self, y)
Or: x.__or__(y) <==> x|y
Data __pos__(self)
Unary plus: x.__pos__() <==> +x
Data __radd__(self, y)
Reverse add: x.__radd__(y) <==> y+x
Data __rdiv__(self, y)
Reverse divide: x.__rdiv__(y) <==> y/x
string __repr__(self)
Return string representation
Data __rfloordiv__(self, y)
x.__rfloordiv__(y) <==> y//x
Data __rlshift__(self, y)
Reverse left binary shift: x.__rlshift__(y) <==> y<<x
Data __rmod__(self, y)
Reverse modulus: x.__rmod__(y) <==> y%x
Data __rmul__(self, y)
Multiply: x.__mul__(y) <==> x*y
Data __ror__(self, y)
Or: x.__or__(y) <==> x|y
Data __rrshift__(self, y)
Reverse right binary shift: x.__rrshift__(y) <==> y>>x
Data __rshift__(self, y)
Right binary shift: x.__rshift__(y) <==> x>>y
Data __rsub__(self, y)
Reverse subtract: x.__rsub__(y) <==> y-x
Data __rxor__(self, y)
Reverse xor: x.__rxor__(y) <==> y^x
string __str__(self)
Return string representation
Data __sub__(self, y)
Subtract: x.__sub__(y) <==> x-y
Data __xor__(self, y)
Xor: x.__xor__(y) <==> x^y
Bool bool(self)
Return boolean
Bool compare(self, value)
Compare this data with argument
Data compile(expr, *args)
Static method (routine in C++) which compiles the expression (via TdiCompile()) and returns the object instance correspondind to the compiled expression. (Static method)
Scalar,Array data(self)
Return primitimive value of the data.
string decompile(self)
Return string representation
Data deserialize(data)
Return Data from serialized buffer. (Static method)
Data dim_of(self, idx)
Return dimension of object
Data evaluate(self)
Return the result of TDI evaluate(this).
Data execute(expr, *args)
Execute and expression inserting optional arguments into the expression before evaluating (Static method)
Int8 getByte(self)
Convert this data into a byte.
Int8Array getByteArray(self)
Convert this data into a byte array.
Data getDimensionAt(self, idx)
Return dimension of object
Float64 getDouble(self)
Convert this data into a float64.
Data getError(self)
Get the error field.
Float32 getFloat(self)
Convert this data into a float32.
Data getHelp(self)
Returns the result of TDI GET_HELP(this).
Int32 getInt(self)
Convert this data into a int.
Int32Array getIntArray(self)
Convert this data into a int array.
Int64 getLong(self)
Convert this data into a long.
Int64Array getLongArray(self)
Convert this data into a long array.
Int32Array getShape(self)
Get the array dimensions as an integer array.
Int16 getShort(self)
Convert this data into a short.
Int16Array getShortArray(self)
Convert this data into a short array.
String getString(self)
Convert this data into a STRING.
Data getTdiVar(tdivarname)
Get value of tdi public variable (Static method)
Data getUnits(self)
Return the TDI evaluation of UNITS_OF(this).
Data makeData(value)
Return MDSplus data class from value. (Static method)
Bool mayHaveChanged(self)
return true if the represented data could have been changed since the last time this method has been called.
Data pop_dollar_value(self)
Pop $value for expression evaluation
None push_dollar_value(self)
Set $value for expression evaluation
Data raw_of(self)
Return raw part of object
Uint8Array serialize(self)
Return Uint8Array binary representation.
None setError(self, error)
Set the Error field for this Data instance.
None setHelp(self, help)
Set the Help field for this Data instance.
Data setTdiVar(self, tdivarname)
Set tdi public variable with this data
None setUnits(self, units)
Set units
Float32Array sind(self)
Return sin() of data assuming data is in degrees
Data units_of(self)
Return units part of the object
Data value_of(self)
Return value part of object
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Property Summary
  descriptor
  error
  help
  units
  validation

Instance Method Details

__init__(self, *value)
(Constructor)

Cannot create instances of class Data objects. Use Data.makeData(initial-value) instead
Returns:
Data
Raises:
TypeError - Raised if attempting to create an instance of Data
Overrides:
__builtin__.object.__init__

__abs__(self)

Absolute value: x.__abs__() <==> abs(x)
Returns:
Data

__add__(self, y)
(Addition operator)

Add: x.__add__(y) <==> x+y
Returns:
Data

__and__(self, y)
(And operator)

And: x.__and__(y) <==> x&y
Returns:
Data

__div__(self, y)

Divide: x.__div__(y) <==> x/y
Returns:
Data

__eq__(self, y)
(Equality operator)

Equals: x.__eq__(y) <==> x==y
Returns:
Bool

__float__(self)

Float: x.__float__() <==> float(x)
Returns:
Data

__floordiv__(self, y)

Floordiv: x.__floordiv__(y) <==> x//y
Returns:
Data

__ge__(self, y)
(Greater-than-or-equals operator)

Greater or equal: x.__ge__(y) <==> x>=y
Returns:
Bool

__getitem__(self, y)
(Indexing operator)

Subscript: x.__getitem__(y) <==> x[y]
Returns:
Data

__gt__(self, y)
(Greater-than operator)

Greater than: x.__gt__(y) <==> x>y
Returns:
Bool

__int__(self)

Integer: x.__int__() <==> int(x)
Returns:
int

__invert__(self)

Binary not: x.__invert__() <==> ~x
Returns:
Data

__le__(self, y)
(Less-than-or-equals operator)

Less than or equal: x.__le__(y) <==> x<=y
Returns:
Bool

__len__(self)
(Length operator)

Length: x.__len__() <==> len(x)
Returns:
Data

__long__(self)

Convert this object to python long
Returns:
long

__lshift__(self, y)

Lrft binary shift: x.__lshift__(y) <==> x<<y
Returns:
Data

__lt__(self, y)
(Less-than operator)

Less than: x.__lt__(y) <==> x<y
Returns:
Bool

__mod__(self, y)

Modulus: x.__mod__(y) <==> x%y
Returns:
Data

__mul__(self, y)

Multiply: x.__mul__(y) <==> x*y
Returns:
Data

__ne__(self, y)

Not equal: x.__ne__(y) <==> x!=y
Returns:
Data

__neg__(self)

Negation: x.__neg__() <==> -x
Returns:
Data

__nonzero__(self)
(Boolean test operator)

Not equal 0: x.__nonzero__() <==> x != 0
Returns:
Bool

__or__(self, y)
(Or operator)

Or: x.__or__(y) <==> x|y
Returns:
Data

__pos__(self)

Unary plus: x.__pos__() <==> +x
Returns:
Data

__radd__(self, y)
(Right-side addition operator)

Reverse add: x.__radd__(y) <==> y+x
Returns:
Data

__rdiv__(self, y)

Reverse divide: x.__rdiv__(y) <==> y/x
Returns:
Data

__repr__(self)
(Representation operator)

Return string representation
Returns:
string

__rfloordiv__(self, y)

x.__rfloordiv__(y) <==> y//x
Returns:
Data

__rlshift__(self, y)

Reverse left binary shift: x.__rlshift__(y) <==> y<<x
Returns:
Data

__rmod__(self, y)

Reverse modulus: x.__rmod__(y) <==> y%x
Returns:
Data

__rmul__(self, y)

Multiply: x.__mul__(y) <==> x*y
Returns:
Data

__ror__(self, y)

Or: x.__or__(y) <==> x|y
Returns:
Data

__rrshift__(self, y)

Reverse right binary shift: x.__rrshift__(y) <==> y>>x
Returns:
Data

__rshift__(self, y)

Right binary shift: x.__rshift__(y) <==> x>>y
Returns:
Data

__rsub__(self, y)

Reverse subtract: x.__rsub__(y) <==> y-x
Returns:
Data

__rxor__(self, y)

Reverse xor: x.__rxor__(y) <==> y^x
Returns:
Data

__str__(self)
(Informal representation operator)

Return string representation
Returns:
string

__sub__(self, y)
(Subtraction operator)

Subtract: x.__sub__(y) <==> x-y
Returns:
Data

__xor__(self, y)

Xor: x.__xor__(y) <==> x^y
Returns:
Data

bool(self)

Return boolean
Returns:
Bool

compare(self, value)

Compare this data with argument
Parameters:
value - data to compare to
           (type=Data)
Returns:
Return True if the value and this Data object contain the same data
           (type=Bool)

data(self)

Return primitimive value of the data.
Returns:
Scalar,Array

decompile(self)

Return string representation
Returns:
string

dim_of(self, idx=0)

Return dimension of object
Parameters:
idx - Index of dimension
           (type=int)
Returns:
Data

evaluate(self)

Return the result of TDI evaluate(this).
Returns:
Data

getByte(self)

Convert this data into a byte. Implemented at this class level by returning TDI data(BYTE(this)). If data() fails or the returned class is not scalar, generate an exception.
Returns:
Int8
Raises:
TypeError - Raised if data is not a scalar value

getByteArray(self)

Convert this data into a byte array. Implemented at this class level by returning TDI data(BYTE(this)). If data() fails or the returned class is not array, generates an exception. In Java and C++ will return a 1 dimensional array using row-first ordering if a multidimensional array.
Returns:
Int8Array

getDimensionAt(self, idx=0)

Return dimension of object
Parameters:
idx - Index of dimension
           (type=int)
Returns:
Data

getDouble(self)

Convert this data into a float64. Implemented at this class level by returning TDI data(FT_FLOAT(this)). If data() fails or the returned class is not scalar, generate an exception.
Returns:
Float64
Raises:
TypeError - Raised if data is not a scalar value

getError(self)

Get the error field. Returns EmptyData if no error defined.
Returns:
Data

getFloat(self)

Convert this data into a float32. Implemented at this class level by returning TDI data(F_FLOAT(this)).If data() fails or the returned class is not scalar, generate an exception.
Returns:
Float32
Raises:
TypeError - Raised if data is not a scalar value

getHelp(self)

Returns the result of TDI GET_HELP(this). Returns EmptyData if no help field defined.
Returns:
Data

getInt(self)

Convert this data into a int. Implemented at this class level by returning TDI data(LONG(this)).If data() fails or the returned class is not scalar, generate an exception.
Returns:
Int32
Raises:
TypeError - Raised if data is not a scalar value

getIntArray(self)

Convert this data into a int array. Implemented at this class level by returning TDI data (LONG(this)). If data() fails or the returned class is not array, generates an exception. In Java and C++ will return a 1 dimensional array using row-first ordering if a multidimensional array.
Returns:
Int32Array

getLong(self)

Convert this data into a long. Implemented at this class level by returning TDI data(QUADWORD(this)).If data() fails or the returned class is not scalar, generate an exception.
Returns:
Int64
Raises:
TypeError - if data is not a scalar value

getLongArray(self)

Convert this data into a long array. Implemented at this class level by returning TDI data(QUADWORD(this)). If data() fails or the returned class is not array, generates an exception. In Java and C++ will return a 1 dimensional array using row-first ordering if a multidimensional array.
Returns:
Int64Array

getShape(self)

Get the array dimensions as an integer array. It is implemented at this class level by computing TDI expression SHAPE(this). If shape fails an exception is generated.
Returns:
Int32Array

getShort(self)

Convert this data into a short. Implemented at this class level by returning TDI data(WORD(this)).If data() fails or the returned class is not scalar, generate an exception.
Returns:
Int16
Raises:
TypeError - Raised if data is not a scalar value

getShortArray(self)

Convert this data into a short array. Implemented at this class level by returning TDI data(WORD(this)). If data() fails or the returned class is not array, generates an exception. In Java and C++ will return a 1 dimensional array using row-first ordering if a multidimensional array.
Returns:
Int16Array

getString(self)

Convert this data into a STRING. Implemented at this class level by returning TDI data((this)). If data() fails or the returned class is not string, generates an exception.
Returns:
String

getUnits(self)

Return the TDI evaluation of UNITS_OF(this). EmptyData is returned if no units defined.
Returns:
Data

mayHaveChanged(self)

return true if the represented data could have been changed since the last time this method has been called.
Returns:
Bool

pop_dollar_value(self)

Pop $value for expression evaluation
Returns:
Data

push_dollar_value(self)

Set $value for expression evaluation
Returns:
None

raw_of(self)

Return raw part of object
Returns:
Data

serialize(self)

Return Uint8Array binary representation.
Returns:
Uint8Array

setError(self, error)

Set the Error field for this Data instance.
Returns:
None

setHelp(self, help)

Set the Help field for this Data instance.
Returns:
None

setTdiVar(self, tdivarname)

Set tdi public variable with this data
Parameters:
tdivarname - The name of the public tdi variable to create
           (type=string)
Returns:
Returns new value of the tdi variable
           (type=Data)

setUnits(self, units)

Set units
Returns:
None

sind(self)

Return sin() of data assuming data is in degrees
Returns:
Float32Array

units_of(self)

Return units part of the object
Returns:
Data

value_of(self)

Return value part of object
Returns:
Data

Static Method Details

compile(expr, *args)

Static method (routine in C++) which compiles the expression (via TdiCompile()) and returns the object instance correspondind to the compiled expression.
Returns:
Data

deserialize(data)

Return Data from serialized buffer.
Parameters:
data - Buffer returned from serialize.
           (type=Uint8Array)
Returns:
Data

execute(expr, *args)

Execute and expression inserting optional arguments into the expression before evaluating
Returns:
Data

getTdiVar(tdivarname)

Get value of tdi public variable
Parameters:
tdivarname - The name of the publi tdi variable
           (type=string)
Returns:
Data

makeData(value)

Return MDSplus data class from value.
Parameters:
value - Any value
Returns:
Data

Generated by Epydoc 2.1 on Wed Aug 18 13:35:32 2010 http://epydoc.sf.net