From b267c475ed8754150be76a1289924754326608c7 Mon Sep 17 00:00:00 2001 From: Bill-Gray Date: Mon, 6 Nov 2023 12:24:10 -0500 Subject: [PATCH] Extracted the table of spacecraft identifications (JPL, MPC code, COSPAR, NORAD, common name) into 'jpl_xrefs.h'. This table had been duplicated in two places (see the 'miscell' repository) and may be extended to a fourth soon. Also, some dependencies for installation in the makefile were not properly handled. --- add_off.c | 49 +------------------------------------------------ jpl_xref.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ makefile | 8 +++++--- 3 files changed, 53 insertions(+), 51 deletions(-) create mode 100644 jpl_xref.h diff --git a/add_off.c b/add_off.c index 7d1bbb1..edb7ca7 100644 --- a/add_off.c +++ b/add_off.c @@ -29,6 +29,7 @@ has worked well thus far, but the above URL could come in handy. */ #include "afuncs.h" #include "mpc_func.h" #include "stringex.h" +#include "jpl_xref.h" typedef struct { @@ -59,54 +60,6 @@ static double get_sat_obs_jd( const char *buff) return( jd); } -/* The following conversion table is going to need occasional fixes. -Cas = Cassini, SoO = Solar Orbiter, etc. are _not_ official MPC codes. -The table is also used in 'jpl2mpc.cpp' and 'jpl2sof.c' in the 'miscell' -repository. It therefore contains objects and data not needed for -add_off.c (i.e., spacecraft that will never produce astrometry). Changes -made to the table in one file should be mirrored in the others. */ - -typedef struct -{ - const char mpc_code[4]; - int jpl_desig, norad_number; - const char *intl_desig, *name; -} jpl_xref_t; - -/* MPC code JPL# NORAD# Intl desig Common name */ -static const jpl_xref_t jpl_xrefs[] = { - { "249", -21, 23726, "1995-065A", "SOHO" }, - { "Jui", -28, 56176, "2023-053A", "JUICE" }, - { "Ha2", -37, 40319, "2014-076A", "Hayabusa 2" }, - { "250", -48, 20580, "1990-037B", "Hubble Space Telescope" }, - { "Luc", -49, 49328, "2021-093A", "Lucy" }, - { "OsR", -64, 41757, "2016-055A", "OSIRIS-REx" }, - { "Cas", -82, 25008, "1997-061A", "Cassini" }, - { "245", -79, 27871, "2003-038A", "Spitzer Space Telescope" }, - { "C57", -95, 43435, "2018-038A", "TESS" }, - { "PSP", -96, 43592, "2018-065A", "Parker Solar Probe" }, - { "C54", -98, 28928, "2006-001A", "New Horizons" }, - { "Equ", -101, 79970, "2022-156ZZZ", "EQUULEUS" }, - { "SoO", -144, 45167, "2020-010A", "Solar Orbiter" }, - { "Cha", -151, 25867, "1999-040B", "Chandra X-ray Observatory" }, - { "Cdr", -158, 57320, "2023-098A", "Chandrayaan-3" }, - { "C51", -163, 36119, "2009-071A", "WISE" }, - { "LFL", -164, 54697, "2022-168B", "Lunar Flashlight" }, - { "274", -170, 50463, "2021-130A", "James Webb Space Telescope" }, - { "C55", -227, 34380, "2009-011A", "Kepler" }, - { "C49", -234, 29510, "2006-047A", "STEREO-A" }, - { "C50", -235, 29511, "2006-047B", "STEREO-B" }, - { "Sli", -240, 57803, "2023-137D", "SLIM" }, - { "Psy", -255, 58049, "2023-157A", "Psyche" }, - { "Euc", -680, 57217, "2023-092A", "Euclid" }, - { "C52", -128485, 28485, "2004-047A", "Swift" }, - { "C53", -139089, 39089, "2013-009D", "NEOSSat" }, - { "258", -139479, 39479, "2013-074A", "Gaia" }, - { "C56", -141043, 41043, "2015-070A", "LISA Pathfinder" }, - { "C59", -148840, 48841, "2021-050B", "Yangwang 1" }, - { "Tia", -9901491, 45935, "2020-049A", "Tianwen-1" } }; -/* MPC code JPL# NORAD# Intl desig Common name */ - static int get_horizons_idx( const char *mpc_code) { size_t i; diff --git a/jpl_xref.h b/jpl_xref.h new file mode 100644 index 0000000..5fe886e --- /dev/null +++ b/jpl_xref.h @@ -0,0 +1,47 @@ +/* The following table is going to need occasional fixes, mostly +as new spacecraft are launched. Cas = Cassini, SoO = Solar Orbiter, +etc. are _not_ official MPC codes; if they ever get them, that +will also cause updates to be made. The list does not reflect +every spacecraft listed on Horizons; it lists those that have +either gotten astrometry or for which I compute TLEs. */ + +typedef struct +{ + const char mpc_code[4]; + int jpl_desig, norad_number; + const char *intl_desig, *name; +} jpl_xref_t; + +/* MPC code JPL# NORAD# Intl desig Common name */ +static const jpl_xref_t jpl_xrefs[] = { + { "249", -21, 23726, "1995-065A", "SOHO" }, + { "Jui", -28, 56176, "2023-053A", "JUICE" }, + { "Ha2", -37, 40319, "2014-076A", "Hayabusa 2" }, + { "250", -48, 20580, "1990-037B", "Hubble Space Telescope" }, + { "Luc", -49, 49328, "2021-093A", "Lucy" }, + { "OsR", -64, 41757, "2016-055A", "OSIRIS-REx" }, + { "Cas", -82, 25008, "1997-061A", "Cassini" }, + { "245", -79, 27871, "2003-038A", "Spitzer Space Telescope" }, + { "C57", -95, 43435, "2018-038A", "TESS" }, + { "PSP", -96, 43592, "2018-065A", "Parker Solar Probe" }, + { "C54", -98, 28928, "2006-001A", "New Horizons" }, + { "Equ", -101, 79970, "2022-156ZZZ", "EQUULEUS" }, + { "SoO", -144, 45167, "2020-010A", "Solar Orbiter" }, + { "Cha", -151, 25867, "1999-040B", "Chandra X-ray Observatory" }, + { "Cdr", -158, 57320, "2023-098A", "Chandrayaan-3" }, + { "C51", -163, 36119, "2009-071A", "WISE" }, + { "LFL", -164, 54697, "2022-168B", "Lunar Flashlight" }, + { "274", -170, 50463, "2021-130A", "James Webb Space Telescope" }, + { "C55", -227, 34380, "2009-011A", "Kepler" }, + { "C49", -234, 29510, "2006-047A", "STEREO-A" }, + { "C50", -235, 29511, "2006-047B", "STEREO-B" }, + { "Sli", -240, 57803, "2023-137D", "SLIM" }, + { "Psy", -255, 58049, "2023-157A", "Psyche" }, + { "Euc", -680, 57217, "2023-092A", "Euclid" }, + { "C52", -128485, 28485, "2004-047A", "Swift" }, + { "C53", -139089, 39089, "2013-009D", "NEOSSat" }, + { "258", -139479, 39479, "2013-074A", "Gaia" }, + { "C56", -141043, 41043, "2015-070A", "LISA Pathfinder" }, + { "C59", -148840, 48841, "2021-050B", "Yangwang 1" }, + { "Tia", -9901491, 45935, "2020-049A", "Tianwen-1" } }; +/* MPC code JPL# NORAD# Intl desig Common name */ diff --git a/makefile b/makefile index 2870b8f..141e659 100644 --- a/makefile +++ b/makefile @@ -138,7 +138,7 @@ all: add_off$(EXE) adestest$(EXE) astcheck$(EXE) astephem$(EXE) \ tables$(EXE) test_des$(EXE) test_ref$(EXE) testprec$(EXE) \ themis$(EXE) them_cat$(EXE) uranus1$(EXE) utc_test$(EXE) -install: +install: $(LIBLUNAR) $(MKDIR) $(INSTALL_DIR)/include $(CP) afuncs.h $(INSTALL_DIR)/include $(CP) brentmin.h $(INSTALL_DIR)/include @@ -146,6 +146,7 @@ install: $(CP) comets.h $(INSTALL_DIR)/include $(CP) date.h $(INSTALL_DIR)/include $(CP) get_bin.h $(INSTALL_DIR)/include + $(CP) jpl_xref.h $(INSTALL_DIR)/include $(CP) lunar.h $(INSTALL_DIR)/include $(CP) mpc_func.h $(INSTALL_DIR)/include $(CP) showelem.h $(INSTALL_DIR)/include @@ -156,10 +157,10 @@ install: $(CP) $(LIBLUNAR) $(LIB_DIR) $(MKDIR) $(INSTALL_DIR)/bin -install_astcheck: +install_astcheck: astcheck$(EXE) $(CP) astcheck$(EXE) $(INSTALL_DIR)/bin -install_integrat: +install_integrat: integrat $(CP) integrat $(INSTALL_DIR)/bin uninstall: @@ -168,6 +169,7 @@ uninstall: rm -f $(INSTALL_DIR)/include/comets.h rm -f $(INSTALL_DIR)/include/date.h rm -f $(INSTALL_DIR)/include/get_bin.h + rm -f $(INSTALL_DIR)/include/jpl_xref.h rm -f $(INSTALL_DIR)/include/lunar.h rm -f $(INSTALL_DIR)/include/mpc_func.h rm -f $(INSTALL_DIR)/include/showelem.h