Viewing contents of file '../idllib/iuedac/iuelib/pro/assess.pro'
;******************************************************************************
;+
;*NAME:
;
;       ASSESS       (RDAF General Production Library)       (18-DEC-83)
;
;*CLASS:
;
;       History
;
;*CATEGORY:
;
;*PURPOSE:
;
;       List IUESIPS software changes to the terminal which may affect the
;          input image file
; 
;*CALLING SEQUENCE:
;
;       ASSESS,IMAGET
;
;*PARAMETERS: 
;
;       IMAGET   (REQ) (I) (1) (S)
;          Required input string for disk file name of processed IUE data file, 
;          i.e. 'SWP25787L'
; 
;*EXAMPLES:
;
;       ASSESS,'SWP25787L'
;
;*SYSTEM VARIABLES USED:
;
;*INTERACTIVE INPUT:
;
;SUBROUTINES CALLED:
;
;	PARCHECK
;	LABEL
;	IPDATA
;	HISSORT1
;	JULDATE
;
;*FILES USED:
;
;     IMAGET  (I)
;     !iuer.dat histgraph.tab  (I)
;          (opened by HISSORT1 subroutine)
;     !iuer.dat bargraph.tab   (I)
;
;*SIDE EFFECTS:
; 
;*NOTES
;
;     ASSESS relies on the header label to determine date of processing and type
;     of processing performed. Missing label information will result in a less
;     accurate listing of relevant configurations. Note that some configuration
;     entries only refer to changes to the header label and some may only
;     pertain to a small number of images. The user however, should make sure
;     that the listed software changes do not affect their interpretation
;     or analysis of the IUE data.
;     Input image files which were processed after the end date of the
;     latest configuration entry stored in HISTORY.DAT will (of course) not
;     show any pertinent entries.
;
;     	tested with IDL Version 2.1.0 (sunos sparc)	16 Jul 91
;	tested with IDL Version 2.1.0 (ultrix mispel)	N/A
;     	tested with IDL Version 2.1.0 (vms vax)		16 Jul 91
; 
;*PROCEDURE:
;
;     Lines of the header label are written out using the routine LABEL. The
;     camera, station number, and image number are then extracted using the
;     subroutine IDTYPE. Procedure IPDATA is called to extract information
;     from the history portion of the header label including: processing date,
;     scheme name and aperture type. Procedure JULDATE converts date to julian
;     date. The julian date is then compared to entries in the BARGRAPH.TAB
;     file (created by BARGRAPH.PRO) to determine valid configuration entries.
;     A further sorting is done by procedure INSTRUCT which uses the header
;     label information and entries from the HISTGRAPH.TAB file to determine
;     entries to be output to the users terminal. See documentation for
;     BARGRAPH.PRO and HISTGRAPH.PRO for format of implicit input files.
; 
;*MODIFICATION HISTORY:
;
;      Written by S. Heap, 18-DEC-83
;      History file updated, modified to handle multiple entries for
;        one configuration and uses Histgraph.Tab instead of History.Dat
;        by R. Thompson  added to [210021] on 12-19-83
;      Modified to set 'ENTRY' array for Vilspa images and not list any
;         entries with an 'X' flag.  RWT 6-15-84
;      Modified 9-2-84 RWT to update array ENTRY in accord with changes
;         made to BARGRAPH.TAB and HISTGRAPH.TAB
;      Modified 12-28-84 RWT remove compile of COMPOSE, changes references
;         from [210,23] to [210,3] and implement in IUER_PROD:.
;      Modified 4-26-85 RWT to correct search of scheme name due to
;         inadvertent error in IUESIPS processing schemes
;      Configuration entries updated in [210,23] RWT 4-28-85
;      Modified to use external routine IPDATA to replace subroutines
;         ITYPE & IPDATA RWT 5-16-85
;      Configuration entries updated with information received from
;         VILSPA RWT 9-17-85
;      DIDL modified - remove REORDER and use # for @ RWT 11-1-85
;      Increase ENTRY array to handle 1986 & later images RWT 5-9-86
;      Modified 6-15-84 RWT to allow processing of images not containing the
;         processing date in header label 
;      Correct problem with 1978 images & use VAX assignment
;         statements RWT 4-3-87
;      Remove JULDATE and INSTRUCT subroutines and change
;         INSTRUCT procedure to HISSORT1  RWT 6-19-87
;      Add Rdaf prolog HAA 3-8-88
;      Add procedure call listing RWT 6-9-88
;      1-2-90 RWT UNIX mods: file access updated, convert to lower case. 
;      4-10-91 KBC modify filename structure based on operating system type
;      5-29-91 PJL added PARCHECK and updated prolog
;      7-16-91 PJL changed logical; tested on SUN and VAX; updated prolog
;     2 Sep 94 LLT replace getenv(IUER_DAT) with !iuer.dat
;-
;*****************************************************************************
 pro assess,imaget
;
 npar = n_params(0)
 if npar eq 0 then begin
    print,' ASSESS,IMAGET'
    retall
 endif  ; npar
 parcheck,npar,1,'ASSESS'
;
; print out iuesips portion of label
;
 bl = string(32b)
 dash = string(bytarr(65) + 45b)
 print,bl
 print,bl & print,'Observation file ', imaget
 print,bl & print,dash
 print,' Image processing portion of vicar label'
 print,dash & print,bl
 label,imaget,1,3 & print,bl 
 label,imaget, 101, 0
 print,dash & print,bl 
;
; get main characteristics of imaget & image processing info
;
 ipdata,imaget,type,sname,apname,date,sdate
 if sdate ne ' ' then print,'Processing date: ',sdate
 if sname ne ' ' then print,'Scheme name: ',sname
 if apname ne ' ' then print,'Aperture: ',apname
;
; converts input date (yr,month,day,hr,min) to julian date
;
 juldate,date,jd
;
; write out processing station
;
 station=type(0)>1<2
 if station eq 1 then obs='Goddard' else obs='Vilspa'
 print,'Observation made at ', obs
;
; get the iuesips history bargraph , given the obs. station
;
 openr,/GET_LUN,lun1,!iuer.dat + 'bargraph.tab'
 rec=assoc(lun1,fltarr(200))
 c=rec(1)
 if station eq 1 then start=rec(2) else start=rec(4)
 if station eq 1 then finish=rec(3) else finish=rec(5)
 free_lun,lun1
;
; extract the configurations for this imaget
;
 valid=where( (jd ge start) and (jd le finish),count) ;entrys within time limits
 if (count gt 0) then begin
    config = c(valid)               ;valid configuration numbers 
    for jj=1,12 do print,bl
;
; set up limit file and select config. for printing
;
    entry = intarr(15)
    if station eq 1 then begin  ;gsfc entries
       entry = entry + 235       ;set defaults to latest entry
       entry([0,1,2,3,4]) = [1,77,115,149,189]
    endif else begin            ;vilspa entries
       entry = entry + 139       ;set defaults to latest entry
       entry([0,1,2,3]) = [1,27,95,103]
    endelse  ; station
    hissort1,type,config,sname,apname,date,entry 
 endif else print,'No configuration entries found'
;
 print,' '
 return
 end  ; assess