Skip to content

Commit

Permalink
Extracted the table of spacecraft identifications (JPL, MPC code, COS…
Browse files Browse the repository at this point in the history
…PAR, 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.
  • Loading branch information
Bill-Gray committed Nov 6, 2023
1 parent f52a967 commit b267c47
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 51 deletions.
49 changes: 1 addition & 48 deletions add_off.c
Expand Up @@ -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
{
Expand Down Expand Up @@ -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;
Expand Down
47 changes: 47 additions & 0 deletions 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 */
8 changes: 5 additions & 3 deletions makefile
Expand Up @@ -138,14 +138,15 @@ 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
$(CP) cgi_func.h $(INSTALL_DIR)/include
$(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
Expand All @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit b267c47

Please sign in to comment.