JD2YMD [1] $SSW/gen/idl/fund_lib/jhuapl/jd2ymd.pro
[Previous] [Next]
 NAME:
       JD2YMD
 PURPOSE:
       Find year, month, day from julian day number.
 CATEGORY:
 CALLING SEQUENCE:
       jd2ymd, jd, y, m, d
 INPUTS:
       jd = Julian day number (like 2447000).     in
 KEYWORD PARAMETERS:
 OUTPUTS:
       y = year (like 1987).                      out
       m = month number (like 7).                 out
       d = day of month (like 23).                out
 CALLS: ***
	YMD2JD [1], YMD2JD [2], YMD2JD [3]
 CALLED BY:
	DT_TM_MAK [1], DT_TM_MAK [2], DT_TM_MAK [3]
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  21 Aug, 1986.
       Johns Hopkins Applied Physics Lab.
       RES 18 Sep, 1989 --- converted to SUN
       R. Sterner, 30 Apr, 1993 --- cleaned up and allowed arrays.
       Theo Brauers, 21 Sep, 1997 long loop index i

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.


JDCNV [1] $SSW/gen/idl/fund_lib/astron/jdcnv.pro
[Previous] [Next]
 NAME:
	JDCNV
 PURPOSE:
	Converts Gregorian dates to Julian days   

 EXPLANATION:
       For IDL versions V5.1 or greater, this procedure is superceded by
       JULDAY() function in the standard IDL distribution.   Note, however,
       that prior to V5.1 there wasa bug in JULDAY() that gave answers off
       by 0.5 days. 
        
 CALLING SEQUENCE:
	JDCNV, YR, MN, DAY, HR, JULIAN

 INPUTS:
 	YR = Year, integer scalar or vector
	MN = Month  integer (1-12) scalar or vector
	DAY = Day   integer 1-31) scalar or vector 
	HR  = Hours and fractions of hours of universal time (U.T.), scalar
              or vector
		
 OUTPUTS:
	JULIAN = Julian date (double precision) 

 CALLED BY:
	CT2LST, Ex2Int [1], Ex2Int [2], UTIME [1], UTIME [2], UT_2_YYDOY [1], ut_2_yydoy [2]
 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
	Converted to IDL V5.0   W. Landsman   September 1997


JDCNV [2] $SSW/gen/idl_libs/astron/astro/jdcnv.pro
[Previous] [Next]
 NAME:
	JDCNV
 PURPOSE:
	Converts Gregorian dates to Julian days   

 EXPLANATION:
       For IDL versions V5.1 or greater, this procedure is superceded by
       JULDAY() function in the standard IDL distribution.   Note, however,
       that prior to V5.1 there wasa bug in JULDAY() that gave answers off
       by 0.5 days. 
        
 CALLING SEQUENCE:
	JDCNV, YR, MN, DAY, HR, JULIAN

 INPUTS:
 	YR = Year, integer scalar or vector
	MN = Month  integer (1-12) scalar or vector
	DAY = Day   integer 1-31) scalar or vector 
	HR  = Hours and fractions of hours of universal time (U.T.), scalar
              or vector
		
 OUTPUTS:
	JULIAN = Julian date (double precision) 

 CALLED BY:
	CT2LST, Ex2Int [1], Ex2Int [2], UTIME [1], UTIME [2], UT_2_YYDOY [1], ut_2_yydoy [2]
 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
	Converted to IDL V5.0   W. Landsman   September 1997


JOIN_STRUCT [1] $SSW/gen/idl/struct/join_struct.pro
[Previous] [Next]
 Project     : HESSI

 Name        : JOIN_STRUCT

 Purpose     : join two structures together

 Syntax      : new_struct=join_struct(struct1,struct2)

 Inputs      : STRUCT1, 2 = input structures to join (array or scalar)
               Tag values in STRUCT1 override those in STRUCT2

 Outputs     : NEW_STRUCT = new structure

 Keywords    : ERR = error string

 Category    : Structure handling

 Written     : 1-Dec-02, Zarro (EER/GSFC)
 Modified    : 24-Dec-04, Zarro (L-3Com/GSFC) - vectorized

 CALLS:
 CALLED BY
	ADD_PROP, FRAME ABSTRACT CLASS DEFINITION
	FRAMEWORK ABSTRACT CLASS DEFINITION, GET_CDS_ASRUN
	HESSI CLEAN ALGORITHM CLASS DEFINITION
	HESSI IMAGE STRATEGY CLASS DEFINITION, HSI_SPECTRUM__DEFINE, MAP__DEFINE
	MK_PLAN_CUSTOM, MK_SOHO_CUSTOM, RATIO_PLOTTER [1], SPECTRUM CLASS DEFINITION
	XYPLOT__DEFINE, fixinate_eit, hsi_image__getaxis [2], hsi_params_2_top_struct
	plotman, ratio_plotter [2], read_trace, ssw_findstuff_struct, sswfits_struct [1]
	sswfits_struct [2], struct2ssw, trace_bin_struct, trace_cat2cosmic, zcheck_hdr
	zwritefits


