Difference between revisions of "Special Functions"

From LIBISIS
Jump to navigation Jump to search
Line 1: Line 1:
 
Some special functions exist that are useful when writing scripts that use Libisis
 
Some special functions exist that are useful when writing scripts that use Libisis
 +
  
 
==Contract Functions==
 
==Contract Functions==
 +
 
These functions are used to contract an array of datasets into a single dataset.  
 
These functions are used to contract an array of datasets into a single dataset.  
  
Line 12: Line 14:
  
 
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].
 
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.
 
These functions are used to expand a single [[IXTdataset_2d]] into an array of datasets.
  
Line 33: Line 37:
 
* Output will be an array, each element pertaining to one y row in the input  
 
* 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
 
* 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  
 
Conversion functions convert from one object type or data type to another  
  
Line 52: Line 58:
  
 
* Converts one dimension (x or y) from histogram data to point data
 
* 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  
 
Standard functions exist to help with plotting  
  

Revision as of 09:09, 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