Add observation functions for 19 planetary moons across four systems: - Galilean moons (Io, Europa, Ganymede, Callisto) via clean-room L1.2 theory - Saturn moons (Mimas through Hyperion) via TASS 1.7 - Uranus moons (Miranda through Oberon) via GUST86 - Mars moons (Phobos, Deimos) via MarsSat Add Jupiter decametric radio burst prediction for Radio JOVE operators: - io_phase_angle() — Io orbital phase from superior conjunction - jupiter_cml() — System III Central Meridian Longitude with light-time correction - jupiter_burst_probability() — Carr et al. (1983) source regions A, B, C, D L1.2 Galilean theory is a clean-room MIT implementation from the published IMCCE FORTRAN coefficients. All other ephemeris libraries are MIT-licensed extractions from Stellarium with static caching removed for PARALLEL SAFE. All 10 regression tests pass. Extension .so grows from 2.4MB to 2.5MB.
73 lines
2.6 KiB
Makefile
73 lines
2.6 KiB
Makefile
MODULE_big = pg_orbit
|
|
EXTENSION = pg_orbit
|
|
DATA = sql/pg_orbit--0.1.0.sql sql/pg_orbit--0.2.0.sql sql/pg_orbit--0.1.0--0.2.0.sql
|
|
|
|
# Our extension C sources
|
|
OBJS = src/pg_orbit.o src/tle_type.o src/eci_type.o src/observer_type.o \
|
|
src/sgp4_funcs.o src/coord_funcs.o src/pass_funcs.o src/gist_tle.o \
|
|
src/star_funcs.o src/kepler_funcs.o \
|
|
src/vsop87.o src/elp82b.o src/elliptic_to_rectangular.o \
|
|
src/precession.o src/sidereal_time.o src/planet_funcs.o \
|
|
src/tass17.o src/gust86.o src/marssat.o src/l12.o \
|
|
src/moon_funcs.o src/radio_funcs.o
|
|
|
|
# sat_code C++ sources (compiled with g++, linked with extern "C" symbols)
|
|
SAT_CODE_DIR = lib/sat_code
|
|
SAT_CODE_SRCS = $(SAT_CODE_DIR)/sgp4.cpp $(SAT_CODE_DIR)/sdp4.cpp \
|
|
$(SAT_CODE_DIR)/deep.cpp $(SAT_CODE_DIR)/common.cpp \
|
|
$(SAT_CODE_DIR)/basics.cpp $(SAT_CODE_DIR)/get_el.cpp \
|
|
$(SAT_CODE_DIR)/tle_out.cpp
|
|
SAT_CODE_OBJS = $(SAT_CODE_SRCS:.cpp=.o)
|
|
|
|
OBJS += $(SAT_CODE_OBJS)
|
|
|
|
# Regression tests
|
|
REGRESS = tle_parse sgp4_propagate coord_transforms pass_prediction gist_index convenience \
|
|
star_observe kepler_comet planet_observe moon_observe
|
|
REGRESS_OPTS = --inputdir=test
|
|
|
|
# Need C++ runtime for sat_code
|
|
SHLIB_LINK += -lstdc++ -lm
|
|
|
|
# Compiler flags
|
|
PG_CPPFLAGS = -I$(SAT_CODE_DIR)
|
|
|
|
# Use PGXS
|
|
PG_CONFIG ?= pg_config
|
|
PGXS := $(shell $(PG_CONFIG) --pgxs)
|
|
include $(PGXS)
|
|
|
|
# Rule for compiling sat_code C++ files
|
|
$(SAT_CODE_DIR)/%.o: $(SAT_CODE_DIR)/%.cpp
|
|
$(CXX) $(CXXFLAGS) -fPIC -I$(SAT_CODE_DIR) -c -o $@ $<
|
|
|
|
# ── Docker packaging ────────────────────────────────────────
|
|
REGISTRY ?= git.supported.systems/warehack.ing
|
|
IMAGE ?= pg_orbit
|
|
PG_MAJOR ?= 17
|
|
TAG ?= pg$(PG_MAJOR)
|
|
|
|
docker-build:
|
|
docker build --build-arg PG_MAJOR=$(PG_MAJOR) \
|
|
--target artifact -t $(REGISTRY)/$(IMAGE):$(TAG)-artifact .
|
|
docker build --build-arg PG_MAJOR=$(PG_MAJOR) \
|
|
--target standalone -t $(REGISTRY)/$(IMAGE):$(TAG) .
|
|
|
|
docker-push:
|
|
docker push $(REGISTRY)/$(IMAGE):$(TAG)-artifact
|
|
docker push $(REGISTRY)/$(IMAGE):$(TAG)
|
|
|
|
docker-test:
|
|
@echo "Smoke-testing standalone image..."
|
|
docker run --rm -d --name pg_orbit_test \
|
|
-e POSTGRES_PASSWORD=test $(REGISTRY)/$(IMAGE):$(TAG)
|
|
@echo "Waiting for PostgreSQL to initialize..."
|
|
@sleep 10
|
|
docker exec pg_orbit_test psql -U postgres -tAc \
|
|
"SELECT tle_norad_id(E'1 25544U 98067A 24001.50000000 .00016717 00000-0 10270-3 0 9025\n2 25544 51.6400 208.9163 0006703 30.1694 61.7520 15.50100486 00001'::tle);" \
|
|
| grep -q 25544
|
|
@docker stop pg_orbit_test
|
|
@echo "Smoke test passed."
|
|
|
|
.PHONY: docker-build docker-push docker-test
|