KPL/IK

MDIS Instrument Kernel
===========================================================================

   This instrument kernel (I-kernel) contains references to mounting
   alignment, operating modes, and timing as well as internal and FOV
   geometry for the MESSENGER Mercury Dual Imaging System.


Version and Date
---------------------------------------------------------------

   The TEXT_KERNEL_ID stores version information of loaded project text
   kernels.  Each entry associated with the keyword is a string that
   consists of four parts: the kernel name, version, entry date, and type.
   For example, the frame kernel might have an entry as follows:

      TEXT_KERNEL_ID += 'MESSENGER_MDIS V1.6.0 17-APR-2015 IK'

   MDIS I-kernel Version:

      \begindata
      TEXT_KERNEL_ID += 'MESSENGER_MDIS V1.6.0 17-APR-2015 IK'
      \begintext

   Version 1.6.0 -- April 17, 2015 -- Scott Turner

      Updated WAC color filter focal lengths per email communication from
      Bob Gaskell containing his latest efforts at reducing them from 
      surface calibration images.

   Version 1.5.0 -- February 26, 2015 -- Grant Stephens and Scott Turner

      Updated NAC focal length and distortion model. The new model is
      physically significant, but is expressed in terms supported by
      the pre-existing third order Taylor series.

   Version 1.4.0 -- July 19, 2013 -- Scott Turner and Grant Stephens

      Minor update to the MDIS WAC clear filter distortion model.
      Incorporated Gaskell's most recent estimates of the color 
      filter distortion.  Refined the WAC focal length thermal 
      calibration.

      Incorporated a preliminary model of the NAC focal length thermal 
      calibration.

      This release of the kernel should be used with version 2.3.0 
      of the MESSENGER orbiter frame kernel, along with the latest
      pivot C-kernels that capture the empirical temporal drift model.

   Version 1.3.1 -- September 27, 2012 -- Grant Stephens and Scott Turner

      Skipped 1.3.0 version per request from Susan Ensor.

      Section and keywords were added that describe the WAC's focal length
      as a function of focal plane temperature.  Values for the NAC were
      added for completeness, though they include no variation.

   Version 1.2.0 -- October 5, 2010 -- Lillian Nguyen

      Replaced the WAC distortion model and updated the WAC focal lengths.
      Changed the default WAC filter from the clear filter (filter 2) to 
      the morphology filter (filter 7).

   Version 1.1.2 -- November 2, 2009 -- Lillian Nguyen

      Clarified the text regarding the direction of the WAC distortion map.

   Version 1.1.1 -- September 30, 2009 -- Kris Becker

      Restored keyword value assignments that were accidentally commented
      out in the original release of the 1.1.0 kernel.

   Version 1.1.0 -- September 15, 2009 -- Lillian Nguyen

      Replaced the NAC distortion model and updated the NAC focal length.
      Corrected the text describing the origin of the filter focal length
      values.

   Version 1.0.0 -- June 18, 2008 -- Lillian Nguyen

      Added the MDIS distortion model description and keywords.
      Updated the focal length values and added filter focal lengths.
      Changed the pixel numbering from 0-based to 1-based.
      Renamed the PIXEL_SIZE keyword to PIXEL_PITCH and changed its
      units to millimeters.
      Added keywords to describe the binned image shift.

   Version 0.1.1 -- August 31, 2005 -- Scott Turner

      Updated the NAC instrument ID code to match the MSGR_MDIS_NAC
      frame ID code in the frame kernel.

   Version 0.1 -- August 1, 2005 -- Scott Turner

      Diagrams updated in preparation for the Earth fly-by release.
      An error in the field of view specifications for both the NAC
      and WAC were corrected.  Prior releases of this kernel had the
      full field of view angles encoded in the values where half angles
      should have been supplied.

   Version 0.0 -- November 23, 2004 -- Scott Turner

      Initial prototype release.


References
---------------------------------------------------------------

      1.   "Kernel Pool Required Reading"

      2.   MESSENGER Spacecraft Frames Definition Kernel

      3.   MESSENGER Project Web Page describing the instruments.

      4.   Excel spreadsheet from Scott Murchie regarding MDIS
           field of view extent and geometry.

      5.   Excerpt from Howard Taylor's MDIS calibration notebook
           pages 12-13.

      6.   Notes from a discussion with Ed Hawkins regarding MDIS
           FOV geometry and alignment.

      7.   Notes from a discussion with Scott Turner regarding the MDIS
           distortion model, and the MDIS addendum instrument kernel,
           mdisAddendum005.ti, used in USGS ISIS software.

      8.   "MESSENGER Mercury Dual Imaging System (MDIS) Experimental Data
           Record (EDR) Software Interface Specification (SIS)" V2G.

      9.   Java code developed by Scott Turner containing the NAC
           distortion model, and discussions with him about the model,
           Dec. 15, 2008. Also msgr_mdis_taylor_dist.ti, v1.0.0.

      10.  JHU/APL memo SIS-10-012 titled 'Updated Alignment Determination 
           for MESSENGER/MDIS'. 

      11.  Email from Robert Gaskell containing a description of the
           WAC color filter distortion model he developed from images
           of the Mercury surface acquired during the flybys dated 
           6/8/2010.
           
      12.  Discussion with Scott Turner 10/2010.
      
      13.  JHU/APL memo SIS-12-007 titled 'Results from Initial Thermal 
           Calibration of MESSENGER/MDIS'

      14.  Pending JHU/APL memo containing the updates to the camera
           model and alignment of MDIS.

      15.  K. Seidl, J. Knobbe, D. Schneider, and H. Lakner, "Distortion
           correction of all-reflective unobscured optical-power zoom 
           objective," Appl. Opt.  49, 2712-2719 (2010).

      16.  Email communication from Bob Gaskell containing the focal 
           length estimates for the WAC color filters from Oct. 2014.


Contact Information
---------------------------------------------------------------

   Direct questions, comments, or concerns about the contents of this kernel
   to:

      Grant Stephens, JHUAPL/SIS, (443)778-3584, Grant.Stephens@jhuapl.edu
      Scott Turner, JHUAPL/SIS, (443)778-1693, Scott.Turner@jhuapl.edu


Implementation Notes
---------------------------------------------------------------

   This file is used by the SPICE system as follows: programs that make use
   of this frame kernel must "load" the kernel normally during program
   initialization.  Loading the kernel associates the data items with
   their names in a data structure called the "kernel pool".  The SPICELIB
   routine FURNSH loads a kernel into the pool as shown below:

      FORTRAN: (SPICELIB)

         CALL FURNSH ( frame_kernel_name )

      C: (CSPICE)

         furnsh_c ( frame_kernel_name );

      IDL: (ICY)

         cspice_furnsh, frame_kernel_name

   In order for a program or routine to extract data from the pool, the
   SPICELIB routines GDPOOL, GIPOOL, and GCPOOL are used.  See [2] for
   more details.

   This file was created and may be updated with a text editor or word
   processor.


Naming Conventions
---------------------------------------------------------------

   All names referencing values in this I-kernel start with the characters
   'INS' followed by the NAIF MESSENGER spacecraft ID number (-236) and then
   followed by a NAIF three digit code for an MDIS camera (WAC = 800,
   NAC = 820).

   The remainder of the name is an underscore character followed by the
   unique name of the data item.  For example, the WAC boresight direction
   in the MSGR_MDIS_WAC frame (see [2]) is specified by:

      INS-236800_BORESIGHT

   The upper bound on the length of the name of any data item identifier
   is 32 characters.

   If the same item is included in more than one file, or if the same item
   appears more than once within a single file, the latest value supersedes
   any earlier values.


MDIS Description
---------------------------------------------------------------

   From [3]:

   This instrument consists of wide-angle and narrow-angle imagers that
   will map landforms, track variations in surface spectra and gather
   topographic information. A pivot platform will help point it in whatever
   direction the scientists choose. The two instruments will enable MESSENGER
   to "see" much like our two eyes do.


