ISOPHOT Interactive Analysis (PIA): Astrolib

ASTRO


List of Routines


Routine Descriptions

ADSTRING

[Next Routine] [List of Routines]
 NAME:
	ADSTRING
 PURPOSE:
	Return RA and Dec as character string in sexigesimal format.
	RA and Dec may be entered as either a 2 element vector or as
	2 scalars.  One can also specify the precision of the declination
	in digits after the decimal point.

 CALLING SEQUENCE
	result = ADSTRING( ra_dec )	      
		or
	result = ADSTRING( ra,dec,[ precision ] )

 INPUTS:
	RA_DEC - 2 element vector giving the right ascension and declination
		in decimal degrees.
                     or
	RA     - Right ascension in decimal degrees, numeric scalar
	DEC    - Declination in decimal degrees, numeric scalar

 OPTIONAL INPUT:
	PRECISION  - The number of digits after the decimal of DEClination.
		The RA is automatically 1 digit more.  This parameter may 
		either be the third parameter after RA,DEC or the second 
		parameter after [RA,DEC].  It is not available for just DEC.  
		If no PRECISION parameter is passed, a precision of 1 for 
		both RA and DEC is returned to maintain compatibility with 
		past ADSTRING functions.  A precision of 0 will result in 
		the below format, always claimed, but but never delivered by 
		ADSTRING.

 OUTPUT:
	RESULT - Character string containing HR,MIN,SEC,DEC,MIN,SEC formatted
		as ( 2I3,F5.(p+1),2I3,F4.p ) where p is the PRECISION 
		parameter.    If only a single scalar is supplied it is 
		converted to a sexigesimal string (2I3,F5.1).

 EXAMPLE:
	(1) Display CRVAL coordinates in a FITS header, H

	IDL> crval = sxpar(h,'CRVAL*')  ;Extract 2 element CRVAL vector (degs)
	IDL> print, adstring(crval)     ;Print CRVAL vector sexigesimal format

	(2)  print,adstring(30.42,-1.23,1)  ==>  ' 02 01 40.80  -01 13 48.0'
	     print,adstring(30.42,+0.23)    ==>  ' 02 01 40.8  +00 13 48.0'
	     print,adstring(+0.23)          ==>  '+00 13 48.0'

 PROCEDURES CALLED:
	RADEC, SIXTY, NINT

 REVISION HISTORY:
	Written   W. Landsman                      June 1988
	Addition of variable precision and DEC seconds precision fix. 
	ver.  Aug. 1990 [E. Deutsch]
	Output formatting spiffed up       October 1991 [W. Landsman]
	Remove ZPARCHECK call, accept 1 element vector  April 1992 [W. Landsman]

(See /usr/local/idl/lib/zastron/astro/adstring.pro)


AIRTOVAC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	AIRTOVAC
 PURPOSE:
	Convert air wavelengths to vacuum wavelengths, i.e. correct 
	for the index of refraction of air under standard conditions.  
	Wavelength values below 2000 A will not be altered.  Uses the IAU 
	standard for conversion given in Morton (1991 Ap.J. Suppl. 77, 119)

 CALLING SEQUENCE:
	AIRTOVAC, WAVE

 INPUT/OUTPUT:
	WAVE - Wavelength in Angstroms, scalar or vector
		WAVE should be input as air wavelength(s), it will be
		returned as vacuum wavelength(s).  WAVE is always converted to
		double precision upon return.

 EXAMPLE:
	If the air wavelength is  W = 6056.125 (a Krypton line), then 
	AIRTOVAC, W yields an vacuum wavelength of W = 6057.8019

 METHOD:
	See Morton (Ap. J. Suppl. 77, 119) for the formula used

 REVISION HISTORY
	Written W. Landsman                November 1991

(See /usr/local/idl/lib/zastron/astro/airtovac.pro)


AITOFF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	AITOFF
 PURPOSE:
	Convert right ascension, declination to X,Y using an AITOFF equal-area
	projection.  Often used to create an all-sky map in galactic 
	coordinates. Output map coordinates are zero longitude centered.

 CALLING SEQUENCE:
	AITOFF, L, B, X, Y 

 INPUTS:
	L - longitude - scalar or vector, in degrees
	B - latitude - same number of elements as L, in degrees

 OUTPUTS:
	X - X coordinate, same number of elements as L.   X is normalized to
		be between -180 and 180
	Y - Y coordinate, same number of elements as L.  Y is normalized to
		be between -90 and 90.

 NOTES:
	See AIPS memo No. 46, page 4, for details of the algorithm.  This
	version of AITOFF assumes the projection is centered at b=0 degrees.

 REVISION HISTORY:
	Written  W.B. Landsman  STX          December 1989
	Modified for Unix:
		J. Bloch	LANL SST-9	5/16/91	1.1

(See /usr/local/idl/lib/zastron/astro/aitoff.pro)


AITOFF_GRID

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	AITOFF_GRID

 PURPOSE:
	Produce an overlay of latitude and longitude lines over a plot or image
	on the current graphics device. AITOFF_GRID assumes that the ouput plot
	coordinates span the x-range of -180 to 180 and the y-range goes from
	-90 to 90.

 CALLING SEQUENCE:

	AITOFF_GRID[,DLONG,DLAT,[LINESTYLE=N,/LABELS]

 INPUTS:

	DLONG	= Optional input longitude line spacing in degrees. If left
		  out, defaults to 30.
       DLAT    = Optional input lattitude line spacing in degrees. If left
                 out, defaults to 30.

 KEYWORDS:

	LINESTYLE	= Optional input integer specifying the linestyle to
			  use for drawing the grid lines.
	LABELS		= Optional keyword specifying that the lattitude and
			  longitude lines on the prime meridian and the
			  equator should be labeled in degrees. If LABELS is
			  given a value of 2, i.e. LABELS=2, then the longitude
			  labels will be in hours and minutes instead of
			  degrees.

 OUTPUTS:
	Draws grid lines on current graphics device.

 CATAGORY:
	SST-9 Graphics routine.

 AUTHOR AND MODIFICATIONS:

	J. Bloch	1.2	6/2/91

(See /usr/local/idl/lib/zastron/astro/aitoff_grid.pro)


ARROWS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       ARROWS
 PURPOSE:
       To display "weathervane" directional arrows on an astronomical image 
	showing orientation of North and East.

 CALLING SEQUENCE:
       arrows,h, [ xcen,ycen, THICK = , CHARSIZE = , ARROWLEN = , COLOR = ,
				/NOTVERTEX ]

 INPUTS:
       h - FITS or STSDAS header array, must include astrometry

 OPTIONAL INPUTS:
       xcen,ycen - numeric scalars, specifying the center position of
		arrows.   Position in device units unless the /NORMALIZED 
		keyword is specified.   If not supplied, then ARROWS
		will prompt for xcen and ycen

 OPTINAL KEYWORD INPUTS:
       thick     - line thickness, default = 1.0, floating point scalar
       charsize  - character size, default = 2.0, floating point scalar
       arrowlen  - length of arrows in terms of normal Y size of vector-drawn
                     character,  default  = 3.5, floating point scalar
       color     - color that the arrows and NE letters should be.  Default
                    value is !P.COLOR
       NotVertex - Normally (historically) the specified xcen,ycen indicated
                    the position of the vertex of the figure.  If this
                    keyword is set, the xcen,ycen coordinates refer to a sort
                    of 'center of mass' of the figure.  This allows the
                    figure to always appear with the area irregardless of
                    the rotation angle.
	Normal - if this keyword is set and nonzero, the input center 
		(xcen,ycen) is taken to be in normalized coordinates.   The
		default is device coordinates.
 OUTPUTS:
       none
 EXAMPLE:
	Draw a weathervane at (400,100) on the currently active window, 
	showing the orientation of the image associated with a FITS header, hdr

	IDL> arrows, hdr, 400, 100

 METHOD:
	Uses EXTAST to EXTract ASTrometry from the FITS header.   The 
	directions of North and East are computed and the procedure
	ONE_ARROW called to create the "weathervane".

 REVISON HISTORY:
       written by B. Boothman 2/5/86 
       Recoded with new procedures ONE_ARROW, ONE_RAY.  R.S.Hill,HSTX,5/20/92
       Added separate determination for N and E arrow to properly display
         arrows irregardless of handedness or other peculiarities and added
         /NotVertex keyword to improve positioning of figure. E.Deutsch 1/10/93
	Added /DATA and /NORMAL keywords W. Landsman      July 1993

(See /usr/local/idl/lib/zastron/astro/arrows.pro)


ASTRO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ASTRO
 PURPOSE:
	Interactive astronomical utitlity for precession and coordinate
	conversion.

 CALLING SEQUENCE:
	ASTRO, [ selection, EQUINOX = ]

 OPTIONAL INPUT:
	SELECTION - Scalar Integer (0-6) giving the the particular astronomical
		utility to be used.  (0) Precession, (1) RA, Dec to Galactic 
		coordinates, (2) Galactic to RA,Dec (3) RA,Dec to Ecliptic,
		(4) Ecliptic to RA, Dec, (5) Ecliptic to Galactic, (6) Galactic
		to Ecliptic.   Program will prompt for SELECTION if this 
		parameter is omitted.

 OPTIONAL KEYWORD INPUT:
	EQUINOX - numeric scalar specifying the equinox to use when converting 
		between celestial and other coordinates.    If not supplied, 
		then the RA and Dec will be assumed to be in EQUINOX 1950.   
		This keyword is ignored by the precession utility.   For 
		example, to convert from RA and DEC (2000) to galactic 
		coordinates:

		IDL> astro, 1, E=2000

 METHOD:
	ASTRO uses PRECESS to compute precession, and EULER to compute
	coordinate conversions.   The procedure GET_COORDS is used to
	read the coordinates, and ADSTRING to format the RA,Dec output.

 NOTES:
	ASTRO temporarily sets !QUIET to suppress compilation messages and
	keep a pretty screen display.   
         
 PROCEDURES USED:
	Procedures: GET_COORDS, EULER       Function: ADSTRING
 REVISION HISTORY
	Written, W. Landsman November 1987
	Code cleaned up       W. Landsman   October 1991
	Added Equinox keyword, call to GET_COORDS, W. Landsman   April, 1992

(See /usr/local/idl/lib/zastron/astro/astro.pro)


A_B

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	A_b
 PURPOSE:
	Compute interstellar extinction in the B bandpass as a function 
	of galactic position  using the 21 parameter function given by
	deVaucoulers in the 2nd Reference Catalog of Galaxies (RC2).   Note 
	that this formula is no longer used in the RC3 and that reddenings
	are instead obtained from the Burstein-Heiles maps.

 CALLING SEQUENCE:
	result = A_b( l2, b2)

 INPUT PARAMETERS
	l2 = galactic longitude (degrees), scalar or vector
	b2 = galactic latitude  (degrees), scalar or vector

 OUTPUT PARAMETERS
	RESULT - Interstellar extinction Ab in magnitudes, scalar

 NOTES:
	The controversial aspect of the deVaucoulers reddening curve
	is that it predicts an extinction of about 0.2 at the poles 

	The parameters used here differ from the ones printed in the RC2
	but are the ones actually used for entries in the catalog
	(see Rowan-Robinson 1985) 

 REVISION HISTORY
	Written by R. Cornett and W. Landsman, STX October 1987
	Vectorized code      W. Landsman   STX    December 1992

(See /usr/local/idl/lib/zastron/astro/a_b.pro)


BARYVEL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	BARYVEL
 PURPOSE:
	Calculates the heliocentric and barycentric velocity components of
	the Earth.   Takes into account the Earth-Moon motion.   Useful for 
	radial velocity work to an accuracy of 	~1 m/s.

 CALLING SEQUENCE:
	BARYVEL, dje, deq, dvelh, dvelb

 INPUTS:
	DJE - (scalar) julian ephemeris date.
	DEQ - (scalar) epoch of mean equinox of dvelh and dvelb. If deq=0
		then deq is assumed to be equal to dje.
 OUTPUTS: 
	DVELH: (vector(3)) heliocentric velocity component. in km/s 
	DVELB: (vector(3)) barycentric velocity component. in km/s

	The 3-vectors DVELH and DVELB are given in a right-handed coordinate 
	system with the +X axis toward the Vernal Equinox, and +Z axis 
	toward the celestial pole.   	

 PROCEDURE CALLED:
	Function PREMAT -- computes precession matrix

 NOTES:
	Algorithm taken from FORTRAN program of Stumpff (1980, A&A Suppl, 41,1)
	Stumpf claimed an accuracy of 42 cm/s for the velocity.    A 
	comparison with the JPL FORTRAN planetary ephemeris program PLEPH
       found agreement to within about 65 cm/s between 1986 and 1994

 EXAMPLE:
	Compute the radial velocity of the Earth toward Altair on 15-Feb-1994

	IDL> jdcnv, 1994, 2, 15, 0, jd          ;==> JD = 2449398.5
	IDL> ra = ten(19,50,46.77)/!RADEG       ;RA  in radians
	IDL> dec = ten(08,52,3.5)/!RADEG        ;Dec in radians
	IDL> baryvel, jd, 2000, vh, vb          
		==> vh = [-17.07809, -22.80063, -9.885281]  ;Heliocentric km/s
		==> vb = [-17.08083, -22.80471, -9.886582]  ;Barycentric km/s

	IDL> v = vb(0)*cos(dec)*cos(ra) + $   ;Project velocity toward star
		vb(1)*cos(dec)*sin(ra) + vb(2)*sin(dec) 

 REVISION HISTORY:
	Jeff Valenti,  U.C. Berkeley    Translated BARVEL.FOR to IDL.
	W. Landsman, Cleaned up program sent by Chris McCarthy (SfSU) June 1994

(See /usr/local/idl/lib/zastron/astro/baryvel.pro)


BPRECESS

[Previous Routine] [Next Routine] [List of Routines]
 NAME
	BPRECESS
 PURPOSE:
	Calculate the mean place of a star at B1950.0 on the FK4 system from the
	mean place at J2000.0 on the FK5 system.    

 CALLING SEQUENCE:
	bprecess, ra, dec, ra_1950, dec_1950, [ MU_RADEC = , PARALLAX = 
					RAD_VEL =  ]

 INPUTS:
	RA,DEC - Input J2000 right ascension and declination in *degrees*.
		Scalar or N element vector

 OUTPUTS:
	RA_1950, DEC_1950 - The corresponding B1950 right ascension and 
		declination in *degrees*.    Same number of elements as
		RA,DEC but always double precision.

 OPTIONAL INPUT-OUTPUT KEYWORDS
	MU_RADEC - 2xN element double precision vector containing the proper 
		   motion in seconds of arc per tropical *century* in right 
		   ascension and declination.
	PARALLAX - N_element vector giving stellar parallax (seconds of arc)
	RAD_VEL  - N_element vector giving radial velocity in km/s

	The values of MU_RADEC, PARALLAX, and RADVEL will all be modified
	upon output to contain the values of these quantities in the
	B1950 system.  The parallax and radial velocity will have a very 
	minor influence on the B1950 position.   

 NOTES:
	The algorithm is taken from the Astronomical Almanac 1990, page B42.
	Also see Aoki et al (1983), A&A, 128,263

	The error in using the IDL procedure PRECESS for converting between
	B1950 and J1950 can be up to 1.5", mainly in right ascension.   If
	better accuracy than this is needed then BPRECESS should be used.

 EXAMPLE:
	The SAO2000 catalogue gives the J2000 position and proper motion for
	the star HD 119288.   Find the B1950 position. 

	RA(2000) = 13h 42m 12.740s      Dec(2000) = 8d 23' 17.69''  
	Mu(RA) = -.0257 s/yr      Mu(Dec) = -.090 ''/yr

	IDL> mu_radec = 100D* [ -15D*.0257, -0.090 ]
	IDL> ra = ten(13, 42, 12.740)*15.D 
	IDL> dec = ten(8, 23, 17.69)
	IDL> bprecess, ra, dec, ra1950, dec1950, mu_radec = mu_radec
	IDL> print, adstring(ra1950, dec1950,2)
	        ===> 13h 39m 44.526s    +08d 38' 28.63"

 REVISION HISTORY:
	Written,    W. Landsman                October, 1992
	Vectorized, W. Landsman                February, 1994

(See /usr/local/idl/lib/zastron/astro/bprecess.pro)


CCM_UNRED

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CCM_UNRED
 PURPOSE:
	Deredden a flux vector according to the parameterization
	of Cardelli, Clayton, and Mathis (1989 ApJ. 345, 245),
	including the update for the near-UV given by O'Donnell (1994, ApJ, 
	422, 158).   Parameterization is valid from the IR to the far-UV 
	(3.5 microns to 0.1 microns).

 CALLING SEQUENCE:
	CCM_UNRED, wave, flux, ebv, funred, [ R_V = ]      

 INPUT:
	WAVE - wavelength vector (Angstroms)
	FLUX - calibrated flux vector, same number of elements as WAVE
	EBV  - color excess E(B-V), scalar.  If a negative EBV is supplied,
		then fluxes will be reddened rather than deredenned.

 OUTPUT:
	FUNRED - unreddened flux vector, same units and number of elements
		as FLUX

 OPTIONAL INPUT KEYWORD
	R_V - scalar specifying the ratio of total selective extinction
		R(V) = A(V) / E(B - V).    If not specified, then R_V = 3.1
		Extreme values of R(V) range from 2.75 to 5.3

 EXAMPLE:
	Determine how a flat spectrum (in wavelength) between 1200 A and 3200 A
	is altered by a reddening of E(B-V) = 0.1.   Assume an "average"
	reddening for the diffuse interstellar medium (R(V) = 3.1)

	IDL> w = 1200 + findgen(40)*50      ;Create a wavelength vector
	IDL> f = w*0 + 1                    ;Create a "flat" flux vector
	IDL> ccm_unred, w, f, -0.1, fnew  ;Redden (negative E(B-V)) flux vector
	IDL> plot,w,fnew                   

 NOTES:
	(1) The CCM curve shows good agreement with the Savage & Mathis (1979)
		ultraviolet curve shortward of 1400 A, but is probably
		preferable between 1200 and 1400 A.
	(2)  Many sightlines with peculiar ultraviolet interstellar extinction 
		can be represented with a CCM curve, if the proper value of 
		R(V) is supplied.
	(3)  Curve is extrapolated between 912 and 1000 A as suggested
		by Longo et al. (1989, ApJ, 339,474)

 REVISION HISTORY:
	Written   W. Landsman        Hughes/STX   January, 1992
	Extrapolate curve for wavelengths between 900 and 1000 A   Dec. 1993
	Use updated coefficients for near-UV from O'Donnell   Feb 1994

