Skip to content

Commit 3116615

Browse files
committed
Some refactoring and further expanded README
1 parent 7703532 commit 3116615

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2064
-481
lines changed

Doxyfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,8 @@ FILE_PATTERNS = *.c \
10321032
*.qsf \
10331033
*.ice \
10341034
*.mm \
1035-
README-pruned.md
1035+
*.mm \
1036+
README-headless.md
10361037

10371038
# The RECURSIVE tag can be used to specify whether or not subdirectories should
10381039
# be searched for input files as well.
@@ -1165,7 +1166,7 @@ FILTER_SOURCE_PATTERNS =
11651166
# (index.html). This can be useful if you have a project on for instance GitHub
11661167
# and want to reuse the introduction page also for the doxygen output.
11671168

1168-
USE_MDFILE_AS_MAINPAGE = README-pruned.md
1169+
USE_MDFILE_AS_MAINPAGE = README-headless.md
11691170

11701171
# The Fortran standard specifies that for fixed formatted Fortran code all
11711172
# characters from position 72 are to be considered as comment. A common

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ all: api solsys tools test coverage check
4141

4242
.PHONY: clean
4343
clean:
44-
rm -f README-pruned.md
44+
rm -f README-headless.md
4545
@make -C tools clean
4646
@make -C test clean
4747

@@ -68,10 +68,10 @@ cio_file: lib/novas.a
6868
obj/jplint.o: $(SRC)/jplint.f
6969
gfortran -c -o $@ $<
7070

71-
README-pruned.md: README.md
71+
README-headless.md: README.md
7272
tail -n +`sed -n '/\# /{=;q;}' $<` $< > $@
7373

74-
dox: README-pruned.md
74+
dox: README-headless.md
7575

7676

7777
# ===============================================================================

README-headless.md

+559
Large diffs are not rendered by default.

README.md

+149-121
Large diffs are not rendered by default.

include/novas.h

+24-27
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@
112112
/// [s] TT - TAI time offset
113113
#define NOVAS_TAI_TO_TT 32.187
114114

