Skip to content

Commit

Permalink
Merge naif.h into solarsystem.h and site update
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Nov 11, 2024
1 parent d5d00f3 commit 1754cd3
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 47 deletions.
5 changes: 2 additions & 3 deletions .cproject
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.2126916097">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.2126916097" moduleId="org.eclipse.cdt.core.settings" name="Default">
<macros>
<stringMacro name="CALCEPH_SUPPORT" type="VALUE_TEXT" value="1"/>
</macros>
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
Expand All @@ -28,6 +25,8 @@
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.490761690" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="DEFAULT_SOLSYS=3"/>
<listOptionValue builtIn="false" value="THREAD_LOCAL=__thread"/>
<listOptionValue builtIn="false" value="USE_CSPICE=1"/>
<listOptionValue builtIn="false" value="USE_CALCEPH=1"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1061272597" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
Expand Down
3 changes: 3 additions & 0 deletions .settings/org.eclipse.cdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ eclipse.preferences.version=1
environment/project/cdt.managedbuild.toolchain.gnu.base.2126916097/CALCEPH_SUPPORT/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.base.2126916097/CALCEPH_SUPPORT/operation=append
environment/project/cdt.managedbuild.toolchain.gnu.base.2126916097/CALCEPH_SUPPORT/value=1
environment/project/cdt.managedbuild.toolchain.gnu.base.2126916097/CSPICE_SUPPORT/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.base.2126916097/CSPICE_SUPPORT/operation=append
environment/project/cdt.managedbuild.toolchain.gnu.base.2126916097/CSPICE_SUPPORT/value=1
environment/project/cdt.managedbuild.toolchain.gnu.base.2126916097/append=true
environment/project/cdt.managedbuild.toolchain.gnu.base.2126916097/appendContributed=true
org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation=16
Expand Down
29 changes: 0 additions & 29 deletions include/naif.h

This file was deleted.

43 changes: 35 additions & 8 deletions include/solarsystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,27 @@
* @author G. Kaplan and A. Kovacs
*
* SuperNOVAS header for custom solar-system ephemeris calculations for major planets plus
* the Sun, Moon, and the Solar-system barycenter. The source files solsys1.c, solsys2.c,
* solsys3.c and solsys-ephem.c provide various standard implementations that users may use
* (some require additional sources, or user-specific implementations), or you can write your
* own version if that seems more appropriate.
* the Sun, Moon, and the Solar-system barycenter.
*
* The source files solsys-calceph.c and solsys-cspice.c provide implementations that
* interface with the CALCEPH C library and the NAIF CSPICE Toolkit, respectively. CSPICE is
* the canocical library for handling JPL (SPK) ephemeris data, while CALCEPH is a more
* modern tool, which allows handling most types of JPL ephemerides, as well INPOP 2.0/3.0
* format data files.
*
* The source files solsys1.c, solsys2.c, solsys3.c and solsys-ephem.c provide various legacy
* implementations that users may use (some require additional sources, or user-specific
* implementations).
*
* If the standard implementations are compiled with the DEFAULT_SOLSYS option set (see
* Makefile), then the library is compiled with that version providing a built-in default
* implementation (the default is to use solsys3, which is a self-contained orbital
* calculation).
* `config.mk`), then the library is compiled with that version providing a built-in default
* implementation (the default is to use `solsys3.c`, which is a self-contained orbital
* calculation for the Sun and Earth only).
*
* Additionally, users may set their custom choice of major planet ephemeris handler at
* runtime via the set_ephem_size().
* runtime via the set_planet_provider() and/or set_planet_provider_hp() functions. They may
* also define custom handlers for all other types of Solar-system objects (i.e.
* `NOVAS_EPHEM_OBJECT` types) via set_ephem_provider().
*
* Based on the NOVAS C Edition, Version 3.1:
*
Expand All @@ -25,6 +34,8 @@
* <a href="http://www.usno.navy.mil/USNO/astronomical-applications">
* http://www.usno.navy.mil/USNO/astronomical-applications</a>
*
* @sa solsys-calceph.c
* @sa solsys-cspice.c
* @sa solsys1.c
* @sa solsys2.c
* @sa solsys3.c
Expand Down Expand Up @@ -363,6 +374,22 @@ int cspice_remove_kernel(const char *filename);

# ifdef __NOVAS_INTERNAL_API__

/// NAIF ID for the geocenter
#define NAIF_EARTH 399

/// NAIF ID for the Moon
#define NAIF_MOON 301

/// NAIF_ID for the Sun
#define NAIF_SUN 10

/// NAIF ID for the Solar-System Barycenter (SSB)
#define NAIF_SSB 0

/// NAIF ID for the Earth-Moon Barycenter (EMB)
#define NAIF_EMB 3


/**
* The function to use to provide planet ephemeris data.
*
Expand Down
1 change: 0 additions & 1 deletion src/naif.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

#define __NOVAS_INTERNAL_API__ ///< Use definitions meant for internal use by SuperNOVAS only
#include "novas.h"
#include "naif.h"

/**
* Converts a NAIF ID to a NOVAS major planet ID. It account for the different IDs used for Sun, Moon and SSB.
Expand Down
2 changes: 1 addition & 1 deletion src/solsys-calceph.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define __NOVAS_INTERNAL_API__ ///< Use definitions meant for internal use by SuperNOVAS only
#include "novas.h"
#include "calceph.h"
#include "naif.h"
#include "novas-naif.h"

#define CALCEPH_MOON 10 ///< Moon in CALCEPH
#define CALCEPH_SUN 11 ///< Sun in CALCEPH
Expand Down
1 change: 0 additions & 1 deletion src/solsys-cspice.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#define USE_CSIPCE 1 ///< NOVAS cspice integration prototypes
#define __NOVAS_INTERNAL_API__ ///< Use definitions meant for internal use by SuperNOVAS only
#include "novas.h"
#include "naif.h"

#include "cspice/SpiceUsr.h"
#include "cspice/SpiceZpr.h" // for reset_c
Expand Down
2 changes: 1 addition & 1 deletion test/src/test-errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <math.h>
#include <string.h>

#define __NOVAS_INTERNAL_API__ ///< Use definitions meant for internal use by SuperNOVAS only
#include "novas.h"
#include "naif.h"

static int check(const char *func, int exp, int error) {
if(error != exp) {
Expand Down
3 changes: 0 additions & 3 deletions test/src/test-super.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@
#include <unistd.h>
#include <libgen.h>



#define __NOVAS_INTERNAL_API__ ///< Use definitions meant for internal use by SuperNOVAS only
#include "novas.h"
#include "naif.h"

#define J2000 2451545.0
#define DAY 86400.0
Expand Down

0 comments on commit 1754cd3

Please sign in to comment.