Skip to content
Snippets Groups Projects
Unverified Commit 0f626c6f authored by Sergio Poppi's avatar Sergio Poppi Committed by GitHub
Browse files

Solar system bodies tracking (#912)


* First skeleton issue #002

* SolarSystemBody.midl interface and makefile patched

* Xephem Astro lib added to Common Libraries

* Patched Makefile XEphem libastro

* Xephem libastro wrapper to solarsystem comp

* Patched makefile in astrolib

* inclded dynamic comp in cdb

* added build.log to gitignore

* Git ignored solarsystem body

* Xephemlib added to System Make

* Modified xephemAstrilib wrappe.
implemented SolarSystemBodyImpl::execute.

* Site implementation

* Removed handy shortcuts from astro.h in astrolib

* Refactored libastrowrapper to opimize handling  solar system body names with static methods.

* Unresolved symbols due to missing linking objects in SolarSystem makefile

* Implemented Method body position

* getAttribute method implemented.

* Implemented getCoordinates and getAllCoordinates

* patch to allow test component with python

* test_solarsystembody.py

 added az el calculation

* Testing output Solar System Body output

* patched libastrowrapper. Added getJ2000EquatorialMethod.

* unittest setup

* patched test planet jupiter

* SolarSystemBody comp. test apparant equatorial and horizontal

* SolarSystemBody:added test for setting offsets.

* Add to git new tests

* test on Sun and offsets

* test Sun added

* Implemented distance

* Test jupiter distance

* Patched getAttributes

* Implemented SUN in Antenna boss component

* Sun tracking:implemented in scheduler

* SolarSystem module added to SystemMake

* Error handling if a wrong planet is chosen

* Included functinality for planet tracking. Typos patched.

* Bug fixed Mercury planet code. Planet not found i NOBJ code

* Wrong planet name gives correct exception

* planet tracking with schedule, first draft

* Patched schedule subscan to allow planet tracking in schedule file

* Otimized logging of the SolarSystemBody component

* Generator showed in antennaBoss TUI

* typos fixes

* patche logs

---------

Co-authored-by: default avatarGiuseppe Carboni <giuseppecarboni89@live.com>
parent 32ce82f2
Branches
No related tags found
No related merge requests found
Showing
with 1544 additions and 9 deletions
......@@ -6,11 +6,13 @@ object/
*~
*.swp
*.pyc
.project*
# Ignore the SliLibrary directory
Common/Libraries/SlaLibrary
# Files generated by the building process
Common/Interfaces/build.log
Common/Clients/CaltoolClient/src/calibrationtool_ui.py
Common/Clients/CaltoolClient/src/calibrationtool_ui.pye
Common/Errors/AntennaErrors/idl/AntennaErrors.idl
......@@ -26,12 +28,16 @@ Common/Errors/ParserErrors/idl/ParserErrors.idl
Common/Errors/ReceiversErrors/idl/DerotatorErrors.idl
Common/Errors/ReceiversErrors/idl/ReceiversErrors.idl
Common/Errors/XBackendErrors/idl/XBackendsErrors.idl
Common/Errors/ActiveSurfaceErrors/idl/ASErrors.idl
Common/Interfaces/ActiveSurfaceInterface/idl/ActiveSurfaceCommon.idl
Common/Interfaces/AntennaInterface/idl/SolarSystemBody.idl
Common/Interfaces/AntennaInterface/idl/AntennaBoss.idl
Common/Interfaces/AntennaInterface/idl/Moon.idl
Common/Interfaces/AntennaInterface/idl/Mount.idl
Common/Interfaces/AntennaInterface/idl/OTF.idl
Common/Interfaces/AntennaInterface/idl/Observatory.idl
Common/Interfaces/AntennaInterface/idl/SkySource.idl
Common/Interfaces/AntennaInterface/idl/SolarSystemBody.idl
Common/Interfaces/ActiveSurfaceInterface/idl/ActiveSurfaceCommon.idl
Common/Interfaces/CommonInterface/idl/AntennaDefinitions.idl
Common/Interfaces/CommonInterface/idl/BackendsDefinitions.idl
......@@ -50,4 +56,7 @@ SRT/Clients/SRTActiveSurfaceGUIClient/include/SRTActiveSurfaceGUI.h
SRT/Clients/SRTActiveSurfaceGUIClient/src/moc_SRTActiveSurfaceCore.cpp
SRT/Clients/SRTActiveSurfaceGUIClient/src/moc_SRTActiveSurfaceGUIui.cpp
SRT/Interfaces/SRTActiveSurfaceInterface/idl/SRTActiveSurfaceBoss.idl
Common/Libraries/build.log
SRT/Interfaces/SRTActiveSurfaceInterface/idl/SRTActiveSurfaceCommon.idl
.DS_Store
.vscode/settings.json
......@@ -162,6 +162,49 @@ void updateGenerator(maci::SimpleClient& client,Antenna::TGeneratorType& lastGen
extraLabel6->Refresh();
break;
}
case Antenna::ANT_SOLARSYSTEMBODY : {
IRA::CString str1,str2;
Antenna::SolarSystemBodyAttributes_var att;
Antenna::SolarSystemBody_var ssbody;
try {
ssbody=Antenna::SolarSystemBody::_narrow(lastGenerator);
if (!CORBA::is_nil(ssbody)) {
ssbody->getAttributes(att);
}
}
catch (...) {
_EXCPT(ClientErrors::UnknownExImpl,impl,"::Main()");
_IRA_LOGGUARD_LOG_EXCEPTION(guard,impl,LM_ERROR);
return;
}
tmpString=(const char*)att->sourceID;
outString="Source name : "+tmpString;
extraLabel1->setValue(outString);
extraLabel1->Refresh();
IRA::CIRATools::radToHourAngle(att->rightAscension,str1);
IRA::CIRATools::radToSexagesimalAngle(att->declination,str2);
outString="Apparent Eq. : "+str1+"/"+str2+"/";
str1.Format("%.5lf",att->julianEpoch);
outString+=str1;
extraLabel2->setValue(outString);
extraLabel2->Refresh();
IRA::CIRATools::radToAngle(att->gLongitude,str1);
IRA::CIRATools::radToAngle(att->gLatitude,str2);
outString="Galactic : "+str1+"/"+str2;
extraLabel3->setValue(outString);
extraLabel4->Refresh();
IRA::CIRATools::radToAngle(att->azimuth,str1);
IRA::CIRATools::radToAngle(att->elevation,str2);
outString="Horizontal : "+str1+"/"+str2;
extraLabel4->setValue(outString);
extraLabel4->Refresh();
extraLabel5->setValue("");
extraLabel5->Refresh();
extraLabel6->setValue("");
extraLabel6->Refresh();
break;
}
case Antenna::ANT_OTF: {
Antenna::OTFAttributes_var att;
Antenna::OTF_var otf;
......
......@@ -6,6 +6,7 @@
#include <SkySourceC.h>
#include <OTFC.h>
#include <MoonC.h>
#include <SolarSystemBodyC.h>
#include <ManagementErrors.h>
#include <acsncSimpleConsumer.h>
#include <fstream>
......@@ -396,7 +397,7 @@ int main(int argc, char *argv[]) {
generatorType_box->setStatusLook(Antenna::ANT_SIDEREAL);
generatorType_box->setStatusLook(Antenna::ANT_MOON);
generatorType_box->setStatusLook(Antenna::ANT_SUN);
generatorType_box->setStatusLook(Antenna::ANT_SOLARSYTEMBODY);
generatorType_box->setStatusLook(Antenna::ANT_SOLARSYSTEMBODY);
generatorType_box->setStatusLook(Antenna::ANT_SATELLITE);
generatorType_box->setStatusLook(Antenna::ANT_OTF);
......@@ -434,6 +435,8 @@ int main(int argc, char *argv[]) {
_TW_SET_COMPONENT(output_label,0,WINDOW_HEIGHT-(OUTPUT_FIELD_HEIGHT+1),WINDOW_WIDTH-1,OUTPUT_FIELD_HEIGHT,OUTPUT_FIELD_COLOR_PAIR,OUTPUT_FIELD_STYLE,NULL);
#endif
// Monitors
ACS_LOG(LM_FULL_INFO,MODULE_NAME"::Main()",(LM_INFO,MODULE_NAME"::MONITORS_INSTALLATION"));
/** Add all required monitor installation here */
......
......@@ -66,7 +66,7 @@ EXECUTABLES_L =
_tui_AntennaBossTextClient_OBJECTS = AntennaBossTextClient
_tui_AntennaBossTextClient_LIBS = AntennaBossStubs IRALibrary \
ManagmentDefinitionsStubs TextWindowLibrary ClientErrors ComponentErrors ManagementErrors \
AntennaErrors AntennaDefinitionsStubs EphemGeneratorStubs SkySourceStubs OTFStubs MoonStubs acsnc
AntennaErrors AntennaDefinitionsStubs EphemGeneratorStubs SkySourceStubs OTFStubs MoonStubs SolarSystemBodyStubs acsnc
SCRIPTS = antennaBossTui
......
/* ************************************************************************************/
/* INAF DISCOS
/* */
/* $Id: SolarSystemBody.midl,v 1.3 2010-09-24 15:42:03 a.orlati Exp $ */
/* */
/* This code is under GNU General Public Licence (GPL) */
/* */
/* Who when What */
/* S.Poppi, S.Righini 09/May/2017 created */
#ifndef _SSB_IDL
#define _SSB_IDL
#include "baci.idl"
#include <enumpropMACRO.idl>
#include <EphemGenerator.idl>
#pragma prefix "alma"
module Antenna {
/*
* Here we have defined a struct "SolarSystemBody structure" that contains all the properties of the component.
* Since EphemGenerator defines all the properties of the component and we have inherited the SolarSystemBody component from EphemGenerator.
* This Interface will be mapped into the ACS dynamic component so it can't expose properties in their classic definations.
* Component attributes are read via their accesor method (<i>getAttributes()</i>). *
*/
DEFATTRIBUTES (SolarSystemBodyAttributes)
double angularSize; /** apparent angular diameter of the body degrees**/
double distance; /**body distance AU **/
double radialVelocity; /**body radial velocity km/s**/
Antenna::TReferenceFrame vradFrame; /** reference frame of the radial velocity */
Antenna::TVradDefinition vradDefinition; /** definition of the radial velocity */
ENDDEFATTRIBUTES;
interface SolarSystemBody: EphemGenerator {
/*This is the Interface of the component Moon and this is inherited from EphemGenerator
* all the properties metioned below are inherited by the interface SolarSystemBody
* # input Source ID:SolarSystemBody, the name of the source
* # double right Ascension of the body in radians
* # double decination of the body in radians
* # double azimuth in radians
* # double elevation in radians
* # Julian Epoch the current time as a julian epoch
* # double userAzimuthOffset in radians
* # double userElevationOffset in radians
* # double userRightAscensionOffset in radians
* # double userDeclinationOffset in radians
* # double parallacticAngle in radians
*/
void getAttributes(out SolarSystemBodyAttributes att); /*this method is the attribute accessor*/
/**
* This method is only for control software internal use. It used, given a timestamp, to retrive the apparent
* J2000 Equatorial coordiantes coordinates in one shot.
* @throw CORBA::SystemException
* @param timestamp this parameter is used to pass the exact time the caller wants to know the topocentric coordinates.
* @param ra that's the returned value in radians of the right ascension for the requested time.
* @param re that's the returned value in radians of the declination for the requested time.
*/
void getJ2000EquatorialCoordinate(in ACS::Time timestamp, out double ra,out double dec);
/**
@param bodyName of the target
*/
void setBodyName(in string bodyName) raises (AntennaErrors::AntennaErrorsEx);
/**
* This method is only for control software internal use. It used, given a timestamp, to retrive the distance of the body
* @param timestamp this parameter is used to pass the exact time the caller wants to know the topocentric coordinates.
* @param distance body distance in AU.
* J2000 Equatorial coordiantes coordinates in one shot.
*/
void getDistance(in ACS::Time timestamp, out double distance);
};
};
#endif
......@@ -30,7 +30,7 @@ CDB_SCHEMAS = Mount Station PointingModel
# IDL Files and flags
#
IDL_FILES = Observatory Mount PointingModel EphemGeneratorMACRO_include \
EphemGenerator SkySource OTF Refraction AntennaBoss Moon
EphemGenerator SkySource OTF Refraction AntennaBoss Moon SolarSystemBody
IDL_TAO_FLAGS =
USER_IDL =
ObservatoryStubs_LIBS = baciStubs maciStubs AntennaDefinitionsStubs ComponentErrorsStubs
......@@ -48,7 +48,7 @@ AntennaBossStubs_LIBS = baciStubs maciStubs ManagmentDefinitionsStubs Management
EphemGeneratorStubs ComponentErrorsStubs AntennaErrorsStubs \
AntennaDefinitionsStubs
MoonStubs_LIBS = baciStubs maciStubs EphemGeneratorStubs
SolarSystemBodyStubs_LIBS = baciStubs maciStubs EphemGeneratorStubs
#
# list of all possible C-sources (used to create automatic dependencies)
......
......@@ -105,7 +105,7 @@ module Antenna {
ANT_SUN, /*!< tracks the sun */
ANT_MOON, /*!< tracks the moon */
ANT_SATELLITE, /*!< tracks an artificial sattelite */
ANT_SOLARSYTEMBODY, /*!< tracks a body of the solar system */
ANT_SOLARSYSTEMBODY, /*!< tracks a body of the solar system */
ANT_OTF, /*!< perform a On the Fly Scan */
ANT_NONE /*!< no generator */
};
......
......@@ -62,6 +62,7 @@ module Management {
MNG_SUN, /*!< tracks the sun */
MNG_MOON, /*!< tracks the moon */
MNG_SATELLITE, /*!< tracks an artificial sattelite */
MNG_PLANET, /*!< tracks a planet */
MNG_SOLARSYTEMBODY, /*!< tracks a body of the solar system */
MNG_OTF, /*!< perform a On the Fly Scan */
MNG_OTFC, /*!< this is a wrapper of the otf, it allows the system to compute the center of the on-the-fly */
......
......@@ -40,6 +40,10 @@ public:
mode=Management::MNG_SOLARSYTEMBODY;
return true;
}
else if (strcasecmp(strScan,"PLANET")==0) {
mode=Management::MNG_PLANET;
return true;
}
else if (strcasecmp(strScan,"OTF")==0) {
mode=Management::MNG_OTF;
return true;
......
......@@ -293,6 +293,25 @@ module Management {
*/
void moon() raises (ComponentErrors::ComponentErrorsEx,ManagementErrors::ManagementErrorsEx);
/**
* It allows to immediately start a tracking of the Sun.
* @throw CORBA::SystemExcpetion
* @throw ComponentErrors::ComponentErrorsEx
* @throw ManagementErrors::ManagementErrorsEx
*/
void sun() raises (ComponentErrors::ComponentErrorsEx,ManagementErrors::ManagementErrorsEx);
/**
* It allows to immediately start a tracking of the Sun.
* @throw CORBA::SystemExcpetion
* @throw ComponentErrors::ComponentErrorsEx
* @throw ManagementErrors::ManagementErrorsEx
*/
void planet(in string name) raises (ComponentErrors::ComponentErrorsEx,ManagementErrors::ManagementErrorsEx);
/**
* It allows to immediately go to a fixed horizontal position (beampark).
* @param az azimuth in radians. It could be -1, in that case the current position is taken
......
This diff is collapsed.
extern int read_bdl (FILE *fp, double jd, double *xp, double *yp, double *zp,
char ynot[]);
/* For RCS Only -- Do Not Edit
* @(#) $RCSfile: bdl.h,v $ $Date: 2003/03/20 08:56:31 $ $Revision: 1.1 $ $Name: $
*/
/* Position of outer planets; straightforward from:
ftp://adc.gsfc.nasa.gov/pub/adc/archives/journal_tables/A+AS/109/181:
J/A+AS/109/181 Planetary ephemerides (Chapront, 1995)
===============================================================================
Representation of planetary ephemerides by frequency analysis. Application to
the five outer planets.
CHAPRONT J.
<Astron. Astrophys. Suppl. Ser. 109, 181 (1995)>
=1995A&AS..109..181C (SIMBAD/NED Reference)
===============================================================================
Keywords: ephemerides - planets and satellites: general - methods: numerical
Contents:
Heliocentric equatorial rectangular coordinates of the five outer planets
(X, Y and Z). The source is based on DE200 (tables 4 to 7) or a reconstruction
of DE200 by numerical integration (tables 9 to 13). The reference frame is
the mean equator and equinox J2000 of DE200.
The general formulation of the series X is:
X = SUM[i=1,Records] T**n_i*(CX_i*cos(Nu_k*t)+SX_i*sin(Nu_k*t))
The formulation is identical for Y and Z.
T is the time (TDB) in Julian centuries from J2000:
T = (JulianDate - 2451545.0)/36525
t is the time (TDB) in Julian years from J2000:
t = (JulianDate - 2451545.0)/365.25
Nu is the frequency. Frequencies are identical for all terms of rank k:
Nu_k = Nu_i when n_i = 0
For purely secular terms k = 0 and Nu_0 = 0
===============================================================================
(End) Patricia Bauer [CDS] 03-Oct-1994
*/
#define CHAP_SCALE 1e10
/* JDs of validity period */
#define CHAP_BEGIN (2338032.5 - MJD0) /* 1689/3/19 */
#define CHAP_END (2542032.5 - MJD0) /* 2247/10/1 */
/* coding flags */
/* calculating rates increases time by about 10%
*
* On an HP715/75, for pluto the times per step are 0.00049 s and 0.00057 s
* This method is quite fast.
*/
#define CHAP_GETRATE 1
typedef struct {
short n; /* order of time; "-1" marks end of list */
double amp[6]; /* amplitudes of cosine and sine terms for x,y,z */
/* in original order [CX,SX,CY,SY,CZ,SZ] */
double Nu; /* Frequency Nu_k; given only at n=0 */
} chap95_rec;
extern chap95_rec chap95_jupiter[];
extern chap95_rec chap95_saturn[];
extern chap95_rec chap95_uranus[];
extern chap95_rec chap95_neptune[];
extern chap95_rec chap95_pluto[];
extern int chap95 (double m, int obj, double prec, double *ret);
/* For RCS Only -- Do Not Edit
* @(#) $RCSfile: chap95.h,v $ $Date: 2003/03/20 08:51:37 $ $Revision: 1.2 $ $Name: $
*/
#ifndef _CONST_H
#define _CONST_H
/* $Id: deepconst.h,v 1.1 2000/09/25 17:21:25 ecdowney Exp $ */
#define GE (3.986005E14)
#define PI (3.1415926535897932385)
#define XKE (7.43669161E-2)
#define CK2 (5.413080E-4)
#define CK4 (6.2098875E-7)
#define E6A (10E6)
#define QOMS2T (1.88027916E-9)
#define S (1.01222928)
#define TOTHRD (2.0/3.0) /* 6.6666666666666666667E-1 */
#define XJ3 (-2.53881E-6)
/* #define XKE KE */
#define XKMPER (6378.135)
#define XMNPDA (1440.0)
#define AE (1.0)
#define DE2RA (1.7453292519943295769E-2)
#define PIO2 (1.57079632679489661925) /* PI/2 */
#define TWOPI (6.2831853071795864770)
#define X3PIO2 (4.7123889803846898578) /* 3*PI/2 */
#define RHO (0.15696590235)
#endif /* _CONST_H */
/* For RCS Only -- Do Not Edit
* @(#) $RCSfile: deepconst.h,v $ $Date: 2000/09/25 17:21:25 $ $Revision: 1.1 $ $Name: $
*/
/* global info for the preferences facility.
* N.B. many of these enums are used as indexes -- don't change without
* checking where they are used!
*/
#ifndef _PREFERENCES_H
#define _PREFERENCES_H
#ifdef __cplusplus
extern "C" {
#endif
// all of your legacy C code here
typedef enum {
PREF_EQUATORIAL, PREF_UNITS, PREF_DATE_FORMAT, PREF_ZONE, PREF_DPYPREC,
PREF_MSG_BELL, PREF_PRE_FILL, PREF_TIPS, PREF_CONFIRM, PREF_WEEKSTART,
NPREFS
} Preferences;
typedef enum {PREF_GEO, PREF_TOPO} PrefEquatorial;
typedef enum {PREF_ENGLISH, PREF_METRIC} PrefUnits;
typedef enum {PREF_MDY, PREF_YMD, PREF_DMY} PrefDateFormat;
typedef enum {PREF_LOCALTZ, PREF_UTCTZ} PrefStampZone;
typedef enum {PREF_LOPREC, PREF_HIPREC} PrefDpyPrec;
typedef enum {PREF_NOMSGBELL, PREF_MSGBELL} PrefMsgBell;
typedef enum {PREF_PREFILL, PREF_NOPREFILL} PrefPreFill;
typedef enum {PREF_TIPSON, PREF_NOTIPS} PrefTips;
typedef enum {PREF_CONFIRMON, PREF_NOCONFIRM} PrefConfirm;
typedef enum {PREF_SAT, PREF_SUN, PREF_MON} PrefWeekStart;
extern int pref_get (Preferences p);
extern int pref_set (Preferences p, int newp);
#ifdef __cplusplus
}
#endif
#endif /* _PREFERENCES_H */
/* For RCS Only -- Do Not Edit
* @(#) $RCSfile: preferences.h,v $ $Date: 2003/03/20 08:51:37 $ $Revision: 1.6 $ $Name: $
*/
#ifndef __SATLIB_H
#define __SATLIB_H
/* $Id: satlib.h,v 1.1 2000/09/25 17:21:25 ecdowney Exp $ */
typedef struct _SatElem {
float se_XMO;
float se_XNODEO;
float se_OMEGAO;
float se_EO;
float se_XINCL;
float se_XNDD60;
float se_BSTAR;
float pad1;
double se_XNO;
double se_XNDT20;
double se_EPOCH;
struct {
unsigned int catno : 21;
unsigned int classif : 5;
unsigned int elnum : 10;
unsigned int year : 14;
unsigned int launch : 10;
unsigned int piece : 15;
unsigned int ephtype : 4;
unsigned int orbit : 17;
} se_id;
} SatElem;
#if 0
struct sat_loc {
double sl_X;
double sl_XDOT;
double sl_Y;
double sl_YDOT;
double sl_Z;
double sl_ZDOT;
};
#endif
struct sgp4_data {
unsigned int sgp4_flags;
unsigned int pad;
double sgp4_AODP;
double sgp4_AYCOF;
double sgp4_C1;
double sgp4_C4;
double sgp4_C5;
double sgp4_COSIO;
double sgp4_D2;
double sgp4_D3;
double sgp4_D4;
double sgp4_DELMO;
double sgp4_ETA;
double sgp4_OMGCOF;
double sgp4_OMGDOT;
double sgp4_SINIO;
double sgp4_SINMO;
double sgp4_T2COF;
double sgp4_T3COF;
double sgp4_T4COF;
double sgp4_T5COF;
double sgp4_X1MTH2;
double sgp4_X3THM1;
double sgp4_X7THM1;
double sgp4_XLCOF;
double sgp4_XMCOF;
double sgp4_XMDOT;
double sgp4_XNODCF;
double sgp4_XNODOT;
double sgp4_XNODP;
};
struct deep_data {
struct {
unsigned int IRESFL : 1;
unsigned int ISYNFL : 1;
} deep_flags;
double deep_s_SINIQ;
double deep_s_COSIQ;
double deep_s_OMGDT;
double deep_ATIME;
double deep_D2201;
double deep_D2211;
double deep_D3210;
double deep_D3222;
double deep_D4410;
double deep_D4422;
double deep_D5220;
double deep_D5232;
double deep_D5421;
double deep_D5433;
double deep_DEL1;
double deep_DEL2;
double deep_DEL3;
double deep_E3;
double deep_EE2;
double deep_FASX2;
double deep_FASX4;
double deep_FASX6;
double deep_OMEGAQ;
double deep_PE;
double deep_PINC;
double deep_PL;
double deep_SAVTSN;
double deep_SE2;
double deep_SE3;
double deep_SGH2;
double deep_SGH3;
double deep_SGH4;
double deep_SGHL;
double deep_SGHS;
double deep_SH2;
double deep_SH3;
double deep_SHS;
double deep_SHL;
double deep_SI2;
double deep_SI3;
double deep_SL2;
double deep_SL3;
double deep_SL4;
double deep_SSE;
double deep_SSG;
double deep_SSH;
double deep_SSI;
double deep_SSL;
double deep_STEP2;
double deep_STEPN;
double deep_STEPP;
double deep_THGR;
double deep_XFACT;
double deep_XGH2;
double deep_XGH3;
double deep_XGH4;
double deep_XH2;
double deep_XH3;
double deep_XI2;
double deep_XI3;
double deep_XL2;
double deep_XL3;
double deep_XL4;
double deep_XLAMO;
double deep_XLI;
double deep_XNI;
double deep_XNQ;
double deep_XQNCL;
double deep_ZMOL;
double deep_ZMOS;
};
struct sdp4_data {
double sdp4_AODP; /* dpa */
double sdp4_AYCOF;
double sdp4_BETAO; /* dpa */
double sdp4_BETAO2; /* dpa */
double sdp4_C1;
double sdp4_C4;
double sdp4_COSG; /* dpa */
double sdp4_COSIO; /* dpa */
double sdp4_EOSQ; /* dpa */
double sdp4_OMGDOT; /* dpa */
double sdp4_SING; /* dpa */
double sdp4_SINIO; /* dpa */
double sdp4_T2COF;
double sdp4_THETA2; /* dpa */
double sdp4_X1MTH2;
double sdp4_X3THM1;
double sdp4_X7THM1;
double sdp4_XLCOF;
double sdp4_XMDOT; /* dpa */
double sdp4_XNODCF;
double sdp4_XNODOT; /* dpa */
double sdp4_XNODP; /* dpa */
double sdp4_XMDF_seco;
double sdp4_OMGADF_seco;
double sdp4_XNODE_seco;
double sdp4_EM_seco;
double sdp4_XINC_seco;
double sdp4_XN_seco;
double sdp4_E_pero;
double sdp4_XINC_pero;
double sdp4_OMGADF_pero;
double sdp4_XNODE_pero;
double sdp4_XMAM_pero;
};
typedef struct _SatData {
struct _SatElem *elem;
union {
struct sgp4_data *sgp4;
struct sdp4_data *sdp4;
} prop;
struct deep_data *deep;
} SatData;
void sgp4(SatData *sat, Vec3 *pos, Vec3 *dpos, double t);
void sdp4(SatData *sat, Vec3 *pos, Vec3 *dpos, double TSINCE);
#endif /* __SATLIB_H */
/* For RCS Only -- Do Not Edit
* @(#) $RCSfile: satlib.h,v $ $Date: 2000/09/25 17:21:25 $ $Revision: 1.1 $ $Name: $
*/
#ifndef __SATSPEC_H
#define __SATSPEC_H
/* $Id: satspec.h,v 1.1 2000/09/25 17:21:25 ecdowney Exp $ */
#include "sattypes.h"
#include "satlib.h"
#define SGP4_SIMPLE 0x00000001
extern void init_deep(struct deep_data *deep);
void init_sdp4(struct sdp4_data *sdp);
char *tleerr(int);
int readtle(char *, char *, SatElem *);
double current_jd();
double ut1_to_gha(double);
void smallsleep(double t);
double epoch_jd(double);
double actan(double sinx, double cosx);
double thetag(double EP, double *DS50);
void dpinit(SatData *sat, double EQSQ, double SINIQ, double COSIQ,
double RTEQSQ, double AO, double COSQ2, double SINOMO,
double COSOMO, double BSQ, double XLLDOT, double OMGDT,
double XNODOT, double XNODP);
void dpsec(SatData *sat, double *XLL, double *OMGASM, double *XNODES,
double *EM, double *XINC, double *XN, double T);
void dpper(SatData *sat, double *EM, double *XINC, double *OMGASM,
double *XNODES, double *XLL, double T);
#endif /* __SATSPEC_H */
/* For RCS Only -- Do Not Edit
* @(#) $RCSfile: satspec.h,v $ $Date: 2000/09/25 17:21:25 $ $Revision: 1.1 $ $Name: $
*/
#ifndef __SATTYPES_H
#define __SATTYPES_H
/* $Id: sattypes.h,v 1.1 2000/09/25 17:21:25 ecdowney Exp $ */
typedef struct _Vec3 {
double x, y, z;
} Vec3;
typedef struct _LookAngle {
double az;
double el;
double r;
} LookAngle;
typedef struct _Geoloc {
double lt;
double ln;
double h;
} GeoLoc;
#endif /* __SATTYPES_H */
/* For RCS Only -- Do Not Edit
* @(#) $RCSfile: sattypes.h,v $ $Date: 2000/09/25 17:21:25 $ $Revision: 1.1 $ $Name: $
*/
#ifndef __SATVECTOR_H
#define __SATVECTOR_H
/* $Id: vector.h,v 1.1 2000/09/25 17:21:25 ecdowney Exp $ */
#define dotp(A,B) ((A).x*(B).x+(A).y*(B).y+(A).z*(B).z)
#define crossp(A,B,C) {(C).x=(A).y*(B).z-(A).z*(B).y;(C).y=(A).z*(B).x-(A).x*(B).z;(C).z=(A).x*(B).y-(A).y*(B).x;}
#define vecabs(V) (sqrt((V).x*(V).x+(V).y*(V).y+(V).z*(V).z))
#define vecsq(V) ((V).x*(V).x+(V).y*(V).y+(V).z*(V).z)
#define vecsub(A,B,C) {(C).x=(A).x-(B).x;(C).y=(A).y-(B).y;(C).z=(A).z-(B).z;}
#define vecscale(A,k) {(A).x*=(k);(A).y*=(k);(A).z*=(k);}
#endif /* __SATVECTOR_H */
/* For RCS Only -- Do Not Edit
* @(#) $RCSfile: vector.h,v $ $Date: 2000/09/25 17:21:25 $ $Revision: 1.1 $ $Name: $
*/
/* Position of planets mercury to neptune; from:
ftp://ftp.bdl.fr/pub/ephem/planets/vsop87/
from README:
========================== ===========================
BUREAU DES LONGITUDES
PLANETARY SOLUTION VSOP87
1996, January
========================== ===========================
These files and programs are associated to :
Planetary Theories in rectangular and spherical variables: VSOP87 solution.
Bretagnon P., Francou G.
Astron. Astrophys. 202, 309 (1988).
Theorie du mouvement de l'ensemble des planetes (VSOP82).
Bretagnon P.
Astron. Astrophys. 114, 278 (1982).
==============================================================================
Description:
The Planetary solutions VSOP87 (Variations Seculaires des Orbites
Planetaires) are analytical solutions of the motion of the planets in
different versions. The main version VSOP87 consists of the series in
elliptic elements as in the case of VSOP82 solution and the other
versions VSOP87 (A-B-C-D-E) are built in rectangular and spherical
variables.
Authors' Address:
P. Bretagnon, G. Francou
Bureau des Longitudes, CNRS URA 707
77, Avenue Denfert-Rochereau
75014, Paris, France
Tel : (33) 1 40 51 22 69 (33) 1 40 51 22 60
Fax : (33) 1 46 33 28 34
E-mail : pierre@bdl.fr francou@bdl.fr
Contents:
The main version of VSOP87 is similar to the previous theory VSOP82.
In the both cases the constants of integration have been determined by
fitting to the numerical integration DE200 of the Jet Propulsion
Laboratory. The various versions of VSOP87 are different from one to
another in the type of coordinates and the reference frame.
VSOP87 : heliocentric elliptic variables; equinox and ecliptic J2000.
VSOP87A : heliocentric rectangular variables; equinox and ecliptic J2000.
VSOP87B : heliocentric spherical variables; equinox and ecliptic J2000.
VSOP87C : heliocentric rectangular variables; equinox and ecliptic of date.
VSOP87D : heliocentric spherical variables; equinox and ecliptic of date.
VSOP87E : barycentric rectangular variables; equinox and ecliptic J2000.
...
==============================================================================
User feed-back is encouraged. Unless otherwise specified, send comments and bug
reports to: E-mail : comments@bdl.fr
Fax : (33) 1 46 33 28 34
Postal mail: Bureau des longitudes
77 avenue Denfert Rochereau
F-75014 PARIS
==============================================================================
implemented for C: stern
*/
#define VSOP_ASCALE 1e8 /* amplitude factor as stored */
/* coding flags */
#define VSOP_SPHERICAL 1 /* version in data.c uses spherical coords */
#define VSOP_GETRATE 0 /* calculate time derivatives of coordinates */
/* data tables */
extern double vx_mercury[][3];
extern int vn_mercury[][3];
extern double vx_venus[][3];
extern int vn_venus[][3];
extern double vx_earth[][3];
extern int vn_earth[][3];
extern double vx_mars[][3];
extern int vn_mars[][3];
extern double vx_jupiter[][3];
extern int vn_jupiter[][3];
extern double vx_saturn[][3];
extern int vn_saturn[][3];
extern double vx_uranus[][3];
extern int vn_uranus[][3];
extern double vx_neptune[][3];
extern int vn_neptune[][3];
extern int vsop87 (double mj, int obj, double prec, double *ret);
/* For RCS Only -- Do Not Edit
* @(#) $RCSfile: vsop87.h,v $ $Date: 2003/03/20 08:51:37 $ $Revision: 1.2 $ $Name: $
*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment