PDS_VERSION_ID = PDS3
LABEL_REVISION_NOTE = "20120925 EPOXI:sm Copied crosstalk files from MRI
Hartley2 V1.0 dataset, changed DATA_SET_ID, corrected year from 2010 to
2011 in PRODUCT_ID and PRODUCT_CREATION_TIME."
RECORD_TYPE = "FIXED_LENGTH"
RECORD_BYTES = 2880
FILE_RECORDS = 4
^FITS_HEADER = "MRIVIS_071004_3_9.FIT"
^ARRAY = ("MRIVIS_071004_3_9.FIT", 2)
DATA_SET_ID = "DIFMMRI3/4EPOXIMARSV2.0"
MISSION_NAME = "EPOXI"
INSTRUMENT_HOST_NAME = "DEEP IMPACT FLYBY SPACECRAFT"
INSTRUMENT_HOST_ID = "DIF"
INSTRUMENT_NAME = "DEEP IMPACT MEDIUM RESOLUTION INSTRUMENT
 VISIBLE CCD"
INSTRUMENT_ID = "MRI"
PRODUCT_ID = "XTALK_MRIVIS_071004_3_9201105"
PRODUCT_NAME = "MRI CROSSTALK CORRECTION MODE 9"
PRODUCT_CREATION_TIME = 20110503T12:42:00
START_TIME = 20071004T00:00:00
STOP_TIME = "UNK"
SPACECRAFT_CLOCK_START_COUNT = "N/A"
SPACECRAFT_CLOCK_STOP_COUNT = "N/A"
FILTER_NAME = "N/A"
FILTER_NUMBER = "N/A"
TARGET_NAME = "N/A"
INSTRUMENT_MODE_ID = "9"
NOTE = "The Primary Data Unit (PDU) of this
FITSformat file is a 3D data cube comprising coefficients of polynomials
specifying how much crosstalk occurs between all possible ordered pairs
of quadrants of an input MRIVIS image. Indices of the first two
dimensions (axes NAXIS1 and NAXIS2 in FITS or SAMPLE and LINE in this PDS
label) specify to which ordered pair of quadrants the coefficients at
those indices apply. The values in Column J (NAXIS1 or SAMPLE), row I
(NAXIS2 or LINE) in this data cube are the coefficients of a polynomial
which specifies the crosstalk gain from input MRIVIS image quadrant J
onto quadrant I. Details of the quadrant numbering convention are below.
The indices of the last dimension (axis NAXIS3 in FITS or
LINEAR_COEFFICIENT in this PDS label) indicate the exponent to apply to
that J quadrant value before multiplying by the coefficient at that
index. The first index of dimension NAXIS3 (i.e., the axis named
LINEAR_COEFFICIENT in the ARRAY object defined in this PDS label)
specifies the offset (exponent 0), the next index specifies the linear
coefficient (exponent 1), and so on. At the time these comments were
first written, all crosstalk polynomials have only two coefficients, and
all offset (exponent 0) values are zero.
In addition to the coefficients in the PDU, the FITS Primary Header Data
Unit (PHDU) has keywords XSjOVERi (e.g. XS2OVER1) which contain the X
(column) shift to apply to input MRIVIS image quadrant J before
subtracting the calculated crosstalk from quadrant I. In those keywords,
j and i are 1based quadrant numbers, and the Xshifts for the cases
where I=J are not included. Finally, the presence of keyword XSHIFTOK
with logical value T is a convention to indicate the presence of the
XSjOVERi keywords. The shift values from the PHDU are copied here
for reference:
XSHIFTOK= T / Use XSHIFT[N,N] values from this header
XS2OVER1= 1 / XSHIFT for quadrant 2 over quadrant 1
XS3OVER1= 1 / XSHIFT for quadrant 3 over quadrant 1
XS4OVER1= 1 / XSHIFT for quadrant 4 over quadrant 1
XS1OVER2= 1 / XSHIFT for quadrant 1 over quadrant 2
XS3OVER2= 1 / XSHIFT for quadrant 3 over quadrant 2
XS4OVER2= 1 / XSHIFT for quadrant 4 over quadrant 2
XS1OVER3= 1 / XSHIFT for quadrant 1 over quadrant 3
XS2OVER3= 1 / XSHIFT for quadrant 2 over quadrant 3
XS4OVER3= 1 / XSHIFT for quadrant 4 over quadrant 3
XS1OVER4= 1 / XSHIFT for quadrant 1 over quadrant 4
XS2OVER4= 1 / XSHIFT for quadrant 2 over quadrant 4
XS3OVER4= 1 / XSHIFT for quadrant 3 over quadrant 4
The quadrant numbering convention starts at the top left, next is top
right. If this a VIS instrument, the next is bottom left, and finally
bottom right. This convention, which assumes the data in MRIVIS images
are stored from left to right and from bottom to top with increasing
NAXIS1 and NAXIS2, respectively, are laid out in the following diagrams:
+++ +++ +++
 0  1   1  2   A  B 
