/*  
 *  - - - - - - - - - - 
 *   g a l _ t l e . h  
 *  - - - - - - - - - - 
 *  
 *  This routine is part of the General Astrodynamics Library  
 *
 *  Description:
 *
 *     This header file defines the two-line element set structure
 *  
 *  Status: 
 *  
 *     Header file  
 *  
 *  Notes:
 *
 *  1) Standard Two-Line Elements (TLE) Format
 *     
 *     1 25107U 97082D   98151.26839894 -.00007632  00000-0 -27359-2 0  1321
 *     2 25107  86.3970 282.3520 0003565  65.4476 294.7132 14.34205441 23251
 *     
 *     Breakdown of a Two Line Element Set
 *     
 *     !>Line Number 1
 *     !   !>Catalog Number (NORAD)
 *     !   !  !>Security Classification for this Element Set
 *     !   !  !    !>International Identification for this Object (COSPAR)
 *     !   !  !    !     !>Two Digit Year
 *     !   !  !    !     !  !>Day of Year
 *     !   !  !    !     !  !     !>Fraction of 24 Hour Day
 *     !   !  !    !     !  !     !     !>Sign of 1st Time Derivative
 *     !   !  !    !     !  !     !     !    !>1st Time Derivative
 *     !   !  !    !     !  !     !     !    !     !>Sign of 2nd Time Derivative
 *     !   !  !    !     !  !     !     !    !     !  !>2nd Time Derivative
 *     !   !  !    !     !  !     !     !    !     !  !  !>Sign of exponent
 *     !   !  !    !     !  !     !     !    !     !  !   !>Exponent 2ndTimeDerivative
 *     !   !  !    !     !  !     !     !    !     !  !     !>Sign of BSTAR drag term
 *     !   !  !    !     !  !     !     !    !     !  !     !  !>BSTAR/Drag Term
 *     !   !  !    !     !  !     !     !    !     !  !     !  !  !>Sign of Exponent
 *     !   !  !    !     !  !     !     !    !     !  !     !  !  !!>Exponent BstarDrg
 *     !   !  !    !     !  !     !     !    !     !  !     !  !  !! !>Ephemeris Type
 *     !   !  !    !     ! ---    !     !    !     !  !     !  !  !! ! !>Element No.
 *     ! -----! -------- --|||--------- !--------- !-----   !-----!! ! ----!>Checksum
 *     1 25107U 97082D   98151.26839894 -.00007632  00000-0 -27359-2 0  1321 = Line 1
 *     2 25107 086.3970 282.3520 0003565 065.4476 294.7132 14.34205441 23251 = Line 2
 *     123456789012345678901234567890123456789012345678901234567890123456789 = columns
 *     ! ----- ---.---- ---.---- ------- ---.---- ---.---- --.--------|||||!>Checksum
 *     !   !   Incl     RAAN     Ecc     AoP      MA       RpD        -----
 *     !   !   !        !        !       !        !        !          !>Rev # @ Epoch
 *     !   !   !        !        !       !        !        !>MeanMotion(Revolutions/Day)
 *     !   !   !        !        !       !        !>Mean Anomaly
 *     !   !   !        !        !       !>Argument of Perigee
 *     !   !   !        !        !>Eccentricity, with assumed decimal point leading
 *     !   !   !        !>Right Ascension of Ascending Node
 *     !   !   !>Inclination
 *     !   !>Catalog Number (NORAD)
 *     !>Line Number 2
 *     
 *     Line 1
 *     
 *        Column Numbers     Number of
 *        First     Last     Characters     Description
 *        -----     ----     ----------     -----------
 *          1        1           1          Line No. Identification
 *          3        7           5          Catalog No.
 *          8        8           1          Security Classification
 *         10       17           8          International Designator (COSPAR/WDC-A-R&S)
 *         19       32          14          YRDOY.FODddddd
 *         34       34           1          Sign of first time derivative
 *         35       43           9          1st Time Derative
 *         45       45           1          Sign of 2nd Time Derivative
 *         46       50           5          2nd Time Derivative
 *         51       51           1          Sign of 2nd Time Derivative Exponent
 *         52       52           1          Exponent of 2nd Time Derivative
 *         54       54           1          Sign of Bstar/Drag Term
 *         55       59           5          Bstar/Drag Term
 *         60       60           1          Sign of Exponent of Bstar/Drag Term
 *         61       61           1          Exponent of Bstar/Drag Term
 *         63       63           1          Ephemeris Type
 *         65       68           4          Element Number
 *         69       69           1          Check Sum, Modulo 10
 *     
 *     Line 2
 *     
 *        Column Numbers     Number of
 *        First     Last     Characters     Description
 *        -----     ----     ----------     -----------
 *          1        1           1          Line No. Identification
 *          3        7           5          Catalog No.
 *          9       16           8          Inclination
 *         18       25           8          Right Ascension of Ascending Node
 *         27       33           7          Eccentricity with assumed leading decimal
 *         35       42           8          Argument of the Perigee
 *         44       51           8          Mean Anomaly
 *         53       63          11          Revolutions per Day (Mean Motion)
 *         64       68           5          Revolution Number at Epoch
 *         69       69           1          Check Sum Modulo 10
 *     
 *  References:
 *  
 *     Revisting Spacetrack Report #3
 *     Vallado, David, Crawford, Paul, Hujsak, Richard, Kelso, T.S.
 *     AIAA 2006-6753
 *  
 *  This revision:  
 * 
 *     2008 March 30 
 *  
 *  Copyright (C) 2008 Paul C. L. Willmott. See notes at end. 
 *  
 *-----------------------------------------------------------------------  
 */  

