next up previous contents index
Next: Default Header Variables Up: Variables Previous: The Rope to Hang

Index Variables

The variable FOUND refers to the number of observations in the index. It is declared Read-Only of course. Its main use is as a test variable for actions which should be performed only if something exists in the index. As an example, the following procedure reduces a mapping observing run by averaging all spectra at each position, and requires only two user input : the two steps in Lambda and Beta.

SAY "Procedure MAP.CLASS : reduce mapping observations by averaging all" -
"spectra for each point. Input required from user : XSTEP and YSTEP" -
"the map spacings in both directions"
!
LAS\FIND
SIC\IF (FOUND.EQ.0) THEN
    SIC\RETURN
SIC\ENDIF
SIC\DEFINE DOUBLE XMIN XMAX YMIN YMAX XSTEP YSTEP ! Local variables
!
! Determine offset extrema. 
LAS\GET FIRST
SIC\LET XMIN = OFF_LAMBDA
SIC\LET XMAX = OFF_LAMBDA
SIC\LET YMIN = OFF_BETA
SIC\LET YMAX = OFF_BETA
SIC\FOR I 2 TO FOUND
    LAS\GET NEXT
    SIC\LET XMIN = MIN(XMIN,OFF_LAMBDA)
    SIC\LET XMAX = MAX(XMAX,OFF_LAMBDA)
    SIC\LET YMIN = MIN(YMIN,OFF_BETA)
    SIC\LET YMAX = MAX(YMAX,OFF_BETA)
SIC\NEXT
!
! Now make map. XSTEP and YSTEP must be specified by user
SAY "Enter step in Lambda"
LET XSTEP =
SAY "Enter step in Beta"
LET YSTEP = 
SIC\FOR XOFF XMIN TO XMAX BY XSTEP
    SIC\FOR YOFF YMIN TO YMAX BY YSTEP
        LAS\FIND/OFFSET XOFF YOFF
        SIC\IF (FOUND.GT.0) THEN
            LAS\SUM
            LAS\WRITE
        SIC\ENDIF
    SIC\NEXT
SIC\NEXT
SIC\RETURN

The FIND  command does not return an error, but set FOUND = 0, if it finds nothing. A second variable related to the index is the INDEX array, of dimension FOUND, which contains the observation numbers of all observations in the index.



lucas@iram.fr