Level 2 Help for FARENC

INP

 1 or 2 input files.

       The required first file is an input picture containing the
       target body. The maximum size is 1400 by 1400.

       The optional second file (IBIS tiepoint format) contains GEOMA
       parameters for geometrically correcting the input picture. 


OUT

 0-3 Output Files:

 The LAST output file contains GEOMA parameters which the user can use
 as a secondary input to GEOMA (along with the input image to FARENC) to
 produce an image with the target body centered on NL/2.,NS/2.
 This file will have the format of an IBIS tiepoint file  and will contain the 
 GEOM parameters necessary to translate the picture to the center of the 
 output picture.  If the second input is provided, geometric correction
 will be included in the translation. Since for GLL project there are
 no reseaus the geometric correction is included for all inputs
 not already corrected.
 (See parameter GEOM)

 In addition 2 optional output files may be specified: CURVE and POINTS:

   CURVE must be the first output data set, if it is desired.  It is the
   size of the input picture, and displays all of the limb fitted curves
   superimposed on the target body.

   POINTS must be the the second output data set, if it is desired.  It
   is a byte image the size of the input picture containing a display of
   all limb points. 
   All limb points used in the fitting are in black.
   All candidate limb points not used in the fit are in white.

Note: If the input image has a map3 perspective label placed there by
      the PERSLAB program Farenc will ignore the sedr/spice and
      will write the planet center to an output file called: FARENC.POS
      This file is a Vicar image, has 1 line & 2 samples with the
      real values line,sample.


SIZE

 4 INTEGERS - A Vicar SIZE field which is ignored unless the GEOM
 is specified, then Number-of-lines and Number-of-samples refer
 to the size of the output file containing the translated image.


SL

 INTEGER - Starting line in the input file to be processed


SS

 INTEGER - Starting sample in the input file to be processed


NL

 INTEGER - Number of lines in the input file to be processed


NS

 INTEGER - Number of samples in the input file to be processed


FORMAT

 ('HALF or 'BYTE) - Specifies the Input picture, the Curve data set
  and the GEOMed image are to be in halfword or byte format.
  Default is to read the format parameter in the VICAR label.


NOSEDR

   A keyword which specifies that SEDR file information is to be ignored.
   The default is to read the SEDR file.


RANGE

  The maximum permitted error in the SPICE/SEDR location of the
  planet center in pixels.  This range is used to restrict farenc
  in it's search for the planet center from the predicted SPICE
  planet center location. Default is 400 for VGR and 250 for GLL.
  If no sedr/spice available it defaults to the picture size.
  Range is the diameter of the error circle.
  Does not apply if an unconstrained circle is used.


INITCEN

Real, 2 values representing the initial line,samp location of the
planet center. The default is to consult the sedr/spice. If no
sedr/spice is available this will default to the image center.
Ignored for the unconstrained circle. This is an object space coordinate.
Example: initcen=(256.,256.)  



DNTHRESH

 INTEGER - All pixels whose DN's are less than DNTHRESH will
 be ignored.  No activity value will be computed for such
 pixels and they will never be considered as a potential
 target body limb position.
 Default is DNTHRESH = 30 for byte and 200 for halfword.
 See AUTO keyword.


ACTIVITY

 INTEGER - All pixels whose activity value is less than
 ACTIVITY will be ignored.
 If 'AUTO keyword is NOT used: Default is ACTIVITY = 55.
 See AUTO keyword.


DISTANCE

 INTEGER - Each column and row through out the picture is
 searched for two maximum activity values.  The values must be
 at least DISTANCE apart.  If no two acceptable values occur
 at a separation of at least DISTANCE pixels, the value with
 the least activity measure will be discarded. This value is
 used to assure both sides of the target body are represented.
 Default is DISTANCE = 10


HEIGHT

 REAL - The maximum accepted ratio between the activity
 values of the second and first maximum on each line and
 column.  A HEIGHT of 1 would indicate that the second largest
 value must be at least equal to the largest value.
 This would virtually preclude a second value.
 Default is HEIGHT = 0.60.


BELOW

 At least one of the
 adjacent 8 pixels must lie at or below the value BELOW.
 To use this parameter the value of BELOW must be above
 the dark current.
 Default is 30 for byte and 200 for halfword pictures. 
 See AUTO keyword.


