PDS_VERSION_ID           = PDS3
RECORD_TYPE              = STREAM
SPACECRAFT_NAME          = "PHOBOS_2"
OBJECT                   = TEXT
 NOTE                     = "Description of software provided with
                              the ISM data base"
 PUBLICATION_DATE         = 1998-09-1
END_OBJECT               = TEXT
END


 Processing of ISM/Phobos data




     This file describes the software provided with the ISM data base. The
programs used to generate calibrated data and coordinates files are included,
as well as fortran and IDL programs to read, plot and extract the information.
IDL routines provided here are only intended as skeletons of procedures to be
developed by the user, while fortran programs are completely functional.

     All fortran programs were originally written to run on Vax / VMS
machines, and use Digital fortran with non-standard instructions. The
decompression programs are not intended to run under other systems, and this
is normally not required (their outputs are all available in the directories
EDT_DATA and GEOMETRY). Graphic programs in fortran were used in early
processing of the data; they are again written in Digital fortran, and rely on
the UNIRAS graphic library to perform plotting and mapping. They use graphic
formats that are probably obsolete now, and are provided as is to look at the
data without using IDL.

     IDL routines have been tested on under MacOS, Unix, and Window in IDL
version 4 and 5 (up to 5.4). They assume an X-like device with 240 colours.
IDL routines use the PDS-like directories' hierarchy of the data base, and
normally adjust the path names to the system in use; they also swap byte order
automatically depending on the machine architecture (little-endian vs
big-endian). However, the routines may need to be adapted to local systems, in
particular for use with a version of IDL older than 3.6.

     Instructions to read the data files with the SIPS software under IDL are
also included at the end of this file.




1) Writing the decompressed data


Convert.for

     Decompresses raw telemetry files in directory /RAW_DATA/FLIGHT and
corrects some telemetry errors. Can process files partially or in totality.
The output of the program must be considered as the primary raw data files
(EDR).

     Input
Telemetry data files in the directory /RAW_DATA/FLIGHT. The program prompts
for the month and day of observation, then for time limits. The default is to
process only the science observations in the main sessions. Providing time
limits allows to process separately the sky observations and secondary
sessions.

     Processing
Telemetry files are written so that any parameter is coded on the minimum
number of bits required to store all its possible values. This program
decompacts measured reflectances and important instrument parameters, and
stores them as 16-bits integers in a more standard format. Timing continuity
is restored, and obvious telemetry errors are corrected. The program must be
linked with the routine "DDISM.for" that decompresses the telemetry blocks.
This routine uses specific Vax Fortran functions and can run only under
Vax-VMS. The output can be read easily on any system, and is strictly
equivalent to the original telemetry files for all practical purposes.

     Output
The program writes two files for each session, corresponding respectively to
odd and even channels (xxxeven.edt and xxxodd.edt). The spectra are written in
sequence (bands interleaved by pixel, or BIP format) along the North-South
lines of the image (the order of acquisition). Each record is composed of 72
integers :
      spec(1 to 4) are hour, minute, second and eighth-second of acquisition
(spacecraft time)
      spec(5 and 6) are x and y, respectively line (W to E) and sample number
(N to S) in the acquisition grid
      spec(7) is a code for focal plane temperature
      spec(8) is a code for mirror position
      spec(9 to 72) are reflectance measurements in increasing wavelength
order for odd or even channels. This is the exact output of the instrument,
except for correction of telemetry errors. The data are actually coded on a
12-bit scale (ranging from 0 to 4096).
     The data are signed 16-bits Vax integers, i. e. little-endian format. The
files characteristics are described in "Files.pdf".


DDISM.for

     This is the routine used by "convert.for" and other fortran programs to
read and decompress the original telemetry files. It makes calls to
bits-shifting functions that are specific to Vax Fortran, and may work only
under Digital machines.


Corpho.for

     This program performs a resampling of the Phobos window. A three pixels