+++ +++ +++
 2  3   3  4   C  D 
+++ +++ +++
Quadrant numbering
or naming convention: 0based 1based alphabased
N.B. The ABCD convention applies only to these crosstalk gains and
is not the same convention as is used in, for example, Deep
Impact instrument calibration publications.
=========================================================================
We describe how the quadrants are rotated to compute the crosstalk to
remove from each quadrant of the input image. Using the onebased
numbering convention and centerline definitions:
LINE_DIRECTION = 'UP'
^
 +++ <last pixel in IMAGE OBJECT
  1  2 
 +++ <horizontal centerline
  3  4 
 first> +++
 pixel ^
 in 
 IMAGE vertical centerline
 OBJECT

+>LINE_SAMPLE_DIRECTION = 'RIGHT'
For applying J to I (J over I; onebased J and I):
Method 1:
Calculate the absolute value of the difference between 5 and
the sum of J and I (onebased), call this AD5S:
AD5S =  5  (J+I) 
 if AD5S is 0 (zero), then flip J leftright then topbottom
 if AD5S is 1 (one), then flip J topbottom, only
 if AD5S is 2 (one), then flip J leftright, only
Note: For zerobased J and I use 3 instead of 5
Method 2:
 if J and I are on opposite sides of the vertical centerline,
flip J leftright
 if J and I are on opposite sides of the horizontal centerline,
flip J topbottom
Example i) to apply quadrant 1 (topleft) to quadrant 4 (bottomright)
Method 1:
 ADS5 =  5  (1+4)  = 0 = 0
Method 2:
 1 is to the left and 4 is to the right of the vertical centerline
 1 is above and 4 is below the horizontal centerline
Result:
 quadrant 1 should be flipped leftright, then topbottom, before
shifting, scaling by the crosstalk gain, and subtraction from
quadrant 4.
Example ii) to apply quadrant 4 (bottomright) to quadrant 2 (topright)
Method 1:
 ADS5 =  5  (4+2)  = 1 = 1
Method 2:
 both 4 and 2 are to the right of the vertical centerline
 4 is below and 2 is above the horizontal centerline
Result:
 quadrant 1 should be flipped topbottom, only, before shifting,
scaling by gain, and subtraction from quadrant 4.
Table of flips to apply to quadrant J when applying quadrant J to
quadrant I (J over I; onebased J and I):
\I 1  2  3  4
J\   
++++
1  N/A  LR  TB  LR,TB
   
2  LR  N/A  LR,TB  TB
   
3  TB  LR,TB  N/A  LR
   
4  LR,TB  TB  LR  N/A
where:
LR indicates a leftright flip [IDL ROTATE(Q,5)]
TB indicates a topbottom flip [IDL ROTATE(Q,7)]
LR,TB indicate both leftright and topbottom flips [IDL ROTATE(Q,2)]
Note: A ROTATE is always performed a SHIFT.
=========================================================================
"
OBJECT = FITS_HEADER
HEADER_TYPE = "FITS"
BYTES = 2880
RECORDS = 1
INTERCHANGE_FORMAT = "BINARY"
DESCRIPTION = "
FITS format is defined in NASA/Science Office Standards
Technology 1001.0."
END_OBJECT = FITS_HEADER
OBJECT = ARRAY
NAME = "XTALK_CORRECTION_BY_QUADRANT"
INTERCHANGE_FORMAT = "BINARY"
AXES = 3
AXIS_ITEMS = (4,4,2)
AXIS_NAME = ("SAMPLE", "LINE", "LINEAR_COEFFICIENT")
AXIS_ORDER_TYPE = "FIRST_INDEX_FASTEST"
START_BYTE = 2881
OBJECT = ELEMENT
DATA_TYPE = "IEEE_REAL"
BYTES = 8
NAME = "XTALK LINEAR COEFFICIENT"
END_OBJECT = ELEMENT
END_OBJECT = ARRAY
END