AUTO

 'AUTO - 
 AUTOmatically resets ACTIVITY
 AUTOmatically resets DNTHRESH
 AUTOmatically resets BELOW
 depending on the maximum DN in the picture.  The maximum
 DN is determined by computing a certain percentage of the
 way down from the top of the histogram (See PERCENT).
 If this value is MAXDN then the following defaults are
 evaluated:

       ACTIVITY = (MAXDN-OFFSET)/7 
       DNTHRESH = (MAXDN-OFFSET)/7+OFFSET
       BELOW    = (MAXDN-OFFSET)/7+OFFSET

 Parameters override all defaults and auto values.
 For the case of halfword pictures, DN
 values above 14000 will be truncated to 14000.


FRACTION

 This parameter is a user-supplied estimate of the fraction of the
 target body that is contained in the image.  It is only used in the
 AUTO algorithm (see parameter AUTO), in estimating the lowest DN
 on the planet.  Its most reliable usage is when the entire planet is
 in view, in which case the user would specify FRACTION=1.0 in order
 to enable this algorithm.  (Estimating the fraction of a partially
 covered target body may lead to erroneous results, and should be
 done with care.)

 Note that the default value of 0.0 does NOT mean that by default
 the target body is 100% off the image, but merely serves to disable
 this algorithm:  by default, the AUTO algorithm will not attempt to
 take account of the size of the target body in the image.


OFFSET

 INTEGER _ Specified when a Dark Current OFFSET has been
 added to the picture. The offset is used only in computing
 the new ACTIVITY value in the AUTO mode.
 Default is OFFSET = 0.


PERCENT

 REAL - The PERCENTage to bypass at the top of the histogram
 for AUTO.
 Default is 0.20.
 NOTE PERCENT is ignored if AUTO is not specified.


LINC

 INTEGER - The interval between lines to be read for computing
 the AUTO histogram.
 Default is 5.
 LINC is ignored if AUTO is not specified.


CLUSTER

 2 INTEGERS - (C1,C2) -  The half-width of a box in pixels (C1) and
 the minimum number of limb points to be contained within the box(C2).
 For each candidate limb point, a check is made of the number of
 other points lying within a box of dimension 2*C1 pixels centered at the
 point. If the number is less than C2, the point in question is
 rejected from the set of possible limb points.  Rejected points
 do not appear as white on the points display data set of FARENC.
 Default is C1 = 30, C2 = 24. ( C1 > C2)


AREA

 4 INTEGERS - (Starting-Line, Starting-Sample, Number-of-Lines,
 Number-of-Samples) - The search for candidate limb points will only
 be performed within the specified area.
 Default is to search the entire image.  Points located will be with
 respect to L=1, S=1.


MEDIAN

 ODD INTEGER - The filter width.  If specified , each picture line
 will be low pass filtered. The median filter has the advantage of
 passing unchanged all samples which are monotonic within MEDIAN pixels
 Default is to perform no filtering.


