|
User Documentation |
|||||||||
prev file | next file | ||||||||||
SUMMARY: fields | routine DETAILS: routine | ||||||||||
./toolbox dcresize.pro
dcresize |
procedure dcresize, dc, newsize, [/zero], beginning=beginning |
Change the size of an existing data container.
If new channels are added to the end of an existing data container, they are filled with the blanked value (not a number, NAN) unless the /zero flag is set (in which case they are replaced with zeros). If /beginning is set then the extra channels are added to the beginning of the data and reference_channel value is adjust accordingly.
This only works for spectrum data containers where the x-axis is linear in frequency and so the x-axis values are always well-determined when extending a spectrum data container.
; double the size of dc, new channels are filled with NAN nels = data_valid(dc) dcresize,dc,nels*2 ; back to its original size dcresize,dc,nels ; add 100 channels, fill with 0.0 dcresize,dc,(nels+100),/zero ; to use this, or any toolbox function, on a DC in the !g ; structure, do this dc = !g.s[0] nels = data_valid(dc) dcresizse,dc,nels+200
Parameters | |
dc |
The data container to resize. |
newsize |
The new number of channels. This must be > 0. |
Keywords | |
zero |
If set, any new channels are filled with zero instead of NAN. |
beginning |
. |