#ifndef _GAL_TLE_H_  
#define _GAL_TLE_H_ 1  
  
#undef  __BEGIN_DECLS  
#undef  __END_DECLS  
#ifdef  __cplusplus  
#define __BEGIN_DECLS extern "C" {  
#define __END_DECLS }  
#else  
#define __BEGIN_DECLS /* empty */  
#define __END_DECLS   /* empty */  
#endif
  
__BEGIN_DECLS  
  
typedef struct {
  int    satnum         ;  /* NORAD Catalog Number                        */
  char   classification ;  /* Security Classification                     */
  char   intldesg[10]   ;  /* International Designator (COSPAR/WDC-A-R&S) */
  int    epochyr        ;  /* Epoch Year                                  */
  double epochdays      ;  /* Epoch Day of Year (plus Fraction)           */
  double ndot           ;  /* Mean motion derivative (rev/day /2)         */
  double nddot          ;  /* Mean motion second derivative (rev/day2 /6) */
  double bstar          ;  /* Bstar / Drag Term                           */
  int    ephtype        ;  /* Ephermeris Type                             */
  int    setnum         ;  /* Element set number                          */
  double inclo          ;  /* Inclination                                 */
  double nodeo          ;  /* Right Ascension of Ascending Node (deg)     */
  double ecco           ;  /* Eccentricity                                */
  double argpo          ;  /* Argument of Perigee (deg)                   */
  double mo             ;  /* Mean Anamaly (deg)                          */
  double no             ;  /* Mean Motion (rev/day)                       */
  int    revnum         ;  /* Epoch Revolution Number                     */
} gal_tle_t ;
 
__END_DECLS  
  
#endif /* !_GAL_TLE_H_ */ 

/*
 *  gal - General Astrodynamics Library  
 *  Copyright (C) 2008 Paul C. L. Willmott  
 *  
 *  This program is free software; you can redistribute it and/or modify  
 *  it under the terms of the GNU General Public License as published by  
 *  the Free Software Foundation; either version 2 of the License, or  
 *  (at your option) any later version.  
 *  
 *  This program is distributed in the hope that it will be useful,  
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of  
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
 *  GNU General Public License for more details.  
 *  
 *  You should have received a copy of the GNU General Public License along  
 *  with this program; if not, write to the Free Software Foundation, Inc.,  
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.  
 *    
 *  Contact:  
 *    
 *  Paul Willmott  
 *  vp9mu@amsat.org  
 */  
  