spatial convolution is applied to minimize registration discrepancies in the
image. Although the data are modified, the output files can be considered the
primary data files for the main Phobos image. This step is pertinent only to
the Phobos window, and replaces the registration correction applied on Mars
data as a step of the calibration process in "Etalonne.for".

     Input
Uses the two files Phoeven.edt and Phoodd.edt in the directory
/EDT_DATA/PHOBOS (written by Convert.for), Pixloc.ctr in the directory
/GEOMETRY, and
Decal2.dat in the directory /CALIB.

     Output
Writes files Phoeven.res and Phoodd.res, with format similar to the input,
located in the same directory.



2) Writing the calibrated data


Etalonne.for

     Calibrates the data and writes data files located in the directory
/CAL_DATA/MARS. The program is adapted only to the main eleven sessions on
Mars. Files corresponding to even channels form the core of the data set for
Mars. Calibrated data are also provided for odd channels, but it must be
understood that the calibration process is not optimized for those channels,
and very often is not satisfying (ie., the final relative accuracy is much
better for even channels). An 'atmosphere removed' version on the files can be
written also; the correction for atmospheric absorptions relies on a very
simple model and is only intended to compensate a part of the absorption. This
model is not adapted to the whole range of surface elevations observed, and
doesn't take atmospheric scattering into account. More accurate atmospheric
correction is part of the scientific processing of the data an dis not handled
here.
     The program was developed on a Vax-VMS machine but should run with any
Fortran compiler; the input may need to be adapted to read files of Vax
integers.

     Input
Decompressed even and odd channels data files in the directory /EDT_DATA/MARS
and calibration files in directory /CALIB. The program prompts for the month
and day of observation, then asks whether an atmospheric correction should be
performed.

     Processing
The program corrects for registration discrepancies using a three-pixels
convolution, and interpolates missing spectra wherever possible. Corrections
are performed for dark current, analogic gain, detectivity variations with
temperature, grating orders overlap, transfer function and stray light. A
rough compensation of atmospheric absorptions can be optionally performed. The
corrections applied are described in details in "DocISM.pdf".

     Output
The output format is similar to that of the input files; the only differences
are channels output (now calibrated as radiance factors) and focal plane
temperatures (now in degrees Celsius). Two files are written for each session,
corresponding respectively to odd and even channels. The spectra are written in
sequence (bands interleaved by pixel, or BIP format) along the North-South
lines of the image (order of acquisition). Each record is composed of 72
integers :
      spec(1 to 4) are hour, minute, second and eighth-second of acquisition
(spacecraft time)
      spec(5 and 6) are x and y, respectively line (W to E) and sample number
(N to S) in the acquisition grid
      spec(7) is the focal plane temperature (degrees C x 100)
      spec(8) is a code for mirror position
      spec(9 to 72) are reflectance measurements in increasing wavelength
order for odd or even channels. The values are coded from 0.0 to 0.5 on a
range of 0 to 32767. This conversion range preserves signal-to-noise without
providing numerical saturation.
     The data are signed 16-bits Vax integers, i. e. little-endian. The
sessions modes and parameters are described in "Files.pdf".

     Output files
Calibrated data are written as "xxxeven.cal" and "xxxodd.cal". For the
Ascraeus session, a file "asceven.ca0" is written. Calibrated data with
atmospheric correction are written as "xxxeven.atm" and "xxxodd.atm". These
files are located in directory /CAL_DATA/MARS.


CorAsc.for

     Writes the even channels calibrated data file for the Ascraeus image
cube. This session was acquired at gain 3, and some even channels are
saturated or non-linear in the brightest part of the image. The program
interpolate reflectance estimates in the saturated channels, and is adapted
only to this observation session.

     Input
Calibrated data for even channels "Asceven.ca0" in directory /EDT_DATA/MARS
(output of Etalonne.for).

     Processing
Reflectances in saturated channels are computed from correlation with
neighbouring channels where no saturation occurs.

     Output
Calibrated data "Asceven.cal" in directory /CAL_DATA/MARS. The format is
similar to that of the input files, and similar to the output of
"Etalonne.for".


