PDS_VERSION_ID      = PDS3
RECORD_TYPE         = STREAM
SPACECRAFT_NAME     = "MARS GLOBAL SURVEYOR"
TARGET_NAME         = "MARS"
OBJECT              = TEXT
 INTERCHANGE_FORMAT = ASCII
 PUBLICATION_DATE   = 1998-11-09
END_OBJECT          = TEXT
END








           Mars Orbital Camera


          Software Interface Specification
          MOC Narrow Angle and Wide Angle
          Decompressed Standard Data Products


          M. Caplinger
          Malin Space Science Systems, Inc.



          Approved by:


          _________________________
          M. Malin, Principal Investigator












          September 1998
          (formatted December 29, 1998)








































                                    Contents



           1. Introduction ......................................    1
            1.1. Purpose ........................................    1
            1.2. Scope ..........................................    1
            1.3. Applicable Documents ...........................    1
            1.4. Functional Description .........................    1
             1.4.1. Data Content Summary ........................    1
             1.4.2. Source and Transfer Method ..................    2
             1.4.3. Recipients and Utilization ..................    2
             1.4.4. Pertinent Relationships with Other  Inter-
               faces ............................................    2
            1.5. Assumptions and Constraints ....................    2
           2. Environment .......................................    3
            2.1. Hardware Characteristics and Limitations .......    3
             2.1.1. Special Equipment and Device Interfaces .....    3
             2.1.2. Special Setup Requirements ..................    3
            2.2. Interface Medium Characteristics ...............    3
            2.3. Failure Protection, Detection, and Recovery ....    3
            2.4. End-of-File Conventions ........................    3
           3. Access ............................................    3
            3.1. Access Tools ...................................    3
            3.2. Input/Output Protocols .........................    3
            3.3. Timing and Sequencing Characteristics ..........    3
            3.4. PDB Information ................................    3
           4. Detailed Interface Specifications .................    4
            4.1. Labeling and Identification ....................    4
            4.2. Structure and Organization Overview ............    4
            4.3. Substructure Definition and Format .............    5
             4.3.1. Header/Trailer Description Details ..........    9
            4.4. Volume, Size, and Frequency Estimates ..........    9




















          September 1998                                           iii



          1.  Introduction
          _   ____________

          1.1.  Purpose
          _ _   _______

          This document describes the format of the Mars Orbiter  Cam-
          era  (MOC,  previously  known  as  the Mars Observer Camera)
          Decompressed Standard Data Product for the Narrow Angle (NA)
          and Wide Angle (WA) systems.

          Note that this product is explicitly not called  an  Experi-
          ment  Data  Record (EDR), because it has undergone more pro-
          cessing (decompression and error  correction)  than  an  EDR
          traditionally  sees.   The  closest  thing to an EDR product
          which will be archived are the raw MOC instrument packets.

          1.2.  Scope
          _ _   _____

          The format and content specifications in this SIS  apply  to
          all  phases  of the project for which this product is avail-
          able.

          1.3.  Applicable Documents
          _ _   __________ _________

          Mars Global Surveyor Science Data Management Plan (JPL  542-
          310)

          Mars Global Surveyor Project Archive Generation,  Validation
          and Transfer Plan (JPL 542-312)

          Mars Global Surveyor Project Data Management Plan (JPL  542-
          403)

          Mars Observer Camera Software User's Guide (Part  1:  Flight
          Software)

          Mars Observer Camera Instrument Template (I-Kernel PDS docu-
          ment)

          Mars Observer Project Archive Policy and Data Transfer Plan,
          642-447.

          Planetary Science Data Dictionary Document, PDS Version 2.0,
          May 1991.

          Margaret Cribbs, "Comments on the MOC label",  IOM#  361-92-
          MAC016, 2 April 1992.

          1.4.  Functional Description
          _ _   __________ ___________

          1.4.1.  Data Content Summary
          _ _ _   ____ _______ _______

          Each MOC Decompressed Standard  Data  Product  is  a  single
          image in decompressed format.


          September 1998                                             1










          The only formatting  differences  between  Narrow  and  Wide
          Angle  products  are the maximum possible width of the image
          (2048 for the Narrow Angle and 3456 for the Wide Angle)  and
          the presence or values of some of the keywords; the products
          are otherwise formatted identically.

          1.4.2.  Source and Transfer Method
          _ _ _   ______ ___ ________ ______

          MOC products are produced by the `makepds' program from  the
          format  internally used at the MOC Mission Operations Facil-
          ity (MOF).  This program reads a raw image file (see the MOC
          Software  User's  Guide), extracts some information from its
          headers, formats and attaches the PDS  labels,  and  appends
          the image data.

          It is expected that there will be three ways to receive  MOC
          products:  by  electronic file transfer from the MOC MOF, by
          electronic file transfer from the Project Database,  and  on
          some archival medium such as CD-ROM.

          1.4.3.  Recipients and Utilization
          _ _ _   __________ ___ ___________

          These products will be available to MOC  team  members,  the
          Mars  Global  Surveyor science community, the planetary sci-
          ence community, and other interested parties.   Descriptions
          of  data rights and proprietary periods are beyond the scope
          of this document, and are discussed in the Mars Global  Sur-
          veyor  Project Archive Policy and Data Transfer Plan, and in
          unique Operational Interface Agreements between the MOC Sci-
          ence Team and other parties.

          These products will be used for engineering support,  direct
          science  analysis, or the construction of other science pro-
          ducts.

          1.4.4.  Pertinent Relationships with Other Interfaces
          _ _ _   _________ _____________ ____ _____ __________

          See the MOC Software User's Guide for descriptions of  other
          interfaces.

          1.5.  Assumptions and Constraints
          _ _   ___________ ___ ___________

          Note that this file contains decompressed image data.  It is
          a  raw image that is not corrected for instrument signature,
          effects of spacecraft motion,  or  the  effects  of  imaging
          geometry.   Although  there  is  enough  information  in the
          header to do some processing, for  more  sophisticated  pro-
          cessing  ancillary  files will be required.  These ancillary
          files are not described in this document.  Every effort will
          be  made  to  insure that this ancillary information will be
          conveniently accessible to users of MOC products (for  exam-
          ple,  it  may  be  included on the same CDROM volumes as the
          data products themselves.)  Examples of ancillary files  are


          September 1998                                             2










          calibration  files, viewing geometry files (e.g., SPICE ker-
          nels), image index tables, etc.

          2.  Environment
          _   ___________

          2.1.  Hardware Characteristics and Limitations
          _ _   ________ _______________ ___ ___________

          2.1.1.  Special Equipment and Device Interfaces
          _ _ _   _______ _________ ___ ______ __________

          Interfaces to access either  CD-ROM  volumes  or  electronic
          file transfer are described elsewhere; for example, see TBD.

          2.1.2.  Special Setup Requirements
          _ _ _   _______ _____ ____________

          None.

          2.2.  Interface Medium Characteristics
          _ _   _________ ______ _______________

          2.3.  Failure Protection, Detection, and Recovery
          _ _   _______ __________  _________  ___ ________

          Raw instrument  telemetry  will  be  archived  in  the  PDB.
          Depacketized  compressed  image data will be archived at the
          MOC MOF.

          2.4.  End-of-File Conventions
          _ _   ___ __ ____ ___________

          End-of-file  labeling  shall  comply  with  SFDU  standards;
          specifically, fixed-size records are used, the header expli-
          citly contains the record offset of each subelement  of  the
          dataset,  and  the  size  of each subelement can be computed
          from information in the header.

          3.  Access
          _   ______

          3.1.  Access Tools
          _ _   ______ _____

          Existing PDS image display programs can display these files.

          3.2.  Input/Output Protocols
          _ _   _____ ______ _________

          None identified.

          3.3.  Timing and Sequencing Characteristics
          _ _   ______ ___ __________ _______________

          None.

          3.4.  PDB Information
          _ _   ___ ___________

          These products can be retrieved using the standard PDB  key-
          words.   (The  keywords  expected to be useful for retrieval
          are FILE_NAME and START_TIME.  A higher-level catalog may be
          available but is beyond the scope of this document.)



          September 1998                                             3










          4.  Detailed Interface Specifications
          _   ________ _________ ______________

          4.1.  Labeling and Identification
          _ _   ________ ___ ______________

          The dataset ID is MGS-M-MOC-NA/WA-2-DSDP-L0-V1.0.

          Each product will have a file name of the  form  "<id>.IMG",
          where  the ID is not to exceed 8 characters, will start with
          an  alphabetic  character,  and   will   consist   only   of
          alphanumeric  characters.   For  pre-mapping  images, the id
          will be of the form PPPNNNMM, where PPP is a  mission  phase
          descriptor,  NNN is the orbit number, and MM is the image of
          that orbit.  (For the mapping  mission,  the  expected  form
          will be PPPIIIII, where PPP will be a three-character string
          defining the mapping cycle,  and  IIIII  will  be  an  index
          within  the  mapping  cycle.)  The  file name will be unique
          across all MOC data product files.  Case is not significant;
          under  the  Unix  operating  system,  the names will be con-
          sidered to be in all lower-case.

          4.2.  Structure and Organization Overview
          _ _   _________ ___ ____________ ________

          All MOC images must be a multiple of 16 pixels in both width
          and  height.   Images  are  broken  up  into subimages (also
          called  fragments),  and  each   fragment   is   transmitted
          separately.   Raw  and  predictively  compressed  images are
          reconstructed by concatenating all of their image  fragments
          and  then  processing;  transform compressed images are pro-
          cessed a fragment at a time.

          A MOC data product consists of one image with  decompression
          applied.   In  the  event  of  data  loss  caused by packets
          dropped in the space-to-earth link or in the ground  segment
          of  the DSN, a standard first-order correction algorithm has
          been applied.  Selected MOC images may have  had  additional
          corrections applied; this archive represents the best avail-
          able reconstruction at the time of archive production.

          PDS_VERSION_ID                 PDS3
          FILE_NAME                      "filename"
          RECORD_TYPE                    FIXED_LENGTH
          RECORD_BYTES                   nnnn
          FILE_RECORDS                   nn
          LABEL_RECORDS                  nn
          ^IMAGE                         nn
          SPACECRAFT_NAME                MARS_GLOBAL_SURVEYOR
          MISSION_PHASE_NAME             AEROBRAKING-1; SPO-1; SPO-2; MAPPING
          TARGET_NAME                    MARS
          INSTRUMENT_ID                  MOC-NA or MOC-WA
          PRODUCER_ID                    MGS_MOC_TEAM
          DATA_SET_ID                    MGS-M-MOC-2-DSDP-L0-V1.0
          PRODUCT_RELEASE_DATE           yyyy-mm-ddThh:mm:ss.fff



          September 1998                                             4










          PRODUCT_CREATION_TIME          yyyy-mm-ddThh:mm:ss.fff
          SOFTWARE_VERSION               "id-string"
          UPLOAD_ID                      "version-id"
          PRODUCT_ID                     "product-id"
          START_TIME                     yyyy-mm-ddThh:mm:ss.fff
          IMAGE_TIME                     yyyy-mm-ddThh:mm:ss.fff
          STOP_TIME                      yyyy-mm-ddThh:mm:ss.fff
          SPACECRAFT_CLOCK_START_COUNT   "sclk-string"
          SPACECRAFT_CLOCK_STOP_COUNT    "N/A"
          FOCAL_PLANE_TEMPERATURE        ff.fff
          GAIN_MODE_ID                   "gain-id"
          OFFSET_MODE_ID                 "offset-id"
          LINE_EXPOSURE_DURATION         ff.fff
          DOWNTRACK_SUMMING              nn
          CROSSTRACK_SUMMING             nn
          EDIT_MODE_ID                   "nnnn"
          FILTER_NAME                    RED or BLUE
          RATIONALE_DESC                 string
          OBJECT                         IMAGE
          LINES                          nnn
          LINE_SAMPLES                   nnn
          LINE_PREFIX_BYTES              nnn
          LINE_SUFFIX_BYTES              nnn
          SAMPLE_TYPE                    UNSIGNED_INTEGER
          SAMPLE_BITS                    8
          SAMPLE_BIT_MASK                2#11111111#
          CHECKSUM                       16#xxxx#
          END_OBJECT
          END CCSD3...


          4.3.  Substructure Definition and Format
          _ _   ____________ __________ ___ ______

          PDS_VERSION_ID
               The PDS version number for  the  header  format;  e.g.,
               PDS3.

          FILE_NAME
               The file name for these products; see above.

          RECORD_TYPE
               The record type; always  FIXED_LENGTH  for  these  pro-
               ducts.

          RECORD_BYTES
               The number of bytes per record.   For  these  products,
               the same as the LINE_SAMPLES field of the IMAGE object.

          FILE_RECORDS
               The total number of records in  this  file.   The  last
               record will be padded with zeros if necessary.




          September 1998                                             5










          LABEL_RECORDS
               The number of records used for header data.  If needed,
               the  last  record  of  the  header  will be padded with
               blanks.

          ^IMAGE
               Pointer to the starting record of the image  object  in
               the file.

          SPACECRAFT_NAME
               Always MARS_GLOBAL_SURVEYOR.

          MISSION_PHASE_NAME
               Name of the mission phase; e.g., AEROBRAKING-1.

          TARGET_NAME
               The name of the target body; typically MARS.

          PRODUCER_ID
               Always MGS_MOC_TEAM.

          DATA_SET_ID
               Always MGS-M-MOC-2-DSDP-L0-V1.0.

          PRODUCT_RELEASE_DATE
               Date of this product's  release  to  the  Project  Data
               Base.   This  date  does  not  imply  the  end  of  the
               proprietary period.

          PRODUCT_CREATION_TIME
               Time and date of this file's creation.  Note that  this
               time  is  the time of this file's creation in this for-
               mat, and does not reflect the acquisition time  or  the
               time  of  any  other  processing that may be associated
               with this product.

          SOFTWARE_VERSION
               Identifier of the version of the MOC Ground Data System
               software that created this product.

          UPLOAD_ID
               Identifier of version of the MOC flight  software  used
               to acquire this image.

          PRODUCT_ID
               (This field replaces the earlier IMAGE_ID field.)  This
               uniquely identifies this MOC product among all MOC pro-
               ducts.  The MOC product ID format  for  pre-mapping  is
               xxx-ooo/nnn,  where  xxx is a mission phase string, ooo
               is the orbit number and nnn is the image on that orbit;
               e.g.,  SPO1-501/01.  For the mapping mission, we expect
               to use Mcc/nnnnn, where c is the mapping  cycle  number
               and  nnnnn is an index within that mapping cycle; e.g.,


          September 1998                                             6










               M01/12345.

          START_TIME, IMAGE_TIME
               SCET (UTC) time at start of image  acquisition.   These
               two   fields  are  always  the  same.   (IMAGE_TIME  is
               included for compatibility with  earlier  non-MOC  pro-
               ducts.)

          STOP_TIME
               SCET (UTC) time at end of image acquisition.   This  is
               redundant  and can be computed from the start time, the
               line clocking rate, and the number of lines.

          SPACECRAFT_CLOCK_START_COUNT
               Value of spacecraft clock at start  of  image  acquisi-
               tion.   This  is redundant with the above times, unless
               there is an anomaly with  the  spacecraft  clock.   The
               format  of  this  field  is  compatible  with  the NAIF
               Toolkit software  (e.g.,  "00610499:32")  There  is  no
               corresponding  STOP_COUNT  because  the timing of a MOC
               image, once started, is independent of  the  spacecraft
               clock.

          The following information can be used, along  with  calibra-
          tion  files  to be included on the volume, to calibrate each
          image.  This information is in  some  sense  redundant  with
          that  in  the  E-kernel  (presumably  a separate file on the
          volume), but as of now,  the  E-kernel  is  still  too  ill-
          defined to be a reliable source of information.  See the MOC
          I-kernel for more information on calibration.

          FOCAL_PLANE_TEMPERATURE
               Temperature of focal plane of optical system associated
               with this image, in degrees Kelvin.

          GAIN_MODE_ID
               The MOC gain setting in hexadecimal.

          OFFSET_MODE_ID
               The MOC offset in integer steps of 5 DN.

          LINE_EXPOSURE_DURATION
               Per-line exposure duration in  units  of  milliseconds.
               The time a given line was acquired can be determined by
               multiplying the line exposure time  by  the  number  of
               previous  lines  and adding it to the image start time.
               Note  that  the  NA  implements  downtrack  summing  by
               increasing  the  line  time;  for example, a 2X2 summed
               image has an actual line time twice that given by  this
               field.   Similarly,  the gain is adjusted appropriately
               for summed NA images; for example, a 2X2 summed image's
               gain is reduced by a factor of 2.



          September 1998                                             7










          DOWNTRACK_SUMMING, CROSSTRACK_SUMMING
               The MOC can do pixel averaging in the instrument before
               transmission.   For  the NA, this must range from 1 (no
               summing) to 8x summing, and  downtrack  and  crosstrack
               summing  must  be  equal.   For  the  WA, downtrack and
               crosstrack summing range from 1 to 127, and can be dif-
               ferent.

          EDIT_MODE_ID
               The edit mode is the first pixel of the CCD sampled for
               the image acquisition, and thus specifies the off-nadir
               look angle.  For WA products, the  special  value  3456
               indicates  that  the leading dark reference pixels were
               acquired as the first eight pixels of  each  line;  the
               special  value  3472  indicates  that the trailing dark
               reference pixels were acquired as the last eight pixels
               of  each  line.   For  WA products, if dark pixels were
               acquired and compression was enabled, the  dark  refer-
               ence  pixels  are  compressed and included in the data.
               An EDIT_MODE_ID value of "0" refers to the first  pixel
               in the array.

          FILTER_NAME
               Either RED for the red Wide Angle or BLUE for the  blue
               Wide Angle.  Does not appear for NA products.

          RATIONALE_DESC
               A text description of the scientific  purpose  for  the
               acquisition of this image; e.g., "Monthly monitoring of
               aeolian features on summit of Pavonis Mons".

          For  some  specific  images,  this  string  will  contain  a
          description  of  the image as actually received; for routine
          mapping operations, it will more likely be the goal  of  the
          image  as targeted (which may not be met if the image missed
          its target significantly.)

          The following describe keywords found internal to the  IMAGE
          object.

          LINES
               Number of lines in the image.

          LINE_SAMPLES
               Number of samples per line in the image.

          LINE_PREFIX_BYTES
               Number of bytes of prefix  information  per  line.   If
               these  bytes  are  present,  they  are the leading dark
               reference pixel values.

          LINE_SUFFIX_BYTES
               Number of bytes of suffix  information  per  line.   If


          September 1998                                             8










               these  bytes  are  present,  they are the trailing dark
               reference pixel values.

          SAMPLE_TYPE
               Type of each sample; for MOC, always UNSIGNED_INTEGER.

          SAMPLE_BITS
               Number of bits for each sample; for MOC, always 8.

          SAMPLE_BIT_MASK
               Bit mask description for each sample; for  MOC,  always
               2#11111111#.

          CHECKSUM
               This is a checksum for the  entire  data  part  of  the
               image, to be used for data validation.

          4.3.1.  Header/Trailer Description Details
          _ _ _   ______ _______ ___________ _______

          See above.  No trailers are present.

          4.4.  Volume, Size, and Frequency Estimates
          _ _   ______  ____  ___ _________ _________

          The total volume of MOC data to be returned is approximately
          45  GBytes.   Volume  returned  varies  as a function of the
          available data rate; see the Archive Policy and Data Manage-
          ment Plan for more details.

          It is not known what fraction of total MOC  return  will  be
          used for products of a particular type (e.g., NA or WA).  It
          is also not known what average amounts of  compression  will
          be used, although a nominal value of 5:1 is expected.























          September 1998                                             9