OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
orbit.h File Reference
#include <stdint.h>
#include <math.h>
#include <time.h>
#include <stdio.h>
#include "earth.h"
#include "lunsol.h"
Include dependency graph for orbit.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ATTITUDE
 
struct  BROUWER
 
struct  GEODETIC
 
struct  KEPLER
 
struct  NUTATION
 
struct  PRECESSION
 
struct  RADEC
 
struct  SGP4
 
struct  TLE_VALUES
 
struct  TOPOCENTRIC
 

Macros

#define DPI   3.14159265358979323846
 
#define D2PI   6.28318530717958647692
 
#define D3PI   9.42477796076937971538
 
#define FP_ERRVAL   -1.0e-20 /* Error value from f.p. routines */
 
#define DTOR(X)   ((X) * DPI/180.0)
 
#define RTOD(X)   ((X) * 180.0/DPI)
 
#define AN2PI(X)   fmod(fmod((X), D2PI) + D2PI, D2PI)
 
#define ANPI(X)   (fmod(fmod((X), D2PI) + D3PI, D2PI) - DPI)
 
#define AN360(X)   fmod(fmod((X), 360.0) + 360.0, 360.0)
 
#define ASTOR(X)   ((X) * DPI/(180.0 * 3600.0))
 
#define ASPCTORPD(X)   ((X) * DPI/(180.0 * 3600.0 * 36525.0))
 
#define J2000   (51545.0)
 

Functions

int blinit (struct BROUWER *bp, char **errstr)
 
int blosc (struct BROUWER *bp, double delt, struct KEPLER *kp, char **errstr)
 
void ctogd (double r[3], double gha, struct GEODETIC *geod, double dgeod[3][3])
 
int ctok (double r[6], struct KEPLER *keplr, char **errmsg)
 
void ctotc (double r[3], struct GEODETIC *obs, double gha, struct TOPOCENTRIC *top, double daer[3][3])
 
double eanom (double manom, double ecc, char **errstr)
 
int efitoeci (double r[6], double gha, double rp[6])
 
int efrtoeci (double r[6], double gha, double rp[6])
 
int ecitoefi (double r[6], double gha, double rp[6])
 
int ecitoefr (double r[6], double gha, double rp[6])
 
double gmha (double tjd)
 
double gmhadot (double tjd)
 
void caldat (int32_t julian, int *year, int *month, int *day)
 
double itojul (int32_t date, int32_t time)
 
int32_t julday (int year, int month, int day)
 
void jultoi (double tjd, int32_t *date, int32_t *time)
 
void jultotm (double tjd, struct tm *time)
 
double tmtojul (struct tm *time)
 
int ktoc (struct KEPLER *kp, double r[6], char **errstr)
 
int ktosgp4 (struct KEPLER *kepler, struct SGP4 *sgp4, char **errmsg)
 
int locate (double r[6], struct ATTITUDE *sat, struct ATTITUDE *scanner, double loc[3])
 
void moonpos (double tjd, double r[3])
 
void nut_angles (double tjd, struct NUTATION *angles, struct NUTATION *rates)
 
void nut_matrix (double tjd, double a[3][3])
 
void obliq (double tjd, double *mood, double *dmood)
 
void pre_angles (double tjd0, double tjd1, struct PRECESSION *angles)
 
void pre_reduce (double tjd0, struct RADEC *rad0, double tjd1, struct RADEC *rad1)
 
void rdtotc (struct RADEC *rad, struct GEODETIC *obs, double gmha, struct TOPOCENTRIC *top)
 
double refract (double alt, double temp, double pressure)
 
double unrefract (double alt, double temp, double pressure)
 
int sgp4_init (struct SGP4 *sgp4, char **errstr)
 
int sgp4_pred (struct SGP4 *sgp4, double tsince, double rect[6], char **errstr)
 
double sgp4_orbit (struct SGP4 *sgp4, struct TLE_VALUES *tv, double tsince)
 
int sgp4_tle (double *epoch, struct SGP4 *sgp4, char *line1, char *line2, char **errstr)
 
int sunpos (double tjd, double r[3], char **errstr)
 
double tconv (double tjd, char conv[], char **errstr)
 
int tcset (double x, char what[], char **errstr)
 
int tle_parse (char *line1, char *line2, struct TLE_VALUES *tv, char **errstr)
 

Macro Definition Documentation

◆ AN2PI

#define AN2PI (   X)    fmod(fmod((X), D2PI) + D2PI, D2PI)

Definition at line 57 of file orbit.h.

◆ AN360

#define AN360 (   X)    fmod(fmod((X), 360.0) + 360.0, 360.0)

Definition at line 63 of file orbit.h.

◆ ANPI

#define ANPI (   X)    (fmod(fmod((X), D2PI) + D3PI, D2PI) - DPI)

Definition at line 60 of file orbit.h.

◆ ASPCTORPD

#define ASPCTORPD (   X)    ((X) * DPI/(180.0 * 3600.0 * 36525.0))

Definition at line 69 of file orbit.h.

◆ ASTOR

#define ASTOR (   X)    ((X) * DPI/(180.0 * 3600.0))

Definition at line 66 of file orbit.h.

◆ D2PI

#define D2PI   6.28318530717958647692

Definition at line 45 of file orbit.h.

◆ D3PI

#define D3PI   9.42477796076937971538

Definition at line 46 of file orbit.h.

◆ DPI

#define DPI   3.14159265358979323846

Definition at line 44 of file orbit.h.

◆ DTOR

#define DTOR (   X)    ((X) * DPI/180.0)

Definition at line 51 of file orbit.h.

◆ FP_ERRVAL

#define FP_ERRVAL   -1.0e-20 /* Error value from f.p. routines */

Definition at line 48 of file orbit.h.

◆ J2000

#define J2000   (51545.0)

Definition at line 72 of file orbit.h.

◆ RTOD

#define RTOD (   X)    ((X) * 180.0/DPI)

Definition at line 54 of file orbit.h.

Function Documentation

◆ blinit()

int blinit ( struct BROUWER bp,
char **  errstr 
)

◆ blosc()

int blosc ( struct BROUWER bp,
double  delt,
struct KEPLER kp,
char **  errstr 
)

◆ caldat()

void caldat ( int32_t  julian,
int *  year,
int *  month,
int *  day 
)

Definition at line 75 of file julian.c.

◆ ctogd()

void ctogd ( double  r[3],
double  gha,
struct GEODETIC geod,
double  dgeod[3][3] 
)

◆ ctok()

int ctok ( double  r[6],
struct KEPLER keplr,
char **  errmsg 
)

◆ ctotc()

void ctotc ( double  r[3],
struct GEODETIC obs,
double  gha,
struct TOPOCENTRIC top,
double  daer[3][3] 
)

◆ eanom()

double eanom ( double  manom,
double  ecc,
char **  errstr 
)

Definition at line 53 of file eanom.c.

◆ ecitoefi()

int ecitoefi ( double  r[6],
double  gha,
double  rp[6] 
)

◆ ecitoefr()

int ecitoefr ( double  r[6],
double  gha,
double  rp[6] 
)

◆ efitoeci()

int efitoeci ( double  r[6],
double  gha,
double  rp[6] 
)

◆ efrtoeci()

int efrtoeci ( double  r[6],
double  gha,
double  rp[6] 
)

◆ gmha()

double gmha ( double  tjd)

Definition at line 61 of file gmha.c.

◆ gmhadot()

double gmhadot ( double  tjd)

Definition at line 78 of file gmha.c.

◆ itojul()

double itojul ( int32_t  date,
int32_t  time 
)

Definition at line 100 of file time-utils.c.

◆ julday()

int32_t julday ( int  year,
int  month,
int  day 
)

Definition at line 37 of file julian.c.

◆ jultoi()

void jultoi ( double  tjd,
int32_t *  date,
int32_t *  time 
)

Definition at line 134 of file time-utils.c.

◆ jultotm()

void jultotm ( double  tjd,
struct tm time 
)

Definition at line 62 of file time-utils.c.

◆ ktoc()

int ktoc ( struct KEPLER kp,
double  r[6],
char **  errstr 
)

◆ ktosgp4()

int ktosgp4 ( struct KEPLER kepler,
struct SGP4 sgp4,
char **  errmsg 
)

◆ locate()

int locate ( double  r[6],
struct ATTITUDE sat,
struct ATTITUDE scanner,
double  loc[3] 
)

◆ moonpos()

void moonpos ( double  tjd,
double  r[3] 
)

◆ nut_angles()

void nut_angles ( double  tjd,
struct NUTATION angles,
struct NUTATION rates 
)

◆ nut_matrix()

void nut_matrix ( double  tjd,
double  a[3][3] 
)

◆ obliq()

void obliq ( double  tjd,
double *  mood,
double *  dmood 
)

Definition at line 35 of file obliq.c.

◆ pre_angles()

void pre_angles ( double  tjd0,
double  tjd1,
struct PRECESSION angles 
)

◆ pre_reduce()

void pre_reduce ( double  tjd0,
struct RADEC rad0,
double  tjd1,
struct RADEC rad1 
)

◆ rdtotc()

void rdtotc ( struct RADEC rad,
struct GEODETIC obs,
double  gmha,
struct TOPOCENTRIC top 
)

◆ refract()

double refract ( double  alt,
double  temp,
double  pressure 
)

◆ sgp4_init()

int sgp4_init ( struct SGP4 sgp4,
char **  errstr 
)

◆ sgp4_orbit()

double sgp4_orbit ( struct SGP4 sgp4,
struct TLE_VALUES tv,
double  tsince 
)

◆ sgp4_pred()

int sgp4_pred ( struct SGP4 sgp4,
double  tsince,
double  rect[6],
char **  errstr 
)

◆ sgp4_tle()

int sgp4_tle ( double *  epoch,
struct SGP4 sgp4,
char *  line1,
char *  line2,
char **  errstr 
)

◆ sunpos()

int sunpos ( double  tjd,
double  r[3],
char **  errstr 
)

◆ tconv()

double tconv ( double  tjd,
char  conv[],
char **  errstr 
)

◆ tcset()

int tcset ( double  x,
char  what[],
char **  errstr 
)

◆ tle_parse()

int tle_parse ( char *  line1,
char *  line2,
struct TLE_VALUES tv,
char **  errstr 
)

◆ tmtojul()

double tmtojul ( struct tm time)

Definition at line 32 of file time-utils.c.

◆ unrefract()

double unrefract ( double  alt,
double  temp,
double  pressure 
)