Difference between revisions of "Binary Operators"
Line 1: | Line 1: | ||
The binary operators in Libisis can be used in many different ways. They may be used with [[IXTdataset_1d]] and [[IXTdataset_2d]] objects. All operators act in a similar, intuitive way. The lists below give the most general case wherever possible (i.e. does not distinguish between [[IXTdataset_1d]] and [[IXTdataset_2d]] objects. | The binary operators in Libisis can be used in many different ways. They may be used with [[IXTdataset_1d]] and [[IXTdataset_2d]] objects. All operators act in a similar, intuitive way. The lists below give the most general case wherever possible (i.e. does not distinguish between [[IXTdataset_1d]] and [[IXTdataset_2d]] objects. | ||
− | |||
− | + | * Operations are performed on the signal data of the object | |
+ | * The data in an [[IXTdataset_1d ]] object can be thought of as a single row of data | ||
+ | * The signal data in an [[IXTdataset_2d]] ojbect can be thought of as a matrix, with x data corresponding to columns and y data corresponding to rows. | ||
+ | |||
+ | |||
+ | In the examples, the following conventions will be used: | ||
+ | * ''' Bold ''' represents an array or matrix | ||
+ | * n is a number | ||
+ | * w is an [IXTdataset_1d] | ||
+ | * ww is an [[IXTdataset_2d]] | ||
+ | * i, j, k represent indicies of the matricies | ||
+ | |||
+ | |||
+ | ==operation_x and operation_y methods== | ||
These functions are | These functions are | ||
Line 47: | Line 59: | ||
− | gives | + | where n is a one dimensional array of objects and ww is an array of [[IXTdataset_2d]], gives |
+ | |||
+ | |||
+ | '''new_ww(i).signal(j,k) = ww(i).signal(j,k) + a(j)''' | ||
+ | |||
+ | |||
+ | ==Operation Between a Dataset and a Single Number== | ||
+ | |||
+ | This operation is | ||
+ | |||
+ | <pre>>> wnew = w + n | ||
+ | >> wwnew = ww + n</pre> | ||
+ | |||
+ | The operation is performed on each signal element and the single number such that | ||
+ | |||
+ | new_signal(i,j) = signal(i,j) + number |
Revision as of 14:35, 17 March 2008
The binary operators in Libisis can be used in many different ways. They may be used with IXTdataset_1d and IXTdataset_2d objects. All operators act in a similar, intuitive way. The lists below give the most general case wherever possible (i.e. does not distinguish between IXTdataset_1d and IXTdataset_2d objects.
- Operations are performed on the signal data of the object
- The data in an IXTdataset_1d object can be thought of as a single row of data
- The signal data in an IXTdataset_2d ojbect can be thought of as a matrix, with x data corresponding to columns and y data corresponding to rows.
In the examples, the following conventions will be used:
- Bold represents an array or matrix
- n is a number
- w is an [IXTdataset_1d]
- ww is an IXTdataset_2d
- i, j, k represent indicies of the matricies
operation_x and operation_y methods
These functions are
>> plus_x(a,b) >> plus_y(a,b) >> minus_x(a,b) >> minus_y(a,b) >> times_x(a,b) >> times_y(a,b) >> divide_x(a,b) >> divide_y(a,b)
These functions are methods of IXTdataset_2d objects.
operation_x(a,b)
- Forces any operation with a linear array to operate on the x columns of the signal data of an IXTdataset_2d object separately. Otherwise, this operation is the same as the normal operator.
example:
>> new_ww = plus_x(ww,n)
where n is a one dimensional array of objects and ww is an array of IXTdataset_2d, gives
new_ww(i).signal(j,k) = ww(i).signal(j,k) + a(k)
and similarly for the error information.
operation_y(a,b)
- Forces any operation with a linear array to operate on the y rows of the signal data of the IXTdataset_2d object separately. Otherwise, this operation is the same as the normal operator.
example:
>> new_ww = plus_y(ww, n)
where n is a one dimensional array of objects and ww is an array of IXTdataset_2d, gives
new_ww(i).signal(j,k) = ww(i).signal(j,k) + a(j)
Operation Between a Dataset and a Single Number
This operation is
>> wnew = w + n >> wwnew = ww + n
The operation is performed on each signal element and the single number such that
new_signal(i,j) = signal(i,j) + number