Index: trunk/psastro/src/psastroAnalysis.c
===================================================================
--- trunk/psastro/src/psastroAnalysis.c	(revision 23412)
+++ trunk/psastro/src/psastroAnalysis.c	(revision 23688)
@@ -1,5 +1,5 @@
 /** @file psastroAnalysis.c
  *
- *  @brief 
+ *  @brief
  *
  *  @ingroup libpsastro
@@ -13,5 +13,21 @@
 # include "psastroInternal.h"
 
-bool psastroAnalysis (pmConfig *config) {
+/// Turn save on/off for a file
+static void fileSave(pmConfig *config,  // Configuration
+                     const char *name,  // Name of file
+                     bool save          // Save file?
+    )
+{
+    pmFPAfile *file = pmFPAfileSelectSingle(config->files, name, 0); // File of interest
+    if (!file) {
+        psErrorClear();
+        return;
+    }
+    file->save = save;
+    return;
+}
+
+
+bool psastroAnalysis (pmConfig *config, psMetadata *stats) {
 
     bool status;
@@ -40,6 +56,15 @@
     }
     if (nStars == 0) {
-        psLogMsg ("psastro", 2, "skipping astrometry analysis : no stars\n");
-        return false;
+        // This is likely a data quality issue
+        psWarning("No stars for astrometry analysis --- suspect bad data quality");
+        if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) {
+            psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE,
+                             "No stars for astrometry", PSASTRO_ERR_DATA);
+        }
+        fileSave(config, "PSASTRO.OUTPUT", false);
+        fileSave(config, "PSASTRO.OUTPUT.MASK", false);
+        fileSave(config, "PSASTRO.OUT.REFSTARS", false);
+        psErrorClear();
+        return true;
     }
 
