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

astropy | supernovas++
--- | ---

from astropy import units as u
from astropy.coordinates import SkyCoord,
EarthLocation, Longitude, Latitude,
CIRS
# Define ICRS coordinates
source = SkyCoord(
'16h 29m 24.45970s', '−26d 25m 55.2094s',
d = u.AU / 5.89 * u.mas,
pmra = -12.11 * u.mas / u.yr,
pmdec = -23.30 * u.mas / u.yr,
rv = -3.4 * u.km / u.s)
# Observer location
loc = EarthLocation.from_geodetic(
Longitude(50.7374),
Latitude(7.0982),
height=60.0)
# Set time of observation
time = astropy.time.Time(
"2025-02-27T19:57:00.728+0200"
scale='tai')
# Observer frame & system
frame = CIRS(obstime=time, location=loc)
# apparent coordinates
app = source.transform_to(frame);

#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
NOVAS_TAI
@ NOVAS_TAI
International Atomic Time (TAI).
Definition novas.h:1796
supernovas
Definition supernovas.h:32
supernovas.h

Copyright (C) 2026 Attila Kovács