115-
116-
117115
/// Reciprocal masses of solar system bodies, from DE-405 (Sun mass / body mass).
118116
/// [0]: Earth/Moon barycenter, MASS[1] = Mercury, ...,
119117
/// [9]: Pluto, [10]: Sun, [11]: Moon.
@@ -205,7 +203,7 @@ enum novas_planet {
205203
*
206204
*/
207205
enum novas_observer_place {
208-
NOVAS_OBSERVER_AT_GEOCENTER = 0, ///< Calculate coordinates as if observing from the geocenter for location and Earth rotation independent coordinates.
206+
NOVAS_OBSERVER_AT_GEOCENTER = 0, ///< Calculate coordinates as if observing from the geocenter for location and Earth rotation independent coordinates.
209207
NOVAS_OBSERVER_ON_EARTH, ///< Observer is at a location that is in the rotating frame of Earth.
210208

211209
/**
@@ -237,7 +235,7 @@ enum novas_reference_system {
237235
*/
238236
enum novas_equator_type {
239237
NOVAS_MEAN_EQUATOR = 0, ///< True equinox Of Date (TOD): dynamical system of the true equator, with its origin at the true equinox (pre IAU 2006 system).
240-
NOVAS_TRUE_EQUATOR, ///< Celestial Intermediate Reference System (CIRS): dynamical system of the true equator, with its origin at the CIO (preferred since IAU 2006)
238+
NOVAS_CIRS_EQUATOR, ///< Celestial Intermediate Reference System (CIRS): dynamical system of the true equator, with its origin at the CIO (preferred since IAU 2006)
241239
NOVAS_ICRS_EQUATOR ///< International Celestiual Reference system (ICRS). The equatorial system fixed to the frame of distant quasars.
242240
};
243241

@@ -260,7 +258,7 @@ enum novas_accuracy {
260258
*/
261259
enum novas_refraction_model {
262260
NOVAS_NO_ATMOSPHERE = 0, ///< Do not apply atmospheric refraction correction
263-
NOVAS_STANDARD_ATMOSPHERE, ///< Uses a standard atmospheric model, ignoring all weather values defined for the specific observing location
261+
NOVAS_STANDARD_ATMOSPHERE, ///< Uses a standard atmospheric model, ignoring all weather values defined for the specific observing location
264262
NOVAS_WEATHER_AT_LOCATION ///< Uses the weather parameters that are specified together with the observing location.
265263
};
266264

@@ -315,9 +313,9 @@ enum novas_transform_type {
315313
/// applies a rotation of the reference frame
316314
/// corresponding to precession between the first and second dates,
317315
/// but leaves the star fixed in space.
318-
CHANGE_SYSTEM,
316+
PRECESSION,
319317

320-
/// The combined equivalent of CHANGE_EPOCH and CHANGE_EQUATOR_EQUINOX together.
318+
/// The combined equivalent of PROPER_MOTION and PRECESSION together.
321319
CHANGE_EPOCH,
322320

323321
/// A fixed rotation about very small angles (<0.1 arcsecond) to take data from the
@@ -399,8 +397,11 @@ typedef struct {
399397
double Omega; ///< [rad] mean longitude of the Moon's ascending node.
400398
} novas_fundamental_args;
401399

402-
#define SIZE_OF_OBJ_NAME 51 ///< Maximum bytes in object names including string termination.
403-
#define SIZE_OF_CAT_NAME 4 ///< Maximum bytes in catalof IDs including string termination.
400+
401+
// These sit next to 64-bit values in structures, which means the structure is aligned to 64-bytes. So we
402+
// might as well define names to contain up to 64 bytes, including termination.
403+
#define SIZE_OF_OBJ_NAME 64 ///< Maximum bytes in object names including string termination.
404+
#define SIZE_OF_CAT_NAME 64 ///< Maximum bytes in catalog IDs including string termination.
404405

405406
/**
406407
* Basic astrometric data for any celestial object
@@ -411,7 +412,7 @@ typedef struct {
411412
typedef struct {
412413
char starname[SIZE_OF_OBJ_NAME]; ///< name of celestial object
413414
char catalog[SIZE_OF_CAT_NAME]; ///< catalog designator (e.g., HIP)
414-
long starnumber; ///< integer identifier assigned to object
415+
long starnumber; ///< integer identifier assigned to object
415416
double ra; ///< [h] ICRS right ascension (hours)
416417
double dec; ///< [deg] ICRS declination (degrees)
417418
double promora; ///< [mas/yr] ICRS proper motion in right ascension (milliarcseconds/year)
@@ -494,7 +495,6 @@ typedef struct {
494495
double ra_cio; ///< [arcsec] right ascension of the CIO with respect to the GCRS (arcseconds)
495496
} ra_of_cio;
496497

497-
498498
/**
499499
* Macro for converting epoch year to TT-based Julian date
500500
*
@@ -684,8 +684,7 @@ short ephemeris(const double jd_tdb[2], const object *cel_obj, enum novas_origin
684684

685685
int transform_hip(const cat_entry *hipparcos, cat_entry *hip_2000);
686686

687-
short transform_cat(enum novas_transform_type, double date_incat, const cat_entry *incat, double date_newcat, const char *newcat_id,
688-
cat_entry *newcat);
687+
short transform_cat(enum novas_transform_type, double date_in, const cat_entry *in, double date_out, const char *out_id, cat_entry *out);
689688

690689
int limb_angle(const double *pos_obj, const double *pos_obs, double *limb_ang, double *nadir_ang);
691690

@@ -700,7 +699,7 @@ double norm_ang(double angle);
700699
short make_cat_entry(const char *star_name, const char *catalog, long star_num, double ra, double dec, double pm_ra, double pm_dec,
701700
double parallax, double rad_vel, cat_entry *star);
702701

703-
short make_object(enum novas_object_type, int number, const char *name, const cat_entry *star_data, object *cel_obj);
702+
short make_object(enum novas_object_type, long number, const char *name, const cat_entry *star_data, object *cel_obj);
704703

705704
short make_observer(enum novas_observer_place, const on_surface *obs_surface, const in_space *obs_space, observer *obs);
706705

@@ -717,32 +716,30 @@ int make_in_space(const double *sc_pos, const double *sc_vel, in_space *obs_spac
717716

718717
// Added API in SuperNOVAS
719718

720-
int place_star(const cat_entry *star, const observer *obs, double jd_tt, double ut1_to_tt, enum novas_reference_system system,
719+
int place_star(double jd_tt, const cat_entry *star, const observer *obs, double ut1_to_tt, enum novas_reference_system system,
721720
enum novas_accuracy accuracy, sky_pos *pos);
722721

723-
int place_icrs(const object *source, double jd_tt, enum novas_accuracy accuracy, sky_pos *pos);
722+
int place_icrs(double jd_tt, const object *source, enum novas_accuracy accuracy, sky_pos *pos);
724723

725-
int place_gcrs(const object *source, double jd_tt, enum novas_accuracy accuracy, sky_pos *pos);
724+
int place_gcrs(double jd_tt, const object *source, enum novas_accuracy accuracy, sky_pos *pos);
726725

727-
int place_cirs(const object *source, double jd_tt, enum novas_accuracy accuracy, sky_pos *pos);
726+
int place_cirs(double jd_tt, const object *source, enum novas_accuracy accuracy, sky_pos *pos);
728727

729-
int place_tod(const object *source, double jd_tt, enum novas_accuracy accuracy, sky_pos *pos);
728+
int place_tod(double jd_tt, const object *source, enum novas_accuracy accuracy, sky_pos *pos);
730729

731-
int light_time2(double jd_tdb, const object *ss_object, const double *pos_obs, double tlight0, enum novas_accuracy accuracy, double *pos, double *vel, double *tlight);
730+
int light_time2(double jd_tdb, const object *ss_object, const double *pos_obs, double tlight0, enum novas_accuracy accuracy, double *pos,
731+
double *vel, double *tlight);
732732

733733
double tt2tdb(double jd_tt);
734734

735-
double tt_hour(double utchour, int leap_seconds);
735+
double get_ut1_to_tt(int leap_seconds, double dut1);
736+
737+
double get_utc_to_tt(int leap_seconds);
736738

737739
int cio_set_locator_file(const char *filename);
738740

739-
int nutation_set_lp(novas_nutate_func f);
741+
int nutation_set_lp_calc(novas_nutate_func f);
740742

741743
#include "solarsystem.h"
742744

743-
744-
745-
746-
747-
748745
#endif /* _NOVAS_ */

0 commit comments

Comments
 (0)