EtalPho.for

     Writes the calibrated data files for the Phobos image cube. The program
is adapted only to this observation session. The calibration process is
optimized for even channels, although calibrated data are also provided for
odd channels. The program was developed on a Vax-VMS machine but should run
with any Fortran compiler; on other machines the input may need to be adapted
to read files of Vax integers.

     Input
Decompressed and resampled data files "Phoeven.res" and "Phoodd.res" in
directory /EDT_DATA/PHOBOS (output of CorPho.for), plus calibration files in
directory /CALIB.

     Processing
Corrections are performed for dark current, analogic gain, detectivity
variations with temperature, grating orders overlaps and transfer function.

     Output
Calibrated data "Phoeven.cal" and "Phoodd.cal" in directory /CAL_DATA/PHOBOS.
The format is similar to that of the input files, and similar to the output of
"Etalonne.for" for Mars sessions.



3) Writing the coordinates files


Coord.for

     This program computes the coordinates and viewing angles for the Mars
image cubes. It must be linked with "Orbit.for".

     Input
"xxxeven.cal" in the directory /CAL_DATA/MARS; "orbit.dat" in the directory
/GEOMETRY.

     Output
"xxx_coor.dat", located in the directory /GEOMETRY. The file has a BIP
structure with one record per pixel. Each record consists of 14 16-bits signed
integers (Vax format):
     coord(1-2): line and sample number
     coord(3-4): long/lat of the first corner
     coord(5-10): long/lat of the other three corners
     coord(11-13): incidence, emergence and phase angles
     coord(14): mirror position (coded, 0 if no data). All angles are given in
degrees, and multiplied by 100 to preserve accuracy. Longitudes are given using
the terrestrial convention (-180 degrees to 180 degrees eastward) to fit the
16-bits format; this convention is used by most cartography programs,
including IDL, although is differs from the planetary standard.


Orbit.for

     A library of fortran routines used by "Coord.for" to compute spacecraft
location and viewing direction at a given time. These routines must be linked
with the main program.



4) Extracting data


Extrait.for

     A fortran program to extract a calibrated spectrum from data files. All
128 channels are read and written in sequence of increasing wavelength.

     Input
Files "xxxeven.cal", "xxxodd.cal" located in directory /CAL_DATA/MARS, or any
other couple of data files with similar format.
Wavelength file "Lambda.dat" in directory /CALIB.

     Output
ASCII file with 3 columns (channel number, reflectance and wavelength) and 128
lines. A trailer gives the reference line and sample numbers. These files can
be plotted by the IDL routine "Affspe.pro".


Fiche.for

     Reads the telemetry data files located in the directory /RAW_DATA/FLIGHT,
and lists the value of any parameter through time. This is specially useful to
follow ancillary parameters (focal plane temperature, gain) and to check files
continuity.

     Input
Telemetry data files in directory /RAW_DATA/FLIGHT. The program prompts for a
file name, then for the code of the parameter to be followed. Important
parameters are discussed in "DocISM.pdf"; a more complete list is provided as
comments in ddISM.for, and in the hardcopy documentation.

     Processing
The program follows one parameter and write its new value each time the
parameter is updated. When focal plane temperature is selected, it is listed
both coded and translated in Celsius degrees. The program must be linked with
the routine "DDISM.for" that decompresses the telemetry files. This routine
uses peculiar Vax Fortran functions and can run only under Vax-VMS.

     Output
The program writes a nameless files on logical unit 2 (For002.dat under VMS).



5) Mapping programs in fortran


Pixtrace.for

     A versatile fortran program to plot geographic maps of spectral
parameters for the eleven sessions on Mars. Spectral parameters consist in
reflectance averaged in several channels, or in ratios of several spectral
channels. Several sessions can be plotted together, in areas that are
delimited by the user; cylindrical equidistant projection with an arbitrary
aspect ratio is used; altimetry lines from Mariner 9 can be superimposed on
the maps as an option. This program must be linked with "Fenetre.for". The
routines use the Uniras graphic library to write on various devices, but also
write directly in Regis language. This ability makes it possible to use the
program without Uniras on a Regis terminal (VT240, VT340, DecWindow...) and to
write graphic files for Regis/Sixel printers, although lots of warnings would
occur when linking without Uniras (Regis and Sixel formats are now obsolete).

     Input