MDIS First Order Optical Parameters
---------------------------------------------------------------

   This section describes the focal length of the two imagers.  The NAC has
   a single focal length provided below; however, the WAC includes a series
   of color filters that alter the effective focal length of the camera. 
   These individual filter focal lengths are determined empirically and are
   included in the subsection entitled: 'WAC Color Filter Focal Lengths'.
   For convenience, a single focal length for the WAC 'as a whole' is included
   below with the NAC focal length.  This value is that of WAC filter 7, and 
   should only be used for coarse studies where a high degree of accuracy
   is not required. 

   After Mercury orbit insertion, when the thermal environment became more
   severe, a measurable variation of the WAC focal length as a function of 
   temperature became apparent.  The last subsection entitled: 'Focal Length
   as a Function of Temperature' captures the empirical model of this 
   variation determined from calibration images taken in orbit.  This model
   should be implemented when accuracy is required.

   Basic Optical Parameters:

      The first order optical parameters for the two cameras that constitute
      the MDIS imagers (from [5], [7], [9], [10], and [12]):

         ------------------------------     -----------     -----------
                   parameter                    WAC             NAC
         ------------------------------     -----------     -----------
          Effective Focal Length, mm          78.23670    549.1178195372703
             Estimated Uncertainty, mm         0.15            0.5
          Spectral Band, nm                   395-1040       700-800
          F/number                             10              22
         ------------------------------     -----------     -----------

      These values are given in the keywords below in the same units as
      the table above:

      Wide Angle Camera (WAC):

           \begindata

           INS-236800_FOCAL_LENGTH     = ( 78.23670  )
           INS-236800_FL_UNCERTAINTY   = (  0.15     )
           INS-236800_WAVELENGTH_RANGE = ( 395, 1040 )
           INS-236800_F/NUMBER         = ( 10        )

           \begintext

      Narrow Angle Camera (NAC):

           \begindata

           INS-236820_FOCAL_LENGTH     = ( 549.1178195372703 )
           INS-236820_FL_UNCERTAINTY   = (   0.5    )
           INS-236820_WAVELENGTH_RANGE = ( 700, 800 )
           INS-236820_F/NUMBER         = ( 22       )

           \begintext

   Individual Focal Lengths For WAC Color Filters:

      [10] gives the focal lengths of the MDIS filters in units of mm. The 
      clear filter focal length (INS-236802_FOCAL_LENGTH) was determined from
      analysis of star images. Other focal lengths were derived from the clear 
      filter focal length.

      Note: The values included below were determined during the cruise phase
      of the mission prior to Mercury orbit insertion where the thermal 
      environment was significantly colder than during the orbit phase.  For
      accurate focal lengths, especially at temperatures greater than -30C, 
      use the thermally varying calibration model provided in the next section.
   
           INS-236801_FOCAL_LENGTH     = ( 78.22164 )
           INS-236802_FOCAL_LENGTH     = ( 78.20293193298751 )
           INS-236803_FOCAL_LENGTH     = ( 78.05320 )
           INS-236804_FOCAL_LENGTH     = ( 78.09631 )
           INS-236805_FOCAL_LENGTH     = ( 78.13646 )
           INS-236806_FOCAL_LENGTH     = ( 78.11253 )
           INS-236807_FOCAL_LENGTH     = ( 78.23670 )
           INS-236808_FOCAL_LENGTH     = ( 78.46714 )
           INS-236809_FOCAL_LENGTH     = ( 78.52539 )
           INS-236810_FOCAL_LENGTH     = ( 78.40472 )
           INS-236811_FOCAL_LENGTH     = ( 78.52753 )
           INS-236812_FOCAL_LENGTH     = ( 78.33067 )

      The updates below are the values of the focal lengths evaluated from
      the thermal response at 0 degrees centigrade: (Values above are 
      retained for reference purposes.)

           INS-236801_FOCAL_LENGTH     = ( 78.2995274018716 )
           INS-236802_FOCAL_LENGTH     = ( 78.244824098     )
           INS-236803_FOCAL_LENGTH     = ( 78.1039278607985 )
           INS-236804_FOCAL_LENGTH     = ( 78.1457692804849 )
           INS-236805_FOCAL_LENGTH     = ( 78.1850092162597 )
           INS-236806_FOCAL_LENGTH     = ( 78.163806277336  )
           INS-236807_FOCAL_LENGTH     = ( 78.2992955624578 )
           INS-236808_FOCAL_LENGTH     = ( 78.5450080183072 )
           INS-236809_FOCAL_LENGTH     = ( 78.5741495205943 )
           INS-236810_FOCAL_LENGTH     = ( 78.4531775454011 )
           INS-236811_FOCAL_LENGTH     = ( 78.6044873862418 )
           INS-236812_FOCAL_LENGTH     = ( 78.3790617006708 )

      From [16], Gaskell updated his estimates of the focal lengths for the
      color filters.  The values in the keyword block below are his models
      evaluated at 0 degress centigrade.  The values from before are retained
      for reference purposes.

           \begindata

           INS-236801_FOCAL_LENGTH     = ( 78.288021500488  )
           INS-236802_FOCAL_LENGTH     = ( 78.244824098     )
           INS-236803_FOCAL_LENGTH     = ( 78.112293014943  )
           INS-236804_FOCAL_LENGTH     = ( 78.155391828952  )
           INS-236805_FOCAL_LENGTH     = ( 78.196137664612  )
           INS-236806_FOCAL_LENGTH     = ( 78.169747876299  )
           INS-236807_FOCAL_LENGTH     = ( 78.296180557766  )
           INS-236808_FOCAL_LENGTH     = ( 78.538034839584  )
           INS-236809_FOCAL_LENGTH     = ( 78.582744714521  )
           INS-236810_FOCAL_LENGTH     = ( 78.464138080361  )
           INS-236811_FOCAL_LENGTH     = ( 78.598049402115  )
           INS-236812_FOCAL_LENGTH     = ( 78.390021453182  )

           \begintext
   

   WAC Focal Length as a Function of Temperature

      The WAC clear filter focal length has a measurable fluctuation with 
      temperature (see [13]).  Using the focal plane temperature contained
      with the MDIS image header (with the PDS label of 
      FOCAL_PLANE_TEMPERATURE), a model of this variation was determined
      using star calibration images acquired in the orbital phases of the 
      mission.  The model assumes the form of a simple polynomial:

         F(T) = A0 + A1*T + A2*T^2 + A3*T^3 + A4*T^4 + A5*T^5

      Currently a linear fit is all that appears to be required (see [13]), 
      thus:

         A2 = A3 = A4 = A5 = 0.0

      However, the coefficients supplied here are carried out to fifth order
      to provide flexibility for on-going modeling efforts.

      Note: this model was developed from calibration images acquired in the
      orbital phase of the mission.  It does not work as well when applied to
      the colder extremes of the thermal range experienced in cruise.  It
      incurs an error of about 0.01mm when applied to images acquired prior
      to MOI.

      The model coefficients for the clear filter:

           INS-236802_FL_TEMP_COEFFS   = ( 78.25274448257375,
                                            0.0010882669556798268,
                                            0.0, 0.0, 0.0, 0.0 )

      No effort was undertaken to independently calibrate the thermal response
      of the color filters.  A simple linear scaling to the A0 term between
      the previously determined focal length and the clear filter one is 
      applied:

         A0       =  F     (T0) / F     (T0) * A0
           color      color        clear         clear

      The results of this scaling are captured in the keywords below:

           INS-236801_FL_TEMP_COEFFS   = ( 78.2714644659747,
                                            0.0010882669556798268,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236803_FL_TEMP_COEFFS   = ( 78.10291717554908,
                                            0.0010882669556798268,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236804_FL_TEMP_COEFFS   = ( 78.14605463512072,
                                            0.0010882669556798268,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236805_FL_TEMP_COEFFS   = ( 78.18623020927525,
                                            0.0010882669556798268,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236806_FL_TEMP_COEFFS   = ( 78.16228496669697,
                                            0.0010882669556798268,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236807_FL_TEMP_COEFFS   = ( 78.28653405867126,
                                            0.0010882669556798268,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236808_FL_TEMP_COEFFS   = ( 78.517120840942,
                                            0.0010882669556798268,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236809_FL_TEMP_COEFFS   = ( 78.57540794416744,
                                            0.0010882669556798268,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236810_FL_TEMP_COEFFS   = ( 78.45466108157149,
                                            0.0010882669556798268,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236811_FL_TEMP_COEFFS   = ( 78.57754930727306,
                                            0.0010882669556798268,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236812_FL_TEMP_COEFFS   = ( 78.38056391429521,
                                            0.0010882669556798268,
                                            0.0, 0.0, 0.0, 0.0 )

      As described in [14], the focal lengths and their thermal 
      responses have been updated.  Gaskell has utilized the distortion
      model update for the clear filter captured in this version of 
      the IK to reduce a new set of thermal responses for the color 
      filter.  From his email:

	    FL(I,T) = (1+G(I))FL(2,T)

	    where

	    G(01) =   0.699130D-03
	    G(02) =   0.000000D+00
	    G(03) =  -0.180071D-02
	    G(04) =  -0.126596D-02
	    G(05) =  -0.764458D-03
	    G(06) =  -0.103544D-02
	    G(07) =   0.696167D-03
	    G(08) =   0.383647D-02
	    G(09) =   0.420891D-02
	    G(10) =   0.266284D-02
	    G(11) =   0.459664D-02
	    G(12) =   0.171561D-02

      These new scalings are incorporated into the values below; the 
      values above are retained for reference.

           INS-236801_FL_TEMP_COEFFS   = ( 78.2995274018716,
                                            0.00111527717898674,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236802_FL_TEMP_COEFFS   = ( 78.244824098,
                                            0.001114498,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236803_FL_TEMP_COEFFS   = ( 78.1039278607985,
                                            0.00111249111230642,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236804_FL_TEMP_COEFFS   = ( 78.1457692804849,
                                            0.00111308709011192,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236805_FL_TEMP_COEFFS   = ( 78.1850092162597,
                                            0.00111364601308792,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236806_FL_TEMP_COEFFS   = ( 78.163806277336,
                                            0.00111334400419088,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236807_FL_TEMP_COEFFS   = ( 78.2992955624578,
                                            0.00111527387672917,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236808_FL_TEMP_COEFFS   = ( 78.5450080183072,
                                            0.00111877373814206,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236809_FL_TEMP_COEFFS   = ( 78.5741495205943,
                                            0.00111918882177718,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236810_FL_TEMP_COEFFS   = ( 78.4531775454011,
                                            0.00111746572985432,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236811_FL_TEMP_COEFFS   = ( 78.6044873862418,
                                            0.00111962094608672,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236812_FL_TEMP_COEFFS   = ( 78.3790617006708,
                                            0.00111641004391378,
                                            0.0, 0.0, 0.0, 0.0 )

      From [16], Gaskell has provided updated focal length estimates:

         We have solved for the color filter focal lengths in terms
         of the clear filter #2 through the use of thousands of common 
         control points:

               FL(I,T) = (1+G(I))FL(2,T)

               where

	       G(01) =   0.552080D-03
	       G(02) =   0.000000D+00
	       G(03) =  -0.169380D-02
	       G(04) =  -0.114298D-02
	       G(05) =  -0.622232D-03
	       G(06) =  -0.959504D-03
	       G(07) =   0.656356D-03
	       G(08) =   0.374735D-02
	       G(09) =   0.431876D-02
	       G(10) =   0.280292D-02
	       G(11) =   0.451436D-02
	       G(12) =   0.185568D-02

      These latest scalings are incorporated into the values below; the 
      previous values above are retained for reference.
      
         \begindata

           INS-236801_FL_TEMP_COEFFS   = ( 78.288021500488,
                                            0.00111527717898674,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236802_FL_TEMP_COEFFS   = ( 78.244824098,
                                            0.001114498,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236803_FL_TEMP_COEFFS   = ( 78.112293014943,
                                            0.0011126102632876,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236804_FL_TEMP_COEFFS   = ( 78.155391828952,
                                            0.0011132241510760,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236805_FL_TEMP_COEFFS   = ( 78.196137664612,
                                            0.0011138045236805,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236806_FL_TEMP_COEFFS   = ( 78.169747876299,
                                            0.0011134286347110,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236807_FL_TEMP_COEFFS   = ( 78.296180557766,
                                            0.0011152295074493,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236808_FL_TEMP_COEFFS   = ( 78.538034839584,
                                            0.0011186744140803,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236809_FL_TEMP_COEFFS   = ( 78.582744714521,
                                            0.0011193112493825,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236810_FL_TEMP_COEFFS   = ( 78.464138080361,
                                            0.0011176218487342,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236811_FL_TEMP_COEFFS   = ( 78.598049402115,
                                            0.0011195292451913,
                                            0.0, 0.0, 0.0, 0.0 )
           INS-236812_FL_TEMP_COEFFS   = ( 78.390021453182,
                                            0.0011165661516486,
                                            0.0, 0.0, 0.0, 0.0 )

         \begintext


   NAC Focal Length as a Function of Temperature

      The variation of the NAC's focal length with temperature is an 
      unknown at this point.  The following keyword value assignment
      is included only for completeness and implements a temperature
      invariant focal length for the NAC:

           INS-236820_FL_TEMP_COEFFS   = ( 549.1178195372703,
                                             0.0,
                                             0.0, 0.0, 0.0, 0.0 )

      The following is a preliminary calibration of the focal length
      temperature response for the NAC.  The observation data off 
      which it is based covers post-orbit insertion at temperatures
      between -8C and +15C.  Cruise data was included to nail down
      the slope, and additional data that fills in the gap between
      cruise temperatures and -8C are scheduled to be acquired in
      a few months.

           INS-236820_FL_TEMP_COEFFS   = ( 549.5342508861298,
                                             0.009874674835787519,
                                             0.0, 0.0, 0.0, 0.0 )

      The distortion model was refit using 16 WAC-NAC co-align sets
      with a total of 544 images ranging in temperatures from -30C to
      20C. During this fit, the focal length temperature dependence
      was also fit. 

           \begindata

           INS-236820_FL_TEMP_COEFFS   = ( 549.5120497341695,
                                             0.010185643391234385,
                                             0.0, 0.0, 0.0, 0.0 )

           \begintext


MDIS Field of View Parameters
---------------------------------------------------------------

   FOV Sizes (in degrees)

                                  ^
                                  | Gimbal Articulation
        Samples                   |        Axis
  (1,1) + + + + >                 |
    +  \_____________________________________________________  ___
 L  +  |                                                     |  |
 i  +  |                                                     |  |
 n  +  |                                                     |  |
 e  V  |                                                     |  |
 s     |                          ^ Y                        |  |
       |                          |  nac                     |  |
       |                          |                          |  |
       |                          |                          |  |
       |                     |--1.493--|                     |  |
       |                 _ _  _________                      |  |
       |                  |  |         |                     |  |
       |                  |  |         | ^                   |  |
       |          <--- 1.493 |    X    | +                   | 10.54 --->
       |                  |  |         | + Lines             |  |     X
       |         X       _|_ |_________| +                   |  |      wac
       |          nac         NAC      \                     |  |
       |                       < + + + (1,1)                 |  |
       |                         Samples                     |  |
       |                                                     |  |
       |                                                     |  |
       |                                                     |  |
       |                                                     |  |
       |                                                     |  |
       |                                                     |  |
       |_____________________________________________________| _|_
        WAC
       |------------------------10.54------------------------|

                                  |
                                  |
                                  |  Y
                                  V   wac


   Note that although the above diagram suggests the NAC and WAC boresights
   are co-aligned, this is not the case.  As [2] points out, there are two
   separate frame definitions which are calibrated independently of one
   another.  [6] provides the location of the image origins, as well as
   the direction of the lines and samples.

   The FOVs of the MDIS detectors have the following angular sizes (from
   [4]):

           ------------  ----------------  ----------------
             Detector       Horizontal         Vertical
           ------------  ----------------  ----------------
               WAC         10.54 degrees     10.54 degrees

               NAC          1.493 degrees     1.493 degrees
           ------------  ----------------  ----------------

   The CCD geometry parameters as presented in [4] and [5] are provided
   below:

           ------------------------------  -----------  -----------
                     parameter                 WAC          NAC
           ------------------------------  -----------  -----------
            Detector Array Size             1024x1024    1024x1024
            Detector Size, mm               14.4x14.4    14.4x14.4
            Pixel Size, mm (est)             14.0E-3      14.0E-3
            FOV Angular Size, degrees       0.35x0.35    3.48x3.48
            IFOV, microradian/pixel           179.6        25.44
           ------------------------------  -----------  -----------

   which translates to the following keyword and value pairs:

   Wide Angle Camera (WAC):

           \begindata

           INS-236800_PIXEL_SAMPLES     =  (  1024    )
           INS-236800_PIXEL_LINES       =  (  1024    )
           INS-236800_PIXEL_PITCH       =  (  14.0E-3 )
           INS-236800_CCD_CENTER        =  (  512.5, 512.5 )
           INS-236800_IFOV              =  (  179.6   )

           \begintext

   Narrow Angle Camera (NAC):

           \begindata

           INS-236820_PIXEL_SAMPLES     =  (  1024    )
           INS-236820_PIXEL_LINES       =  (  1024    )
           INS-236820_PIXEL_PITCH       =  (  14.0E-3 )
           INS-236820_CCD_CENTER        =  (  512.5, 512.5 )
           INS-236820_IFOV              =  (  25.44   )

           \begintext


WAC Field of View Definition
---------------------------------------------------------------

   The MDIS wide angle camera field of view is a square boresighted
   on the Z-axis of the MSGR_MDIS_WAC frame.  The angular dimension
   of the field of view is 10.54 x 10.54 (degrees).

   The following diagrams illustrate the field of view extents in
   the MSGR_MDIS_WAC frame:


                                   X
                                    ins
                                  ^     /
                                  |    /
                                  |   /
                                  |  /
                             Y    | /    o
                              ins |/ 5.27
                                  o-------->
                                  |\         Z
                                  | \         ins
                                  |  \
                                  |   \
                                  |    \
                                  |     \
                                                Plane Y = 0


                                   Y
                                    ins
                                  ^     /
                                  |    /
                                  |   /
                                  |  /
                             X    | /    o
                              ins |/ 5.27
                                  x-------->
                                  |\         Z
                                  | \         ins
                                  |  \
                                  |   \
                                  |    \
                                  |     \
                                                Plane X = 0


   which leads to the following FOV definition:

      \begindata

      INS-236800_FOV_FRAME       = 'MSGR_MDIS_WAC'
      INS-236800_FOV_SHAPE       = 'RECTANGLE'
      INS-236800_BORESIGHT       = ( 0.0, 0.0, 1.0 )
      INS-236800_FOV_CLASS_SPEC  = 'ANGLES'
      INS-236800_FOV_REF_VECTOR  = ( 1.0, 0.0, 0.0 )
      INS-236800_FOV_REF_ANGLE   = ( 5.27 )
      INS-236800_FOV_CROSS_ANGLE = ( 5.27 )
      INS-236800_FOV_ANGLE_UNITS = 'DEGREES'

      \begintext


NAC Field of View Definition
---------------------------------------------------------------

   The MDIS narrow angle camera field of view is a square boresighted
   on the Z-axis of the MSGR_MDIS_NAC frame.  The angular dimension
   of the field of view is 1.493 x 1.493 (degrees).

   The following diagrams illustrate the field of view extents in
   the MSGR_MDIS_NAC frame:


                                   X
                                    ins
                                  ^     /
                                  |    /
                                  |   /
                                  |  /
                             Y    | /      o
                              ins |/ 0.7465
                                  o-------->
                                  |\         Z
                                  | \         ins
                                  |  \
                                  |   \
                                  |    \
                                  |     \
                                                Plane Y = 0


                                   Y
                                    ins
                                  ^     /
                                  |    /
                                  |   /
                                  |  /
                             X    | /      o
                              ins |/ 0.7465
                                  x-------->
                                  |\         Z
                                  | \         ins
                                  |  \
                                  |   \
                                  |    \
                                  |     \
                                                Plane X = 0


   which leads to the following FOV definition:

      \begindata

      INS-236820_FOV_FRAME       = 'MSGR_MDIS_NAC'
      INS-236820_FOV_SHAPE       = 'RECTANGLE'
      INS-236820_BORESIGHT       = ( 0.0, 0.0, 1.0 )
      INS-236820_FOV_CLASS_SPEC  = 'ANGLES'
      INS-236820_FOV_REF_VECTOR  = ( 1.0, 0.0, 0.0 )
      INS-236820_FOV_REF_ANGLE   = ( 0.7465 )
      INS-236820_FOV_CROSS_ANGLE = ( 0.7465 )
      INS-236820_FOV_ANGLE_UNITS = 'DEGREES'

      \begintext


MDIS Distortion Model
---------------------------------------------------------------

   From [7]:

   The MDIS distortion model consists of three mappings that when combined
   take vectors in instrument coordinates to image pixel coordinates:

   1) instrument coordinates to ideal detector coordinates (undistorted)
   2) ideal detector coordinates to actual detector coordinates
   3) actual detector coordinates to image pixel coordinates

   The first mapping is a gnomonic, or pinhole, projection that takes unit
   vectors in the instrument coordinate system into the millimeter space
   of the image plane of an idealized detector (such as would occur in a
   perfect pinhole camera):

      [ xp ] = [ f * (v1/v3) ]
      [ yp ]   [ f * (v2/v3) ]

   where f is the focal length (given in keyword INS-2368##_FOCAL_LENGTH
   for each camera and WAC filter), [v1, v2, v3] is a unit vector in the
   instrument coordinate system with the Z axis as the boresight, and
   [xp, yp] is the projection of the vector [v1, v2, v3] onto the image
   plane.

   The second mapping is the distortion map. It describes how the actual
   (or distorted) camera coordinates are deformed from the idealized (or
   undistorted) image plane coordinates.

   The NAC and WAC distortion maps are nonradial. The NAC's was determined 
   by fitting data taken from a simulation of the NAC's optical behavior 
   to a 3rd order Taylor series expansion [9]. The WAC's distortion map 
   was also fitted to a 3rd order Taylor series, but based on data from 
   the model described in [10]. The Taylor series for both cameras are
   as follows.

      [ x ] = [ xa xb xc xd xe xf xg xh xi xj ] * [ 1        ]
      [ y ]   [ ya yb yc yd ye yf yg yh yi yj ]   [ xp       ]
                                                  [ yp       ]
                                                  [ xp*xp    ]
                                                  [ xp*yp    ]
                                                  [ yp*yp    ]
                                                  [ xp*xp*xp ]
                                                  [ xp*xp*yp ]
                                                  [ xp*yp*yp ]
                                                  [ yp*yp*yp ]

   Where [xp, yp] are the undistorted coordinates and [x, y] are
   the distorted coordinates. The first matrix on the right hand
   side of the equation contains the model coefficients, given below
   in the keywords 
   
      INS-2368##_OD_T_X = ( xa, xb, xc, xd, xe, xf, xg, xh, xi, xj )
      INS-2368##_OD_T_Y = ( ya, yb, yc, yd, ye, yf, yg, yh, yi, yj ).
   
   where ## refers to the each camera and filter instrument ID. The 
   coordinates [x, y] may be solved for using the Newton-Raphson method 
   for root-finding if a reverse mapping is desired (actual, distorted 
   coordinates to undistorted coordinates). 

   The third mapping is the conversion from image plane coordinates to
   pixel coordinates and is performed by the following transformation:

      [ p ] = [ Kx   Kxy ][ x ] + [p0]
      [ l ]   [ Kyx  Ky  ][ y ]   [l0]

   where [p, l] are pixel (or sample) and line coordinates, and [p0, l0]
   are the pixel coordinates of the optical center of the detector, given
   in keywords INS-2368##_CCD_CENTER for each camera. This third mapping 
   consists of a scaling and rotation, represented by the matrix in the
   equation, and a translation from the optical center. It is assumed
   that lines are perpendicular to samples in the image plane, hence Kxy 
   and Kyx are both equal to 0. The scale factors Kx and Ky represent the 
   number of pixels per millimeter in the detector. Kx and Kxy are given 
   in the second and third coordinate values of keyword INS-2368##_ITRANSS. 
   Kyx and Ky are given in the second and third coordinate values of 
   keyword INS-2368##_ITRANSL. The inverse mapping (pixel coordinates to 
   image plane coordinates) is provided in keywords INS-2368##_TRANSX 
   and INS-2368##_TRANSY. Note that the first coordinate in each of those 
   keywords is carried over from the addendum kernel in [7] and represents 
   a constant offset not used by MDIS. It is therefore set to 0.0 and not 
   discussed here.

   The three mappings describing the MDIS distortion model are summarized
   in the following diagram:

      [ v1 ]         [    ]         [   ]         [   ]
      [    ]    f    [ xp ]    D    [ x ]    k    [ p ]
      [ v2 ] ------> [    ] ------> [   ] ------> [   ]
      [    ]         [ yp ]         [ y ]         [ l ]
      [ v3 ]         [    ]         [   ]         [   ]

   where f is the pinhole projection, D is the distortion map, and k is the
   conversion to pixel coordinates. 
   
   Note that pixel coordinates are defined such that (1,1) marks the
   center of the first pixel. For a 1024 x 1024 image:

        (.5, .5) ________         . . .
                |     |               .
                |  *  |               .
                |_____|
                |      (1.5, 1.5)
           first pixel
                               last pixel
                                 _____|
                .               |     |
                .               |  *  |
                . . .         __|_____|
                                       (1024.5, 1024.5)

WAC Distortion Model Parameters
---------------------------------------------------------------

   The WAC distortion model parameter values described in the section 
   above are given in the keywords below. Note that these values are 
   identical to those of the clear filter (INS-236802). 

   The distortion models provided below for each of the WAC color filters
   are identical to one another.  The differences between the filters in 
   this release of the instrument kernel are captured solely in the focal
   lengths.  These models utilize a third order expansion of the distortion
   that was derived directly from the model developed by Robert Gaskell 
   from images of the Mercury surface as described in [11].  The main 
   reason this expansion was used in lieu of the actual model was to 
   minimize changes to existing software already capable of absorbing the
   NAC model.  As Gaskell's model contains terms that are higher than third
   order, differences between the two exist--at worst 0.02 pixels in the 
   extreme corners of the detector, though typical deviations are less than
   0.005 pixels over most of the field of view.

   For completeness, the model described in [11]:

                                                                   |e1|
                                                                   |e2| 
       dx = |-yp*r   xp*r^2    -yp*r^3    xp*r^4    xp*yp  xp^2  | |e3|  
       dy = | xp*r   yp*r^2     xp*r^3    yp*r^4    yp^2   xp*yp | |e4|
                                                                   |e5|
                                                                   |e6|

   where (xp,yp) is the Gnomic projection (pinhole), the actual focal plane 
   locations are xp+dx,yp+dy, and r^2=xp^2+yp^2.  e1 and e3 are tangential 
   distortions, e2 and e4 are radial, and e5 and e6 are keystone.  The 
   coefficients of this model as supplied are:

      e1 =  0.86935D-06
      e2 =  0.44808D-05
      e3 = -0.19418D-07
      e4 =  0.94198D-08
      e5 =  0.21519D-05
      e6 = -0.73206D-04

   In addition to the distortions, [11] provides focal length estimates for 
   each of the 11 WAC color filters which are provided here in the 
   INS-#_FOCAL_LENGTH keyword value pairs.  The focal length of the clear
   filter was determined independently from star calibration images using
   the model supplied in [11].  The third order expansion of Gaskell's 
   model is:

      INS-236800_FRAME  = 'MSGR_MDIS_WAC'
      INS-236800_TRANSX      = ( 0.0, 14.0E-3,      0.0        )
      INS-236800_TRANSY      = ( 0.0,  0.0,        14.0E-3     )
      INS-236800_ITRANSS     = ( 0.0, 71.42857143,  0.0        )
      INS-236800_ITRANSL     = ( 0.0,  0.0,        71.42857143 )
      INS-236800_OD_T_X = (  0.0,
                             0.9999816415736285,
                             -5.276020897336537E-6,
                             -7.320599999999683E-5,
                             2.15189999999999E-6,
                             0.0,
                             5.349752842983975E-6,
                             1.4606023811364754E-7,
                             5.486341986184268E-6,
                             1.2383483998569488E-7 )
      INS-236800_OD_T_Y = (  0.0,
                             5.2760208973357154E-6,
                             0.9999816415736285,
                             0.0,
                             -7.3206E-5,
                             2.1518999999997434E-6,
                             -1.238348399857238E-7,
                             5.486341986184246E-6,
                             -1.4606023811347893E-7,
                             5.349752842984318E-6 )
      
   Distortion model values for the WAC filters:

      INS-236801_FRAME  = 'MSGR_MDIS_WAC_FILTER1'
      INS-236801_TRANSX      = ( 0.0, 14.0E-3,      0.0        )
      INS-236801_TRANSY      = ( 0.0,  0.0,        14.0E-3     )
      INS-236801_ITRANSS     = ( 0.0, 71.42857143,  0.0        )
      INS-236801_ITRANSL     = ( 0.0,  0.0,        71.42857143 )
      INS-236801_OD_T_X = (  0.0,
                             0.9999816415736285,
                             -5.276020897336537E-6,
                             -7.320599999999683E-5,
                             2.15189999999999E-6,
                             0.0,
                             5.349752842983975E-6,
                             1.4606023811364754E-7,
                             5.486341986184268E-6,
                             1.2383483998569488E-7 )
      INS-236801_OD_T_Y = (  0.0,
                             5.2760208973357154E-6,
                             0.9999816415736285,
                             0.0,
                             -7.3206E-5,
                             2.1518999999997434E-6,
                             -1.238348399857238E-7,
                             5.486341986184246E-6,
                             -1.4606023811347893E-7,
                             5.349752842984318E-6 )

      INS-236802_FRAME  = 'MSGR_MDIS_WAC_FILTER2'
      INS-236802_TRANSX      = ( 0.0, 14.0E-3,      0.0        )
      INS-236802_TRANSY      = ( 0.0,  0.0,        14.0E-3     )
      INS-236802_ITRANSS     = ( 0.0, 71.42857143,  0.0        )
      INS-236802_ITRANSL     = ( 0.0,  0.0,        71.42857143 )
      INS-236802_OD_T_X = (  0.0,
                             0.9999816415736285,
                             -5.276020897336537E-6,
                             -7.320599999999683E-5,
                             2.15189999999999E-6,
                             0.0,
                             5.349752842983975E-6,
                             1.4606023811364754E-7,
                             5.486341986184268E-6,
                             1.2383483998569488E-7 )
      INS-236802_OD_T_Y = (  0.0,
                             5.2760208973357154E-6,
                             0.9999816415736285,
                             0.0,
                             -7.3206E-5,
                             2.1518999999997434E-6,
                             -1.238348399857238E-7,
                             5.486341986184246E-6,
                             -1.4606023811347893E-7,
                             5.349752842984318E-6 )

      INS-236803_FRAME  = 'MSGR_MDIS_WAC_FILTER3'
      INS-236803_TRANSX      = ( 0.0, 14.0E-3,      0.0        )
      INS-236803_TRANSY      = ( 0.0,  0.0,        14.0E-3     )
      INS-236803_ITRANSS     = ( 0.0, 71.42857143,  0.0        )
      INS-236803_ITRANSL     = ( 0.0,  0.0,        71.42857143 )
      INS-236803_OD_T_X = (  0.0,
                             0.9999816415736285,
                             -5.276020897336537E-6,
                             -7.320599999999683E-5,
                             2.15189999999999E-6,
                             0.0,
                             5.349752842983975E-6,
                             1.4606023811364754E-7,
                             5.486341986184268E-6,
                             1.2383483998569488E-7 )
      INS-236803_OD_T_Y = (  0.0,
                             5.2760208973357154E-6,
                             0.9999816415736285,
                             0.0,
                             -7.3206E-5,
                             2.1518999999997434E-6,
                             -1.238348399857238E-7,
                             5.486341986184246E-6,
                             -1.4606023811347893E-7,
                             5.349752842984318E-6 )

      INS-236804_FRAME  = 'MSGR_MDIS_WAC_FILTER4'
      INS-236804_TRANSX      = ( 0.0, 14.0E-3,      0.0        )
      INS-236804_TRANSY      = ( 0.0,  0.0,        14.0E-3     )
      INS-236804_ITRANSS     = ( 0.0, 71.42857143,  0.0        )
      INS-236804_ITRANSL     = ( 0.0,  0.0,        71.42857143 )
      INS-236804_OD_T_X = (  0.0,
                             0.9999816415736285,
                             -5.276020897336537E-6,
                             -7.320599999999683E-5,
                             2.15189999999999E-6,
                             0.0,
                             5.349752842983975E-6,
                             1.4606023811364754E-7,
                             5.486341986184268E-6,
                             1.2383483998569488E-7 )
      INS-236804_OD_T_Y = (  0.0,
                             5.2760208973357154E-6,
                             0.9999816415736285,
                             0.0,
                             -7.3206E-5,
                             2.1518999999997434E-6,
                             -1.238348399857238E-7,
                             5.486341986184246E-6,
                             -1.4606023811347893E-7,
                             5.349752842984318E-6 )

      INS-236805_FRAME  = 'MSGR_MDIS_WAC_FILTER5'
      INS-236805_TRANSX      = ( 0.0, 14.0E-3,      0.0        )
      INS-236805_TRANSY      = ( 0.0,  0.0,        14.0E-3     )
      INS-236805_ITRANSS     = ( 0.0, 71.42857143,  0.0        )
      INS-236805_ITRANSL     = ( 0.0,  0.0,        71.42857143 )
      INS-236805_OD_T_X = (  0.0,
                             0.9999816415736285,
                             -5.276020897336537E-6,
                             -7.320599999999683E-5,
                             2.15189999999999E-6,
                             0.0,
                             5.349752842983975E-6,
                             1.4606023811364754E-7,
                             5.486341986184268E-6,
                             1.2383483998569488E-7 )
      INS-236805_OD_T_Y = (  0.0,
                             5.2760208973357154E-6,
                             0.9999816415736285,
                             0.0,
                             -7.3206E-5,
                             2.1518999999997434E-6,
                             -1.238348399857238E-7,
                             5.486341986184246E-6,
                             -1.4606023811347893E-7,
                             5.349752842984318E-6 )

      INS-236806_FRAME  = 'MSGR_MDIS_WAC_FILTER6'
      INS-236806_TRANSX      = ( 0.0, 14.0E-3,      0.0        )
      INS-236806_TRANSY      = ( 0.0,  0.0,        14.0E-3     )
      INS-236806_ITRANSS     = ( 0.0, 71.42857143,  0.0        )
      INS-236806_ITRANSL     = ( 0.0,  0.0,        71.42857143 )
      INS-236806_OD_T_X = (  0.0,
                             0.9999816415736285,
                             -5.276020897336537E-6,
                             -7.320599999999683E-5,
                             2.15189999999999E-6,
                             0.0,
                             5.349752842983975E-6,
                             1.4606023811364754E-7,
                             5.486341986184268E-6,
                             1.2383483998569488E-7 )
      INS-236806_OD_T_Y = (  0.0,
                             5.2760208973357154E-6,
                             0.9999816415736285,
                             0.0,
                             -7.3206E-5,
                             2.1518999999997434E-6,
                             -1.238348399857238E-7,
                             5.486341986184246E-6,
                             -1.4606023811347893E-7,
                             5.349752842984318E-6 )

      INS-236807_FRAME  = 'MSGR_MDIS_WAC_FILTER7'
      INS-236807_TRANSX      = ( 0.0, 14.0E-3,      0.0        )
      INS-236807_TRANSY      = ( 0.0,  0.0,        14.0E-3     )
      INS-236807_ITRANSS     = ( 0.0, 71.42857143,  0.0        )
      INS-236807_ITRANSL     = ( 0.0,  0.0,        71.42857143 )
      INS-236807_OD_T_X = (  0.0,
                             0.9999816415736285,
                             -5.276020897336537E-6,
                             -7.320599999999683E-5,
                             2.15189999999999E-6,
                             0.0,
                             5.349752842983975E-6,
                             1.4606023811364754E-7,
                             5.486341986184268E-6,
                             1.2383483998569488E-7 )
      INS-236807_OD_T_Y = (  0.0,
                             5.2760208973357154E-6,
                             0.9999816415736285,
                             0.0,
                             -7.3206E-5,
                             2.1518999999997434E-6,
                             -1.238348399857238E-7,
                             5.486341986184246E-6,
                             -1.4606023811347893E-7,
                             5.349752842984318E-6 )

      INS-236808_FRAME  = 'MSGR_MDIS_WAC_FILTER8'
      INS-236808_TRANSX      = ( 0.0, 14.0E-3,      0.0        )
      INS-236808_TRANSY      = ( 0.0,  0.0,        14.0E-3     )
      INS-236808_ITRANSS     = ( 0.0, 71.42857143,  0.0        )
      INS-236808_ITRANSL     = ( 0.0,  0.0,        71.42857143 )
      INS-236808_OD_T_X = (  0.0,
                             0.9999816415736285,
                             -5.276020897336537E-6,
                             -7.320599999999683E-5,
                             2.15189999999999E-6,
                             0.0,
                             5.349752842983975E-6,
                             1.4606023811364754E-7,
                             5.486341986184268E-6,
                             1.2383483998569488E-7 )
      INS-236808_OD_T_Y = (  0.0,
                             5.2760208973357154E-6,
                             0.9999816415736285,
                             0.0,
                             -7.3206E-5,
                             2.1518999999997434E-6,
                             -1.238348399857238E-7,
                             5.486341986184246E-6,
                             -1.4606023811347893E-7,
                             5.349752842984318E-6 )

      INS-236809_FRAME  = 'MSGR_MDIS_WAC_FILTER9'
      INS-236809_TRANSX      = ( 0.0, 14.0E-3,      0.0        )
      INS-236809_TRANSY      = ( 0.0,  0.0,        14.0E-3     )
      INS-236809_ITRANSS     = ( 0.0, 71.42857143,  0.0        )
      INS-236809_ITRANSL     = ( 0.0,  0.0,        71.42857143 )
      INS-236809_OD_T_X = (  0.0,
                             0.9999816415736285,
                             -5.276020897336537E-6,
                             -7.320599999999683E-5,
                             2.15189999999999E-6,
                             0.0,
                             5.349752842983975E-6,
                             1.4606023811364754E-7,
                             5.486341986184268E-6,
                             1.2383483998569488E-7 )
      INS-236809_OD_T_Y = (  0.0,
                             5.2760208973357154E-6,
                             0.9999816415736285,
                             0.0,
                             -7.3206E-5,
                             2.1518999999997434E-6,
                             -1.238348399857238E-7,
                             5.486341986184246E-6,
                             -1.4606023811347893E-7,
                             5.349752842984318E-6 )

      INS-236810_FRAME  = 'MSGR_MDIS_WAC_FILTER10'
      INS-236810_TRANSX      = ( 0.0, 14.0E-3,      0.0        )
      INS-236810_TRANSY      = ( 0.0,  0.0,        14.0E-3     )
      INS-236810_ITRANSS     = ( 0.0, 71.42857143,  0.0        )
      INS-236810_ITRANSL     = ( 0.0,  0.0,        71.42857143 )
      INS-236810_OD_T_X = (  0.0,
                             0.9999816415736285,
                             -5.276020897336537E-6,
                             -7.320599999999683E-5,
                             2.15189999999999E-6,
                             0.0,
                             5.349752842983975E-6,
                             1.4606023811364754E-7,
                             5.486341986184268E-6,
                             1.2383483998569488E-7 )
      INS-236810_OD_T_Y = (  0.0,
                             5.2760208973357154E-6,
                             0.9999816415736285,
                             0.0,
                             -7.3206E-5,
                             2.1518999999997434E-6,
                             -1.238348399857238E-7,
                             5.486341986184246E-6,
                             -1.4606023811347893E-7,
                             5.349752842984318E-6 )

      INS-236811_FRAME  = 'MSGR_MDIS_WAC_FILTER11'
      INS-236811_TRANSX      = ( 0.0, 14.0E-3,      0.0        )
      INS-236811_TRANSY      = ( 0.0,  0.0,        14.0E-3     )
      INS-236811_ITRANSS     = ( 0.0, 71.42857143,  0.0        )
      INS-236811_ITRANSL     = ( 0.0,  0.0,        71.42857143 )
      INS-236811_OD_T_X = (  0.0,
                             0.9999816415736285,
                             -5.276020897336537E-6,
                             -7.320599999999683E-5,
                             2.15189999999999E-6,
                             0.0,
                             5.349752842983975E-6,
                             1.4606023811364754E-7,
                             5.486341986184268E-6,
                             1.2383483998569488E-7 )
      INS-236811_OD_T_Y = (  0.0,
                             5.2760208973357154E-6,
                             0.9999816415736285,
                             0.0,
                             -7.3206E-5,
                             2.1518999999997434E-6,
                             -1.238348399857238E-7,
                             5.486341986184246E-6,
                             -1.4606023811347893E-7,
                             5.349752842984318E-6 )

      INS-236812_FRAME  = 'MSGR_MDIS_WAC_FILTER12'
      INS-236812_TRANSX      = ( 0.0, 14.0E-3,      0.0        )
      INS-236812_TRANSY      = ( 0.0,  0.0,        14.0E-3     )
      INS-236812_ITRANSS     = ( 0.0, 71.42857143,  0.0        )
      INS-236812_ITRANSL     = ( 0.0,  0.0,        71.42857143 )
      INS-236812_OD_T_X = (  0.0,
                             0.9999816415736285,
                             -5.276020897336537E-6,
                             -7.320599999999683E-5,
                             2.15189999999999E-6,
                             0.0,
                             5.349752842983975E-6,
                             1.4606023811364754E-7,
                             5.486341986184268E-6,
                             1.2383483998569488E-7 )
      INS-236812_OD_T_Y = (  0.0,
                             5.2760208973357154E-6,
                             0.9999816415736285,
                             0.0,
                             -7.3206E-5,
                             2.1518999999997434E-6,
                             -1.238348399857238E-7,
                             5.486341986184246E-6,
                             -1.4606023811347893E-7,
                             5.349752842984318E-6 )


   The latest WAC clear filter model described below was developed from 
   in flight stellar calibration images acquired once a week.  The prior
   distortion model and the process used to create it are documented above,
   but the contents are not loaded into the kernel pool.  It remains there
   for reference purposes.

   The models described below are designed to be utilized with the updated
   focal length thermal calibration coefficients described in a preceding
   section.  As previously the models below were developed using the model
   form discussed in detail above and in reference [11].  The coefficients
   determined from the set of calibration images are:

      e1 =  0.0
      e2 =  5.50903572727233e-06
      e3 =  0.0
      e4 =  0.0
      e5 =  3.59987190213887e-06
      e6 = -7.72089425205662e-05 

   Per discussions with Gaskell, we elected to only fit the parameters: 
   e2, e5, and e6, however; we included Ky and Kyx in the fit as well
   which resulted in:

      Ky  = 71.4399371332522
      Kyx = -6.76106091652016e-04

   As before, for consistency with the NAC model, we have expanded these
   models into their third order Taylor series:

      \begindata

      INS-236800_FRAME  = 'MSGR_MDIS_WAC'
      INS-236800_TRANSX  = ( 0.0, 13.99999999972e-03,    0.0                )
      INS-236800_TRANSY  = ( 0.0, 1.32495711261385e-07,  13.997772676294e-03 )
      INS-236800_ITRANSS = ( 0.0, 71.42857143,           0.0        )
      INS-236800_ITRANSL = ( 0.0, -6.76106091652016e-04, 71.4399371332522 )
      INS-236800_OD_T_X = (  0.0,
                             1.0,
                             0.0,
                            -7.720894252056575E-5,
                             3.599871902138938E-6,
                             0.0,
                             5.509035727272325E-6,
                             0.0,
                             5.509035727272406E-6,
                             0.0 )
      INS-236800_OD_T_Y = (  0.0,
                             0.0,
                             1.0000000000261484,
                             0.0,
                            -7.720894252092194E-5,
                             3.5998717824736167E-6,
                             0.0,
                             5.5090356219415276E-6,
                             0.0,
                             5.509030873819812E-6 )

      \begintext   
      
   Distortion model values for the WAC filters:

      \begindata

      INS-236801_FRAME  = 'MSGR_MDIS_WAC_FILTER1'
      INS-236801_TRANSX  = ( 0.0, 13.99999999972e-03,    0.0                )
      INS-236801_TRANSY  = ( 0.0, 1.32495711261385e-07,  13.997772676294e-03 )
      INS-236801_ITRANSS = ( 0.0, 71.42857143,           0.0        )
      INS-236801_ITRANSL = ( 0.0, -6.76106091652016e-04, 71.4399371332522 )
      INS-236801_OD_T_X = (  0.0,
                             1.0,
                             0.0,
                            -7.720894252056575E-5,
                             3.599871902138938E-6,
                             0.0,
                             5.509035727272325E-6,
                             0.0,
                             5.509035727272406E-6,
                             0.0 )
      INS-236801_OD_T_Y = (  0.0,
                             0.0,
                             1.0000000000261484,
                             0.0,
                            -7.720894252092194E-5,
                             3.5998717824736167E-6,
                             0.0,
                             5.5090356219415276E-6,
                             0.0,
                             5.509030873819812E-6 )

      INS-236802_FRAME  = 'MSGR_MDIS_WAC_FILTER2'
      INS-236802_TRANSX  = ( 0.0, 13.99999999972e-03,    0.0                )
      INS-236802_TRANSY  = ( 0.0, 1.32495711261385e-07,  13.997772676294e-03 )
      INS-236802_ITRANSS = ( 0.0, 71.42857143,           0.0        )
      INS-236802_ITRANSL = ( 0.0, -6.76106091652016e-04, 71.4399371332522 )
      INS-236802_OD_T_X = (  0.0,
                             1.0,
                             0.0,
                            -7.720894252056575E-5,
                             3.599871902138938E-6,
                             0.0,
                             5.509035727272325E-6,
                             0.0,
                             5.509035727272406E-6,
                             0.0 )
      INS-236802_OD_T_Y = (  0.0,
                             0.0,
                             1.0000000000261484,
                             0.0,
                            -7.720894252092194E-5,
                             3.5998717824736167E-6,
                             0.0,
                             5.5090356219415276E-6,
                             0.0,
                             5.509030873819812E-6 )

      INS-236803_FRAME  = 'MSGR_MDIS_WAC_FILTER3'
      INS-236803_TRANSX  = ( 0.0, 13.99999999972e-03,    0.0                )
      INS-236803_TRANSY  = ( 0.0, 1.32495711261385e-07,  13.997772676294e-03 )
      INS-236803_ITRANSS = ( 0.0, 71.42857143,           0.0        )
      INS-236803_ITRANSL = ( 0.0, -6.76106091652016e-04, 71.4399371332522 )
      INS-236803_OD_T_X = (  0.0,
                             1.0,
                             0.0,
                            -7.720894252056575E-5,
                             3.599871902138938E-6,
                             0.0,
                             5.509035727272325E-6,
                             0.0,
                             5.509035727272406E-6,
                             0.0 )
      INS-236803_OD_T_Y = (  0.0,
                             0.0,
                             1.0000000000261484,
                             0.0,
                            -7.720894252092194E-5,
                             3.5998717824736167E-6,
                             0.0,
                             5.5090356219415276E-6,
                             0.0,
                             5.509030873819812E-6 )

      INS-236804_FRAME  = 'MSGR_MDIS_WAC_FILTER4'
      INS-236804_TRANSX  = ( 0.0, 13.99999999972e-03,    0.0                )
      INS-236804_TRANSY  = ( 0.0, 1.32495711261385e-07,  13.997772676294e-03 )
      INS-236804_ITRANSS = ( 0.0, 71.42857143,           0.0        )
      INS-236804_ITRANSL = ( 0.0, -6.76106091652016e-04, 71.4399371332522 )
      INS-236804_OD_T_X = (  0.0,
                             1.0,
                             0.0,
                            -7.720894252056575E-5,
                             3.599871902138938E-6,
                             0.0,
                             5.509035727272325E-6,
                             0.0,
                             5.509035727272406E-6,
                             0.0 )
      INS-236804_OD_T_Y = (  0.0,
                             0.0,
                             1.0000000000261484,
                             0.0,
                            -7.720894252092194E-5,
                             3.5998717824736167E-6,
                             0.0,
                             5.5090356219415276E-6,
                             0.0,
                             5.509030873819812E-6 )

      INS-236805_FRAME  = 'MSGR_MDIS_WAC_FILTER5'
      INS-236805_TRANSX  = ( 0.0, 13.99999999972e-03,    0.0                )
      INS-236805_TRANSY  = ( 0.0, 1.32495711261385e-07,  13.997772676294e-03 )
      INS-236805_ITRANSS = ( 0.0, 71.42857143,           0.0        )
      INS-236805_ITRANSL = ( 0.0, -6.76106091652016e-04, 71.4399371332522 )
      INS-236805_OD_T_X = (  0.0,
                             1.0,
                             0.0,
                            -7.720894252056575E-5,
                             3.599871902138938E-6,
                             0.0,
                             5.509035727272325E-6,
                             0.0,
                             5.509035727272406E-6,
                             0.0 )
      INS-236805_OD_T_Y = (  0.0,
                             0.0,
                             1.0000000000261484,
                             0.0,
                            -7.720894252092194E-5,
                             3.5998717824736167E-6,
                             0.0,
                             5.5090356219415276E-6,
                             0.0,
                             5.509030873819812E-6 )

      INS-236806_FRAME  = 'MSGR_MDIS_WAC_FILTER6'
      INS-236806_TRANSX  = ( 0.0, 13.99999999972e-03,    0.0                )
      INS-236806_TRANSY  = ( 0.0, 1.32495711261385e-07,  13.997772676294e-03 )
      INS-236806_ITRANSS = ( 0.0, 71.42857143,           0.0        )
      INS-236806_ITRANSL = ( 0.0, -6.76106091652016e-04, 71.4399371332522 )
      INS-236806_OD_T_X = (  0.0,
                             1.0,
                             0.0,
                            -7.720894252056575E-5,
                             3.599871902138938E-6,
                             0.0,
                             5.509035727272325E-6,
                             0.0,
                             5.509035727272406E-6,
                             0.0 )
      INS-236806_OD_T_Y = (  0.0,
                             0.0,
                             1.0000000000261484,
                             0.0,
                            -7.720894252092194E-5,
                             3.5998717824736167E-6,
                             0.0,
                             5.5090356219415276E-6,
                             0.0,
                             5.509030873819812E-6 )

      INS-236807_FRAME  = 'MSGR_MDIS_WAC_FILTER7'
      INS-236807_TRANSX  = ( 0.0, 13.99999999972e-03,    0.0                )
      INS-236807_TRANSY  = ( 0.0, 1.32495711261385e-07,  13.997772676294e-03 )
      INS-236807_ITRANSS = ( 0.0, 71.42857143,           0.0        )
      INS-236807_ITRANSL = ( 0.0, -6.76106091652016e-04, 71.4399371332522 )
      INS-236807_OD_T_X = (  0.0,
                             1.0,
                             0.0,
                            -7.720894252056575E-5,
                             3.599871902138938E-6,
                             0.0,
                             5.509035727272325E-6,
                             0.0,
                             5.509035727272406E-6,
                             0.0 )
      INS-236807_OD_T_Y = (  0.0,
                             0.0,
                             1.0000000000261484,
                             0.0,
                            -7.720894252092194E-5,
                             3.5998717824736167E-6,
                             0.0,
                             5.5090356219415276E-6,
                             0.0,
                             5.509030873819812E-6 )

      INS-236808_FRAME  = 'MSGR_MDIS_WAC_FILTER8'
      INS-236808_TRANSX  = ( 0.0, 13.99999999972e-03,    0.0                )
      INS-236808_TRANSY  = ( 0.0, 1.32495711261385e-07,  13.997772676294e-03 )
      INS-236808_ITRANSS = ( 0.0, 71.42857143,           0.0        )
      INS-236808_ITRANSL = ( 0.0, -6.76106091652016e-04, 71.4399371332522 )
      INS-236808_OD_T_X = (  0.0,
                             1.0,
                             0.0,
                            -7.720894252056575E-5,
                             3.599871902138938E-6,
                             0.0,
                             5.509035727272325E-6,
                             0.0,
                             5.509035727272406E-6,
                             0.0 )
      INS-236808_OD_T_Y = (  0.0,
                             0.0,
                             1.0000000000261484,
                             0.0,
                            -7.720894252092194E-5,
                             3.5998717824736167E-6,
                             0.0,
                             5.5090356219415276E-6,
                             0.0,
                             5.509030873819812E-6 )

      INS-236809_FRAME  = 'MSGR_MDIS_WAC_FILTER9'
      INS-236809_TRANSX  = ( 0.0, 13.99999999972e-03,    0.0                )
      INS-236809_TRANSY  = ( 0.0, 1.32495711261385e-07,  13.997772676294e-03 )
      INS-236809_ITRANSS = ( 0.0, 71.42857143,           0.0        )
      INS-236809_ITRANSL = ( 0.0, -6.76106091652016e-04, 71.4399371332522 )
      INS-236809_OD_T_X = (  0.0,
                             1.0,
                             0.0,
                            -7.720894252056575E-5,
                             3.599871902138938E-6,
                             0.0,
                             5.509035727272325E-6,
                             0.0,
                             5.509035727272406E-6,
                             0.0 )
      INS-236809_OD_T_Y = (  0.0,
                             0.0,
                             1.0000000000261484,
                             0.0,
                            -7.720894252092194E-5,
                             3.5998717824736167E-6,
                             0.0,
                             5.5090356219415276E-6,
                             0.0,
                             5.509030873819812E-6 )

      INS-236810_FRAME  = 'MSGR_MDIS_WAC_FILTER10'
      INS-236810_TRANSX  = ( 0.0, 13.99999999972e-03,    0.0                )
      INS-236810_TRANSY  = ( 0.0, 1.32495711261385e-07,  13.997772676294e-03 )
      INS-236810_ITRANSS = ( 0.0, 71.42857143,           0.0        )
      INS-236810_ITRANSL = ( 0.0, -6.76106091652016e-04, 71.4399371332522 )
      INS-236810_OD_T_X = (  0.0,
                             1.0,
                             0.0,
                            -7.720894252056575E-5,
                             3.599871902138938E-6,
                             0.0,
                             5.509035727272325E-6,
                             0.0,
                             5.509035727272406E-6,
                             0.0 )
      INS-236810_OD_T_Y = (  0.0,
                             0.0,
                             1.0000000000261484,
                             0.0,
                            -7.720894252092194E-5,
                             3.5998717824736167E-6,
                             0.0,
                             5.5090356219415276E-6,
                             0.0,
                             5.509030873819812E-6 )

      INS-236811_FRAME  = 'MSGR_MDIS_WAC_FILTER11'
      INS-236811_TRANSX  = ( 0.0, 13.99999999972e-03,    0.0                )
      INS-236811_TRANSY  = ( 0.0, 1.32495711261385e-07,  13.997772676294e-03 )
      INS-236811_ITRANSS = ( 0.0, 71.42857143,           0.0        )
      INS-236811_ITRANSL = ( 0.0, -6.76106091652016e-04, 71.4399371332522 )
      INS-236811_OD_T_X = (  0.0,
                             1.0,
                             0.0,
                            -7.720894252056575E-5,
                             3.599871902138938E-6,
                             0.0,
                             5.509035727272325E-6,
                             0.0,
                             5.509035727272406E-6,
                             0.0 )
      INS-236811_OD_T_Y = (  0.0,
                             0.0,
                             1.0000000000261484,
                             0.0,
                            -7.720894252092194E-5,
                             3.5998717824736167E-6,
                             0.0,
                             5.5090356219415276E-6,
                             0.0,
                             5.509030873819812E-6 )

      INS-236812_FRAME  = 'MSGR_MDIS_WAC_FILTER12'
      INS-236812_TRANSX  = ( 0.0, 13.99999999972e-03,    0.0                )
      INS-236812_TRANSY  = ( 0.0, 1.32495711261385e-07,  13.997772676294e-03 )
      INS-236812_ITRANSS = ( 0.0, 71.42857143,           0.0        )
      INS-236812_ITRANSL = ( 0.0, -6.76106091652016e-04, 71.4399371332522 )
      INS-236812_OD_T_X = (  0.0,
                             1.0,
                             0.0,
                            -7.720894252056575E-5,
                             3.599871902138938E-6,
                             0.0,
                             5.509035727272325E-6,
                             0.0,
                             5.509035727272406E-6,
                             0.0 )
      INS-236812_OD_T_Y = (  0.0,
                             0.0,
                             1.0000000000261484,
                             0.0,
                            -7.720894252092194E-5,
                             3.5998717824736167E-6,
                             0.0,
                             5.5090356219415276E-6,
                             0.0,
                             5.509030873819812E-6 )

      \begintext   


      
NAC Distortion Model Parameters
---------------------------------------------------------------

   The NAC distortion model parameter values described above are given here:

      INS-236820_FRAME  = 'MSGR_MDIS_NAC'
      INS-236820_TRANSX      = ( 0.0, 14.0E-3,      0.0        )
      INS-236820_TRANSY      = ( 0.0,  0.0,        14.0E-3     )
      INS-236820_ITRANSS     = ( 0.0, 71.42857143,  0.0        )
      INS-236820_ITRANSL     = ( 0.0,  0.0,        71.42857143 )
      INS-236820_OD_T_X = (  0.0,
                             1.0020558791381275,
                             0.0,
                             0.0,
                            -5.448742222712919E-4,
                             0.0,
                             6.597498811862692E-6,
                             0.0,
                             6.683129056014682E-6,
                             0.0 )
      INS-236820_OD_T_Y = ( -1.3657975359540047E-5,
                             0.0,
                             1.0,
                             8.85544334965699E-4,
                             0.0,
                             3.338939138331483E-4,
                             0.0,
                             7.74756721313425E-6,
                             0.0,
                             7.79484564042716E-6 )


      The distortion model was refit using 16 WAC-NAC co-align sets
      with a total of 544 images ranging in temperatures from -30C to
      20C. A physical model was used to model the NAC based on the
      model given in [15]. The following is the functional form of the new
      model:

      x = xp + R*xp*r^2 + 2*K*xp*yp + A*xp
      y = yp + R*yp*r^2 + B*r^2 + 2*S*yp^2

      where r^2 = xp^2 + yp^2

      R =  1.0040104714688569E-5 +/- 2.973157396104382E-7
      K = -2.5472202374705557E-4 +/- 1.3566189574971502E-6
      A =  0.0018542696238023333 +/- 1.4088148221488576E-5
      B =  9.06001059499675E-4   +/- 2.635669455596247E-6
      S = -2.7425839841879957E-4 +/- 1.6658414325690593E-6

      During this fit, the focal length temperature dependence was also fit
      and is presented in "MDIS First Order Optical Parameters".

      The terms of this model are represented in the third order Taylor series
      and are expressed analytically as:      

      xa = 0       =  0.0
      xb = 1 + A   =  1.0018542696238023333
      xc = 0       =  0.0
      xd = 0       =  0.0
      xe = 2*K     = -5.0944404749411114E-4
      xf = 0       =  0.0
      xg = R       =  1.0040104714688569E-5
      xh = 0       =  0.0
      xi = R       =  1.0040104714688569E-5
      xj = 0       =  0.0

      ya = 0       =  0.0
      yb = 0       =  0.0
      yc = 1       =  1.0
      yd = B       =  9.06001059499675E-4
      ye = 0       =  0.0
      yf = B + 2*S =  3.5748426266207586E-4
      yg = 0       =  0.0
      yh = R       =  1.0040104714688569E-5
      yi = 0       =  0.0
      yj = R       =  1.0040104714688569E-5

      \begindata

      INS-236820_FRAME  = 'MSGR_MDIS_NAC'
      INS-236820_TRANSX      = ( 0.0, 14.0E-3,      0.0        )
      INS-236820_TRANSY      = ( 0.0,  0.0,        14.0E-3     )
      INS-236820_ITRANSS     = ( 0.0, 71.42857143,  0.0        )
      INS-236820_ITRANSL     = ( 0.0,  0.0,        71.42857143 )
      INS-236820_OD_T_X = (  0.0,
                             1.0018542696238023333,
                             0.0,
                             0.0,
                            -5.0944404749411114E-4,
                             0.0,
                             1.0040104714688569E-5,
                             0.0,
                             1.0040104714688569E-5,
                             0.0 )
      INS-236820_OD_T_Y = (  0.0,
                             0.0,
                             1.0,
                             9.06001059499675E-4,
                             0.0,
                             3.5748426266207586E-4,
                             0.0,
                             1.0040104714688569E-5,
                             0.0,
                             1.0040104714688569E-5 )

      \begintext


MDIS Binning
---------------------------------------------------------------

   From [8]:

   In the normal mode without binning for either the WAC or NAC, the
   first four columns of each image are taken from a region of the CCD
   that is never exposed to light and, thus, represents a dark level
   that is purely a function of bias and dark current. The dark columns
   are separated from the image section by five isolation columns to
   avoid diffusion of signal from the active area (see diagram below).
   When the image is read-out, these four columns are mapped into the
   first four imaging columns, so the resulting image is a square 1024
   by 1024 pixels, with four dark columns. However for the binned modes
   of both cameras, an error in programming the Actel field-programmable
   gate arrays (FPGAs) that execute the binning resulted in a different
   sampling of the CCDs.

   In binned mode, the offset to the isolated dark columns was
   miscalculated, and the first of the two dark columns is actually
   derived from an inactive portion of the CCD. The second dark column
   is an average of an inactive column and the first dark column in the
   dark strip. As a result, a binned image is shifted 8 pixels to the
   left from an identical non-binned image. Since pixel numbering begins
   at 1, the first valid pixel in a binned image is equivalent to pixel 9
   in unbinned pixel coordinates. This shift is illustrated in the following
   diagram (taken from [8]) and captured in the keywords following, where
   FPU refers to the focal plane unit containing the FPGA.

   The first valid binned pixel in unbinned pixel coordinates.

               12
             inactive        16
             prescan        dark                            1024
             elements       lines                        video pixels
                |             |                               |
                | isolation   |          isolation            |
                |  column     |           columns             |
             ___|___ | _______|________  ___|____  ___________|___________
            /       \v/                \/        \/                       \
             _____________________________________________________________
 actual     |       | |                 |         |                       |1024
 non-binned | ...   | | ...|1|2|3|4|... | | | | | | | | | |5|6|7|8|...    |
 pixels     |_______|_|_________________|_________|_______________________|0
             _____________________________________________________________
 intended   |       | |                 |         |                       |1024
 binned     | ...   | | ...| 1 | 2 |... | | | | | | | | | | 3 | 4 |...    |
 pixels     |_______|_|_________________|_________|_______________________|0
             _____________________________________________________________
 actual     |       | |                 |         |                       |1024
 binned     |...| 1 | 2 |    ...        | | 3 | 4 | 5 | 6 |...|512|   |   |
 pixels     |_______|_|_________________|_________|_______________________|0
                                                           ^        ^   ^
                                          |<------------->||         \ /
                                              8 pixels     |     lost pixels
                                                           |    (not recorded)
                                                           |
                                                    equivalent to
                                                   unbinned pixel 9

             Pixels intended for dark columns and the actual pixels used
                       in binned images for the NAC and WAC.


   Wide Angle Camera (WAC):

      \begindata

      INS-236800_FPUBIN_START_SAMPLE =  9.0
      INS-236800_FPUBIN_START_LINE   =  1.0

      \begintext

   Narrow Angle Camera (NAC):

      \begindata

      INS-236820_FPUBIN_START_SAMPLE =  9.0
      INS-236820_FPUBIN_START_LINE   =  1.0

      \begintext


Platform ID
---------------------------------------------------------------

   \begindata

   INS-236800_PLATFORM_ID = ( -236000 )
   INS-236820_PLATFORM_ID = ( -236000 )

   \begintext


NAIF ID Code to Name Mapping
---------------------------------------------------------------

   \begindata

   NAIF_BODY_NAME   += ( 'MSGR_MDIS_WAC' )
   NAIF_BODY_CODE   += ( -236800         )

   NAIF_BODY_NAME   += ( 'MSGR_MDIS_NAC' )
   NAIF_BODY_CODE   += ( -236820         )

   \begintext
