Identifier  plotaar

 Purpose     Plot the Auto Analysis Results

 Synopsis    plotaar, AAR-struct [,XAXIS=xaxis] [,YAXIS=yaxis]
                      [,RANGE=range] [,ITK=itk][,BAND=band] [,DET=det]
                      [,/ERRBAR] [,PSYM=psym] [,LINE=line] [,COLOR=color]
                      [,/STATUS | ,/FLAG, | ,RESET=reset]  [LNUMB=lnumb]
                      [,NOBANNER=nobanner | NOTEMPL=notempl] [,_extra=e]
                                 

 Arguments   Name      I/O  Type:       Description:
             -----------------------------------------------------------------
             AAR-struct I   struct    name of the AAR structure to be plotted
             xaxis      I   string    Select X-xaxis in units [def='wave']
                                      ('itk','wave','',...)
             yaxis      I   string    Select Y-xaxis in units [def='flux']
                                      ('flux','det',...)
             range      I   intarr(2) X-axis INDEX start/end value 
                                      [default=whole range]
             itk        I   intarr(2) Itk range selection
             band       I   intarr    Select detectorband (0,1..6, 0=all bands)
             det        I   intarr    Select detector(s) (1..52)
                                      If option det is specified, the option
                                      band is disabled! [Default all detectors]
             lnumb      I   intarr    Select Line number(s) (1..n)
             /status    I   --        Draw STATUS line below the plot
              reset     I   intarr    Colorline definition to show the resets
             /flag      I   --        Draw FLAG line below the plot (if no
                                      STATUS is defined)
             /errbar    I   --        If this qualifier is set, the plot 
                                      should include the standard deviation 
                                      as error bars.
             psym       I   integer   If set, draws a symbol for every datapoint,
                                      symbol is differend for differend det
                                      (psym=0 the symbols are not drawn)
                                      [default psym=1]
             line       I   intarr    If set, a linestyle is set
             color      I   intarr    A specific color can be choosen
                                      (color=0 means color=!p.color)
             /nobanner  I   --        If set nobanner is drawn
             /notempl   I   --        Normaly the plot is placed on a tem-
                                      plate. Overruled by this option.
             _extra     I   any       Extra plot keywords

 Returns     --

 Description This subroutine plots the AAR structure on the output device. 
             This is just a spectrum with wavelength in the abcissa and the 
             flux in the ordinate. 
             Optionally, error bars can be plotted. 

 Comment     PLOTAAR Callable routines overview:
             
             PLOTAAR
               --IS_AAR           check aar type
               --DET_SELECTION    check input parm det/band selection
                 --BAND2DET       band to detector conversion
               --RANGE_SELECTION  data range check /default settings
               --COLOR_SELECTION  color selection  /default settings
               --PSYM_SELECTION   psym selection   /default settings
               --LINE_SELECTION   line selection   /default settings
               --PLOT_TEMPLATE    Define screen/legend/status/flag layout
               --PLOT_INFO        Draw the banner (fits keys info) 
                 --READ_FITS_KEY  Header info on the screen
               --IA_LEGEND        Draw the plot legend near the plot
                 --CONV_DETBAND2NAME Conv detector number to name ('InSb ',..)
                 --STRTOK         Split textstring in substring
               --ERROR            Error message on the screen and retall

             PLOTAAR,/STATUS,/FLAG Extra:
               --PLOT_STATUS      Plot the status line unther the plot
                 --DECODE_RESET   Decode reset time interval
                   --TEST_STATUS  Test status word
                     --MAKE_STATUS  Create status word  
                 --IS_ERD         Check ERD type
               --PLOT_FLAG        Plot the flag line unther the plot
                 --IS_SPD         Ceck SPD type


 Example     ;Plot all detectors with symbol "." (fastest way to plot all data)
                 PLOTAAR, AAR        

             ;Split up per band, differend symbol per band [1..6]
                 PLOTAAR, AAR, band=0          

             ;Plot some detectors
                 PLOTAAR, AAR, det =[1,13,25,37,49,51]           

             ;Select itk range for xaxis='wave'
                 PLOTAAR, AAR,ITK=[1000,30000] 

             ;Show conversion itk<>wave
                 PLOTAAR,AAR,XAX='WA',ITK=[32000,35000],YAX='ITK'

             ;Select line number
                 PLOTAAR, AAR, LNUMB=[1,2]
          

 Category    PLOT

 Filename    plotaar.pro (module: plotaar)

 Author      N.J.M. Sijm

 Version     5.2

 History     1.0  27-06-94  NS  Creation date
             5.0  22-05-96  NS  Implement fast plot
             5.1  14-06-96  NS  Add key lnumb
             5.2  25-07-96  NS  Add aot_to_apband, yscaling dep off xrange