LCIRCLE

 KEYWORD - ('LCIRCLE) - Causes the candidate limb points to be
 selected from the extremum ends of each row and column, i.e., the
 furthest left and right on the line and the furthest top and bottom
 on the column.  LCIRCLE is to be used with RING.


SIGACT

 REAL - One pass is made through the initial set of potential
 limb points in order to reject all values of activity which
 deviate from the mean activity by more than SIGACT activity.
 Default is SIGACT = 2.5.


SIGMA

 REAL - In order to eliminate spurious points the program will iterate,
 each time rejecting points which give an error in radius from the
 last least squares fit of a circle by more than +/-SIGMA * sigma where
 sigma is the standard deviation of all the errors.  The process ceases
 when all points lie within +/- TOLERANCE.
 Default is SIGMA = 1.70.


TOLERANC

 REAL - A final solution for the target body center and radius requires all
 points on the limb must lie within +/-TOLERANCE of a least square radi
 (see operation)
 Default is TOLERANCE = 1.0.


SUNANGLE

 REAL - The direction of the sun in degrees measured about the target body
 center clockwise from up.  If SEDR is available SUNANGLE will be
 computed automatically.  SUNANGLE allows FARENC to reject terminator
 points for low phase angles.


PRINT

 KEYWORD - ('PRINT) - Causes a listing of line, sample and radial
 error of all points which were used to compute the target body center.


MAXNUM

 INTEGER - The maximum number at points on any video line which
 can be usd in the line fit .  This eliminates the use of a bad
 line in the fit.
 Default is MAXNUM = 10.


RESCALE

 REAL - Specifies the ratio of the desired target body diameter
 (major axis) in pixels to the smallest picture dimension
 (obtained from the size field).  RESCALE provides a
 magnification effect if GEOM is also specified.
 Default is no magnification.
 NOTE: if rescale > 1 the planet will exceed the picture size !


UPDATE

 KEYWORD - Specifies that the SPICE kernel/SEDR data will
 be updated.


NORANGLE

 REAL - Specifies the rotation angle ( in degrees ) of the minor
 axis of the ellipse measured clockwise from up about the ellipse
 center.
    Or the north angle of the projected spin axis of the target body
 into the picture measured clockwise from up about the target body
 center in degrees.


ANGLE

 REAL - Specifies the rotation angle ( in degrees ) of the minor
 axis of the ellipse measured clockwise from up about the ellipse
 center.
    Or the north angle of the projected spin axis of the target body
 into the picture measured clockwise from up about the target body
 center in degrees.


SMAA

 REAL - Specifies the semimajor axis of the ellipse in the picture
 in pixels.


SMIA

 REAL - The semiminor axis of the ellipse in the picture in pixels.


FOCL

 REAL - The camera focal length in millimeters.


FOCAL

 REAL - The camera focal length in millimeters.


SCALE

 REAL - The scale in pixels/mm. of the picture.


PSCALE

 REAL - The number of pixels per millimeter in the camera focal plane.


RADIUS

 REAL - The polar and equatorial radius of the target body in kilometers


REQUATOR

 REAL - The target body equatorial radius in kilometers.


RPOLE

 REAL - The target body polar radius in kilometers.


FAR

 REAL - The distance between the target body center and the spacecraft
 measured in kilometers.
 Default is -400.


RMAG

 REAL - The distance between the target body center and the spacecraft
 measured in kilometers.
 Default is -400.


SLATIUD

 REAL - the geocentric latitude of the subspacecraft point in degrees.


LATITUDE

 REAL - the geocentric latitude of the subspacecraft point in degrees.


RING

 REAL - The radius of Saturn's ring (km).  If RING is specified,
 REQUATOR and RPOLAR are unnecessary.  This causes a fit to be
 made to the ring rather than to the target body. (see LCIRCLE)


LONGITUD

 REAL - The geocentric longitude of the subspacecraft point in degrees.


SOLAR

 2 REALS - (Solar-Latitude, Solar-Longitude) - Subsolar latitude and
 longitude.


PLANET

 KEYWORD - This parameter selects the name of a solar system object.
 Specification of any of these keywords sets the polar and
 equatorial radii to the values currently stored in the Vicar
 subroutine GETPLACON.  (The values returned are in km.)

 The program default values indicating "no data available" are:
            Polar radius = Equatorial radius = -400.0 km.


BEGIN

Percentage of the initial limb candidate points required to fall
within 1 pixel of the limb fit function (circle or ellipse).
Only used in the 'NEW mode of FARENC (as opposed to 'OLD mode).
If this condition fails then the program reduces the percentage
by 10 percent and tries the fit all over again. Eventually the percentage 
may get down from BEGIN to 10 percent, the lowest permitted percentage.
If there still is no solution the solution for the smallest
residual is returned.
Defaults to 80 percent.


FDS

 FDS=integer overrides the FDS number in the input image label.


SERNO

 SERNO=integer overrides the camera serial number in the input image label.


CENTER

 CENTER=(line,sample) causes the center of the target in the output image
 to be set to the specified coordinates. The default is to put the center
 at the center of the output image.


PUTNORTH

 PUTNORTH=(real) causes the pole of the target body in the output image
 to be rotated to the PUTNORTH position. The coordinates are clockwise 
 from up.
 The pole must be positioned such
 that the total rotation is < 45 degrees
  PUTNORTH=0. puts the pole vertical in the output image.


TARGET

Ex: TARGET=GANYMEDE specifies that GANYMEDE is the target in the input image.

The TARGET may be a planet, satellite, or asteroid.  A complete list of valid
target names is located in the ASCII file assigned the logical name (or
environmental variable) BODY_IDS.
If defaulted, the target is retrieved from the VICAR label or other TBD means.


SPICEMODE

SPICEMODE=LOCAL specifies that SPICE data is to be accessed from local
SPICE kernels.  SPICEMODE=REMOTE specifies that SPICE data is to be accessed
via the SPICE server.  If SPICEMODE is defaulted, the logical name (or
environmental variable) DEFAULTSPICE is used to determine whether LOCAL or
REMOTE is used.

Note that if SPICE data is not found in LOCAL or REMOTE mode, the other mode
is attempted in order to retrieve SPICE data.  However, when improved camera
pointing data is stored, only the specified or default mode is used.


CKNAME

CKNAME is a four character string specifying the C-kernel to be used in reading
camera pointing data:

  CKNAME	C KERNEL
  --------      -------------
  DAVI		MIPS_DAVI.CK
  NAV		MIPS_NAV.CK
  FARE		MIPS_FARENC.CK
  NAV2		MIPS_NAV2.CK
  NEAR		MIPS_NEAR.CK
  AMOS		MIPS_AMOS.CK
  NAIF		the best NAIF kernel is used

If defaulted, the kernels are searched in the above order.


CKID

CKID is an alternative way to specify the prefered C-kernel for reading
camera pointing data (see CKNAME parameter):

  CKID	  CKNAME	C KERNEL
  ----	  --------      -------------
  M906	  DAVI		MIPS_DAVI.CK
  M905	  NAV		MIPS_NAV.CK
  M904	  FARE		MIPS_FARENC.CK
  M903	  NAV2		MIPS_NAV2.CK
  M902	  NEAR		MIPS_NEAR.CK
  M901	  AMOS		MIPS_AMOS.CK
  varies  NAIF		there are a large number of these files

Ex:  CKID=M901 specifies the four character ID which uniquely identifies the
     C-kernel MIPS_AMOS.CK.

A complete list of the C-kernel IDs is located in the ASCII file assigned the
logical name (or environmental variable) KERNELDB.

If specified, CKID overrides the CKNAME parameter.


INSTITUTE

INSTITUTE is a four character string identifying the facility which creates
the improved (C-Smithed) camera pointing.  If defaulted, the value of the
logical name (or environmental variable) VICAR_SITE is used.

Ex:  INSTITUTE=ASU identifies ASU as the creator of the improved camera
     pointing.


PURPOSE

PURPOSE is a four character string identifying the purpose of the observation
or the purpose of processing.  For example,
  PURPOSE=MOSA identifies the image as part of a mosaic sequence
  PURPOSE=COLO identifies the image as part of a color sequence


REQNUM

REQUNUM is a four character string identifying the IPL request number for
which the camera pointing was created.  REQNUM must contain exactly 4 digits.

Ex:  REQNUM=0123 identifies (somewhat) request number R000123


CDATE

Date and time the camera pointing was created in the form 'YEARMMDDHHMM'.
The date string must contain exactly 12 digits.

Ex:  CDATE=199602291200 specifies that the pointing was created at noon
     on February 29, 1996.

If defaulted, the current date and time is used.


GROUPID

GROUPID is a three character string which identifies the group of the user
running this program to store improved camera pointing.  (The user ID is
automatically determined by the program).

Ex:  GROUPID=040 identifies group 040 as the creator of the camera pointing.

On VMS, this parameter is ignored since the program automatically determines
the group ID of the current user.

If GROUPID is defaulted on Unix, the program uses the value of the
environmental variable GROUPID.  Note that GROUPID is not a system-defined
variable, and should be defined in your .cshrc as in the following example:

Ex:  setenv GROUPID 040


PCL

 NAME--OPTIONAL
 Specifies the name of a TCL variable to contain the derived planet 
 center line.


PCS

 NAME--OPTIONAL
 Specifies the name of a TCL variable to contain the derived planet 
 center sample.