Difference between revisions of "Special Functions"

From LIBISIS
Jump to navigation Jump to search
 
Line 2: Line 2:
  
 
==Contract Functions==
 
==Contract Functions==
 +
These functions are used to contract an array of datasets into a single dataset.
  
contract_d2d
+
<pre>>> wwout = contract(ww)</pre>
 +
 
 +
* ww is an array of [[IXTdataset_2d]] objects
 +
* wwout is a single [[IXTdataset_2d]] object
 +
* Two datasets must have matching x dimensions
 +
* Each element of ww will be appended to the y dimension in the previous ww
 +
 
 +
For instance, if a dataset has ww(1).x = [1, 2, 3, 4] ww(1).y = [1, 2, 3, 4] ww(2).x = [1, 2, 3, 4] ww(2).y = [6, 7, 8] then wwout will be a dataset with wwout.x = [1, 2, 3, 4] and wwout.y = [1, 2, 3, 4, 6, 7, 8].
  
 
==Expand Functions==
 
==Expand Functions==
 +
These functions are used to expand a single [[IXTdataset_2d]] into an array of datasets.
 +
 +
<pre>>> wwout = expand_d2d(ww)
 +
>>wwout = expand_listd2d(ww, list)</pre>
 +
 +
* Input is an [[IXTdataset_2d]] object
 +
* Output is an [[IXTdataset_2d]] object
 +
* Output will be an array, each element containing just one y value
 +
* If list is given, only the y indicies in list will be expanded
 +
 +
For instance, if a dataset ww has y values ww.y = [32, 44, 55, 66] and list was [2, 3] then wwout will be a 2 element array of [[IXTdataset_2d]] objects with wwout(1).y = 44 and wwout(2).y = 55
 +
 +
<pre>>> wout = expand_d1d(ww)
 +
>> wout = expand_listd1d(ww, list)</pre>
  
expand_d2d expand_listd2d expand_d1d expand_listd1d
+
* Input is an [[IXTdataset_2d]] object
 +
* Output is an [[IXTdataset_1d]] object
 +
* Output will be an array, each element pertaining to one y row in the input
 +
* If list is give, only the y indicies in list will be expanded
  
 
==Conversion Functions==
 
==Conversion Functions==
 +
Conversion functions convert from one object type or data type to another
  
oned_to_twod hist2point, hist2point_x, hist2point_y noisify
+
<pre>>> wwout = oned_to_twod(w)</pre>
 +
 
 +
* Input is an array of [[IXTdataset_1d]] objects
 +
* Output is an [[IXTdataset_2d]] object or array of [[IXTdataset_2d]] objects
 +
* Output will contain one y row for each element of the input
 +
* y values will be [1, 2, 3 ...]
 +
* x values in output will be the same as input
 +
* Signal values in output will be the same as input
 +
* If possible, the output dataset will be contracted to a single [[IXTdataset_2d]] object
 +
 
 +
<pre>>> wout = hist2point(w)
 +
>> wwout = hist2point_x(ww)
 +
>> wwout = hist2point_y(ww)</pre>
 +
 
 +
* Converts one dimension (x or y) from histogram data to point data
  
 
==Functions to Aid Plotting==
 
==Functions to Aid Plotting==
 +
Standard functions exist to help with plotting
 +
 +
<pre>>>[xlab, ylab] = make_label(w)
 +
>> [xlab, ylab, zlab] = make_label(ww)</pre>
  
make_label
+
* xlab is the label for the x axis
 +
* ylab is the label for the y axis
 +
* zlab is the label for the z axis
 +
* w is an [[IXTdataset_1d]] object
 +
* ww is an [[IXTdataset_2d]] object

Revision as of 09:08, 19 March 2008

Some special functions exist that are useful when writing scripts that use Libisis

Contract Functions

These functions are used to contract an array of datasets into a single dataset.

>> wwout = contract(ww)
  • ww is an array of IXTdataset_2d objects
  • wwout is a single IXTdataset_2d object
  • Two datasets must have matching x dimensions
  • Each element of ww will be appended to the y dimension in the previous ww

For instance, if a dataset has ww(1).x = [1, 2, 3, 4] ww(1).y = [1, 2, 3, 4] ww(2).x = [1, 2, 3, 4] ww(2).y = [6, 7, 8] then wwout will be a dataset with wwout.x = [1, 2, 3, 4] and wwout.y = [1, 2, 3, 4, 6, 7, 8].

Expand Functions

These functions are used to expand a single IXTdataset_2d into an array of datasets.

>> wwout = expand_d2d(ww)
>>wwout = expand_listd2d(ww, list)
  • Input is an IXTdataset_2d object
  • Output is an IXTdataset_2d object
  • Output will be an array, each element containing just one y value
  • If list is given, only the y indicies in list will be expanded

For instance, if a dataset ww has y values ww.y = [32, 44, 55, 66] and list was [2, 3] then wwout will be a 2 element array of IXTdataset_2d objects with wwout(1).y = 44 and wwout(2).y = 55

>> wout = expand_d1d(ww)
>> wout = expand_listd1d(ww, list)
  • Input is an IXTdataset_2d object
  • Output is an IXTdataset_1d object
  • Output will be an array, each element pertaining to one y row in the input
  • If list is give, only the y indicies in list will be expanded

Conversion Functions

Conversion functions convert from one object type or data type to another

>> wwout = oned_to_twod(w)
  • Input is an array of IXTdataset_1d objects
  • Output is an IXTdataset_2d object or array of IXTdataset_2d objects
  • Output will contain one y row for each element of the input
  • y values will be [1, 2, 3 ...]
  • x values in output will be the same as input
  • Signal values in output will be the same as input
  • If possible, the output dataset will be contracted to a single IXTdataset_2d object
>> wout = hist2point(w)
>> wwout = hist2point_x(ww)
>> wwout = hist2point_y(ww)
  • Converts one dimension (x or y) from histogram data to point data

Functions to Aid Plotting

Standard functions exist to help with plotting

>>[xlab, ylab] = make_label(w)
>> [xlab, ylab, zlab] = make_label(ww)
  • xlab is the label for the x axis
  • ylab is the label for the y axis
  • zlab is the label for the z axis
  • w is an IXTdataset_1d object
  • ww is an IXTdataset_2d object