From 49410e6fa88647fe9b9f21145e2af5b5b801760a Mon Sep 17 00:00:00 2001
From: Matthew Pitkin <matthew.pitkin@ligo.org>
Date: Wed, 19 Mar 2025 21:49:37 +0000
Subject: [PATCH 1/5] ReadPulsarParFile.c: correct doc string for BETA and
 LAMBDA

---
 lalpulsar/lib/ReadPulsarParFile.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lalpulsar/lib/ReadPulsarParFile.c b/lalpulsar/lib/ReadPulsarParFile.c
index ca5f5a94e0..32007d104d 100644
--- a/lalpulsar/lib/ReadPulsarParFile.c
+++ b/lalpulsar/lib/ReadPulsarParFile.c
@@ -996,10 +996,10 @@ ParConversion pc[NUM_PARS] = {
   { .name = "ELAT", .convfunc = ParConvDegsToRads, .converrfunc = ParConvDegsToRads, .ptype = PULSARTYPE_REAL8_t }, /* ecliptic latitude (converted from degs to rads) */
   { .name = "PMELONG", .convfunc = ParConvMasPerYrToRadPerSec, .converrfunc = ParConvMasPerYrToRadPerSec, .ptype = PULSARTYPE_REAL8_t }, /* proper motion in ecliptic longitude (converted to radians/s) */
   { .name = "PMELAT", .convfunc = ParConvMasPerYrToRadPerSec, .converrfunc = ParConvMasPerYrToRadPerSec, .ptype = PULSARTYPE_REAL8_t }, /* proper motion in ecliptic latitude (converted to radians/s) */
-  { .name = "BETA", .convfunc = ParConvDegsToRads, .converrfunc = ParConvDegsToRads, .ptype = PULSARTYPE_REAL8_t }, /* galactic latitude (converted from degs to rads) */
-  { .name = "LAMBDA", .convfunc = ParConvDegsToRads, .converrfunc = ParConvDegsToRads, .ptype = PULSARTYPE_REAL8_t }, /* galactic longitude (converted from degs to rads) */
-  { .name = "PMBETA", .convfunc = ParConvMasPerYrToRadPerSec, .converrfunc = ParConvMasPerYrToRadPerSec, .ptype = PULSARTYPE_REAL8_t }, /* proper motion in galactic latitude (converted to radians/s) */
-  { .name = "PMLAMBDA", .convfunc = ParConvMasPerYrToRadPerSec, .converrfunc = ParConvMasPerYrToRadPerSec, .ptype = PULSARTYPE_REAL8_t }, /* proper motion in galactic longitude (converted to radians/s) */
+  { .name = "BETA", .convfunc = ParConvDegsToRads, .converrfunc = ParConvDegsToRads, .ptype = PULSARTYPE_REAL8_t }, /* an alias for ELONG also giving ecliptic latitude (converted from degs to rads) */
+  { .name = "LAMBDA", .convfunc = ParConvDegsToRads, .converrfunc = ParConvDegsToRads, .ptype = PULSARTYPE_REAL8_t }, /* an alias for ELAT also giving ecliptic longitude (converted from degs to rads) */
+  { .name = "PMBETA", .convfunc = ParConvMasPerYrToRadPerSec, .converrfunc = ParConvMasPerYrToRadPerSec, .ptype = PULSARTYPE_REAL8_t }, /* proper motion in ecliptic latitude (converted to radians/s) */
+  { .name = "PMLAMBDA", .convfunc = ParConvMasPerYrToRadPerSec, .converrfunc = ParConvMasPerYrToRadPerSec, .ptype = PULSARTYPE_REAL8_t }, /* proper motion in ecliptic longitude (converted to radians/s) */
 
   /* epoch parameters */
   { .name = "PEPOCH", .convfunc = ParConvMJDToGPS, .converrfunc = ParConvDaysToSecs, .ptype = PULSARTYPE_REAL8_t }, /* period epoch (saved as GPS time) */
-- 
GitLab


From 9f440d4530855b655537888b2a0def2912d77cc2 Mon Sep 17 00:00:00 2001
From: Matthew Pitkin <matthew.pitkin@ligo.org>
Date: Wed, 19 Mar 2025 21:56:30 +0000
Subject: [PATCH 2/5] ReadPulsarParFile.c: add ability to read T2CMETHOD and
 TIMEEPH from par file

---
 lalpulsar/lib/ReadPulsarParFile.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lalpulsar/lib/ReadPulsarParFile.c b/lalpulsar/lib/ReadPulsarParFile.c
index 32007d104d..04d6fb95e4 100644
--- a/lalpulsar/lib/ReadPulsarParFile.c
+++ b/lalpulsar/lib/ReadPulsarParFile.c
@@ -968,7 +968,7 @@ typedef struct tagParConversion {
 } ParConversion;
 
 
-#define NUM_PARS 130 /* number of allowed parameters */
+#define NUM_PARS 132 /* number of allowed parameters */
 
 /** Initialise conversion structure with most allowed TEMPO2 parameter names and conversion functions
  * (convert all read in parameters to SI units where necessary). See http://arxiv.org/abs/astro-ph/0603381 and
@@ -1082,6 +1082,8 @@ ParConversion pc[NUM_PARS] = {
   { .name = "NTOA", .convfunc = ParConvToInt, .converrfunc = NULL, .ptype = PULSARTYPE_UINT4_t }, /* number of TOAs in observation */
   { .name = "TRES", .convfunc = ParConvMicrosecToSec, .converrfunc = NULL, .ptype = PULSARTYPE_REAL8_t }, /* timing residual (convert microseconds to seconds) */
   { .name = "CLK", .convfunc = ParConvToString, .converrfunc = NULL, .ptype = PULSARTYPE_string_t }, /* The observatory clock */
+  { .name = "T2CMETHOD", .convfunc = ParConvToString, .converrfunc = NULL, .ptype = PULSARTYPE_string_t }, /* Method for transforming from terrestrial to celestial frame */
+  { .name = "TIMEEPH", .convfunc = ParConvToString, .converrfunc = NULL, .ptype = PULSARTYPE_string_t }, /* Which time ephemeris to use */
 
   /* GW parameters */
   { .name = "H0", .convfunc = ParConvToFloat, .converrfunc = ParConvToFloat, .ptype = PULSARTYPE_REAL8_t }, /* gravitational wave amplitude */
-- 
GitLab


From 4530b7b6e656de3d1ea78125a81487322f51988c Mon Sep 17 00:00:00 2001
From: Matthew Pitkin <matthew.pitkin@ligo.org>
Date: Thu, 20 Mar 2025 20:10:18 +0000
Subject: [PATCH 3/5] ReadTEMPOFileTest.c: add some more test cases

---
 lalpulsar/test/ReadTEMPOFileTest.c | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/lalpulsar/test/ReadTEMPOFileTest.c b/lalpulsar/test/ReadTEMPOFileTest.c
index a6be730fae..fec6e8cbbc 100644
--- a/lalpulsar/test/ReadTEMPOFileTest.c
+++ b/lalpulsar/test/ReadTEMPOFileTest.c
@@ -24,7 +24,7 @@ typedef struct tagParamData {
   const CHAR *fitFlag; /* add a TEMPO-style fitting flag to some parameters */
 } ParamData;
 
-#define NUMPARS 89
+#define NUMPARS 103
 
 /* setup a collection of allowed .par file parameters */
 ParamData p[NUMPARS] = {
@@ -49,12 +49,20 @@ ParamData p[NUMPARS] = {
   /* position parameters */
   { "RAJ",      "12:34:56.7",   "3.29407",          "1.23",         "8.94481e-05",  "1" },
   { "ra",       "12:34:56.7",   "3.29407",          "1.23",         "8.94481e-05",  " " }, /* use lower case input name*/
+  { "ELONG",    "188.73630842", "3.29407",          "1.0",          "0.01745",      " " },
+  { "LAMBDA",   "188.73630842", "3.29407",          "1.0",          "0.01745",      " " },
   { "DECJ",     "-12:34:56.7",  "-0.21960",         "1.23",         "5.96321e-06",  " " },
   { "DEC",      "-12:34:56.7",  "-0.21960",         "1.23",         "5.96321e-06",  " " },
-  { "POSEPOCH", "54321.0",      "870652748.81600",  NULL,           NULL,  " " },
+  { "ELAT",     "-12.58215318", "-0.21960",         "1.0",          "0.01745",      " " },
+  { "BETA",     "-12.58215318", "-0.21960",         "1.0",          "0.01745",      " " },
+  { "POSEPOCH", "54321.0",      "870652748.81600",  NULL,           NULL,           " " },
   { "PMRA",     "12.345",       "1.89654e-15",      "1.23",         "1.88963e-16",  " " },
-  { "EPHEM",    "DE405",        "DE405",            NULL,           NULL,  " " },
+  { "PMELONG",  "12.345",       "1.89654e-15",      "1.23",         "1.88963e-16",  " " },
+  { "PMLAMBDA", "12.345",       "1.89654e-15",      "1.23",         "1.88963e-16",  " " },
+  { "EPHEM",    "DE405",        "DE405",            NULL,           NULL,           " " },
   { "PMDEC",    "-12.345",      "-1.89654e-15",     "1.23",         "1.88963e-16",  "1" },
+  { "PMELAT",   "-12.345",      "-1.89654e-15",     "1.23",         "1.88963e-16",  "1" },
+  { "PMBETA",   "-12.345",      "-1.89654e-15",     "1.23",         "1.88963e-16",  "1" },
   { "DIST",     "123.00000",    "3.79538e+21",      "12.30000",     "3.79538e+20",  " " },
   /* glitch parameters */
   { "GLEP_1",   "54321.0",      "870652748.81600",  "0.00123",      "106.27200",    " " },
@@ -124,9 +132,16 @@ ParamData p[NUMPARS] = {
   { "PHI0SCALAR",   "2.10230",      "2.10230",          "0.11",         "0.11000",      " " },
   { "PHI0SCALAR_F", "0.476",        "0.47600",          "0.12",         "0.12000",      " " },
   /* transient signal parameters */
-  { "TRANSIENTWINDOWTYPE", "RECT",  "RECT",             NULL,           NULL,           " " },
-  { "TRANSIENTSTARTTIME", "54321.0", "870652748.81600", NULL,           NULL,           " " },
-  { "TRANSIENTTAU", "1.23",         "106272.00000",     NULL,           NULL,           " " },
+  { "TRANSIENTWINDOWTYPE", "RECT",    "RECT",            NULL, NULL, " " },
+  { "TRANSIENTSTARTTIME",  "54321.0", "870652748.81600", NULL, NULL, " " },
+  { "TRANSIENTTAU",        "1.23",    "106272.00000",    NULL, NULL, " " },
+  /* TEMPO parameters */
+  { "UNITS",     "TDB",     "TDB",     NULL, NULL, " " },
+  { "EPHEM",     "DE405",   "DE405",   NULL, NULL, " " },
+  { "T2CMETHOD", "TEMPO",   "TEMPO",   NULL, NULL, " " },
+  { "TIMEEPH",   "FB90",    "FB90",    NULL, NULL, " " },
+  { "CLK",       "TT(TAI)", "TT(TAI)", NULL, NULL, " " },
+  { "NRES",      "532.1",   "0.00053", NULL, NULL, " " },
 };
 
 
-- 
GitLab


From 7012a5c53692fd0800eebd575eed68d593ccccdf Mon Sep 17 00:00:00 2001
From: Matthew Pitkin <matthew.pitkin@ligo.org>
Date: Thu, 20 Mar 2025 21:24:19 +0000
Subject: [PATCH 4/5] Switch NRES -> TRES

---
 lalpulsar/test/ReadTEMPOFileTest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lalpulsar/test/ReadTEMPOFileTest.c b/lalpulsar/test/ReadTEMPOFileTest.c
index fec6e8cbbc..d4cee7d3bf 100644
--- a/lalpulsar/test/ReadTEMPOFileTest.c
+++ b/lalpulsar/test/ReadTEMPOFileTest.c
@@ -141,7 +141,7 @@ ParamData p[NUMPARS] = {
   { "T2CMETHOD", "TEMPO",   "TEMPO",   NULL, NULL, " " },
   { "TIMEEPH",   "FB90",    "FB90",    NULL, NULL, " " },
   { "CLK",       "TT(TAI)", "TT(TAI)", NULL, NULL, " " },
-  { "NRES",      "532.1",   "0.00053", NULL, NULL, " " },
+  { "TRES",      "532.1",   "0.00053", NULL, NULL, " " },
 };
 
 
-- 
GitLab


From 8ee45073dc4b4de2689456f95205f448b48b21a6 Mon Sep 17 00:00:00 2001
From: Matthew Pitkin <matthew.pitkin@ligo.org>
Date: Sat, 22 Mar 2025 15:38:40 +0000
Subject: [PATCH 5/5] Remove duplicate EPHEM

---
 lalpulsar/test/ReadTEMPOFileTest.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lalpulsar/test/ReadTEMPOFileTest.c b/lalpulsar/test/ReadTEMPOFileTest.c
index d4cee7d3bf..5983d52783 100644
--- a/lalpulsar/test/ReadTEMPOFileTest.c
+++ b/lalpulsar/test/ReadTEMPOFileTest.c
@@ -24,7 +24,7 @@ typedef struct tagParamData {
   const CHAR *fitFlag; /* add a TEMPO-style fitting flag to some parameters */
 } ParamData;
 
-#define NUMPARS 103
+#define NUMPARS 102
 
 /* setup a collection of allowed .par file parameters */
 ParamData p[NUMPARS] = {
@@ -137,7 +137,6 @@ ParamData p[NUMPARS] = {
   { "TRANSIENTTAU",        "1.23",    "106272.00000",    NULL, NULL, " " },
   /* TEMPO parameters */
   { "UNITS",     "TDB",     "TDB",     NULL, NULL, " " },
-  { "EPHEM",     "DE405",   "DE405",   NULL, NULL, " " },
   { "T2CMETHOD", "TEMPO",   "TEMPO",   NULL, NULL, " " },
   { "TIMEEPH",   "FB90",    "FB90",    NULL, NULL, " " },
   { "CLK",       "TT(TAI)", "TT(TAI)", NULL, NULL, " " },
-- 
GitLab