JOIN_STRUCT [2] $SSW/gen/idl/struct/join_struct2.pro
[Previous] [Next]
 Project     :	SDAC

 Name        :	JOIN_STRUCT

 Purpose     :	join two structures

 Explanation :	

 Use         : NEW_STRUCT=JOIN_STRUCT(S1,S2)

 Inputs      :	S1,S2 input structures

 Opt. Inputs :	None.

 Outputs     :	NEW_STRUCT = new structure

 Opt. Outputs:	None.

 Keywords    :	NAME = new name for structure
               DUPLICATE = keep duplicate tag names

 CALLED BY:
	ADD_PROP, FRAME ABSTRACT CLASS DEFINITION
	FRAMEWORK ABSTRACT CLASS DEFINITION, GET_CDS_ASRUN
	HESSI CLEAN ALGORITHM CLASS DEFINITION
	HESSI IMAGE STRATEGY CLASS DEFINITION, HSI_SPECTRUM__DEFINE, MAP__DEFINE
	MK_PLAN_CUSTOM, MK_SOHO_CUSTOM, RATIO_PLOTTER [1], SPECTRUM CLASS DEFINITION
	XYPLOT__DEFINE, fixinate_eit, hsi_image__getaxis [2], hsi_params_2_top_struct
	plotman, ratio_plotter [2], read_trace, ssw_findstuff_struct, sswfits_struct [1]
	sswfits_struct [2], struct2ssw, trace_bin_struct, trace_cat2cosmic, zcheck_hdr
	zwritefits
 Restrictions:	Input structures must have same dimension

 CALLS: ***
	APPEND_ARR, DATATYPE [1], DATATYPE [2], DATATYPE [3], DPRINT, EXEC_STRUCT
	IDL_RELEASE, JOIN_STRUCT2, MERGE_STRUCT, PAIR_STRUCT, PR_SYNTAX, TRIM, UNIQ [1]
	UNIQ [2], UNIQ [3]
 Side effects:	None.

 Category    :	Structure handling

 Prev. Hist. :	None.

 Written     :	Dominic Zarro (ARC), 7 November 1994
               Modified, 9 April 1997, Zarro (ARC), added DUPLICATE
               Modified, 19 Sept 1997, Zarro (SAC), removed CREATE_STRUCT
               Modified, 16 Oct 1998, Zarro (SAC), restored use of CREATE_STRUCT
               Modified, 19 Oct 1998, Zarro (SAC), fixed bug with input structure arrays
               Modified, 2 Nov 1999, Zarro (SM&A), allowed duplicate tag names
                for anonymous structures
               Modified, 22 March 00, Zarro (SM&A), reduced # of calls to
                DATATYPE
               10-Jan-03, Zarro (EER/GSFC)- added call to improved 
                JOIN_STRUCT for newer versions of IDL.


