Index: /branches/eam_branches/ipp-20230313/ippconfig/recipes/psastro.config
===================================================================
--- /branches/eam_branches/ipp-20230313/ippconfig/recipes/psastro.config	(revision 42626)
+++ /branches/eam_branches/ipp-20230313/ippconfig/recipes/psastro.config	(revision 42627)
@@ -256,4 +256,5 @@
 DVO.GETSTAR.MIN.MAG           F32      12.0
 DVO.GETSTAR.MIN.MAG.INST      F32     -15.0
+DVO.GETSTAR.PM.APPLY	      BOOL    FALSE
 
 # if non-zero use as the zero point for computing magnitude limits for getstar
Index: /branches/eam_branches/ipp-20230313/psastro/src/psastroDefineFiles.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psastro/src/psastroDefineFiles.c	(revision 42626)
+++ /branches/eam_branches/ipp-20230313/psastro/src/psastroDefineFiles.c	(revision 42627)
@@ -61,5 +61,7 @@
 	    return false;
 	}
-	psTime *endtime = psTimeFromString (KHendDate, PS_TIME_TAI);
+	// psTime *endtime = psTimeFromString (KHendDate, PS_TIME_TAI);
+	// 'endtime' and 'time' must be in the same units 
+	psTime *endtime = psTimeFromString (KHendDate, time->type);
 	if (!endtime) {
 	    psError (PM_ERR_CONFIG, false, "KH.CORRECT.APPLY requested, KH.CORRECT.ENDDATE has an invalid date/time");
Index: /branches/eam_branches/ipp-20230313/psastro/src/psastroLoadRefstars.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psastro/src/psastroLoadRefstars.c	(revision 42626)
+++ /branches/eam_branches/ipp-20230313/psastro/src/psastroLoadRefstars.c	(revision 42627)
@@ -139,4 +139,19 @@
     psStringAppend (&getstarCommand, " -region %f %f %f %f -o %s", RAmin, DECmin, RAmax, DECmax, tempFile);
     psTrace ("psastro", 3, "%s\n", getstarCommand);
+
+    // add the MJD for the exposure EPOCH
+    bool ProperMotionApply = psMetadataLookupF32 (&status, recipe, "DVO.GETSTAR.PM.APPLY");
+    if (ProperMotionApply) {
+      pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, source); // we've already done this before
+      myAssert (input, "oops");
+
+      psTime *time = psMetadataLookupPtr(NULL, input->fpa->concepts, "FPA.TIME");
+      if (time->sec == 0 && time->nsec == 0) {
+	psError (PM_ERR_CONFIG, false, "Exposure EPOCH proper motion correction requested, but date/time of exposure not found");
+	return false;
+      }
+      psF64 EpochMJD = psTimeToMJD(time);
+      psStringAppend (&getstarCommand, " -epoch-mjd %lf", EpochMJD);
+    }
 
     psLogMsg("psastro", PS_LOG_INFO, "getstar command: %s", getstarCommand);
