PDS_VERSION_ID       = PDS3                                                   
LABEL_REVISION_NOTE          = "2003-09-30 Cornell:carcich"                   
RECORD_TYPE          = STREAM                                                 
OBJECT               = TEXT                                                   
  PUBLICATION_DATE   = 2003-09-30                                             
  NOTE               = "                                                      
    CSCALFIL_README.TXT file for CONTOUR Archive Volume                       
"                                                                             
END_OBJECT                                                                    
END                                                                           
                                                                              
####### File _CSCALFIL_README.TXT_                                            
                                                                              
      CONTOUR CRISP IR SPECTROMETER CALIBRATION PIPELINE                      
     Joseph Harrington and James F. Bell III, Cornell University              
               9 December 2002                                                
                                                                              
This is the skeleton calibration pipeline for COmet Nucleus TOUR              
(CONTOUR) Remote Imager Spectrometer InfraRed (CRISP-IR) spectrometer         
data.  The job of the pipeline is to apply the best known calibration         
to the raw data, correcting instrument effects and converting to              
physical units.  It also decodes some of the encoded raw header               
keywords, such as array temperature, into SI units.                           
                                                                              
Most of the calibration data were to have come from an in-space               
calibration routine that would have run for the first time shortly            
after transfer-orbit injection.  Unfortunately, the spacecraft was            
lost during the transfer-orbit injection burn.  The pipeline is thus a        
skeleton with hooks for routines to apply, e.g., dark signal and flat         
field corrections.                                                            
                                                                              
The pipeline takes input two ways: it either reads a named FITS file          
from the CONTOUR Science Data Center (SDC) or it accepts a FITS data          
structure.  The FITS data structure option allows the SDC to calibrate        
data as it arrives, immediately following conversion to FITS format,          
without rereading the file.  For more information on FITS format, see         
http://fits.gsfc.nasa.gov/ or the FITS Standard - NOST 100-2.0                
                                                                              
All calibration parameters are recorded in the header by the pipeline         
and these values can override the default values on subsequent runs.          
The user may also set variables when calling the pipeline, and these          
will override those set in the header.  The same image may thus be            
calibrated different ways on successive runs, if the user desires.  We        
do not anticipate that science users will need to use this capability;        
it is there for the convenience of those implementing the calibration.        
                                                                              
The pipeline is written in the Interactive Data Language (IDL), from          
Research Systems, Inc., a Kodak company.                                      
                                                                              
Pipeline routines (in idl directory):                                         
CSCAL            base routine, called by user                                 
CSKEYS           standardizes header keywords                                 
CSREADFITS       applies FITS scaling                                         
FITSKEYUPD       updates/defaults FITS header keywords                        
GENREADIMAGE     reads FITS file                                              
INT              truncates a floating-point value                             
KEYWORD_DEFINED  tests whether a variable is defined                          
MASKMEDFILTLEV   generates bad pixel mask with median filter                  
N_AXIS           determines the number of elementss on a given array axis     
                                                                              
In addition, the following external routines are used:                        
                                                                              
IDL Astronomy Library (in idl/astron directory):                              
DIST_CIRCLE                                                                   
FXPAR                                                                         
FXPOSIT                                                                       
GETTOK                                                                        
IEEE_TO_HOST                                                                  
IS_IEEE_BIG                                                                   
ISARRAY                                                                       
MRD_HREAD                                                                     
MRD_SKIP                                                                      
MRDFITS                                                                       
SXADDHIST                                                                     
SXADDPAR                                                                      
SXPAR                                                                         
VALID_NUM                                                                     
                                                                              
Maskinterp bad pixel interpolation package (in idl/maskinterp-1.2 directory): 
COORD                                                                         
DISC                                                                          
MASKINTERP                                                                    
TWOORDFIT                                                                     
                                                                              
The distribution files for these two external packages are in the             
externdist directory.  They are in gzip-compressed tar format.  Their         
internet origins are:                                                         
    ftp://oobleck.astro.cornell.edu/maskinterp-1.2.tar.gz                     
    http://idlastro.gsfc.nasa.gov/astron.dir.tar.gz                           
                                                                              
Example:                                                                      
                                                                              
cd cscalpipe                                                                  
idl                                                                           
@init.idl                                                                     
filename = projtop+'/data/355_CSBML_WSM_02_0001.fit'                          
im       = cscal(filename)                                                    
header   = im.header                                                          
data     = im.data                                                            
print, header                                                                 
print, sxpar(header, 'CSF1TEMP')                                              
tvscl, data                                                                   
                                                                              
Documentation for the parameters in the pipeline is in the individual         
routines, as is documentation for the minimal processing applied to           
the data.