JPLEPHINTERP $SSW/gen/idl_libs/astron/astro/jplephinterp.pro
[Previous] [Next]
 NAME:
   JPLEPHINTERP

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Interpolate position and motion of planetary bodies (JPL Ephemeris)

 MAJOR TOPICS:
   Planetary Orbits, Interpolation

 CALLING SEQUENCE:
   JPLEPHINTERP, INFO, RAWDATA, T, X, Y, Z, [VX, VY, VZ, /EARTH, /SUN,
         OBJECTNAME=, CENTER=, TBASE=, POSUNITS=, VELUNITS= ]

 DESCRIPTION:

   JPLEPHINTERP interpolates the JPL DE200 or DE405 planetary
   ephemeris to find the positions and motions of planetary bodies.

   This routine is the second stage of a two-stage process to
   interpolate the JPL ephemeris.  In this first stage, the file is
   opened using JPLEPHREAD, and the relevant portions of the table
   are read and stored into the two variables INFO and RAWDATA.  In
   the second stage, the user actually interpolates the ephemeris for
   the desired bodies and to the desired ephemeris time using
   JPLEPHINTERP.

   The only independent variable which must be specified is T, the
   ephemeris time.  For low to moderate accuracy applications, T is
   simply the conventional calendar date, expressed in Julian days.
   See below for high precision applications.

   Upon output, the position components of the desired body are
   returned in parameters X, Y and Z, and if requested velocity
   components are returned in parameters VX, VY and VZ.  Coordinates
   are referred to the ephemeris's coordinate system: FK5 for
   JPL-DE200 and ICRS for JPL-DE405.  By default, the origin of
   coordinates is the solar system barycenter (SSB), unless another
   origin is selected using the CENTER keyword.

   Users must set the VELOCITY keyword to generate body velocities.
   By default they are not generated.

   Users can select the desired body by using either the EARTH or SUN
   keywords, or the OBJECTNAME keyword.

   By default, positions are returned in units of KM and velocities
   in units of KM/DAY.  However, the output units are selectable by
   setting the POSUNITS and VELUNITS keywords.

 High Precision Applications

   If the required precision is finer than a few hundred meters, the
   user must be aware that the formal definition of the ephemeris
   time is the coordinate time of a clock placed at the solar system
   barycenter (SSB).  If the user's time is measured by a clock
   positioned elsewhere, then various corrections must be applied.
   Usually, the most significant correction is that from the
   geocenter to the SSB (see Fairhead & Bretagnon 1990; Fukushima
   1995).  Not applying this correction creates an error with
   amplitude ~170 nano-light-seconds ( = 50 m) on the earth's
   position.  (see TDB2TDT)

   For high precision, the user should also specify the TBASE
   keyword.  TBASE should be considered a fixed epoch with respect to
   which T is measured; T should be small compared to TBASE.
   Internally, subtraction of large numbers occurs with TBASE first,
   so truncation error is minimized by specifying TBASE.

 Nutations and Librations

   This routine also provides information about earth nutations and
   lunar librations, which are stored in the JPL ephemeris tables.
   The POSUNITS and VELUNITS keywords do not affect these
   computations.

   Lunar librations in the form of three Euler angles are returned in
   X, Y, Z, in units of radians, and their time derivatives are
   returned in VX, VY, and VZ in units of radians per day.

   The earth nutation angles psi (nutation in longitude) and epsilon
   (nutation in obliquity) are returned in X and Y, in units of
   radians.  Their time derivatives are returned in VX and VY
   respectively.  The quantities returned in Z and VZ are undefined.

 Verification

   The precision routine has been verified using JPLEPHTEST, which is
   similar to the original JPL program EPHTEST.  For years 1950 to
   2050, JPLEPHINTERP reproduces the original JPL ephemeris to within
   1 centimeter.

 Custom Ephemerides

   It is possible to make custom ephemerides using JPLEPHMAKE, or to
   augmented an existing ephemeris with additional data.  In the
   former case JPLEPHINTERP should automatically choose the correct
   object from the table and interpolate it appropriately.

   For augmented ephemerides, the object can be specified by name,
   which works as expected, or by number, which has a special
   behavior.  For augmented files only, the new objects begin at
   number 100.


 PARAMETERS: 

   INFO - structure returned by JPLEPHREAD.  Users should not modify
          this structure.

   RAWDATA - raw data array returned by JPLEPHREAD.  Users should not
             modify this data array.

   T - ephemeris time(s) of interest.  May be a scalar or vector.
       The actual time is (T+TBASE).

   X, Y, Z - upon return, the x-, y- and z-components of the body
             position are returned in these parameters.  For
             nutations and librations see above.

   VX, VY, VZ - upon return, the x-, y- and z-components of the body
                velocity are returned in these parameters, if the
                VELOCITY keyword is set.  For nutations and
                librations see above.


 KEYWORD PARAMETERS:

   EARTH, SUN - set one of these keywords if the desired body is the
                earth or the sun.  One of EARTH, SUN or OBJECTNAME
                must be specified.

   OBJECTNAME - a scalar string or integer, specifies the planetary
                body of interest.  May take any one of the following
                integer or string values.

                   1 - 'MERCURY'     9 - 'PLUTO'
                   2 - 'VENUS'      10 - 'MOON'  (earth's moon)
                   3 - 'EARTH'      11 - 'SUN'
                   4 - 'MARS'       12 - 'SOLARBARY' (solar system barycenter)
                   5 - 'JUPITER'    13 - 'EARTHBARY' (earth-moon barycenter)
                   6 - 'SATURN'     14 - 'NUTATIONS' (see above)
                   7 - 'URANUS'     15 - 'LIBRATIONS' (see above)
                   8 - 'NEPTUNE' 

                For custom ephemerides, the user should specify the
                object name or number.

                For augmented ephemerides, the user should specify
                the name.  If the number is specified, then numbers
                1-15 have the above meanings, and new objects are
                numbered starting at 100.

   CENTER - a scalar string or integer, specifies the origin of
            coordinates.  See OBJECTNAME for allowed values.
            Default: 12 (Solar system barycenter)

   VELOCITY - if set, body velocities are generated and returned in
              VX, VY and VZ.
              Default: unset (no velocities)

   POSUNITS - a scalar string specifying the desired units for X, Y,
              and Z.  Allowed values:
                 'KM' - kilometers  (default)
                 'CM' - centimeters
                 'AU' - astronomical units
                 'LT-S' - light seconds

   VELUNITS - a scalar string specifying the desired units for VX, VY
              and VZ.  Allowed values:
                 'KM/DAY' - kilometers per day  (default)
                 'KM/S' - kilometers per second
                 'CM/S' - centimeters per second
                 'LT-S/S' - light seconds per second
                 'AU/DAY' - astronomical units per day

   TBASE - a scalar number, specifies a fixed epoch against wich T is
           measured.  The ephemeris time will be (T+TBASE).  Use this
           keyword for maximum precision.


 CALLS: ***
	JPLEPHINTERP_CALC, JPLEPHINTERP_DENEW, MINMAX [1], MINMAX [2], TDB2TDT
 CALLED BY:
	BARYVEL, JPLEPHTEST, PLANET_COORDS
 EXAMPLE:

   Find position of earth at ephemeris time 2451544.5 JD.  Units are
   in Astronomical Units.

   JPLEPHREAD, 'JPLEPH.200', pinfo, pdata, [2451544D, 2451545D]

   JPLEPHINTERP, pinfo, pdata, 2451544.5D, xearth, yearth, zearth, $
                 /EARTH, posunits='AU'
     

 REFERENCES:

   AXBARY, Arnold Rots.
      ftp://heasarc.gsfc.nasa.gov/xte/calib_data/clock/bary/

   HORIZONS, JPL Web-based ephermis calculator (Ephemeris DE406)
      http://ssd.jpl.nasa.gov/horizons.html
   
   Fairhead, L. & Bretagnon, P. 1990, A&A, 229, 240

   Fukushima, T. 1995, A&A, 294, 895

   Standish, E.M. 1982, "Orientation of the JPL Ephemerides,
      DE200/LE200, to the Dynamical Equinox of J2000", Astronomy &
      Astrophysics, vol. 114, pp. 297-302.

   Standish, E.M.: 1990, "The Observational Basis for JPL's DE200,
      the planetary ephemeris of the Astronomical Almanac", Astronomy
      & Astrophysics, vol. 233, pp. 252-271.    

 SEE ALSO
   JPLEPHREAD, JPLEPHINTERP, JPLEPHTEST, TDB2TDT, JPLEPHMAKE
   
 MODIFICATION HISTORY:
   Written and Documented, CM, Jun 2001
   Corrected bug in name conversion of NUTATIONS and LIBRATIONS, 18
     Oct 2001, CM
   Added code to handle custom-built ephemerides, 04 Mar 2002, CM
   Fix bug in evaluation of velocity (only appears in highest order
     polynomial term); JPLEPHTEST verification tests still pass;
     change is of order < 0.5 cm in position, 22 Nov 2004, CM

  $Id: jplephinterp.pro,v 1.14 2005/01/31 04:22:26 craigm Exp $


JPLEPHREAD $SSW/gen/idl_libs/astron/astro/jplephread.pro
[Previous] [Next]
 NAME:
   JPLEPHREAD

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Open and read JPL DE200 or DE405 Ephemeride FITS File

 MAJOR TOPICS:
   Planetary Orbits, Interpolation

 CALLING SEQUENCE:
   JPLEPHREAD, FILENAME, INFO, RAWDATA, JDLIMITS, STATUS=, ERRMSG=

 DESCRIPTION:

   JPLEPHREAD opens and reads the JPL DE200 or DE405 planetary
   ephemerides, as available in FITS format.  The user must have the
   IDL Astronomy Library installed to use this routine.

   This routine is the initialization stage of a two-stage process to
   interpolate the JPL ephemeris.  In this first stage, the file is
   opened, and the relevant portions of the table are read and stored
   into the two variables INFO and RAWDATA.  In the second stage, the
   user actually interpolates the ephemeris for the desired bodies
   and to the desired ephemeris time using JPLEPHINTERP.

   Users must decide ahead of time the approximate dates of interest,
   and pass this range in the JDLIMITS parameter.  Any date covered
   by the ephemeris is valid.

   JPLEPHREAD is able to read files of the following format:
     DE200 - Chebyshev - FITS format - Note 1
     DE405 - Chebyshev - FITS format - Note 1
     DE200 - Taylor    - FITS format - Note 2

   Note 1 - Chebyshev formatted FITS files are available in the
            AXBARY package by Arnold Rots, found here:
              ftp://heasarc.gsfc.nasa.gov/xte/calib_data/clock/bary/
            or at the Markwardt FTP site:
              ftp://cow.physics.wisc.edu/pub/craigm/bary/

   Note 2 - Taylor-series based ephemerides have been available for
            years in the FTOOLS / LHEASOFT package produced by NASA's
            Goddard Space Flight Center.  The original file is
            de200_new.fits, which covers the years 1959-2000,
            inclusive.  A newer file is named
            de200_1950-2050_v2.fits, and covers the years 1959-2050.
            See Markwardt FTP site for these files.

 PARAMETERS: 

   FILENAME - name of ephemeris file (scalar string).

   INFO - upon completion, information about the ephemeris data is
          returned in this parameter in the form of a structure.
          Users must not modify INFO, although several fields are
          useful and may be accessed read-only:
              TSTART/TSTOP (start and stop time of data in Julian
                            days);
              C (speed of light in km/s);
              DENUM (development ephemeris number [200 or 405])
              AU (1 astronomical unit, in units of light-seconds)

   RAWDATA - upon completion, raw ephemeris data is returned in this
             parameter.  Users are not meant to access this data
             directly, but rather to pass it to JPLEPHINTERP.

   JDLIMITS - a two-element vector (optional), describing the desired
              time range of interest.  The vector should have the
              form [TSTART, TSTOP], where TSTART and TSTOP are the
              beginning and ending times of the range, expressed in
              Julian days.
              Default: entire table is read (note, this can be
              several megabytes)


 KEYWORD PARAMETERS:

   STATUS - upon completion, a value of 1 indicates success, and 0
            indicates failure.

   ERRMSG - upon completion, an error message is returned in this
            keyword.  If there were no errors, then the returned
            value is the empty string, ''.


 CALLS: ***
	FXBCLOSE [1], FXBCLOSE [2], FXBDIMEN [1], FXBDIMEN [2], FXBOPEN [1], FXBOPEN [2]
	FXBOPEN [3], FXBREAD [1], FXBREAD [2], FXBREAD [3], FXPAR [1], FXPAR [2], GETTOK [1]
	GETTOK [2], GETTOK [3], GETTOK [4], JPLEPHPAR, JPLEPHVAL
 CALLED BY:
	BARYVEL, JPLEPHTEST, PLANET_COORDS
 EXAMPLE:

   Find position of earth at ephemeris time 2451544.5 JD.  Units are
   in Astronomical Units.

   JPLEPHREAD, 'JPLEPH.200', pinfo, pdata, [2451544D, 2451545D]

   JPLEPHINTERP, pinfo, pdata, 2451544.5D, xearth, yearth, zearth, $
                 /EARTH, posunits='AU'
     

 REFERENCES:

   AXBARY, Arnold Rots.
      ftp://heasarc.gsfc.nasa.gov/xte/calib_data/clock/bary/

   HORIZONS, JPL Web-based ephermis calculator (Ephemeris DE406)
      http://ssd.jpl.nasa.gov/horizons.html
   
   JPL Export Ephemeris FTP Site
      ftp://navigator.jpl.nasa.gov/pub/ephem/export/
      (ephemeris files are available here, however, they must be
      converted to FITS format using the "bin2eph" utility found in
      AXBARY)

   JPL Export Ephemeris CD-ROM - Ordering Information
      http://www.willbell.com/software/jpl.htm

   Standish, E.M. 1982, "Orientation of the JPL Ephemerides,
      DE200/LE200, to the Dynamical Equinox of J2000", Astronomy &
      Astrophysics, vol. 114, pp. 297-302.

   Standish, E.M.: 1990, "The Observational Basis for JPL's DE200,
      the planetary ephemeris of the Astronomical Almanac", Astronomy
      & Astrophysics, vol. 233, pp. 252-271.    

 SEE ALSO
   JPLEPHREAD, JPLEPHINTERP, JPLEPHTEST
 PROCEDURES USED:
     FXBCLOSE, FXBOPEN, FXPAR(), 
   
 MODIFICATION HISTORY:
   Written and Documented, CM, Jun 2001
   Use GETTOK() instead of STR_SEP()  W. Landsman  July 2002

  $Id: jplephread.pro,v 1.6 2001/07/01 03:32:02 craigm Exp $


JPLEPHTEST $SSW/gen/idl_libs/astron/astro/jplephtest.pro
[Previous] [Next]
 NAME:
   JPLEPHTEST

 AUTHOR:
   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
   craigm@lheamail.gsfc.nasa.gov
   UPDATED VERSIONs can be found on my WEB PAGE: 
      http://cow.physics.wisc.edu/~craigm/idl/idl.html

 PURPOSE:
   Test JPLEPHTEST with JPL test data set

 MAJOR TOPICS:
   Planetary Orbits, Interpolation

 CALLING SEQUENCE:
   JPLEPHTEST, EPHFILE, TESTFILE

 DESCRIPTION:

   JPLEPHTEST tests the JPLEPHINTERP procedure for precision.  In
   order to function, you must have a JPL ephemeris test data set.
   The test data set testpo.405 is available in 
   ftp://idlastro.gsfc.nasa.gov/pub/data

   The procedure opens and reads the test set, which contains
   precomputed data.  Every tenth value is printed on the screen.
   Any deviations that exceed 1.5d-13 AU = 1.5 cm are reported.

   The columns are labelled according to the input file, except for
   the final column, which is the deviation between the input file
   and the computed value.


 PARAMETERS: 

   EPHFILE - a scalar string, specifies the name of the ephemeris
             file, in FITS format.    JPLEPHTEST will look in the directory
             $ASTRO_DATA for the file if it is not in the current directory.

   TESTFILE - a scalar string, specifies JPL test data set to compare
              against.   JPLEPHTEST will look in the directory
             $ASTRO_DATA for the file if it is not in the current directory.


 CALLS: ***
	FIND_WITH_DEF [1], FIND_WITH_DEF [2], FIND_WITH_DEF [3], JPLEPHINTERP
	JPLEPHREAD, MINMAX [1], MINMAX [2]
 EXAMPLE:

   Test JPL DE200 and DE405 ephemerides.  Assumes files are in the
   current directory.

   JPLEPHTEST, 'JPLEPH.200', 'testpo.200'
   JPLEPHTEST, 'JPLEPH.405', 'testpo.405'
     

 REFERENCES:

   JPL Export Ephemeris FTP Site
      ftp://navigator.jpl.nasa.gov/pub/ephem/export/
      (see test-data/ for test data sets)
   
   HORIZONS, JPL Web-based ephermis calculator (Ephemeris DE406)
      http://ssd.jpl.nasa.gov/horizons.html


 SEE ALSO
   JPLEPHREAD, JPLEPHINTERP, JPLEPHTEST
   
 MODIFICATION HISTORY:
   Written and Documented, CM, Jun 2001
   Removed TRANSREAD, improved output, improved docs, CM, 9 Jul 2001

  $Id: jplephtest.pro,v 1.4 2001/07/20 13:29:53 craigm Exp $


JPRECESS $SSW/gen/idl_libs/astron/astro/jprecess.pro
[Previous] [Next]
 NAME:
      JPRECESS
 PURPOSE:
      Precess astronomical coordinates from B1950 to J2000
 EXPLANATION:
      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.

      Use BPRECESS for the reverse direction J2000 ==> B1950
 CALLING SEQUENCE:
      jprecess, ra, dec, ra_2000, dec_2000, [ MU_RADEC = , PARALLAX = 
               RAD_VEL =, EPOCH =   ]

 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.

       EPOCH - scalar giving epoch of original observations, default 1950.0d
           This keyword value is only used if the MU_RADEC keyword is not set.
  NOTES:
       The algorithm is taken from the Explanatory Supplement to the 
       Astronomical Almanac 1992, page 184.
       Also see Aoki et al (1983), A&A, 128,263

       JPRECESS distinguishes between the following two cases:
       (1) The proper motion is known and non-zero
       (2) the proper motion is unknown or known to be exactly zero (i.e.
               extragalactic radio sources).   In this case, the algorithm
               in Appendix 2 of Aoki et al. (1983) is used to ensure that
               the output proper motion is  exactly zero.    Better precision
               can be achieved in this case by inputting the EPOCH of the
               original observations.

       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.

 CALLED BY:
	DBCIRCLE [1], DBCIRCLE [2], GLACTC
 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
       Implement Appendix 2 of Aoki et al. (1983) for case where proper
       motion unknown or exactly zero     W. Landsman    November, 1994
       Converted to IDL V5.0   W. Landsman   September 1997
       Fixed typo in updating proper motion   W. Landsman   April 1999
       Make sure proper motion is floating point  W. Landsman December 2000


JSMOVIE $SSW/gen/idl/http/jsmovie.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : JSMOVIE

 Purpose     : Make a Javascript movie HTML file for a series of GIF/JPEG images


 Category    : Imaging

 Explanation : Program reads a template HTML file
               and replaces key parameters with user specified values

 Syntax      : IDL> jsmovie,file,images

 Inputs      : FILE = filename to which Javascript code will be written
                      [def=jsmovie_new.html]
               IMAGES = array of image filenames (e.g. ['frame0.gif','frame1.gif..])
                  or single filename with individual image filenames
 Opt. Inputs : None

 Outputs     : None other than Javascript HTML file

 Opt. Outputs: None

 Keywords    : DELAY = millisecond delay between frames [def=250]
               INCREMENT  = % increment for speed control [def= 10]
               URL = optional URL path to images [def = relative to current dir]
               SIZE = optional pixel size of images as 2-d vector [nx,ny]
               TITLE = optional HTML title
               BORDER, CELL = optional border width & cellpadding for image
                              frame (def = 10 & 8 pixels)
               TEMPLATE = template file name [def= "jsmovie_temp.html"]
               CONTEXT = name of IMAGE to use for context window
                (URL of context IMAGE must be same as that of movie IMAGE files)
               CTITLE = optional title for context window
               PERCENT = % to resize image
               RANGE (switch) - if set, include subrange selection hooks
               STATUS = Returns 0/1 for failure/success

 CALLS: ***
	APPEND_ARR, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1]
	CONCAT_DIR [2], CONCAT_DIR [3], DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST
	FIND_WITH_DEF [1], FIND_WITH_DEF [2], FIND_WITH_DEF [3], GREP, LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], NINT [1], NINT [2], NUM2STR, RD_ASCII [1], RD_ASCII [2]
	TEST_DIR, TRIM, VALID_GIF, VALID_JPEG, VALID_PNG, break_file [4], concat_dir [4]
	file_append [1], file_append [2], get_logenv [1], get_logenv [2]
 CALLED BY:
	HESSI IMAGE STRATEGY CLASS DEFINITION, WR_MOVIE, hsi_image__getaxis [2]
	image2movie
 Common      : None

 Restrictions: None

 Side effects: None

 History     : Version 1,  4-July-1997,  D.M. Zarro (NASA/GSFC) - Written
               Version 2,  4-July-1998,  D.M. Zarro.
                 - Added option for file list input
               Version 3,  2-October-1998,  D.M. Zarro.
                 - Added auto determining of IMAGE file size
               Version 4,  9-October-1998,  D.M. Zarro.
                 - Added context image option
               Version 5,  14-October-1998,  D.M. Zarro.
                 - Modularized
               Version 6,  29-Jan-1999, Zarro (SM&A)
                 - removed stringent check that all IMAGEs be present
                 - removed unnecessary common block
                 - added JPEG support
               Version 7, 20-May-1999, S.L.Freeland, LMSAL
                          Added /RANGE keyword and function
		Version 8, 04-Apr-2002, William Thompson, GSFC
			Changed "<img...>" for Netscape 6.2 compatibility
       18-Feb-2005, Kim Tolbert.  Added status keyword
       15-Apr-2005, N.Rich - Added PNG support

 Contact     : DZARRO@SOLAR.STANFORD.EDU


JSMOVIE2 $SSW/gen/idl/http/jsmovie2.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : JSMOVIE2

 Purpose     : Make a Javascript movie HTML file for a series of GIF/JPEG images
              

 Category    : Imaging

 Explanation : Program reads a template HTML file 
               and replaces key parameters with user specified values

 Syntax      : IDL> jsmovie,file,images

 Inputs      : FILE = filename to which Javascript code will be written
                      [def=jsmovie_new.html]
               IMAGES = array of image filenames (e.g. ['frame0.gif','frame1.gif..])
                  or single filename with individual image filenames
 Opt. Inputs : None

 Outputs     : None other than Javascript HTML file

 Opt. Outputs: None

 Keywords    : DELAY = millisecond delay between frames [def=250]
               INCREMENT  = % increment for speed control [def= 10]
               URL = optional URL path to images [def = relative to current dir]
               SIZE = optional pixel size of images as 2-d vector [nx,ny]
               TITLE = optional HTML title
               BORDER, CELL = optional border width & cellpadding for image
                              frame (def = 10 & 8 pixels)
               TEMPLATE = template file name [def= "jsmovie_temp.html"]
               CONTEXT = name of IMAGE to use for context window
                (URL of context IMAGE must be same as that of movie IMAGE files)
               CTITLE = optional title for context window
               PERCENT = % to resize image
               VERBOSE = print some progress messages
               OUTPUT  = direct HTML to STDOUT instead of file
               TIMES   = string array of times for input images
               NO_RANGE   = set to inhibit RANGE display
               FRANGE  = frame range to include [start,end]
               REFRESH = seconds after which to refresh page automatically


 CALLS: ***
	APPEND_ARR, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1]
	CONCAT_DIR [2], CONCAT_DIR [3], DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST
	FIND_WITH_DEF [1], FIND_WITH_DEF [2], FIND_WITH_DEF [3], GREP, LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], NINT [1], NINT [2], NUM2STR, RD_ASCII [1], RD_ASCII [2]
	RSTRPOS, TEST_DIR, TRIM, VALID_GIF, VALID_JPEG, break_file [4], concat_dir [4]
	file_append [1], file_append [2], is_number [1], is_number [2]
 History     : Version 1,  4-July-1997,  D.M. Zarro (NASA/GSFC) - Written
               Version 2,  4-July-1998,  D.M. Zarro.  
                 - Added option for file list input
               Version 3,  2-October-1998,  D.M. Zarro.  
                 - Added auto determining of IMAGE file size
               Version 4,  9-October-1998,  D.M. Zarro.  
                 - Added context image option
               Version 5,  14-October-1998,  D.M. Zarro.  
                 - Modularized
               Version 6,  29-Jan-1999, Zarro (SM&A) 
                 - removed stringent check that all IMAGEs be present
                 - removed unnecessary common block
                 - added JPEG support
               Version 6.5, 16-April-1999, Zarro (SM&A/GSFC)
                 - added OUTPUT, VERBOSE, & TIMES keywords
                Version 7, 20-May-1999, S.L.Freeland, LMSAL
                 -  Added /RANGE keyword and function
               Version 8, 20-Feb-2000, Zarro (SM&A/GSFC)
                 - added FRANGE, REFRESH, NO_RANGE, and merged previous changes 
		Version 9, 04-Apr-2002, William Thompson, GSFC
			Changed "<img...>" for Netscape 6.2 compatibility

 Contact     : DZARRO@SOLAR.STANFORD.EDU


JULDATE $SSW/gen/idl_libs/astron/astro/juldate.pro
[Previous] [Next]
 NAME:
     JULDATE
 PURPOSE:                                   
     Convert from calendar to Reduced Julian Date

 EXPLANATION:
     Julian Day Number is a count of days elapsed since Greenwich mean noon 
     on 1 January 4713 B.C.  The Julian Date is the Julian day number
     followed by the fraction of the day elapsed since the preceding noon. 

     This procedure duplicates the functionality of the JULDAY() function in
     in the standard IDL distribution, but also allows interactive input and
     gives output as Reduced Julian date (=JD - 2400000.)  
     (Also note that prior to V5.1 there was a bug in JULDAY() that gave 
     answers offset by 0.5 days.)

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

 INPUT:
     DATE -  3 to 6-element vector containing year,month (1-12),day, and 
              optionally hour, minute, and second all specified as numbers
              (Universal Time).   Year should be supplied with all digits.
              Years B.C should be entered as negative numbers (and note that
              Year 0 did not exist).  If Hour, minute or seconds 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 calendar date at the terminal.

 CALLS: ***
	GETOPT
 CALLED BY:
	PLANET_COORDS
  RESTRICTIONS:
       The procedure HELIO_JD can be used after JULDATE, if a heliocentric
       Julian date is required.

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

       IDL> juldate, [2006, 12, 25, 6, 25], jd       
       IDL> juldate, [2006, 12, 25.2673611d], jd 

       In either case, one should obtain a Reduced Julian date of 
       JD = 54094.7673611

  PROCEDURE USED:
       GETOPT()
  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
       Converted to IDL V5.0   W. Landsman   September 1997
       Make negative years correspond to B.C. (no year 0), work for year 1582
       Disallow 2 digit years.    W. Landsman    March 2000


JUMPER $SSW/gen/idl/util/jumper.pro
[Previous] [Next]
 Project     : SDAC
                   
 Name        : JUMPER
               
 Purpose     : This procedure corrects 2-byte or other counter overflow.
               
 Category    : GEN, MATH, NUMERICAL, TELEMETRY
               
 Explanation : 
  This procedure looks for overflow in 2-byte or other counter data and then adjusts
  it to the true rate.  The algorithm looks for abrupt changes in the rate, 
  OVERFLOW, of more than 65536/2.  It is assumed that these jumps are produced 
  by overflow.  After finding these jumps it is simply bookkeeping to reset the 
  data to the true rate.
               
 Use         : 
	jumper, overflow, reset [, summed_rolls=nn, single=single, max_value=max_value]
 CALLED BY:
	FDBREAD, FS_ACC, GRS_CLEAN_PHA, GRS_LIGHTCURVE, READ_DISCLA, RESET [1]
	RESTORE_OVERFLOW
 Example     :
	jumper, temp, reset
   
 Inputs      : 
	Overflow - Input 2byte counter values as longwords or float
               
 Opt. Inputs : None
               
 Outputs     : 
	Reset - Counter value corrected for rollover, same type as Overflow

 Opt. Outputs: None
               
 Keywords    : 
	Inputs:
	MAX_VALUE - maximum unsigned value in counter before rollover, for
	integer data it is 65535L (default).  For byte data set max_value
	to 256, and use an integer to save memory.
 	Outputs:
	SUMMED_ROLLS - signed values of successive rollovers. 
		Should total zero for successful correction.
	SINGLE - If set, then a single unmatched overflow can be corrected

 Calls	      : ***
	CHECKVAR [1], checkvar [2]
 Common      : None
               
 Restrictions: 
               
 Side effects: 
               
 Prev. Hist  :
	written for BATSE data 1991, based on an original Hugh Hudson idea!!!
 Modified    : 
	Version 1 ras, 5 March 1996
	Version 2, ras, 21-mar-1997, eliminate a temporary variable, jump.
		added SINGLE keyword, and max_value
	Version 3, richard.schwartz@gsfc.nasa.gov, 7-sep-1997, more documentation


Jumper2 $SSW/gen/idl/util/jumper2.pro
[Previous] [Next]
 Project     : SDAC
                   
 Name        : Jumper2
               
 Purpose     : This procedure corrects 2-byte or other counter overflow.
               
 Category    : GEN, MATH, NUMERICAL, TELEMETRY
               
 Explanation : 
  This procedure looks for counter overflow in the counter data and then adjusts
  it to the true rate.  The algorithm looks for abrupt changes in the 2nd 
  difference in the rate,
  OVERFLOW, of more than 65536/2.  It is assumed that these jumps are produced 
  by overflow.  After finding these jumps it is simply bookkeeping to reset the 
  data to the true rate.;               
 Use         : 
	 jumper2, overflow, reset , summed_rolls=nn   
 CALLED BY:
	RESET [1], RESTORE_OVERFLOW
 Examples    :
        jumper2, reform(clean-data(last_chan,last_id,wnz)), clean, summed=summed
                              
 Inputs      : 
	Overflow - Input 2byte counter values as longwords or float
               
 Opt. Inputs : None
               
 Outputs     : 
	Reset - Counter value corrected for rollover, same type as Overflow

 Opt. Outputs: None
               
 Keywords    : 
	SUMMED_ROLLS - signed values of successive rollovers. 
		Should total zero for successful correction.

 Calls	      :
 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :
	written for BATSE data 1991
 Modified    : 
	Version 1 ras, 5 March 1996
       Version 2, richard.schwartz@gsfc.nasa.gov, 7-sep-1997, more documentation


JUSTIFY $SSW/gen/idl/string/justify.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS

 NAME:
       JUSTIFY()

 PURPOSE:
       Make string array right/left/center justified

 EXPLANATION:
       This routine adds necessary space in front of each element of a string
       array to make the string array right/left/center justified.

 CALLING SEQUENCE:
       Result = justify(strings)

 INPUTS:
       STRINGS - A string array

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS:
       JUST_CODE  - String scalar, code of justification: 
            '<':  left justification  (this is default)
            '>':  right justification
            '|':  center justified
            '||': full justification (not implemented)

       MAX_LENGTH - Maximum length of resultant string. If present, the
                    actual maximum length of RESULT will be either
                    MAX_LENGTH or maximum length in STRINGS, whichever is
                    larger. 
 CALLS: ***
	BLANK, DATATYPE [1], DATATYPE [2], DATATYPE [3]
 CALLED BY:
	EIS_ITOOL_PTOOL [1], EIS_ITOOL_PTOOL [2], ITOOL_PTOOL, MK_POINT_BASE, POPUP_MSG
	STR2LINES, XANSWER
 COMMON BLOCKS:
       None.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:

 PREVIOUS HISTORY:
       Written April 10, 1995, Liyun Wang, GSFC/ARC

 MODIFICATION HISTORY:
       Version 1, created, Liyun Wang, GSFC/ARC, April 10, 1995
       Version 2, January 26, 1996, Liyun Wang, GSFC/ARC
          Removed keywords LEFT, CENTER, RIGHT; added keyword JUST_CODE

 VERSION:
       Version 2, January 26, 1996