Mars data files "xxxeven.cal" and "xxxodd.cal" in directory /CAL_DATA/MARS,
Orbital parameters in "Orbit.dat" and coordinate files "xxx_coor.dat" in
directory /GEOMETRY,
Color Table "Tabcol.dat" in directory /CALIB when selecting Regis file or
screen,
Elevation files "Mars%%h.dat" in directory /GEOMETRY.

     Processing
   Sessions are identified by the month and day of acquisition. Several
sessions can be entered in a sequence finishing by 0.
   Spatial smoothing can be selected to reduce noise; smoothing uses the four
adjacent pixels, with half the weight of the central pixel.
   The program then prompts for two series of channels to study; each series
is ended with a 0. If a series contains more than one channel, reflectance is
computed as the geometric average of the selected channels. The spectral
parameter plotted is the ratio of reflectances in the two series of channels.
The next option allows to use the squared value of the result (this is useful
for some spectral parameters, to preserve physical dimensions).
   If no channel is entered in the second series (2nd channel=0), the average
reflectance is converted to normal albedo through a Minnaert correction; this
correction minimizes the effects of limb darkening, but relies on several
assumptions.
   If the parameter corresponds to the 2.0 or 1.4 microns atmospheric CO2
bands (first channel = 80 or 79, 56 or 57), it is automatically corrected from
geometrical variations of the atmospheric path length; the result will then be
a measure of atmospheric pressure at the surface (i.e., a non-linear estimate
of surface elevation); this assumes that atmospheric lines are not saturated,
which may no be true wherever absorption becomes large.
   A correct parameter for a band depth centered at wavelength l with
half-width dl would be r(l) / sqrt(r(l-dl)*r(l+dl)). A possible parameters for
Fe2+ absorption at 1 micron is for example: 18, 0, 10, 26, 0. This kind of
ratio is proportional to the second logarithmic derivative, and depends on
calibration errors only through a scaling coefficient (see e.g., Erard et al.
1991).
   Limit values must be entered. The corresponding interval is sliced into 16
classes. The mean value and standard deviation are printed after the map is
displayed to help refining these limits.
   Coordinates are entered using the Mars convention (longitudes from 0 to 360
westward); the display uses an aspect ratio of 4/5 in latitude/longitude.
Values adapted to VMC, HEB and ASC image cubes are for instance: 50, 120, -28,
28. If the option "Hypsometry" is selected, altimetry lines will be
superimposed on the map in areas comprised between -30 and 30 degrees in
latitude; these data were hand-digitized from Mariner-9/Viking maps (UV
measurements + stereophotogrametry) and may be relatively inaccurate.

     Output
   The output device can be a color Regis screen (VT340); a Regis file that
can be later typed on the screen or converted to a Sixel file for use with a
Digital color printer (Regis file); a color level-1 PostScript file
(PostScript); a Digital GPX terminal (GPX); any other device available in the
local implementation of Uniras (the display parameters may then need
optimization). The program writes directly in Regis, so no graphic library is
required with the first two options. Other devices are addressed through the
Uniras graphic library. The Regis/VT output uses a color table optimized for a
VT340 terminal, that may not give good results on other models.
A log file "carte.dat" is written.


Photrace.for

     A program to plot geographic maps of spectral parameters for the Phobos
session. The functioning is similar to "Pixtrace.for". The projection used is
stereoscopic (similar to a camera view acquired from the spacecraft), with
fixed geographic boundaries. This program must be linked with "FeneX.for" that
contains plotting functions for this single image cube.

     Input
   Phobos calibrated data files "Phoeven.cal" and "Phoodd.cal" in the
directory /CAL_DATA/PHOBOS. Screen coordinate files "Pho_scrn.dat" in the
directory /GEOMETRY, Color Table "Tabcol.dat" in the directory /CALIB,
topographic file "Gricor.dat" in directory /GEOMETRY.

     Processing
   A spatial smoothing option can be selected. Spectral channels are then
entered in two series. The interface is identical to "Pixtrace.for". No limb
darkening is performed on reflectance maps (the Minnaert exponent is unknown
in the infrared, although close to 0.5), and of course atmospheric absorption
is not considered.
   Coordinates limits are fixed since there is a single view of Phobos, and
reference topographic lines (from Tom Duxbury's 1991 model) are always
plotted. Pixels acquired in the dark sky or near the limb are not plotted.

     Output
   Output devices are handled in the same manner as in "Pixtrace.for".


Fenetre.for

     A library of fortran routines used by "Pixtrace.for" to display maps of
spectral ratios on various devices. These routines must be linked with the
program even if the Uniras library is not available.


FeneX.for

     A library of fortran routines used by "Photrace.for" to display maps of
spectral ratios on various devices. These routines must be linked with the
program even if the Uniras library  is not available. Routines have similar
names than those in "Fenetre.for" but may be different.



6) IDL routines to read and plot the main sessions


comp

     A main IDL program to compile the various routines and functions in the
correct order (may be required on some Unix systems because of upper case
routine names). Runs IDLdef.pro. Type @comp  at the IDL batch.


ISMdef

     A small routine that defines the path to the data files, according to the
operating system in use. Normally uses the data volume structure. Requires
adaptation to the local directory structure on MacOS (only absolute paths are
accepted, so this string must contain the hard disk name). This can be adapted
to run the software from a hard disk.


Pixtrace2.pro

     A routine that reads ISM calibrated data and plots a geographic map of a
session.  Allows to plot any spectral parameters (not only ratios) using a
hand-written function (/USER). Optionally plots albedo instead of radiance
factor, as estimated with a Minnaert correction (k=0.7 on Mars, k = 0.55 on
Phobos). Optionally plots odd (/ODD) or even channels, or  viewing angle.
Processes only the main observation sessions, Mars and Phobos. Normally

     Input
Request the session's acronym and a channel to be mapped (even or odd channel
number, ranging from 1 to 64).
Calls ISM_sess, ISM_lam, ISM_data, ISM_noise, and ISM_coor.
Keyword /ALBEDO plots an albedo map.
If keyword ANGLE is set to 'emergence', 'incidence' or 'phase', viewing angles
are plotted instead of reflectance values.
If keyword NONOISE is set, plots classes with width of 1 sigma minimum
(reduces the number of colors to the number of significant classes).

     Output
Plots a Mercator map on the current device. Writes an optimized Postscript
file when keyword PS is set. The map is plotted using the terrestrial
convention for longitudes, due to limitations in the standard IDL mapping
routine (map_set.pro).


ISMcom

     Widget tool to map the main ISM sessions (Mars and Phobos) and to plot
spectra. This is a frontend interface to ISM_map and ISM_plot. Maps are
plotted using the terrestrial convention for longitudes, due to limitations in
the standard IDL mapping routine (map_set.pro). OInly one session can be
plotted at a time.


ISM_plot.pro

     A routine that reads ISM calibrated data, plots a small image of the
session and extracts calibrated spectra. Optionally plots odd or even
channels. Processes only the main observation sessions, Mars and Phobos.

     Input
Requests the session's acronym and a channel number to be mapped.
Calls ISM_sess, ISM_lam, and ISM_data.

     Output
Plots spectra on the current device. Optionally writes an optimized Postscript
file.


ISM_raw.pro

     A routine that reads ISM raw data, plots a small image of the session and
extracts uncalibrated spectra. Optionally plots odd or even channels. Processes
only the main observation sessions, Mars and Phobos.

     Input
Request the session's acronym and a channel number to be mapped.
Calls ISM_sess, ISM_lam, and ISM_data.

     Output
Plots spectra on the current device. Optionally writes an optimized Postscript
file.


ISM_cal.pro

     A routine that reads extra ISM sessions, plots a small image of the
