ISIS Application Documentation
    Radiometric correction of Cassini VIMS camera images. 
  
 
          Description
        
    This program applies a dark current and a flat field correction to images,
    then converts the output units to either specific energy or I/F.
     
    Dark Current:
    The dark current correction for VIS consists of reading a
    binary ".tab" file from $cassini/calibration/vims and subtracting derived values from
    this file. 
    The dark current correction for IR consists of reading the sideplane data (stored in a
    SideplaneIr table in the cube) and subtracting this from the input cube. If "CompressorId" is
    available then the sideplane data was already subtracted from the file, but the linear fit
    capabilities are still available to re-do the dark current with a linear fit instead of the
    default subtraction. If spectral summing is on then no dark current can be applied.
    If spectral editing is on then the linear fit on the dark current can not be applied.
    Sideplane keywords for IR are as follows:
     
      - None = No dark current subtraction (applied by the instrument)
 
      - Sideplane = Sideplane was subtracted only without fitting a line
 
      - Fit Delta = Sideplane was previously subtracted so the difference between the
    sideplane and linear fit function subtracted
 
      - Fit = A linear fit was applied to the dark current values and the result was subtracted
 
     
    
    Flat Field:
    For both VIS and IR this determines the correct file from $cassini/calibration/vims/flatfield
    and divides the input data by the flat field data.
     Subareas
    The offset and swath keywords will be respected by running "crop" on the calibration
    files appropriately and using the cropped calibration files.
    
 
          Categories
        
 
              History
          
| Steven Lambright | 2009-06-24 | 
      Original version
     | 
 
| Steven Lambright | 2009-08-03 | 
      The solar distance calculation is now much more likely to succeed
     | 
 
| Steven Lambright | 2009-12-16 | 
      Better error handling - fewer temporary files left around
     | 
 
| Steven Lambright | 2009-12-17 | 
      Sped up program by not searching a pvl much more than necessary,
      improved error messages
     | 
 
| Steven Lambright | 2010-02-19 | 
      Now closing calibration files when done with them
     | 
 
| Steven Lambright | 2010-07-23 | 
      If the solar remove coefficient cannot be calculated then a default
      value will be used now instead of giving an error
     | 
 
| Steven Lambright | 2010-11-23 | 
      Added an option to not do dark current correction
     | 
 
| Steven Lambright | 2012-09-28 | 
      Fixed the default value for the solar remove coefficient. Without this fix, some resulting
      files had I/F values much larger than 1.0. Fixes #1143.
     | 
 
| Tracie Sucharski | 2013-09-09 | 
      The Ir exposure duration in the Vims labels is incorrect due to the inaccuracy of the Vims
      clock.  The Ir exposure duration needs a correction factor of 1.01725 applied before using.
      References #1759.
     | 
 
| Tyler Wilson | 2016-09-15 | 
      Updated vimscal to make use of RC19 files.  Instead of having one calibration
      cube for solar/specific energy/wavecal data, there are now 14 cubes (one for each year in
      the range 2004:2017).  This is because of the wavelength calibration shift as
      a function of time described in "The VIMS Wavelength and Radiometric Calibration
      White Paper", Roger N. Clark, Robert H. Brown, Dyer M. Lytle.  Draft submitted to the
      NASA Planetary Data System: 07/19/2016.   Changes
      to the application are minimal.  The BandBin:Center keyword value was also updated
      for all calibrated cubes to reflect the new knowledge concerning wavelength shifts.
      Fixes #4370.
     | 
 
| Tyler Wilson | 2017-01-03 | 
      Added the ability for users to select which flatfield file they want to use during
      calibration.  The default option is to continue using the original flatfield files.  
      References #4370.
     | 
 
 
 | 
 
 
                Parameter Groups
            
Files
| 
                    Name
                     | 
                    Description
                     | 
 
| FROM | 
          Input Isis cube
         | 
 
| TO | 
           Output Isis cube
         | 
 
 
Options
 | 
 
Files:
                        FROM
                         Description
                       
          Use this parameter to choose an Isis cube to be calibrated.  To ensure 
          that it contains all needed keywords in its label, input cube should 
          have been imported using vims2isis and, if "I/F" is chosen, input cube 
          must have been run through spiceinit application.
        
| 
                             Type
                            | cube | 
| 
                               File Mode
                              | input | 
| 
                               Filter
                              | 
          *.cub
         | 
 
 
Files:
                        TO
                         Description
                       
           Use this parameter to select the output filename of the calibrated 
           Isis cube.
        
| 
                             Type
                            | cube | 
| 
                               File Mode
                              | output | 
| 
                               Pixel Type
                              | real | 
| 
                               Filter
                              | 
           *.cub
         | 
 
 
Options:
                        UNITS
                         Description
                       
        
| 
                             Type
                            | string | 
| 
                               Default
                              | IOF | 
| 
                               Option List:
                              | 
| 
                                   Option | 
                                   Brief | 
                                   Description | 
 
| SPECENERGY | Specific Energy | 
              This option indicates that the output is in terms of specific energy (ergs/sec/spectel). 
             | 
 
| IOF | I/F | 
              This option indicates that the output is in terms of solar flux (I/F). 
              Input cube must have been run through the spiceinit application.
             | 
 
 
 | 
 
 
Options:
                        FLATFIELD
                         Description
                       
        
| 
                             Type
                            | string | 
| 
                               Default
                              | 2006Flat | 
| 
                               Option List:
                              | 
| 
                                   Option | 
                                   Brief | 
                                   Description | 
 
| 2006FLAT | 2006 Flatfield | 
             | 
 
| 2006SSFLAT | 2006 Spectrally Summed Flatfield | 
               | 
 
| 2013FLAT | 2013 Flatfield | 
             | 
 
 
 | 
 
 
Options:
                        IRORIGDARK
                         Description
                       
          By default Isis will fit a line to the dark current values, on each band, across the lines since
          there is one dark value per line. The linear fit value will be applied correctly even if a dark
          current was applied to this cube beforehand. This disables the line fitting for the dark current.
          This parameter has no effect for VIS cubes.
        
| 
                             Type
                            | boolean | 
| 
                               Default
                              | false | 
 
 
Options:
                        DARK
                         Description
                       
          If this is false then no dark current values will be subtracted.
        
| 
                             Type
                            | boolean | 
| 
                               Default
                              | true |