Difference between revisions of "Data Manipulation Functions"
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
<pre>>> wnew = shift(w, xshift) | <pre>>> wnew = shift(w, xshift) | ||
− | >> | + | >> wwout = shift_x(ww, xshift) |
− | >> | + | >> wwout = shift_y(ww, yshift) |
− | >> | + | >> wwout = shift_xy(ww, xshift, yshift) |
− | >> | + | >> wout = scale(w, factor) |
− | >> | + | >> wwout = scale_x(ww, factor) |
− | >> | + | >> wwout = scale_y(ww, factor) |
− | >> | + | >> wout = flip(w) |
− | >> | + | >> wwout = flip_x(ww) |
− | >> | + | >> wwout = flip_y(ww)</pre> |
==Shift Functions== | ==Shift Functions== | ||
Line 42: | Line 42: | ||
==Scale Functions== | ==Scale Functions== | ||
Multiplies one of the independent variable arrays (x or y) by a constant. | Multiplies one of the independent variable arrays (x or y) by a constant. | ||
− | + | ||
+ | <pre>>> wwout = scale_x(w, xscale) | ||
+ | >> wwout = scale_y(ww, yscale) | ||
+ | >> wwout = scale(ww, xyscale)</pre> | ||
+ | |||
+ | * Input is an [[IXT_dataset_2d]] object | ||
+ | * Output is an [[IXT_dataset_2d]] object | ||
+ | * Scales x by factor xscale | ||
+ | * Scales y by factor yscale | ||
+ | * Scales both x and y by amount xyscale | ||
+ | |||
+ | |||
+ | <pre>>> wout = scale(w, xscale)</pre> | ||
+ | |||
+ | * Input is an [[IXTdatset_1d]] object | ||
+ | * Output is an [[IXTdataset_1d]] object | ||
+ | * scales x by an amount xscale | ||
+ | |||
+ | ''' Example: ''' | ||
+ | |||
+ | |||
+ | >> wwout = scale_y(ww, 4) | ||
+ | |||
+ | |||
+ | will multiply every y value in wwout by 4 | ||
+ | |||
==Flip Functions== | ==Flip Functions== | ||
+ | All data, including associated signal and error data is reversed in the order it appears in the dataset. |
Revision as of 15:33, 17 March 2008
Data manipulation functions change the data in some way, such as scaling or flipping it. The functions available are
>> wnew = shift(w, xshift) >> wwout = shift_x(ww, xshift) >> wwout = shift_y(ww, yshift) >> wwout = shift_xy(ww, xshift, yshift) >> wout = scale(w, factor) >> wwout = scale_x(ww, factor) >> wwout = scale_y(ww, factor) >> wout = flip(w) >> wwout = flip_x(ww) >> wwout = flip_y(ww)
Shift Functions
These functions add a value to one of the independent variable arrays (x or y), leaving any related data (such as the signal data) untouched. For instance if an x array, [10, 20, 30, 40, 50], is shifted by 2 the output x array will be [12, 22, 32, 42, 52].
>> shift_x(ww, xshift) >> shift_y(ww,yshift) >> shift_xy(ww,xshift,yshift)
- Input is an IXTdataset_2d object
- Output is an IXTdataset_2d object
- Shifts x data by amount xshift
- Shifts y data by amount yshift
>> shift(w, xshift)
- Input is an IXTdataset_1d object
- Output is an IXTdataset_1d object
- Shifts x data by amount xshift
Example:
>> wout = shift_x(ww, 4)
Every x value in wout will have 4 added to them
Scale Functions
Multiplies one of the independent variable arrays (x or y) by a constant.
>> wwout = scale_x(w, xscale) >> wwout = scale_y(ww, yscale) >> wwout = scale(ww, xyscale)
- Input is an IXT_dataset_2d object
- Output is an IXT_dataset_2d object
- Scales x by factor xscale
- Scales y by factor yscale
- Scales both x and y by amount xyscale
>> wout = scale(w, xscale)
- Input is an IXTdatset_1d object
- Output is an IXTdataset_1d object
- scales x by an amount xscale
Example:
>> wwout = scale_y(ww, 4)
will multiply every y value in wwout by 4
Flip Functions
All data, including associated signal and error data is reversed in the order it appears in the dataset.