Index: /trunk/psastro/src/psastro.h
===================================================================
--- /trunk/psastro/src/psastro.h	(revision 13831)
+++ /trunk/psastro/src/psastro.h	(revision 13832)
@@ -30,5 +30,5 @@
 bool              psastroConvertReadout (pmReadout *readout, psMetadata *recipe);
 psArray          *pmSourceToAstromObj (psArray *sources);
-bool              psastroAstromGuess (pmConfig *config);
+bool              psastroAstromGuess (int *nStars, pmConfig *config);
 
 psPlaneDistort   *psPlaneDistortIdentity ();
Index: /trunk/psastro/src/psastroAnalysis.c
===================================================================
--- /trunk/psastro/src/psastroAnalysis.c	(revision 13831)
+++ /trunk/psastro/src/psastroAnalysis.c	(revision 13832)
@@ -3,9 +3,15 @@
 bool psastroAnalysis (pmConfig *config) {
 
+    int nStars;
+
     // interpret the available initial astrometric information
     // apply the initial guess
-    if (!psastroAstromGuess (config)) {
+    if (!psastroAstromGuess (&nStars, config)) {
 	psError (PSASTRO_ERR_UNKNOWN, false, "failed to determine initial astrometry guess\n");
 	return false;
+    }
+    if (nStars == 0) {
+	psLogMsg ("psastro", 2, "skipping astrometry analysis : no stars\n");
+	return true;
     }
 
Index: /trunk/psastro/src/psastroAstromGuess.c
===================================================================
--- /trunk/psastro/src/psastroAstromGuess.c	(revision 13831)
+++ /trunk/psastro/src/psastroAstromGuess.c	(revision 13832)
@@ -7,5 +7,5 @@
 // headers corresponding to the chips.
 
-bool psastroAstromGuess (pmConfig *config) {
+bool psastroAstromGuess (int *nStars, pmConfig *config) {
 
     bool newFPA = true;
@@ -22,4 +22,6 @@
     pmCell *cell = NULL;
     pmReadout *readout = NULL;
+
+    *nStars = 0;
 
     // select the current recipe
@@ -92,4 +94,5 @@
                 if (rawstars == NULL) { continue; }
 
+		*nStars += rawstars->n;
                 for (int i = 0; i < rawstars->n; i++) {
                     pmAstromObj *raw = rawstars->data[i];
@@ -122,12 +125,19 @@
     }
 
+    // how many total sources are available to us?
+    psMetadataAddS32 (recipe, PS_LIST_TAIL, "NTOTSTAR",  PS_META_REPLACE, "", *nStars);
+    if (*nStars == 0) {
+	psLogMsg ("psastro", 2, "no sources available for astrometry\n");
+	return true;
+    }
+
     psLogMsg ("psastro", 2, "loaded raw data from %f,%f to %f,%f\n", 
 	      DEG_RAD*RAmin, DEG_RAD*DECmin, 
 	      DEG_RAD*RAmax, DEG_RAD*DECmax);
 
-    psMetadataAdd (recipe, PS_LIST_TAIL, "RA_MIN",  PS_DATA_F32 | PS_META_REPLACE, "", RAmin);
-    psMetadataAdd (recipe, PS_LIST_TAIL, "RA_MAX",  PS_DATA_F32 | PS_META_REPLACE, "", RAmax);
-    psMetadataAdd (recipe, PS_LIST_TAIL, "DEC_MIN", PS_DATA_F32 | PS_META_REPLACE, "", DECmin);
-    psMetadataAdd (recipe, PS_LIST_TAIL, "DEC_MAX", PS_DATA_F32 | PS_META_REPLACE, "", DECmax);
+    psMetadataAddF32 (recipe, PS_LIST_TAIL, "RA_MIN",  PS_META_REPLACE, "", RAmin);
+    psMetadataAddF32 (recipe, PS_LIST_TAIL, "RA_MAX",  PS_META_REPLACE, "", RAmax);
+    psMetadataAddF32 (recipe, PS_LIST_TAIL, "DEC_MIN", PS_META_REPLACE, "", DECmin);
+    psMetadataAddF32 (recipe, PS_LIST_TAIL, "DEC_MAX", PS_META_REPLACE, "", DECmax);
 
     psFree (view);
