Produced by IDL 7.1.1
User Documentation

./guide
astack.pro

Last modification date:
Wed Sep 28 13:27:08 2016

astack

function astack([elem], [count=variable])

Function to return the value of a specific element of the stack.

Returns
-1 on error (out of limits), a warning message also appears.
Examples
A simple use of astack:
    ; stack contains [ 10,  12,  14,  20,  25, 28] to begin
    my_elem = astack(3)
    ; my_elem contains the value 20
 
A more substantive use. The following procedure averages all of the data from scans listed in the stack.
 pro myavg,_extra=extra
 freeze
 for i=0,!g.acount-1 do begin
     getnod,astack(i),plnum=0,units='Jy',_extra=extra
     accum
     getnod,astack(i),plnum=1,units='Jy',_extra=extra
     accum
 endfor
 ave
 unfreeze
 end
 
In this example, select is used with astack to flag data using flagrec. This is useful if the data isn't easily described using the parameters available in the flag procedure. The end result here is that all of the data having a source equal to "Orion" and polarization equal to "RR" in IF number 3 is flagged from channel 500 through channel 520.
   emptystack  ; clear the stack first
   select, source='Orion', polarization='RR', ifnum=3 ; populate the stack
   a = astack(count=count)
   if count gt 0 then flagrec,a,bchan=500,echan=520,idstring='RFI-Orion'
 
Version
$Id$

Parameters
elem
in, optional
long integer
The index of the element to return. If elem is omitted, the entire contents of the stack up through (!g.acount-1) is returned as an array.

Keywords
count
out, optional
variable
The number of elements returned (0, 1 or !g.acount).


Produced by IDLdoc 1.6 on Wed Sep 28 13:27:33 2016