(See /usr/local/idl/lib/zastron/astro/ccm_unred.pro)


CT2LST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CT2LST
 PURPOSE:
	To convert local civil time to local mean sidereal time.

 CALLING SEQUENCE:
	CT2LST, Lst, Lng, Tz, Time, [Day, Mon, Year] 

 INPUTS:
	Lng   The longitude in degrees of the place for which the local 
		sidereal time is desired, scalar
	Tz    The time zone of the site in hours.  Use this to easily account 
		for Daylight Savings time (e.g. 4=EDT, 5 = EST/CDT), scalar
	Tme   If the optional parameters are specified then this is the time
		of day of the specified date in decimal hours.  If the optional
		parameters are not specified then this is the Julian date of
		time in question, scalar or vector

 OPTIONAL INPUTS:
	Day   The day of the month.
	Mon   The month, in numerical format.
	Year  The year.

 OUTPUTS:
	Lst   The Local Sideral Time for the date/time specified in hours.

 RESTRICTIONS:
	If specified, the date should be in numerical form.  The year should
	appear as yyyy.

 PROCEDURE:
	The Julian date of the day and time is question is used to determine
	the number of days to have passed since 0 Jan 1968.  This is used
	in conjunction with the GST of that date to extrapolate to the current
	GST; this is then used to get the LST.

 MODIFICATION HISTORY:
	Adapted from the FORTRAN program GETSD by Michael R. Greason, STX, 
		27 October 1988.

(See /usr/local/idl/lib/zastron/astro/ct2lst.pro)


DATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	DATE
 PURPOSE:
	 DATE converts day-of-year to ordinary Gregorian date;
	works on cumulative day from 1-JAN-1979 (for instance),
	as well as more well-mannered days-of-year.

 CALLING SEQUENCE:
       D_STRING = DATE(Year, day )

 INPUTS:
	Year - Years after 1900 may either be written out in full
	(e.g. 1986) or with just the last two digits (e.g. 86)

       Day - number of days after Jan 1 of the specified year

 OUTPUTS:
	D_STRING - String giving date in format '13-MAR-1986'

 RESTRICTIONS:
	Will only work for years after 1900.

 MODIFICATION HISTORY:
       D.M. fecit  24 October,1983

(See /usr/local/idl/lib/zastron/astro/date.pro)


DATE_CONV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	DATE_CONV
 PURPOSE:
	Procedure to perform conversion of dates to one of three possible
	formats.

	format 1: real*8 scalar encoded as:
		(year-1900)*1000 + day + hour/24. + min/24./60 + sec/24./60/60
		where day is the day of year (1 to 366)
	format 2: Vector encoded as:
		date(0) = year (eg. 1987 or just 87)
		date(1) = day of year (1 to 366)
		date(2) = hour
		date(3) = minute
		date(4) = second
	format 3: string (ascii text) encoded as
		DD-MON-YEAR HH:MM:SS.SS
		(eg.  14-JUL-1987 15:25:44.23)
	format 4: three element vector giving spacecraft time words
	from ST telemetry packet.

 CALLING SEQUENCE
	results = DATE_CONV( DATE, TYPE )

 INPUTS:
	DATE - input date in one of the three possible formats.
	TYPE - type of output format desired.  If not supplied then
		format 3 (real*8 scalar) is used.
			valid values:
			'REAL'	- format 1
			'VECTOR' - format 2
			'STRING' - format 3
               TYPE can be abbreviated to the single character strings 'R',
               'V', and 'S'.
		Nobody wants to convert TO spacecraft time (I hope!)
 OUTPUTS:
	The converted date is returned as the function value.
 HISTORY:
	version 1  D. Lindler  July, 1987
       adapted for IDL version 2  J. Isensee  May, 1990

(See /usr/local/idl/lib/zastron/astro/date_conv.pro)


DAYCNV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	DAYCNV
 PURPOSE:
	Converts julian dates to gregorian calendar dates

 CALLING SEQUENCE:
	DAYCNV, XJD, YR, MN, DAY, HR

 INPUTS:
	XJD = Julian date, double precision scalar or vector

 OUTPUTS:
	YR = Year (Integer)
	MN = Month (Integer)
	DAY = Day (Integer)
	HR = Hours and fractional hours (Real).   If XJD is a vector,
		then YR,MN,DAY and HR will be vectors of the same length.

 EXAMPLE:
	IDL> DAYCNV, 2440000.D, yr, mn, day, hr    

	yields yr = 1968, mn =5, day = 23, hr =12.   

 WARNING:
       Be sure that the julian date is specified as double precision to
       maintain accuracy at the fractional hour level.

 REVISION HISTORY:
       Converted to IDL from Yeoman's Comet Ephemeris Generator, 
       B. Pfarr, STX, 6/16/88

(See /usr/local/idl/lib/zastron/astro/daycnv.pro)


DEREDD

[Previous Routine] [Next Routine] [List of Routines]
  NAME:
	DEREDD

  PURPOSE:
	Deredden then Stromgren parameters given for a value of E(b-y)
	See the procedure UVBYBETA for more info.

  CALLING SEQUENCE:
	deredd, eby, by, m1, c1, ub, by0, m0, c0, ub0

  INPUTS:
	Eby - color index E(b-y),scalar
	by - b-y color (observed)
	m1 - Stromgren line blanketing parameter (observed)
	c1 - Stromgren Balmer discontinuity parameter (observed)
	ub - u-b color (observed)

  OUTPUTS:
	by0 - b-y color (dereddened)
	m0 - Line blanketing index (dereddened)
	c0 - Balmer discontinuity parameter (dereddened)
	ub0 - u-b color (dereddened)

  REVISION HISTORY:
    Adapted from FORTRAN routine DEREDD by T.T. Moon 
    W. Landsman          STX Co.        April, 1988

(See /usr/local/idl/lib/zastron/astro/deredd.pro)


EQPOLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	EQPOLE
 PURPOSE:
	Convert right ascension, declination to X,Y using an equal-area polar
	projection. The output X and Y coordinates are scaled to be between
	-90 and +90 to go from equator to pole to equator. Output map points 
	can be centered on the north pole or south pole.

 CALLING SEQUENCE:
	EQPOLE, L, B, X, Y, [ /SOUTHPOLE ]

 INPUTS:
	L - longitude - scalar or vector, in degrees
	B - latitude - same number of elements as RA, in degrees

 OUTPUTS:
	X - X coordinate, same number of elements as RA.   X is normalized to
		be between -90 and 90.
	Y - Y coordinate, same number of elements as DEC.  Y is normalized to
		be between -90 and 90.

 KEYWORDS:

	/SOUTHPOLE	- Keyword to indicate that the plot is to be centered 
		on the south pole instead of the north pole.

 REVISION HISTORY:
	J. Bloch	LANL, SST-9	1.1	5/16/91

(See /usr/local/idl/lib/zastron/astro/eqpole.pro)


EQPOLE_GRID

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	EQPOLE_GRID

 PURPOSE:
	Produce an overlay of latitude and longitude lines over a plot or image
	on the current graphics device using the equal area polar projection.
	EQPOLE_GRID assumes that the output plot coordinates span the
	x and y ranges of -90 to 90 for a region that covers the equator to
	the chosen pole. The grid is assumed to go from the equator to
	the chosen pole.

 CALLING SEQUENCE:

	EQPOLE_GRID[,DLONG,DLAT,[/SOUTHPOLE,LINESTYLE=N,/LABEL]

 INPUTS:

	DLONG	= Optional input longitude line spacing in degrees. If left
		  out, defaults to 30.
       DLAT    = Optional input lattitude line spacing in degrees. If left
                 out, defaults to 30.

 KEYWORDS:

	SOUTHPOLE	= Optional flag indicating that the output plot is
			  to be centered on the south rather than the north
			  pole.
	LINESTYLE	= Optional input integer specifying the linestyle to
			  use for drawing the grid lines.
	LABELS		= Optional flag for creating labels on the output
			  grid on the prime meridian and the equator for
			  lattitude and longitude lines. If set =2, then
			  the longitude lines are labeled in hours and minutes.

 OUTPUTS:
	Draws grid lines on current graphics device.

 CATAGORY:
	SST-9 Graphics routine.


 COPYRIGHT NOTICE:

	Copyright 1992, The Regents of the University of California. This
	software was produced under U.S. Government contract (W-7405-ENG-36)
	by Los Alamos National Laboratory, which is operated by the
	University of California for the U.S. Department of Energy.
	The U.S. Government is licensed to use, reproduce, and distribute
	this software. Neither the Government nor the University makes
	any warranty, express or implied, or assumes any liability or
	responsibility for the use of this software.



 AUTHOR AND MODIFICATIONS:

	J. Bloch	1.4	10/28/92

(See /usr/local/idl/lib/zastron/astro/eqpole_grid.pro)


EULER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	EULER
 PURPOSE:
	Transform between galactic, celestial, and ecliptic coordinates.
	Use the procedure ASTRO to use this routine interactively

 CALLING SEQUENCE:
	EULER, AI, BI, AO, BO, [ SELECT ] 

 INPUTS:
	AI - Input Longitude in DEGREES, scalar or vector.  If only two 
		parameters are supplied, then  AI and BI will be modified to 
		contain the output longitude and latitude.
	BI - Input Latitude in DEGREES

 OPTIONAL INPUT:
	SELECT - Integer (1-6) specifying type of coordinate transformation.  

	SELECT     From          To       |   SELECT      From            To
	1     RA-DEC(1950)   GAL.(ii)   |     4       ECLIPTIC       RA-DEC    
	2     GAL.(ii)       RA-DEC     |     5       ECLIPTIC       GAL.(ii)  
	3     RA-DEC         ECLIPTIC   |     6       GAL.(ii)       ECLIPTIC  

	If omitted, program will prompt for the value of SELECT

 OUTPUTS:
	AO - Output Longitude in DEGREES
	BO - Output Latitude in DEGREES

 REVISION HISTORY:
	Written W. Landsman,  February 1987
	Adapted from Fortran by Daryl Yentis NRL

(See /usr/local/idl/lib/zastron/astro/euler.pro)


FLAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	FLAT

 PURPOSE:
	FLAT transforms the image of a galaxy so that the galaxy appears
	face-on.  Either a nearest-neighbor approximations or a bilinear 
	interpolation may  be used.

 CALLING SEQUENCE:
	RESULT = FLAT( image, ang, inc, [, cen, /INTERP ] )  

 INPUTS:   
	IMAGE  - Image to be transformed
	ANG  - Angle of major axis, counterclockwise from Y-axis, degrees
		For an image in standard orientation (North up, East left)
		this is the Position Angle
	INC - Angle of inclination of galaxy, degrees

 OPTIONAL INPUTS:
	CEN - Two element vector giving the X and Y position of galaxy center
		If not supplied, then the galaxy center is assumed to coincide
		 with the image center

 INPUT KEYWORDS:
	INTERP - If present, and non-zero, then bilinear interpolation will be
		performed.  Otherwise a nearest neighbor approximation  is used.

 OUTPUTS:
	RESULT - the transformed image, same dimensions and type as IMAGE

 METHOD:
	A set of 4 equal spaced control points are corrected for inclination
	using the procedure POLYWARP.   These control points are used by 
	POLY_2D to correct the whole image.

 REVISION HISTORY:
	Written by R. S. Hill, SASC Technologies Inc., 4 December 1985
	Code cleaned up a bit    W. Landsman      December 1992

(See /usr/local/idl/lib/zastron/astro/flat.pro)


FLUX2MAG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	FLUX2MAG
 PURPOSE:
	Convert from flux (ergs/s/cm^2/A) to magnitudes.  Use MAG2FLUX for
	the opposite direction.

 CALLING SEQUENCE:
	mag = flux2mag( flux, [ zero_pt ] )

 INPUTS:
	flux - scalar or vector flux vector

 OPTIONAL INPUT:
	zero_pt - scalar giving the zero point level of the magnitude.
		If not supplied then zero_pt = 21.1 (Code et al 1976)

 OUTPUT:
	mag - magnitude vector  (mag = -2.5*alog10(flux) - zero_pt)

 REVISION HISTORY:
	Written    J. Hill        STX Co.       1988

(See /usr/local/idl/lib/zastron/astro/flux2mag.pro)


GCIRC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	GCIRC
 PURPOSE:
	Computes rigorous great circle arc distances.

 CALLING SEQUENCE:
	GCIRC, U, RA1, DC1, RA2, DC2, DIS

 INPUTS:
	U    -- Describes units of inputs and output:
		0:  everything radians
		1:  RAx in decimal hours, DCx in decimal
			degrees, DIS in arc seconds 
	RA1  -- Right ascension of point 1
	DC1  -- Declination of point 1
	RA2  -- Right ascension of point 2
	DC2  -- Declination of point 2

   OUTPUTS:
	DIS  -- Angular distance on the sky between points 1 and 2
		See U above for units;  double scalar  

   PROCEDURE:
	Ordinary spherical trig formula.

   NOTES:
	Either RA1,DC1 or RA2,DC2 (but not both coordinates) can be vectors.
	In this case DIS is a vector giving the angular distance between
	each of the vector coordinates to the scalar coordinate

   MODIFICATION HISTORY:
	Written in Fortran by R. Hill -- SASC Technologies -- January 3, 1986
	Translated from FORTRAN to IDL, RSH, STX, 2/6/87
	Vector arguments allowed    W. Landsman    April 1989

(See /usr/local/idl/lib/zastron/astro/gcirc.pro)


GET_COORDS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	GET_COORDS

 PURPOSE:
	A general purpose routine that takes user input for angular
	coordinates and returns floating-point values.  The user may input as 
	floating point or sexigesimal.  If user inputs RA then it is the 
	calling procedure's job to convert hours to degrees if needed.
	Since the input string is parsed character-by-character, ANY character
	that is not a digit, minus sign or decimal point may be used as a 
	delimiter, i.e. acceptable examples of user input are:

	1:03:55 -10:15:31
	1 3 55.0 -10 15 31
	1*3 55              -10abcd15efghij31
	1.065278  hello   -10.25861

 CALLING SEQUENCE:
	GET_COORDS, Coords, [ PromptString, NumVals, INSTRING =, /QUIET ]

 OPTIONAL INPUT:
	PromptString - A string to inform the user what data are to be entered
       InString - a keyword that, if set, is assumed to already contain the
		input data string to be parsed.  If this keyword is set, then
		the user is not prompted for any input.
	Quiet - if set the program won't printout any error messages, but bad
		input is still flagged by Coords=[-999,-999].

 OUTPUT:
	Coords - a 2 element floating array containing the coordinates.  The
		vector [-999,-999] is returned if there has been an error.

 OPTIONAL OUTPUT:
	NumVals - the number of separate values entered by the user:  2 if the
		user entered the coordinates as floating point numbers, 6 if 
		the user entered the coordinates as sexigesimal numbers.  Some
		calling procedures might find this information useful (e.g., to
		to print some output in the same format as the user's input).

 REVISION HISTORY
	Written by Joel Parker, 5 MAR 90
	Included InString and Quiet keywords.  Cleaned up some of the code and
	comments.  JWmP,  16 Jun 94

*******************************************************************************

(See /usr/local/idl/lib/zastron/astro/get_coords.pro)


GET_DATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	GET_DATE
 PURPOSE:
	Return the current date in DD/MM/YY format.  This is the format
	required by the DATE and DATE-OBS keywords in a FITS header

 CALLING SEQUENCE:
	GET_DATE, dte
 INPUTS:
	None
 OUTPUTS:
	dte = An eight character scalar string specifying the current day 
		(0-31), current month (1-12), and last two digits of the 
		current year
 EXAMPLE:
	Add the current date to the DATE keyword in a FITS header,h
     
	IDL> GET_DATE,dte
	IDL> sxaddpar, h, 'DATE', dte

 REVISION HISTORY:
	Written      W. Landsman          March 1991

(See /usr/local/idl/lib/zastron/astro/get_date.pro)


GET_JULDATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	GET_JULDATE
 PURPOSE:
	Return the current julian date

 CALLING SEQUENCE:
	GET_JULDATE,jd

 INPUTS:
	None

 OUTPUTS:
	jd = Current Julian Date, double precision scalar

 EXAMPLE:
	Return the current hour, day, month and year as integers

	IDL> GET_JULDATE, JD                  ;Get current julian date
	IDL> DAYCNV, JD, YR, MON, DAY, HOURS  ;Convert to hour,day month & year

 METHOD:
	The systime(1) function is used to obtain the number of days after 
	1-JAN-1970.    	The offset to Julian days is then computed.

	WARNING!   This procedure assumes that systime(1) returns the value
	of Universal Time (UT).    This appears to be true for most Unix
	workstations and DOS machines, but not for VMS or Macintoshes, 
	for which systime(1) returns the local time.     Users
	may need to add the difference between UT and local time to the value
	of JD, depending on the particular installation.

 REVISION HISTORY:
	Written Wayne Landsman                March, 1991

(See /usr/local/idl/lib/zastron/astro/get_juldate.pro)


GLACTC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:  
	GLACTC
 PURPOSE:
	Program to convert right ascension (ra) and declination (dec) to
	galactic longitude (gl) and latitude (gb) (j=1) or vice versa (j=2).
 CALLING SEQUENCE: 
	glactc, ra, dec, year, gl, gb, j

 INPUTS: 
	year     equinox of ra and dec       (input)
	j        direction of conversion     (input)
		1:  ra,dec --> gl,gb
		2:  gl,gb  --> ra,dec

 INPUTS OR OUTPUTS ( depending on argument J )
	ra       right ascension, hours
	dec      declination, degrees
	gl       galactic longitude (system II), degrees
	gb       galactic latitude (system II), degrees

	All results forced double precision floating.

 COMMON BLOCKS:   
      gal      See Side Effects.    

 SIDE EFFECTS:
 	Year and galaxy orientation saved in common to make repeated     
	computations more efficient.

 HISTORY: 
	FORTRAN subroutine by T. A. Nagy, 21-MAR-78.
	Conversion to IDL, R. S. Hill, STX, 19-OCT-87.

(See /usr/local/idl/lib/zastron/astro/glactc.pro)


HELIO

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
	HELIO
 PURPOSE: 
	Compute (low-precision) Heliocentric coordinates for the planets.
	Adapted from the book Celestial Basic
 CALLING SEQUENCE: 
	HELIO, JD, HMS, LIST, HRAD, HLONG, HLAT
 INPUTS:
	JD = Julian day to compute for, long scalar
	HMS = hours, minutes, seconds array: H, M, S.  Universal time.
	LIST = List of planets array.  May be a single number.
		1 = merc, 2 = venus, ... 9 = pluto.

 OUTPUTS:
	HRAD = array of Heliocentric radii (A.U).
	HLONG = array of Heliocentric (ecliptic) longitudes (degrees).
	HLAT = array of Heliocentric latitudes (degrees).
		These values are scalars if LIST is a scalar.

 EXAMPLE:
	To find the heliocentric positions of Jupiter and Saturn on 1-Jan-1989

	JDCNV,1989,1,1,0,JD                   ;Convert to Julian Date 
	HELIO,JD,[0,0,0],[5,6],hrad,hlong,hlat  ;Get radius, long, and lat

 COMMON BLOCKS: 
	HELIOCOM --- stores parameters.

 ROUTINES USED: 
	DATATYPE, ISARRAY,
 MODIFICATION HISTORY: 
	R. Sterner.  20 Aug, 1986.
	Code cleaned up a bit      W. Landsman             December 1992

(See /usr/local/idl/lib/zastron/astro/helio.pro)


HELIO_JD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	HELIO_JD
 PURPOSE:
	Convert geocentric (reduced) Julian date to heliocentric julian date
	(i.e. correct for extra light travel time between Earth and Sun)

 CALLING SEQUENCE:
	jdhelio = HELIO_JD( date, ra, dec)

 INPUTS
	date - reduced Julian date (= JD - 2400000), scalar or vector, MUST
		be double precision
	ra,dec - scalars giving right ascension and declination in DEGREES

 OUTPUTS:
	jdhelio - heliocentric julian date.

 EXAMPLE:
	What is heliocentric julian date of an observation of V402 Cygni
	(RA = 20 7 15, Dec = 37 0.33) taken June 15, 1973 at 11:40 UT?

	IDL> juldate, [1973,6,15,11,40], jd      ;Get Geocentric julian date
	IDL> hjd = helio_jd( jd, ten(20,7,15)*15., ten(37,0.33) )  
                                                            
	==> hjd = 41848.9881

 PROCEDURES CALLED:
	zparcheck, xyz

 REVISION HISTORY:
 	Algorithm from the book Astronomical Photometry by Henden, p. 114
	Written,   W. Landsman       STX     June, 1989 

(See /usr/local/idl/lib/zastron/astro/helio_jd.pro)


IMCONTOUR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	IMCONTOUR
 PURPOSE:
	Contour plot labeled with astronomical coordinates.  The type
	of coordinate display is controlled by the keyword TYPE
	Set TYPE=0 (default) to measure distances from the center of the image
	(IMCONTOUR will decide whether the plotting units will be in
	arc seconds, arc minutes, or degrees depending on image size.)
	Set TYPE=1 for standard RA and Dec labeling

 CALLING SEQUENCE:
	IMCONTOUR, im, hdr,[ TYPE=, PUTINFO=, XTITLE = , YTITLE = , NLEVELS= 
		MAX_VALUE=, LEVELS=, TITLE =, SUBTITLE =, FOLLOW = , XMINOR =,
		YMINOR =, CHAN =  ]

 INPUTS:
	IM - 2-dimensional image array
	HDR - FITS header associated with IM, string array, must include
		astrometry keywords.   IMCONTOUR will also look for the
		OBJECT and IMAGE keywords, and print these if found and the 
		PUTINFO keyword is set.

 OPTIONAL PLOTTING KEYWORDS:
	TYPE - the type of astronomical labeling to be displayed.   Either set
		TYPE = 0 (default), distance to center of the image is
		marked in units of Arc seconds, arc minutes, or degrees

		TYPE = 1 astronomical labeling with Right ascension and 
		declination.

	PUTINFO - If set then IMCONTOUR will add information about the image
		to the right of the contour plot.  Information includes image
		name, object, image center, image center, contour levels, and
		date plot was made

	The other keywords XTITLE, YTITLE, NLEVELS, MAX_VALUE, LEVELS,
	TITLE, SUBTITLE, FOLLOW, XMINOR, and YMINOR have the same 
	meaning as in the CONTOUR procedure.  

	CHAN - On devices with multiple channels this specifies the output 
		channel.   On the IVAS and DeAnza image displays the default 
		is the graphics overlay.

 NOTES:
	(1) The contour plot will have the same dimensional ratio as the input
		image array
	(2) To contour a subimage, use HEXTRACT before calling IMCONTOUR

 PROCEDURES USED:
	CHECK_FITS, EXTAST, GETROT, TICPOS, TICLABEL, TIC_ONE, TICS, XYAD
	CONS_RA, CONS_DEC, ADSTRING

 REVISION HISTORY:
	Written   W. Landsman   STX                    May, 1989
	Fixed RA,Dec labeling  W. Landsman             November, 1991
	Fix plottting keywords  W.Landsman             July, 1992

(See /usr/local/idl/lib/zastron/astro/imcontour.pro)


IMF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	IMF
 PURPOSE:
	Returns values of an N-component power-law logarithmic initial mass 
	function, normalized so that the total mass distribution equals one 
	solar mass.

 CALLING SEQUENCE:
	psi = IMF( mass, expon,  mass_range )

 INPUTS:
	mass - mass in units of solar masses (scalar or vector)
		Converted to floating point if necessary
	expon - power law exponent, uusally negative, scalar or vector
		The number of values in expon equals the number of different
		power-law components in the IMF
		A Saltpeter IMF has a scalar value of expon = -1.35
	mass_range - vector containing the mass upper and lower limits of the 
		IMF and masses where the IMF exponent changes.   The number 
		of values in mass_range should be one more than in expon.   
		The values in mass_range should be monotonically increasing.

 OUTPUTS
	psi - mass function, number of stars per unit logarithimic mass interval
		evaluated for supplied masses

 NOTES:
	The mass spectrum f(m) giving the number of stars per unit mass 
	interval is related to psi(m) by  m*f(m) = psi(m).    The normalization
	condition is that the integral of psi(m) between the upper and lower
	mass limit is unity.

 EXAMPLE:
       (1) Print the number of stars per unit mass interval at 3 Msun 
		for a Salpeter (expon = -1.35) IMF, with a mass range from 
		0.1 MSun to 110 Msun.

		IDL> print, imf(3, -1.35, [0.1, 110] ) / 3

	(2) Lequex et al. (1981, A & A 103, 305) describes an IMF with an
		exponent of -0.6 between 0.007 Msun and 1.8 Msun, and an
		exponent of -1.7 between 1.8 Msun and 110 Msun.    Plot
		the mass spectrum f(m)

		IDL> m = [0.01,0.1,indgen(110) + 1 ]  ;Make a mass vector
		IDL> expon = [-0.6, -1.7]	;Exponent Vector
		IDL> mass_range = [ 0.007, 1.8, 110]	;Mass range
		IDL> plot_oo, m, imf(m, expon, mass_range ) / m

 METHOD
	IMF first calculates the constants to multiply the power-law 
	components such that the IMF is continuous at the intermediate masses, 
	and that the total mass integral is one solar mass.  The IMF is then 
	calculated for the supplied masses.   Also see Scalo (1986)

 REVISION HISTORY:
	Written    W. Landsman              August, 1989  
	Set masses LE mass_u rather than LT mass_u  August, 1992
	Major rewrite to accept arbitary power-law components   April 1993

(See /usr/local/idl/lib/zastron/astro/imf.pro)


JDCNV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	JDCNV
 PURPOSE:
	Converts Gregorian dates to Julian days   

 CALLING SEQUENCE:
	JDCNV, YR, MN, DAY, HR, JULIAN

 INPUTS:
 	YR = Year (integer)  
	MN = Month (integer 1-12)
	DAY = Day  (integer 1-31) 
	HR  = Hours and fractions of hours of universal time (U.T.)

 OUTPUTS:
	JULIAN = Julian date (double precision) 

 EXAMPLE:
	To find the Julian Date at 1978 January 1, 0h (U.T.)

	IDL> JDCNV, 1978, 1, 1, 0., JULIAN

	will give JULIAN = 2443509.5
 NOTES:
	(1) JDCNV will accept vector arguments 
	(2) JULDATE is an alternate procedure to perform the same function

 REVISON HISTORY:
	Converted to IDL from Don Yeomans Comet Ephemeris Generator,
	B. Pfarr, STX, 6/15/88

(See /usr/local/idl/lib/zastron/astro/jdcnv.pro)


JPRECESS

[Previous Routine] [Next Routine] [List of Routines]
 NAME
	JPRECESS
 PURPOSE:
	Calculate the mean place of a star at J2000.0 on the FK5 system from the
	mean place at B1950.0 on the FK4 system.

 CALLING SEQUENCE:
	jprecess, ra, dec, ra_2000, dec_2000, [ MU_RADEC = , PARALLAX = 
		RAD_VEL =  ]

 INPUTS:
	RA,DEC - input B1950 right ascension and declination in *degrees*.
		Scalar or vector

 OUTPUTS:
	RA_2000, DEC_2000 - the corresponding J2000 right ascension and 
		declination in *degrees*.   Same number of elements as RA,DEC
		but always double precision. 

 OPTIONAL INPUT-OUTPUT KEYWORDS
	MU_RADEC - 2xN element double precision vector containing the proper 
		   motion in seconds of arc per tropical *century* in right 
		   ascension and declination.
	PARALLAX - N_element vector giving stellar parallax (seconds of arc)
	RAD_VEL  - N_element vector giving radial velocity in km/s

	The values of MU_RADEC, PARALLAX, and RADVEL will all be modified
	upon output to contain the values of these quantities in the
	J2000 system.    Values will also be converted to double precision.  
	The parallax and radial velocity will have a very minor influence on 
	the J2000 position.

  NOTES:
	The algorithm is taken from the Astronomical Almanac 1990, page B42.
	Also see Aoki et al (1983), A&A, 128,263

	The error in using the IDL procedure PRECESS for converting between
	B1950 and J2000 can be up to 1.5", mainly in right ascension.   If
	better accuracy than this is needed then JPRECESS should be used.

 EXAMPLE:
	The SAO catalogue gives the B1950 position and proper motion for the 
	star HD 119288.   Find the J2000 position. 

	   RA(1950) = 13h 39m 44.526s      Dec(1950) = 8d 38' 28.63''  
	   Mu(RA) = -.0259 s/yr      Mu(Dec) = -.093 ''/yr

	IDL> mu_radec = 100D* [ -15D*.0259, -0.093 ]
	IDL> ra = ten(13,39,44.526)*15.D 
	IDL> dec = ten(8,38,28.63)
	IDL> jprecess, ra, dec, ra2000, dec2000, mu_radec = mu_radec
	IDL> print, adstring(ra2000, dec2000,2)
		===> 13h 42m 12.740s    +08d 23' 17.69"

 RESTRICTIONS:
	"When transferring individual observations, as opposed to catalog mean
	place, the safest method is to tranform the observations back to the
	epoch of the observation, on the FK4 system (or in the system that was
	used to to produce the observed mean place), convert to the FK5 system,
	and transform to the the epoch and equinox of J2000.0" -- from the
	Explanatory Supplement (1992), p. 180

 REVISION HISTORY:
	Written,    W. Landsman                September, 1992
	Corrected a couple of typos in M matrix   October, 1992
	Vectorized, W. Landsman                   February, 1994

(See /usr/local/idl/lib/zastron/astro/jprecess.pro)


JULDATE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	JULDATE
 PURPOSE:                                   
	Convert from calender to Reduced Julian Date

 CALLING SEQUENCE:
	JULDATE, /PROMPT           ;Prompt for Calender Date, print Julian Date
		or
	JULDATE, date, jd      

 INPUT:
	DATE - 5-element array containing year,month (1-12),day,hour & minute
		all specified as numbers (Universal Time). Year after 1900
		can be specified 2 ways, either for example, as 83 or 1983.
		Years B.C should be entered as negative numbers.  If Hour or
		Minute are not supplied, they will default to 0. 

  OUTPUT:
	JD - reduced julian date, double precision scalar.  To convert to
		Julian Date, add 2400000.   JULDATE will print the value of
		JD at the terminal if less than 2 parameters are supplied, or 
		if the /PROMPT keyword is set
      
  OPTIONAL INPUT KEYWORD:
	PROMPT - If this keyword is set and non-zero, then JULDATE will prompt
		for the calender date at the terminal.

  RESTRICTIONS:
	Will not work for years between 0 and 99 A.D.  (since these are
	interpreted as years 1900 - 1999).  Will not work for year 1582.

	The procedure HELIO_JD can be used after JULDATE, if a heliocentric
	Julian date is required.

  EXAMPLE:
	A date of 25-DEC-1981 06:25 UT may be expressed as either

	IDL> juldate, [81,12,25,6,25], jd       
	IDL> juldate, [1981,12,25.2673611], jd 

	In either case, one should obtain a reduced julian date of 
	JD = 44963.7673611

  REVISION HISTORY
	Adapted from IUE RDAF (S. Parsons)                      8-31-87
	Algorithm from Sky and Telescope April 1981   
	Added /PROMPT keyword, W. Landsman    September 1992

(See /usr/local/idl/lib/zastron/astro/juldate.pro)


MAG2FLUX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	MAG2FLUX
 PURPOSE:
	Convert from magnitudes to flux (ergs/s/cm^2/A).  Use FLUX2MAG for
	the opposite direction.

 CALLING SEQUENCE:
	flux = mag2flux( mag, [ zero_pt ] )

 INPUTS:
	mag - scalar or vector of magnitudes

 OPTIONAL INPUT:
	zero_pt - scalar giving the zero point level of the magnitude.
		If not supplied then zero_pt = 21.1 (Code et al 1976)

 OUTPUT:
	flux - scalar or vector flux vector (flux = 10^(-0.4*(mag + zero_pt))

 REVISION HISTORY:
	Written    J. Hill        STX Co.       1988

(See /usr/local/idl/lib/zastron/astro/mag2flux.pro)


MOONPOS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:                                     
	MOONPOS
 PURPOSE:
	To compute the RA and Dec of the Moon at a given date.

 CALLING SEQUENCE:
	MOONPOS, Dte, Ra, Dec

 INPUTS:
	Dte - The Julian date of the day (and time) in question.

 OUTPUTS:
	Ra  - The right ascension of the moon at that date in radians.
	Dec - The declination of the moon at that date in radians.

 SIDE EFFECTS:
	The user should be aware that the equations used are not highly 
	accurate.    The error in right ascension will rarely exceed 0.3 
	degrees; the error in declination will rarely exceed 0.2 degrees.

 PROCEDURE:
     The lunar position is computed from the low precision formulae provided
     in the Astronomical Almanac.

 EXAMPLE:
	IDL> juldate,[1982,4,6],jd    ;Get reduced julian date
	IDL> jd = jd + 2400000.       ;Convert to full julian date
	IDL> moonpos, jd, ra ,dec     ;Get RA and Dec of moon
	IDL> print,adstring(ra*!RADEG,dec*!RADEG)
		==> 11 17  6.1  +09 17 56.0

	This is about 5' from the position given in the Astronomical Almanac
 MODIFICATION HISTORY:
	Written by Michael R. Greason, STX, 31 October 1988.

(See /usr/local/idl/lib/zastron/astro/moonpos.pro)


PLANCK()

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	PLANCK()   
 PURPOSE: 
	To calculate the Planck function in units ergs/cm2/s/a  

 CALLING SEQUENCE: 
	bbflux = PLANCK( wave, temp) 

 INPUT PARAMETERS: 
	WAVE   Scalar or vector giving the wavelength(s) in **Angstroms**
		at which the planck function is to be evaluated.
	TEMP   Scalar giving the temperature of the planck function in degree K

 OUTPUT PARAMETERS:
	BBFLUX - Scalar or vector giving the planck function at the specified
		wavelength points.

 EXAMPLES:
	To calculate the blackbody flux (i.e. PI*Intensity) in erg/cm^2/s/A
	for 30,000 K every 100 Angstroms between 2000A and 2900 A
   
	IDL> WAVE = 2000 + INDGEN(10)*100
	IDL> BBFLUX = PLANCK(WAVE,30000)

 RESTRICTIONS:
	Values less than approximately 1E-24 are truncated to 0.

 PROCEDURE:
	The wavelength data are converted to cm, and the planck function
	is calculated for each wavelength point. See Allen (1973), Astrophysical
	Quantities, section 44 for more information.

 MODIFICATION HISTORY:
	Adapted from the IUE RDAF               August, 1989

(See /usr/local/idl/lib/zastron/astro/planck.pro)


PRECESS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	PRECESS
 PURPOSE:
	Precess coordinates from EQUINOX1 to EQUINOX2.  For interactive
	display, one can use the procedure ASTRO which calls PRECESS or use
	the /PRINT keyword.   The default (RA,DEC) system is FK5 based on 
	epoch J2000.0 but FK4 based on B1950.0 is available via the FK4 keyword.

 CALLING SEQUENCE:
	PRECESS, ra, dec, [ equinox1, equinox2, /PRINT, /FK4 ]

 INPUT - OUTPUT:
	RA - Input right ascension in DEGREES (scalar or vector)
	DEC - Input declination in DEGREES (scalar or vector)
		NOTE: The input RA and DEC are modified by PRECESS to give the 
		values after precession.

 OPTIONAL INPUTS:
	EQUINOX1 - Original equinox of coordinates, numeric scalar.  If 
		omitted, then PRECESS will query for EQUINOX1 and EQUINOX2.
	EQUINOX2 - Equinox of precessed coordinates.

 OPTIONAL INPUT KEYWORDS:
	PRINT - If this keyword is set and non-zero, then the precessed
		coordinates are displayed at the terminal.
       FK4   - If this keyword is set, the FK4 (B1950.0) system
               will be used otherwise FK5 (J2000.0) will be used instead.

 RESTRICTIONS:
	Accuracy of precession decreases for declination values near 90 
	degrees.  PRECESS should not be used more than 2.5 centuries from
	2000 on the FK5 system (1950.0 on the FK4 system).

 EXAMPLES:
	(1) The Pole Star has J2000.0 coordinates (2h, 31m, 46.3s, 
		89d 15' 50.6"); compute its coordinates at J1985.0

	IDL> precess, ten(2,31,46.3)*15, ten(89,15,50.6), 2000, 1985, /PRINT

		====> 2h 16m 22.73s, 89d 11' 47.3"

	(2) Precess the B1950 coordinates of Eps Ind (RA = 21h 59m,33.053s,
	DEC = (-56d, 59', 33.053") to equinox B1975.

	IDL> ra = ten(21, 59, 33.053)*15
	IDL> dec = ten(-56, 59, 33.053)
	IDL> precess, ra, dec ,1950, 1975, /fk4

 PROCEDURE:
	Algorithm from Computational Spherical Astronomy by Taff (1983), 
	p. 24. (FK4). FK5 constants from "Astronomical Almanac Explanatory
       Supplement 1992, page 104 Table 3.211.1.

 PROCEDURE CALLED:
	Function PREMAT - computes precession matrix 

 REVISION HISTORY
	Written, Wayne Landsman, STI Corporation  August 1986
	Correct negative output RA values   February 1989
	Added /PRINT keyword      W. Landsman   November, 1991
       Provided FK5 (J2000.0)  I. Freedman   January 1994
	Precession Matrix computation now in PREMAT   W. Landsman June 1994

(See /usr/local/idl/lib/zastron/astro/precess.pro)


PRECESS_CD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	PRECESS_CD

 PURPOSE:
	Precess CD (coordinate description) matrix from a FITS header 
	from EPOCH1 to EPOCH2.  Called by HPRECESS

 CALLING SEQUENCE:
	PRECESS_CD, cd, epoch1, epoch2, crval_old, crval_new  

 INPUTS/OUTPUT:
	CD - 2 x 2 CD (coordinate description) matrix in any units
		(degrees or radians).  CD will altered on output to contain 
		precessed values in the same units.    On output CD will always
		be double precision no matter how input.

 INPUTS:
	EPOCH1 - Original equinox of coordinates, scalar (e.g. 1950.0).  
	EPOCH2 - Equinox of precessed coordinates, scalar (e.g. 2000.0)
	CRVAL_OLD - 2 element vector containing RA and DEC in DEGREES
		of the reference pixel in the original equinox
	CRVAL_NEW - 2 elements vector giving CRVAL in the new equinox 

 INPUT KEYWORD:
	If this keyword is set, then the precession constants are taken in
	the FK4 reference frame.   The default is the FK5 frame.

 RESTRICTIONS:
	PRECESS_CD should not be used more than 2.5 centuries from the
	year 1900.      

 PROCEDURE:
	Adapted from the STSDAS program FMATPREC.  Precession changes the
	location of the north pole, and thus changes the rotation of
	an image from north up.  This is reflected in the precesion of the
	CD matrix.   This is usually a very small change. 

 REVISION HISTORY
	Written, Wayne Landsman, ST Systems  February 1988
	Fixed sign error in computation of SINRA     March 1992
	Added /FK4 keyword                           Feb 1994

(See /usr/local/idl/lib/zastron/astro/precess_cd.pro)


PREMAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	PREMAT
 PURPOSE:
	Return the precession matrix from EQUINOX1 to EQUINOX2.  This matrix
	is used by the procedures PRECESS and BARVL to precess astronomical
	coordinates

 CALLING SEQUENCE:
	matrix = PREMAT( equinox1, equinox2, [ /FK4 ] )

 INPUTS:
	EQUINOX1 - Original equinox of coordinates, numeric scalar.  
	EQUINOX2 - Equinox of precessed coordinates.

 OUTPUT:
	matrix - double precision 3 x 3 precession matrix, used to precess
		equatorial rectangular coordinates

 OPTIONAL INPUT KEYWORDS:
       FK4   - If this keyword is set, the FK4 (B1950.0) system precession
		angles are used to compute the precession matrix.   The 
		default is to use FK5 (J2000.0) precession angles

 EXAMPLES:
	Return the precession matrix from 1950.0 to 1975.0 in the FK4 system

	IDL> matrix = PREMAT( 1950.0, 1975.0, /FK4)

 PROCEDURE:
	FK4 constants from "Computational Spherical Astronomy" by Taff (1983), 
	p. 24. (FK4). FK5 constants from "Astronomical Almanac Explanatory
       Supplement 1992, page 104 Table 3.211.1.

 REVISION HISTORY
	Written, Wayne Landsman, HSTX Corporation, June 1994

(See /usr/local/idl/lib/zastron/astro/premat.pro)


QDCB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	QDCB

 PURPOSE:

	Convert lattitude and longitude or right ascention and declination
	into quad cube data base coordinates.

 CATEGORY:
	Mapping Coordinate Conversion

 CALLING SEQUENCE:

	QDCB,RA,DEC,FACE,X,Y

 INPUT PARAMETERS:

	RA	= Right ascention or longitude in degrees. May be a scaler
		  or an array.

	DEC	= Declination or lattitude in degrees. May be a scaler or an
		  array but must have same number of elements as RA.



 OPTIONAL KEYWORD PARAMETERS:

 OUTPUT PARAMETERS:

	FACE	= Output integer(s) from 0 to 5 identifying the cube face that
		  the input coordinate(s) lie(s) on. Will have the same number
		  of elements as RA and DEC.

	X	= Output floaing point value between +1 and -1 for the X
		  coordinate value(s) on the cube face(s). Will have the same
		  number of elements as RA and DEC.

	Y	= Output floaing point value between +1 and -1 for the Y
		  coordinate value(s) on the cube face(s). Will have the same
		  number of elements as RA and DEC.

 COMMON BLOCKS:

	NONE


 PROCEDURE:

	Transcribed the C routines from the EUVE quad cube library.


 COPYRIGHT NOTICE:

	Copyright 1991, The Regents of the University of California. This
	software was produced under U.S. Government contract (W-7405-ENG-36)
	by Los Alamos National Laboratory, which is operated by the
	University of California for the U.S. Department of Energy.
	The U.S. Government is licensed to use, reproduce, and distribute
	this software. Neither the Government nor the University makes
	any warranty, express or implied, or assumes any liability or
	responsibility for the use of this software.



 AUTHOR:

	Robert Langer

 MODIFICATIONS/REVISION LEVEL:

	1.6	8/5/92

(See /usr/local/idl/lib/zastron/astro/qdcb.pro)


QDCB_GRID

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	QDCB_GRID

 PURPOSE:

	Produce an overlay of latitude and longitude lines over a plot or image
	on the current graphics device assuming that the current plot is a map
	in the so called quad cube projection (see qdcb.pro). The output plot
	range is assumed to go from 7.0 to -1.0 on the X axis and -3.0 to 3.0
	on the Y axis. Within this plotting space, the quad cube faces are
	laid out as follows (X=Empty, Astronomical Layout shown - X axis can
	be swapped for geographic maps):

	    3.0_
		XXX0
		4321
	   -3.0_XXX5
		|  |
	      7.0  -1.0

 CATEGORY:
	Mapping Support Routine

 CALLING SEQUENCE:

	QDCB_GRID,[,DLONG,DLAT,[LINESTYLE=N,/LABELS]

 INPUT PARAMETERS:

	DLONG	= Optional input longitude line spacing in degrees. If left
		  out, defaults to 30.

	DLAT    = Optional input lattitude line spacing in degrees. If left
		  out, defaults to 30.


 OPTIONAL KEYWORD PARAMETERS:

	LINESTYLE	= Optional input integer specifying the linestyle to
			  use for drawing the grid lines.

	LABELS		= Optional keyword specifying that the lattitude and
			  longitude lines on the prime meridian and the
			  equator should be labeled in degrees. If LABELS is
			  given a value of 2, i.e. LABELS=2, then the longitude
			  labels will be in hours and minutes instead of
			  degrees.

 OUTPUT PARAMETERS:

	NONE

 COMMON BLOCKS:

	NONE

 PROCEDURE:

	Uses QDCB.PRO to compute positions of grid lines and labels.



 COPYRIGHT NOTICE:

	Copyright 1991, The Regents of the University of California. This
	software was produced under U.S. Government contract (W-7405-ENG-36)
	by Los Alamos National Laboratory, which is operated by the
	University of California for the U.S. Department of Energy.
	The U.S. Government is licensed to use, reproduce, and distribute
	this software. Neither the Government nor the University makes
	any warranty, express or implied, or assumes any liability or
	responsibility for the use of this software.



 AUTHOR:

	Jeff Bloch

 MODIFICATIONS/REVISION LEVEL:

	%I%	%G%

(See /usr/local/idl/lib/zastron/astro/qdcb_grid.pro)


RADEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	RADEC
 PURPOSE:
	To convert right ascension and declination from decimal degrees to 
	sexigesimal hours (for R.A.)  and degrees( for Dec.).

 CALLING SEQUENCE:
	radec, ra, dec, ihr, imin, xsec, ideg, imn, xsc

 INPUTS:
	ra   - right ascension in decimal DEGREES, scalar or vector
	dec  - declination in decimal DEGREES, scalar or vector, same number
		of elements as RA

 OUTPUTS:
	ihr  - right ascension hours   (INTEGER*2)
	imin - right ascension minutes (INTEGER*2)
	xsec - right ascension seconds  (REAL*4 or REAL*8)
	ideg - declination degrees (INTEGER*2)
	imn  - declination minutes (INTEGER*2)
	xsc  - declination seconds (REAL*4 or REAL*8)

 RESTRICTIONS:
	RADEC does minimal parameter checking.

 REVISON HISTORY:
	Written by B. Pfarr, STX, 4/24/87

(See /usr/local/idl/lib/zastron/astro/radec.pro)


SIXTY()

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	SIXTY()
 PURPOSE:
	Converts decimal number to sexigesimal.
	Reverse of TEN function.

 CALLING SEQUENCE:
	X = SIXTY( SCALAR ) 

 INPUTS:
	SCALAR -- Decimal quantity.  
 OUTPUTS:
	Function value returned = double real vector of three elements, 
	sexigesimal equivalent of input decimal quantity.
	A negative number is signified by making the first non-zero
	element of the output vection negative.

 PROCEDURE:
	Mostly involves checking arguments and setting the sign.

 MODIFICATION HISTORY:
	Written by R. S. Hill, STX, 19-OCT-87         
	Output changed to single precision.  RSH, STX, 1/26/88

(See /usr/local/idl/lib/zastron/astro/sixty.pro)


STRINGAD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	STRINGAD
 PURPOSE:
	Converts a string of sexigesimal coordinates to their decimal form.

 CALLING SEQUENCE:
	STRINGAD, COORDS, RA, DEC
 INPUT:
	COORDS    A string of coordinates (e.g. '17 00 45.2 25 4 32.4')
		It should have six numbers delimited by spaces
 OUTPUT:
	RA        Right Ascension, decimal degrees, scalar
	DEC       Declination, decimal degrees, scalar
 PROCEDURES CALLED:
	Getopt   Ten
 HISTORY:
	   09-AUG-90 Version 1 written  Kerry McQuade
	20-AUG-90 Put code to account for '-0' back in after it was cleverly
	removed before installation in the MOUSSE library.            E. Deutsch

(See /usr/local/idl/lib/zastron/astro/stringad.pro)


SUNPOS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	SUNPOS
 PURPOSE:
	To compute the RA and Dec of the Sun at a given date.
 CALLING SEQUENCE:
	sunpos, jd, ra, dec, [elong]
 INPUTS:
	jd    - The Julian date of the day (and time) in question, scalar or
	        vector.
 OUTPUTS:
	ra    - The right ascension of the sun at that date in RADIANS.
	dec   - The declination of the sun at that date in RADIANS.
 OPTIONAL OUTPUT:
	elong - Ecliptic longitude of the sun at that date in DEGREES.
 KEYWORDS:
	DEGREES   - If present and non-zero, all parameters that are
	            returned in RADIANS are instead returned in DEGREES.
	ELNG      - Returns the ecliptic longitude of the sun, in RADIANS.
	OBLIQUITY - Returns the obliquity of the ecliptic, in RADIANS.
 NOTES:
	The user should be aware that the equations used are not highly
	accurate.  The error in right ascension and declination is 0.01
	degrees.

	The Ra and Dec are in the given date's equinox.
 PROCEDURE:
	The solar position is computed using the low precision formulae
	given in the 1993 Astromonical Almanac.
 MODIFICATION HISTORY:
	Written by Michael R. Greason, STX, 28 October 1988.
	Accept vector arguments, W. Landsman     April,1989
	Eliminated negative right ascensions.  MRG, Hughes STX, 6 May 1992.
	Rewritten using the 1993 Almanac.  Keywords added.  MRG, HSTX, 
		10 February 1994.

(See /usr/local/idl/lib/zastron/astro/sunpos.pro)


TEN()

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	TEN()
 PURPOSE:
	Converts sexigesimal number to decimal.
	Inverse of SIXTY function.

 CALLING SEQUENCES:
	X = TEN( [ HOUR_OR_DEG, MIN, SEC ] )
	X = TEN( HOUR_OR_DEG, MIN, SEC )
	X = TEN( [ HOUR_OR_DEG, MIN ] )
	X = TEN( HOUR_OR_DEG, MIN )
	X = TEN( [ HOUR_OR_DEG ] )      <--  Trivial cases
	X = TEN( HOUR_OR_DEG )        <--

 INPUTS:
	HOUR_OR_DEG,MIN,SEC -- Scalars giving sexigesimal quantity in 
		in order from largest to smallest.    

 OUTPUTS:
	Function value returned = double real scalar, decimal equivalent of
	input sexigesimal quantity.  A minus sign on any element
	of the input vector causes all the elements to be taken as
	< 0.

 PROCEDURE:
	Mostly involves checking arguments and setting the sign.

	The procedure TENV can be used when dealing with a vector of 
	sexigesimal quantities.

 MODIFICATION HISTORY:
	Written by R. S. Hill, STX, 21 April 87       
	Modified to allow non-vector arguments.  RSH, STX, 19-OCT-87

(See /usr/local/idl/lib/zastron/astro/ten.pro)


TENV()

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	TENV()
 PURPOSE:
	Converts sexigesimal number to decimal.  Like TEN but allows vector
	input.

 CALLING SEQUENCES:
	Result = TENV( dd, mm )           ; result = dd + mm/60.
	Result = TENV( dd, mm, ss)        ; result = dd + mm/60. + ss/3600.

 INPUTS:
	dd - Sexigesimal element(s) corresponding to hours or degrees
	mm - Sexigesimal element(s) corresponding to minutes
	ss - Sexigesimal element(s) corresponding to seconds (optional)
		The input parameters can be scalars or vectors.   However, the
		number of elements in each parameter must be the same.

 OUTPUTS:
	Result -  double, decimal equivalent of input sexigesimal 
		quantities.  Same number of elements as the input parameters.
		If the nth element in any of the input parameters is negative 
		then the nth element in Result wil also be negative.

 EXAMPLE:
	If dd = [60,60,0], and mm = [30,-30,-30], then

	IDL> Result = TENV(dd,mm)  ====>   Result =  [60.5,-60.5,-0.5]

 PROCEDURE:
	Mostly involves checking arguments and setting the sign.

   MODIFICATION HISTORY:
	Written by W.B. Landsman           April, 1991

(See /usr/local/idl/lib/zastron/astro/tenv.pro)


TICLABELS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	TICLABELS
 PURPOSE:
	Used to display images with right ascension and declination
	axes.  This routine creates labels for already determined tic
	marks (every other tic mark)

 CALLING SEQUENCE:
	ticlabels, minval, numtics, incr, ticlabs, [ RA = ,DELTA = ]

 INPUTS:
	minval  - minimum value for labels (degrees)
	numtics - number of tic marks
	incr    - increment in minutes for labels

 OUTPUTS:
	ticlabs - array of charater string labels

 OPTIONAL INPUT KEYWORDS:
	RA - if this keyword is set then the grid axis is assumed to be
		a Right Ascension.   Otherwise a declination axis is assumed
	DELTA - Scalar specifying spacing of labels.   The default is 
		DELTA = 2 which means that a label is made or every other tic
		mark.  Set DELTA=1 to create a label for every tic mark.

 NOTES:
	The following note applies to users of IDL version 2.4.0 or before.
	This bug mentioned was fixed in Version 3.0.0

	If you are using the native Postscript fonts, you must first define
	your font with DEVICE,/TIMES,FONT_INDEX=3 where /TIMES is replaced with
	your font of choice.  The default is Helvetica and therefore does not
	require the above DEVICE command.  This patch is necessary if you are
	using IDL 2.4.0 or before, because the !X feature does not work
	properly using the PostScript Driver in this version.

 PROCEDURES USED:
	RADEC

 RESTRICTIONS:
	Invalid for wide field (> 2 degree) images since it assumes that a 
	fixed interval in Y (or X) corresponds to a fixed interval in Dec 
	(or RA)

 REVISON HISTORY:
	written by B. Pfarr, 4/15/87
	Added DELTA keywrd for compatibility with IMCONTOUR W. Landsman Nov 1991
	Added nicer hms and dms symbols when using native PS fonts Deutsch 11/92
	Added Patch for bug in IDL <2.4.0 as explained in NOTES E. Deutsch 11/92
	Fix when crossing 0 dec or 24h RA

(See /usr/local/idl/lib/zastron/astro/ticlabels.pro)


TICPOS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	TICPOS
 PURPOSE:
	Procedure to specify distance between tic marks for astronomical
	coordinate overlays.  User inputs number an approximate distance
	between tic marks, and the axis length in degrees.  TICPOS will return 
	a distance between tic marks such that the separation is a round
	multiple in arc seconds, arc minutes, or degrees

 CALLING SEQUENCE:
	ticpos, deglen, pixlen, ticsize, incr, units

 INPUTS:
	deglen - length of axis in DEGREES
	pixlen - length of axis in plotting units (pixels)
	ticsize - distance between tic marks (pixels).  This value will be
		adjusted by TICPOS such that the distance corresponds to
		a round multiple in the astronomical coordinate.

 OUTPUTS:
	ticsize - distance between tic marks (pixels), positive scalar 
	incr    - incremental value for tic marks in round units given 
		by the UNITS parameter
	units - string giving units of ticsize, either 'ARC SECONDS',
		'ARC MINUTES', or 'DEGREES'

 EXAMPLE:
	Suppose a 512 x 512 image array corresponds to 0.2 x 0.2 degrees on
	the sky.   A tic mark is desired in round angular units, approximately 
	every 75 pixels.

	IDL> ticsize = 75
	IDL> TICPOS,0.2,512,ticsize,incr,units   

	==> ticsize = 85.333, incr = 2. units = 'ARC MINUTES'

	i.e. a good tic mark spacing is every 2 arc minutes, corresponding
	to 85.333 pixels.

 REVISON HISTORY:
	written by W. Landsman            November, 1988

(See /usr/local/idl/lib/zastron/astro/ticpos.pro)


TICS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	TICS
 PURPOSE:
	For use in labelling a displayed image with right ascension
	and declination axes.  An approximate distance between tic 
	marks is input, and a new value is computed such that the 
	distance between tic marks is in simple increments of the 
	tic label values.

 CALLING SEQUENCE:
	tics, min, max, numx, ticsize, incr, [RA = ]

 INPUTS:
	min - minimum axis value (degrees)
	max - maximum axis value (degrees)
	numx  - number of pixels in x direction

 INPUT/OUTPUT  
	ticsize - distance between tic marks (pixels)

 OUTPUTS:
	incr    - incremental value for tic labels (in minutes of 
		time for R.A., minutes of arc for dec.)

 REVISON HISTORY:
	written by B. Pfarr, 4/14/87
	Added some more tick precision (i.e. 1 & 2 seconds in case:) EWD May92

(See /usr/local/idl/lib/zastron/astro/tics.pro)


TIC_ONE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	TIC_ONE
 PURPOSE:
	For use in labelling images with right ascension
	and declination axes. This routine determines the 
	position in pixels of the first tic.

 CALLING SEQUENCE:
	tic_one, min, pixx, incr, min2, tic1, [RA = ]

 INPUTS:
	min  - astronomical coordinate value at axis zero point (degrees 
		or hours)
	pixx - distance in pixels between tic marks (usually obtained from TICS)
	incr - increment in minutes for labels (usually an even number obtained 
		from the procedure TICS)

 OUTPUTS:
	min2 - astronomical coordinate value at first tic mark 
	tic1 - position in pixels of first tic mark

 EXAMPLE:
	Suppose a declination axis has a value of 30.2345 degrees at its
	zero point.  A tic mark is desired every 10 arc minutes, which 
	corresponds to 12.74 pixels.  Then

	IDL> TIC_ONE, 30.2345, 1, 12.74, min2, tic1

	yields values of min2 = 30.333 and tic1 = 5.74, i.e. the first tic
	mark should be labeled 30 deg 20 minutes and be placed at pixel value
	5.74

 REVISION HISTORY:
	by B. Pfarr, 4/15/87

(See /usr/local/idl/lib/zastron/astro/tic_one.pro)


UNRED

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	UNRED
 PURPOSE:
	Correct an (ultraviolet) flux vector for interstellar extinction. 
	One can choose from 9 different extinction curves (or a user specified 
	curve).    Users may wish to consider the procedure CCM_UNRED as an
	alternative to UNRED.

 CALLING SEQUENCE:
	UNRED, wave, flux, ebv, funred, [ table, SILENT = ]      

 INPUT:
	WAVE - wavelength vector (Angstroms)
	FLUX - calibrated flux vector, same number of elements as WAVE
	EBV  - color excess E(B-V), scalar.  If a negative EBV is supplied,
		then fluxes will be reddened rather than deredenned.

 OPTIONAL INPUT:
	TABLE - Scalar value describing the extinction curve to be
		used as described below. If not specified, UNRED will
		prompt for an extinction curve.  UNRED assumes R = 3.1
		for all curves except 2 (R=3.2) and 3 (R=3.0).
	Lambda Range     Table
	1000-34000A   1  Savage & Mathis (1979, Ann Rev) 
	1000-10000A   2  Seaton, M. "Interstellar Extinction in the UV,"
			M.N.R.A.S. Vol. 187, No. 3 (June 1979) p. 73p-76p
			N.B. longward of 3700 A the data of Nandy, et al.  
	1373-10000A   3  Nandy "Studies of Ultraviolet Interstellar Extinction 
			with the Sky-survey Telescope of the TD-1 Satellite,"
			Astr. Ap., Vol. 44 No. 1 (Nov 1975) p. 195-203.
	1000-3400 A   4  Theta 2B Orionis, Bohlin and Savage (1981) 
			Ap. J. 249, 109.
	1000-35000A   5  SMC Hutchings (1982) Ap. J. 255 p. 70
	1184-3448A    6  LMC Nandy, et al. (1981) M.N.R.A.S. , 196, p. 955
	1110-4400A    7  LMC Koornneef and Code (1981) Ap. J. 247, 860
	1250-3448A    8  LMC 30 Dor Region Fitzpatrick (1985) Ap. J. 299, 219
	1250-3448A    9  LMC non-30 Dor    Fitzpatrick (1985) Ap. J.
		      99  User specified table

 OUTPUT:
	FUNRED - unreddened flux vector, same units and number of elements
		as FLUX

 OPTIONAL INPUT KEYWORD:
	SILENT  - if this keyword is set and non-zero, then informational 
		messages will not be printed.

 NOTES:
	If you wish to use a different extinction curve simply enter the name of
	the file containing the nonstandard extinction curve.  Use record 1 for
	the wavelength and record 2 for the flux.  The file must be floating 
	point format.  UNRED will assume R=3.1 in this case

 DATA FILES:
	The envrironment variable ASTRO_DATA (see first line of program) should 
	point to the directory containing the data files.    This line may need 
	to be changed if UNRED is used outside of the LASP cluster.   (See the
	procedure ASTROLIB).

 RESTRICTIONS:
	Unreddened fluxes will be very unreliable at wavelengths outside of
	the domain of the reddening curve (although no error message is printed)

 REVISION HISTORY:
	Adapted from the IUE RDAF                    November, 1988
	Directory specifications generalized  J. Offenberg	July, 1991
	Added Silent keyword      W. Landsman       January, 1992

(See /usr/local/idl/lib/zastron/astro/unred.pro)


UVBYBETA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	UVBYBETA
 PURPOSE:
	Derive dereddened colors, metallicity, and effective temperature
	from Stromgren colors.  Adapted from FORTRAN routine of same name
	published by T.T. Moon, Communications of University of London
	Observatory, No. 78.  Can be used either interactively or called
	from a main procedure.

 CALLING SEQUENCE:
	uvbybeta                    ;Prompt for all parameters
	uvbybeta,by,m1,c1,beta,n    ;Supply inputs, print outputs
	uvbybeta, by, m1, c1, beta, n, name, Te, Mv, Eby, delm0, radius, 
			[ TEXTOUT= ]

 INPUTS:
	by - Stromgren b-y color, scalar
	m1 - Stromgren line-blanketing parameter, scalar
	c1 - Stromgren Balmer discontinuity parameter, scalar
	beta - H-beta line strength index.  If beta is not know UVBYBETA
		will compute a value based on by, m1,and c1.
	n -  Integer (1-8) giving approximate stellar classification

	(1) B0 - A0, classes III - V, 2.59 < BETA < 2.88,-0.20 <   c0  < 1.00
	(2) B0 - A0, class   Ia     , 2.52 < BETA < 2.59,-0.15 <   c0  < 0.40
	(3) B0 - A0, class   Ib     , 2.56 < BETA < 2.61,-0.10 <   c0  < 0.50
	(4) B0 - A0, class   II     , 2.58 < BETA < 2.63,-0.10 <   c0  < 0.10
	(5) A0 - A3, classes III - V, 2.87 < BETA < 2.93,-0.01 < (b-y)o< 0.06
	(6) A3 - F0, classes III - V, 2.72 < BETA < 2.88, 0.05 < (b-y)o< 0.22
	(7) F1 - G2, classes III - V, 2.60 < BETA < 2.72, 0.22 < (b-y)o< 0.39
	(8) G2 - M2, classes  IV _ V, 0.20 < m0   < 0.76, 0.39 < (b-y)o< 1.00

	name - scalar string giving name of star.  Used only when writing to 
		disk for identification purposes.

 OPTIONAL INPUT KEYWORD:
	TEXTOUT   Used to determine output device.  If not present, the
	value of !TEXTOUT system variable is used (see TEXTOPEN)
		textout=1	Terminal with /MORE
		textout=2	Terminal without /MORE
		textout=3	.PRT
		textout=4	Laser Printer 
		textout=5      User must open file         
		textout = filename (default extension of .prt)

 OPTIONAL OUTPUTS:
	Te - approximate effective temperature
	MV - absolute visible magnitude
	Eby - Color excess b-y
	delm0 - metallicity index, delta m0, may not be calculable for early
		B stars.
	radius - Stellar radius (R/R(solar))

 SYSTEM VARIABLES:
	If keyword textout not used, the non-standard system variable !TEXTOUT 
	becomes the output device indicator.
	Set  !TEXTOUT =3 to have results directed to a file UVBYBETA.PRT 
	If all output parameters were supplied, then type TEXTCLOSE to close
	this file

 REVISION HISTORY:                                           
	W. Landsman          IDL coding              February, 1988
	Keyword textout added, J. Isensee, July, 1990
	Made some constants floating point.   W. Landsman    April, 1994

(See /usr/local/idl/lib/zastron/astro/uvbybeta.pro)


VACTOAIR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	VACTOAIR
 PURPOSE:
	Convert vacuum wavelengths to air wavelengths, i.e. correct
	for the index of refraction of air under standard conditions.  
	Wavelength values below 2000 A will not be altered.  Accurate to 
	about 0.005 A 

 CALLING SEQUENCE:
	VACTOAIR, WAVE

 INPUT/OUTPUT:
	WAVE - Wavelength in Angstroms, scalar or vector
		WAVE should be input as vacuum wavelength(s), it will be
		returned as air wavelength(s).  WAVE is always converted to
		double precision

 EXAMPLE:
	If the vacuum wavelength is  W = 2000, then 

	IDL> VACTOAIR, W 

	yields an air wavelength of W = 1999.353 Angstroms

 METHOD:
	An approximation to the 4th power of inverse wavenumber is used
	See IUE Image Processing Manual   Page 6-15.

 REVISION HISTORY
	Written, D. Lindler 1982 
	Documentation W. Landsman  Feb. 1989

(See /usr/local/idl/lib/zastron/astro/vactoair.pro)


WCSSPH2XY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	WCSSPH2XY 

 PURPOSE:
	To convert spherical (longitude and latitude -- sky) coordinates to x 
	and y (map) angular coordinates.  This procedure is the inverse of 
	WCSXY2SPH.    See WCS_DEMO for example of use.

 CATEGORY:
       Mapping and Auxilliary FITS Routine

 CALLING SEQUENCE:
	wcssph2xy, longitude, latitude, x, y, [ map_type , CTYPE = ,
		FACE =,PROJP1 = , PROJP2= , CRVAL = , CRXY = , LONGPOLE = ,
               NORTH_OFFSET =, SOUTH_OFFSET =, BADINDEX =]

 INPUT PARAMETERS:
	longitude - longitude of data, scalar or vector, in degrees 
	latitude - latitude of data, same number of elements as longitude, 
		in degrees
	map_type - optional positional parameter, numeric scalar (0-25) 
		corresponding to a particular map projection.  This is not a 
		FITS standard, it is simply put in to allow function similar 
		to that of less general map projection procedures (eg AITOFF).
		The following list gives the map projection types and their 
		respective numbers.

  FITS  Number  Name                       Comments
  code   code
  ----  ------  -----------------------    -----------------------------------
   DEF     0    Default = Cartesian
   AZP     1    Zenithal perspective       projp1 required
   TAN     2    Gnomic                     AZP w/ projp1 = 0
   SIN     3    Orthographic               AZP w/ projp1 = Infinity (>10^14)
   STG     4    Stereographic              AZP w/ projp1 = 1
   ARC     5    Zenithal Equidistant
   ZPN     6    Zenithal polynomial        prop1-projp9 required, useless
   ZEA     7    Zenithal equal area
   AIR     8    Airy                       projp1 required
   CYP     9    Cylindrical perspective    projp1 and projp2 required
   CAR    10    Cartesian
   MER    11    Mercator
   CEA    12    Cylindrical equal area     projp1 required
   COP    13    Conical perspective        projp1 and projp2 required
   COD    14    Conical equidistant        projp1 and projp2 required
   COE    15    Conical equal area         projp1 and projp2 required
   COO    16    Conical orthomorphic       projp1 and projp2 required
   BON    17    Bonne's equal area         projp1 required
   PCO    18    Polyconic
   GLS    19    Sinusoidal
   PAR    20    Parabolic
   AIT    21    Hammer-Aitoff
   MOL    22    Mollweide
   CSC    23    Cobe Quadrilateralized     convergence of inverse is poor
                Spherical Cube
   QSC    24    Quadrilateralized 
                Spherical Cube
   TSC    25    Tangential Spherical Cube

 OPTIONAL KEYWORD PARAMETERS:

	CTYPE - One, two, or three element vector containing 8 character 
		strings corresponding to the CTYPE1, CTYPE2, and CTYPE3 
		FITS keywords: 

		CTYPE(0) - first four characters specify standard system
		('RA--','GLON' or 'ELON' for right ascension, galactic 
		longitude or ecliptic longitude respectively), second four 
		letters specify the type of map projection (eg '-AIT' for 
		Aitoff projection)
	        CTYPE(1) - first four characters specify standard sytem
		('DEC-','GLAT' or 'ELAT' for declination, galactic latitude
		or ecliptic latitude respectively; these must match 
		the appropriate system of ctype1), second four letters of 
		ctype2 must match second four letters of ctype1.
		CTYPE(2) - if present must be the 8 character string,'CUBEFACE',
		 only used for spherical cube projections to identify an axis 
		as containing the face on which each x and y pair of 
		coordinates lie.
	FACE - a output variable used for spherical cube projections to 
		designate the face of the cube on which the x and y 
		coordinates lie.   Will contain the same number of elements as
		X and Y.    Must contain at least 1 arbitary element on input
	PROJP1 - scalar with first projection parameter, this may
		or may not be necessary depending on the map projection used
	PROJP2 - scalar with second projection parameter, this may
		or may not be necessary depending on the map projection used
	CRVAL - 2 element vector containing standard system coordinates (the 
		longitude and latitude) of the reference point
	CRXY - 2 element vector giving the x and y coordinates of the 
		reference point, if this is not set the offset is [0,0]
		This is not a FITS standard -- it is similar to CRPIX but in 
		angular X,Y coordinates (degrees) rather than pixel coordinates
	LONGPOLE - native longitude of standard system's North Pole, default
		is 180 degrees
       NORTH_OFFSET - offset (radians) added to input points near north pole.
       SOUTH_OFFSET - offset (radians) added to input points near south pole.
       BADINDEX     - vector, list of transformed points too close to poles.


 OUTPUT PARAMETERS:

	x - x coordinate of data, same number of elements as longitude, in 
		degrees; if CRXY is set, then x will be returned offset by 
		crxy(0).  NOTE: x in all map projections increases to the 
		left, not the right.
	y - y coordinate of data, same number of elements as longitude, in 
		degrees; if CRXY is set, y will be returned offset by crxy(1)
       bad - vector returning index to transformed points close to pole.

 NOTES:
	The conventions followed here are described in more detail in 
	"Representations of Celestial Coordinates in FITS" by Eric Greisen 
	and Mark Calabretta (draft dated August 24, 1993).  The general 
	scheme outlined in that article is to convert coordinates in one of 
	three standard systems (RA and DEC, galactic longitude and latitude 
	or ecliptic longitude and latitude) into a "native system" of 
	latitude and longitude.  The latitude and longitude are then converted
	 into x and y coordinates which depend on the map projection which is 
	performed.  Obviously, the rotation from standard to native coordinates
	can be skipped if one so desires.
	This procedure necessitates two basic sections.  The first converts 
	"standard" coordinates to "native" coordinates while the second converts
	"native" coordinates to x and y coordinates.  The first section is 
	simply a procedure to rotate the coordinate systems while the second 
	contains the guts of the code in which all of the map projection is 
	done.  This procedure can be called in a form similar to AITOFF, EQPOLE,
	or QDCB by calling wcssph2xy with a fifth parameter specifying the map
	projection by number and by not using any of the keywords related to the
	map projection type (e.g. CTYPE).

 PROCEDURE:

	The first task of the procedure is to do general error-checking to 
	make sure the procedure was called correctly and none of the 
	parameters or keywords conflict.  This is particularly important 
	because the procedure can be called in two ways (either using 
	FITS-type keywords or using a number corresponding to a map projection
	type).  All variables are converted into double precision values and 
	angular measurements are converted from degrees into radians.
	If necessary, longitude values are converted into the range -pi to pi.
	Any latitude points close to the  of the poles are mapped to a specific
	latitude of  from the pole so that the map transformations become
	completely invertible.  The magnitude of this correction is given by 
	the keywords NORTH_OFFSET and SOUTH_OFFSET and a list of affected 
       points is optionally returned in the "badindex" output parameter.
	The next task of the procedure is to convert the "standard" 
	coordinates to "native" coordinates by rotating the coordinate system.
	This rotation is governed by the keywords CRVAL and LONGPOLE.  The 
	transformation is a straightforward application of euler angles.
	The final task of the procedure is to take "native" latitude and 
	longitude coordinates and convert them into x and y coordinates.  Any 
	map specific error-checking is done at this time.  All of the 
	equations were obtained from "Representations of Celestial 
	Coordinates in FITS" and cases needing special attention are handled 
	appropriately (see the comments with individual map projections for 
	more information on special cases). 

	Note that a further transformation (using the CD matrix) is required
	to convert the (x,y) coordinates to pixel coordinates. 
 COMMON BLOCKS:

	none

 COPYRIGHT NOTICE:

	Copyright 1993, The Regents of the University of California. This
	software was produced under U.S. Government contract (W-7405-ENG-36)
	by Los Alamos National Laboratory, which is operated by the
	University of California for the U.S. Department of Energy.
	The U.S. Government is licensed to use, reproduce, and distribute
	this software. Neither the Government nor the University makes
	any warranty, express or implied, or assumes any liability or
	responsibility for the use of this software.

 AUTHOR:

	Rick Balsano

 MODIFICATIONS/REVISION LEVEL:

	1.1	8/31/93
	2.3     9/15/93  W. Landsman (HSTX) Update quad cube coords, vectorize
			 keywords
	2.4	12/29/93 I. Freedman (HSTX) Eliminated LU decomposition
       2.5     1/5/93   I. Freedman (HSTX) Offset keywords / bad point index

(See /usr/local/idl/lib/zastron/astro/wcssph2xy.pro)


WCS_DEMO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	wcs_demo

 PURPOSE:

	To demonstrate the basic capabilities of the routines wcssph2xy.pro
	and wcsxy2sph.pro.

 CATEGORY:
	Mapping and Auxillary FITS Demo Routine

 CALLING SEQUENCE:

	.run wcs_demo: compiles wcs_demo and the supporting demo routines
	wcs_demo: run the demo

 INPUT PARAMETERS:

	none

 OUTPUT PARAMETERS:
	none

 PROCEDURE:

	This is a demo program which is meant to call the routines 
	wcssph2xy.pro and wcsxy2sph.pro.  Since the purpose of this
	routine is both to show what the routines can do and what the
	user has to do, a file is created with all of the commands 
	needed to complete the desired operation.  Wcs_demo actually 
	executes this command file, so the user can exactly duplicate
	the results by simply re-executing this file.  Also, this 
	allows a user to edit an already existing file which calls 
	wcssph2xy.pro and wcsxy2sph.pro properly and extend the file's
	usefulness.  This demo program allows several possible tests.
	The first option is to simply draw a grid of evenly spaced
	latitude and longitude lines in a particular map transformation.
	Another possibility is to do a full loop, creating a Cartesian
	grid of latitude and longitude lines and calling wcssph2xy.pro
	to convert them to a particular map.  Then, wcsxy2sph.pro is
	called to invert the process and the difference between the
	original and final latitudes and longitudes can be plotted.
	This allows one to assess the level of the numerical errors
	introduced by the mapping routines.  A third possible option is to
	look at some of the map transformations and include rotations of
	the reference points so that a different perspective is given.

 COMMON BLOCKS:
	none

 PROCEDURES CALLED:
	SPHDIST, WCSXY2SPH, WCSSPH2XY
 COPYRIGHT NOTICE:

	Copyright 1991, The Regents of the University of California. This
	software was produced under U.S. Government contract (W-7405-ENG-36)
	by Los Alamos National Laboratory, which is operated by the
	University of California for the U.S. Department of Energy.
	The U.S. Government is licensed to use, reproduce, and distribute
	this software. Neither the Government nor the University makes
	any warranty, express or implied, or assumes any liability or
	responsibility for the use of this software.

 AUTHOR:

	Rick Balsano

 MODIFICATIONS/REVISION LEVEL:

	1.1	8/31/93

(See /usr/local/idl/lib/zastron/astro/wcs_demo.pro)


XYZ

[Previous Routine] [Next Routine] [List of Routines]
 NAME
	XYZ
 PURPOSE:
	Calculate heliocentric X,Y, and Z coordinates for 1950.0
	(The positive X axis is directed towards the equinox, the y-axis
	towards the point on the equator at right ascension 6h, and the z
	axis toward the north pole of the equator.

 CALLING SEQUENCE:
	xyz, date, x, y, z

 INPUT:
	date - reduced julian date (=JD - 2400000), scalar or vector

 OUTPUT:
	X,Y,Z - scalars or vectors giving heliocentric rectangular coordinates
		(in A.U) for each date supplied.

 EXAMPLE:
	What were the rectangular coordinates of the sun on Jan 1, 1982 at 0h UT
	(= julian day 2444969.5)

	IDL> xyz,44969.5,x,y,z ==> x = 0.1494, y = -0.8915, z = -0.3867

	within 0.001 A.U of the Astronomical Almanac position
 REVISION HISTORY
	Original algorithm from Almanac for Computers, Doggett et al. USNO 1978
	Adapted from the book Astronomical Photometry by A. Henden
	Written  W. Landsman   STX       June 1989

(See /usr/local/idl/lib/zastron/astro/xyz.pro)


ZANG()

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ZANG()
 PURPOSE:
	Determine the angular size of an object as a function of redshift
	in a Friedmann cosmology (homogeneous, isotropic universe with zero
	cosmological constant)

 CALLING SEQUENCE:
	angsiz = zang( dl, [ z, h, omg ] )

 INPUTS:
	dl - linear size of the object in kpc
 OPTIONAL INPUT
	User will be prompted for these parameters if not supplied.

	z - redshift of object 
	h - Hubble constant in km/s/Mpc (usually 50 - 100)
	omega - Cosmological density parameter (twice the deceleration
		parameter q0), Omega =1 at the critical density

 OUTPUT:
	angsiz - Angular size of the object at the given redshift in 
		arc seconds 

 NOTES:
	One (and only one) of the input parameters may be supplied as a vector
	In this case, the output ANGSIZ will also be a vector.
	Be sure to supply the input linear size dl in units of kpc.

 REVISION HISTORY:
	Written    J. Hill   STX           July, 1988

(See /usr/local/idl/lib/zastron/astro/zang.pro)


ZENPOS

[Previous Routine] [List of Routines]
 NAME:
	ZENPOS
 PURPOSE:
	To supply the zenith RA and Dec in radians corresponding to a supplied
	Julian date.

 CALLING SEQUENCE:
	ZENPOS, Date, Ra, Dec

 INPUT:
	Date  The Julian date, in double precision, of the date and time
		for which the zenith position is desired, scalar or vector.

 OUTPUTS:
	Ra    The right ascension in radians of the zenith.
	Dec   The declination in radians of the zenith.

 PROCEDURE:
	The local sidereal time is computed; this is the RA of the zenith.
	It and the observatories latitude (corresponding to the Dec.) are
	converted to radians and returned as the zenith direction.

 PROMPTS:
	ZENPOS will prompt for the following 3 parameters if they are not
	defined in the common block SITE (see below)

	LAT,LNG - north latitude and west longitude of the desired location 
		in DEGREES
	TZONE - Time Zone (in hours) of the desired location (e.g. 4 = EDT,
		5 = EST)

 COMMON BLOCKS:
	SITE - This common block should contain the three scalars LAT, LNG
		and TZONE

 MODIFICATION HISTORY:
	Written by Michael R. Greason, STX, 14 October 1988.

(See /usr/local/idl/lib/zastron/astro/zenpos.pro)