Loading...
Searching...
No Matches
SuperNOVAS C++ vs. C99

C99 | C++11
--- | ---

#include <novas.h>
cat_entry star;
object source;
observer loc;
novas_timespec time;
novas_frame frame;
sky_pos app;
// IERS Earth Orientation Parameters...
int leap_seconds = 37;
double dt1 = 0.06256; // [s]
double dx = 103.4; // [mas]
double dy = 396.2; // [mas]
// Define ICRS coordinates
make_cat_entry("Antares", "HIP", 80763,
novas_hms_hours("16h 29m 24.45970s"),
novas_dms_degrees("−26d 25m 55.2094s"),
-12.11, -23.30, 5.89, -3.4, &star);
make_cat_object(&star, &source);
// Observer location
make_gps_observer(50.7374, 7.0982, 60.0,
&loc);
// Set time of observation
novas_set_str_time(NOVAS_TAI,
"2025-02-27T19:57:00.728+0200",
leap_seconds, dut1, &time);
// Observer frame
novas_make_frame(NOVAS_FULL_ACCURACY,
&loc, &time, dx, dy, &frame);
// apparent coordinates in system
novas_sky_pos(&source, &frame, NOVAS_CIRS, &app);
NOVAS_CIRS
@ NOVAS_CIRS
Celestial Intermediate Reference System: dynamical system of the true equator, with its origin at the...
Definition novas.h:888
NOVAS_FULL_ACCURACY
@ NOVAS_FULL_ACCURACY
Use full precision calculations to micro-arcsecond accuracy.
Definition novas.h:985
NOVAS_TAI
@ NOVAS_TAI
International Atomic Time (TAI).
Definition novas.h:1796
novas.h
SuperNOVAS types, definitions, and function prototypes.
novas_set_str_time
int novas_set_str_time(enum novas_timescale timescale, const char *restrict str, int leap, double dut1, novas_timespec *restrict time)
Sets astronomical time in a specific timescale using a string specification.
Definition timescale.c:515
novas_hms_hours
double novas_hms_hours(const char *restrict hms)
Returns the decimal hours for a HMS string specification.
Definition parse.c:246
cat_entry
struct novas_cat_entry cat_entry
Basic astrometric data for any sidereal object located outside the solar system.
sky_pos
struct novas_sky_pos sky_pos
Celestial object's place on the sky; contains the output from place().
make_gps_observer
int make_gps_observer(double latitude, double longitude, double height, observer *obs)
Initializes an observer data structure for a ground-based observer with the specified GPS / WGS84 loc...
Definition observer.c:277
make_cat_object
int make_cat_object(const cat_entry *star, object *source)
Populates and object data structure with the data for a catalog source.
Definition target.c:501
make_cat_entry
short make_cat_entry(const char *restrict name, const char *restrict catalog, long cat_num, double ra, double dec, double pm_ra, double pm_dec, double parallax, double rv, cat_entry *source)
Fully populates the data structure for a catalog source, such as a star, with all parameters provided...
Definition target.c:336
novas_sky_pos
int novas_sky_pos(const object *restrict object, const novas_frame *restrict frame, enum novas_reference_system sys, sky_pos *restrict out)
Calculates an apparent location on sky for the source.
Definition frames.c:854
novas_dms_degrees
double novas_dms_degrees(const char *restrict dms)
Returns the decimal degrees for a DMS string specification.
Definition parse.c:455
novas_make_frame
int novas_make_frame(enum novas_accuracy accuracy, const observer *obs, const novas_timespec *time, double xp, double yp, novas_frame *frame)
Sets up a observing frame for a specific observer location, time of observation, and accuracy require...
Definition frames.c:525
observer
struct novas_observer observer
Observer location.
novas_frame
A set of parameters that uniquely define the place and time of observation.
Definition novas.h:1916
novas_timespec
A structure, which defines a precise instant of time that can be expressed in any of the astronomical...
Definition novas.h:1822

#include <supernovas.h>
using namespace supernovas;
// IERS Earth Orientation Parameters...
EOP eop(37, 62.56 * Unit::ms,
103.4 * Unit::mas, 396.2 * Unit::mas);
// Define ICRS coordinates
auto source = CatalogEntry("Antares",
"16h 29m 24.45970s", "−26d 25m 55.2094s")
.parallax(5.89 * Unit::mas)
.proper_motion(-12.11 * Unit::mas / Unit::yr,
-23.30 * Unit::mas / Unit::yr)
.radial_velocity(-3.4 * Unit::km / Unit::s)
.to_source();
// Observer location
auto obs = Site::from_GPS(50.7374 * Unit::deg,
7.0982 * Unit::deg, 60.0 * Unit::m)
.to_observer(eop);
// Set time of observation
Time t("2026-03-14T13:43:00.728+0200", eop,
NOVAS_TAI);
// Observer frame
auto frame = obs.frame_at(t);
// apparent coordinates in system
auto app = source.apparent_in(frame).cirs();
supernovas::CatalogEntry
Defines the astrometric parameters of a sidereal source, such as a star, a Galactic cloud,...
Definition supernovas.h:2102
supernovas::CatalogEntry::parallax
Angle parallax() const
Returns the parallax of the source.
Definition CatalogEntry.cpp:359
supernovas::EOP
IERS Earth Orientation Parameters (EOP).
Definition supernovas.h:1346
supernovas::Site::from_GPS
static Site from_GPS(double longitude, double latitude, double altitude=0.0)
Returns an observing site for its geodetic GPS location.
Definition Site.cpp:395
supernovas::Time
Precise astronomical time specification, supporting all relevant astronomical timescales (UT1,...
Definition supernovas.h:1796
supernovas::Unit::km
static constexpr double km
[m] 1 kilometer in meters
Definition supernovas.h:135
supernovas::Unit::deg
static constexpr double deg
[rad] 1 degree in radians
Definition supernovas.h:173
supernovas::Unit::mas
static constexpr double mas
[rad] 1 millisecond of arc in radians
Definition supernovas.h:176
supernovas::Unit::s
static constexpr double s
[s] 1 second (standard unit of time)
Definition supernovas.h:146
supernovas::Unit::yr
static constexpr double yr
[s] 1 tropical calendar year in seconds (at J2000)
Definition supernovas.h:160
supernovas::Unit::ms
static constexpr double ms
[s] 1 millisecond in seconds
Definition supernovas.h:145
supernovas::Unit::m
static constexpr double m
[m] 1 meter (standard unit of distance)
Definition supernovas.h:128
supernovas
Definition supernovas.h:32
supernovas.h

Copyright (C) 2026 Attila Kovács