| 
 | User Documentation | |||||||||
| prev file | next file | ||||||||||
| SUMMARY: fields | routine DETAILS: routine | ||||||||||
./guide astack.pro
| astack | 
Function to return the value of a specific element of the stack.
    ; 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'
| Parameters | |
| elem | 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 | The number of elements returned (0, 1 or !g.acount). |