session and extracts uncalibrated spectra. Optionally plots odd or even
channels. Processes only the extra sessions: Spinning session, limb
observations, flight calibrations, extra Phobos sessions, and cruise tests.

     Input
Request the session's acronym and a channel number to be mapped (acronym is on
3 or 4 characters, depending on session).
Calls ISM_ses2, ISM_lam, and ISM_data.

     Output
Plots spectra on the current device. Optionally writes an optimized Postscript
file.


ISM_map.pro

     A routine that reads ISM calibrated data, and plots a geographic map of
the session. Optionally plots albedo instead of radiance factor, as estimated
with a Minnaert correction (k=0.7 in all situations). Optionally plots odd
(/ODD) or even channels, or  viewing angle. Processes only the main
observation sessions, Mars and Phobos.

     Input
Request the session's acronym and a channel to be mapped (even or odd channel
number, ranging from 1 to 64).
Calls ISM_sess, ISM_lam, ISM_data, and ISM_coor.
Keyword /albedo plots an albedo map; if keyword ANGLE is set to 'emergence',
'incidence' or 'phase', viewing angles are plotted.

     Output
Plots a Mercator map on the current device. Writes an optimized Postscript
file when keyword PS is set. The map is plotted using the terrestrial
convention for longitudes, due to limitations in the standard IDL mapping
routine (map_set.pro).


ISM_pho.pro

     A routine that plots a "satellite" projection of the Phobos image.
Optionally plots odd (/ODD) or even channels, or  viewing angle
(ANGLE='emergence', 'incidence', or 'phase').

     Input
Request a channel number to be mapped.
Calls ISM_sess, ISM_lam, ISM_data, and ISM_coor.

     Output
Plots a map on the current device. Optionally writes an optimized Postscript
file (/PS). The projection used mimics a snapshot from the spacecraft. Default
is to use rounded coordinates so as to get a continuous map (adjacent pixels).
Optionally, the actual pixel corner positions can be used (/REAL).


ISM_sess.pro

     A function that defines the session parameters for ISM sessions (both
Mars and Phobos). Does not attempt to read the information from the PDS labels.

     Output
Returns session parameters in a structure.


ISM_ses2.pro

     Similar to ISM_sess for other, uncalibrated, sessions (limb observations,
flight calibrations...).

     Output
Returns session parameters in a structure.


ISM_data.pro

     A function that reads ISM data files, even or odd channels, for the
session of interest. Adjusts file path syntax on some operating systems (VMS,
Unix). Change byte order on some computers using big-endian encoding (Unix
except OFS, and MacOS).

     Input
Request the session parameters in a structure as initialized by ISM_sess.pro.
Reads files xxxeven.cal or xxxodd.cal (or other files with similar structure,
as *.atm or *.edt).

     Output
Returns session data and main housekeeping parameters in a structure.


ISM_coor.pro

     A function that reads ISM coordinate files for the session of interest.
Adjusts file path syntax on some operating systems (VMS, Unix). Change byte
order on some computers using big-endian encoding (Unix except OFS, and MacOS).

     Input
Request the session parameters in a structure as initialized by ISM_sess.pro.
Reads files xxx_coor.dat for Mars and Phobos. In the case of Phobos, screen
coordinates can be read also (pho_scrn.dat and pho_scor.dat).

     Output
Returns session coordinates and viewing angles in a structure.


ISM_lam.pro

     A function that returns ISM channels wavelengths for odd or even channels.

     Input
Reads file lambda.dat (ascii file).

     Output
Returns 64 wavelengths in an array.


ISM_noise.pro

     A function that returns estimates of noise in ISM channels for odd or
even channels. Used by Pixtrace2.pro to set class limits when option NONOISE
is set.

     Input
Reads file sigtonoi.dat (ascii file).

     Output
Returns 64 noise estimates in an array.



7) Additional plotting and convolution


Lecspe.for

     A Fortran program that convolves any spectrum with ISM spectral response.
