etgetproj, lldist, llxyz, sunxyz, etllbox - Miscellaneous earth transform functions

SYNOPSIS

#include <etx.h>
#include <terrno.h>

int etgetproj(xfm)
ETXFORM xfm;

double lldist(lat1, lon1, lat2, lon2)
double lat1, lon1, lat2, lon2;

int llxyz(lat, lon, x, y, z)
double lat, lon;
double *x, *y, *z;

int sunxyz(date, time, x, y, z)
int date;
double time;
double *x, *y, *z;

int etllbox(xfm, sl, ss, nl, ns,
            minlat, maxlat, minlon, maxlon)
ETXFORM xfm;
int sl, ss, nl, ns;
double *minlat, *maxlat;
double *minlon, *maxlon;

DESCRIPTION

etgetproj extracts the projection code from the earth transform encoded in xfm. Projection codes are listed in include/etx.h.

lldist returns the approximate distance in kilometers between (lat1,lon1) and (lat2,lon2). Latitudes and longitudes are in degrees. The formula used is based on a spherical earth:

EARTH_RADIUS * arc cos ( sin(lat1) * sin(lat2) + cos(lat1) * cos(dlat2) * cos(lon2-lon1) )

llxyz computes geodetic (x,y,z) coordinates in radians given input (lat,lon) coordinates. An elliptical earth is assumed.

sunxyz computes the unit vector (x,y,z) pointing to the sun for a given date and time. date and time are passed using standard TeraScan data and time formats.

etllbox estimates the lat/lon box that covers a particular dataset subsection. sl is start line, ss is start sample, dl is line delta, ds is sample delta for the subsection.

minlat is the southmost latitude of the bounding box; maxlat is the northmost latitude. minlon is the westmost longitude of the bounding box; maxlon is the eastmost longitude. If the dataset subsection contains either the south or north pole, the bounding box runs from 180 degrees west to 180 degrees east.

RETURN VALUES

etgetproj returns the projection code from xfm; -1 is returned if the projection code is invalid. terrno is set to ET_UNKNOWN_PROJ.

lldist returns double precision distance. The input (lat,lon) coordinates are not checked for validity.

llxyz and sunxyz return 0 always. Input parameters are not checked for validity.

etllbox returns 0 if sucessful. Otherwise it returns -1 and sets terrno to the appropriate error code.

ERRORS

Earth transform affine mapping is singular.

Unknown projection passed by way of ETXFORM xfm.

Iterative conversion algorithm failed to converge.

Bad look angles produced from sensor geometry.

Sensor is looking into outer space, not at the earth.

FILES

include/etx.h, include/terrno.h, lib/libetx.a

SEE ALSO

etcoords, etnames, etnav, etready, etxll etx


Last Update: $Date: 1999/05/10 20:56:36 $