The result mimics the calibrated output of ISM looking at the same object; it
would work properly only if the spectral resolution of the input spectrum is
at least equal to that of ISM. The program may write files containing the
spectral response ("reponses.dat") and widths at half-eight ("Largeurs.dat").

     Input
Any spectrum with overlapping spectral range can be processed, but the input
format must be modified accordingly. Originally set for Relab ascii format.

     Output
Formatted ascii file with 128 lines of 3 columns: channel number (integer),
reflectance, wavelengths in microns (reals). Such files can be plotted by the
routine "Affspe.pro".


Affspe.pro

     An IDL procedure to plot calibration files and spectra. The routine reads
an ascii file with 128 lines (channels in increasing wavelength order) and
three columns, respectively channel number (integer), data and wavelength in
microns (reals). Values for odd and even channels are plotted separately (in
green and red respectively).

     Input
Output files from "Lecspe.for" (spectra integrated to ISM wavelength format),
output files from "extrait.for" (spectra extracted from data files),
most data files in directory /CALIB (except "Sourvol.det" which has a
different format), "CNChaud" and "CNFroid" in /EDT_DATA/GROUND.
Keyword DIR allows to select the directory where the file is.

     Output
Optimized for a 240-colours X-window device and PostScript device (/PS).


ISM_rep.pro

     An IDL procedure to read the spectral response of even or odd channels
(files "reponses.dat" and "reponsesi.dat"). These values are the result of
spectral calibrations with a monochromator, they are computed by "Lecspe.for".

     Input
Files "reponses.dat" or "reponsesI.dat" in the directory /CALIB.

     Output
Two (64,12) arrays, containing respectively 12 measurements per channel and
the corresponding wavelength. These values can be plotted by the routine
"Affspe.pro". They can be used to convolve any spectrum to ISM spectral
resolution.


Affrep.pro

     An IDL procedure to plot the spectral response of even channels (file
"reponses.dat"). These values are the result of spectral calibrations with a
monochromator, they are computed in "Lecspe.for". A similar file exists for
odd channels.

     Input
Calls ISM_REP.PRO that reads "reponses.dat" or "reponsesI.dat" in the
directory /CALIB.


Litbidim.pro

     An IDL procedure to plot the ground calibration file "Bidim.dat". The
instrument was mounted on a mobile platform, in front of a black body at about
120 Celsius degrees with non-uniform temperature, i.e. with a spatial
structure. The movement of the platform was used to scan the source, while the
instrument mirror remained in its rest position. This routine reconstitutes and
plots images of the source in each spectral channel. The shift between these
images is a measure of channels misregistration, and was used to compute
correction coefficients in "Decal2.dat".

     Input
"Bidim.dat" in the directory /EDT_DATA/GROUND.


Litalt.pro

     An IDL procedure to read the altimetry data base in directory
/DRV_DATA/TOPO (see Rosenqvist et al., Icarus, 1992). The routine plots a
geographical map of elevation from the files. The file also contains
measurements of vertical pressure from the data; elevation values are
retrieved from depth of the 2.0 microns CO2 band and atmospheric modeling. The
image is resampled in the longitude/latitude plane with a step of 0.3 degrees.
Accuracy is 0.1 mb in pressure, 100 m in elevation; latitude and longitude may
be different and are probably less accurate than the values in the coordinate
files (in the directory /GEOMETRY). The files have 7 columns, respectively
sample/line numbers, latitude and longitude (planetary convention), airmass
factor, pressure (mb) and elevation (km).

     Input
Files "xxxalt.dat" in directory /DRV_DATA/TOPO, except "Pavalt.dat".


Litpav.pro

     An IDL procedure to read the altimetry file for Pavonis Mons in directory
/DRV_DATA/TOPO. This routine is similar to Litalt.pro, but works only for
observations of Pavonis Mons' caldera. In addition, a block diagram is
plotted  from the data.

     Input
File "Pavalt.dat" in the directory /DRV_DATA/TOPO.



8) Instructions for using ISM data files with SIPS


     SIPS is an IDL program developed at the University of Colorado to process
data from terrestrial imaging spectrometers (mainly AVIRIS). Although it bears
no relationship with ISM, this program may be helpful to process ISM image
cubes. SIPS is distributed free of charge by the University of Colorado with
accompanying spectral libraries; it runs on several Unix machines with recent
versions of IDL implemented (contact sips@cses.colorado.edu). An atmospheric
removal program (ATREM) is provided with SIPS, but it is not adapted for the
Martian atmosphere.

     ISM data have been tested with version 1.5 of SIPS and version 3.6.1 of
IDL on HP-700 and -900 computers. SIPS can be used with IDL 4.0.1, provided
that the IDL routine XMENU can be accessed (it was part of the 3.6
distribution, but in version 4.0 it was moved to the directory "obsolete").
The files must be converted for use with SIPS, using the following procedure:

Under IDL, go to the directory containing the data. Type 'Util' to restore
the SIPS utilities. You will be prompted with a widget menu. Click on the
'subset_sips' button. A conversion menu will appear. Fill it with the required
information (all fields must be validated by Return):

- Name of input file (calibrated file from "Etalonne.for" e.g., "syreven.cal"
for the Syrtis-Isidis image cube, even channels without atmospheric correction)
- Name of output file (e.g., "syrevencal_bip.cub"; the "_bip.cub" suffix is a
useful default for SIPS input files)
- Storage order: BIP
- Number of samples: 25 (medium resolution sessions like Syrtis-Isidis) or 8
(high resolution sessions)
- Number of lines: depending on the session (121 for Syrtis-Isidis)
- Number of bands: 72 (8 parameters + 64 measurements)
- Header size: 0
- Byte order: Little Endian (this is required to convert from VMS format)
- Data type: Integer
- Image type: Other image
- Sample Mini/Max: 1 and number of samples per line (25 or 8)
- Line Mini/Max: 1 and total number of lines
- Band Mini/Max: 9 and 72. This allows to skip the ancillary data at the
beginning of the spectra.

Once this is done, click on 'Start' and exit both menus.

 DN numbers can optionally be converted back to reflectance values, using the
'flat_field' utility:

- If the input file is the one you have just converted, most of the fields
will fill up automatically.
- Enter 'norm.dat' as removal spectrum file name.
- Enter a name for the output file (using the '_bip.cub' suffix makes life
easier)

 To work with its spectral libraries, SIPS needs a wavelength file
corresponding to the session. Such files are provided for even and odd
channels separately ("waveleven.dat" and "wavelodd.dat" in directory /CALIB)
and are identical for all observations files in the data base. They must have
the same root name as the input file with a '.wav' extension (e.g.,
'syrevencal.wav' in the previous example) to take advantage of SIPS defaults.
When no wavelength file is provided, SIPS will use the channel number instead
of wavelengths; beware that spectral interval between ISM channels is twice
larger in the first order (from channel 32 among 64).

 In the main IDL window type: "sips_view, 'syrevencal'".
This will start the SIPS session opening the file "syrevencal_bip.cub" and
looking for a wavelength file named 'syrevencal.wav'. The two spectra windows
must be adapted to the file format:

- Click on 'Functions/Scale/Text entry' in the pop-up menu beneath the windows.
- Enter 9 for X Min if working with the band numbers instead of wavelengths,
and validate with Return.
- Enter 32767 (or slightly less) for Y Max if working with DN numbers. The
default value of 1000 is adapted for files converted to reflectance values
with the 'flat_field' utility. However the reflectance level in the data is
never larger than 500 and usually less than 400 (those numbers are radiance
factors multiplied by 1000).

 The image displayed is a not a map of the region observed, but is plotted on
the acquisition grid (line and sample numbers). This results in a shift of
approximately one pixel per line in the E-W direction. Also, the scene is both
rotated and transposed, so that East is on top and South is at the right of the
screen. This can be fixed with the 'rotate' utility of SIPS, but this routine
will only work on a cube with BSQ structure. Such a file can be created in
SIPS with the 'convert' utility.

