Index: trunk/Ohana/src/opihi/dvo/ccd.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/ccd.c	(revision 4606)
+++ trunk/Ohana/src/opihi/dvo/ccd.c	(revision 4679)
@@ -8,5 +8,5 @@
   int i, m, k, Npts, NPTS, N;
   int N1, N2, i1, i2, mode[4];
-  int Ngraph, Nsec, Nregions;
+  int Ngraph, Nsec, Nregions, KeepNulls;
 
   Catalog catalog;
@@ -33,4 +33,10 @@
   if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape;
   if (!SetPhotSelections (&argc, argv, 4)) goto usage;
+
+  KeepNulls = FALSE;
+  if (N = get_argument (argc, argv, "-nulls")) {
+    KeepNulls = TRUE;
+    remove_argument (N, &argc, argv);
+  }
 
   /* interpret command-line options */
@@ -82,5 +88,13 @@
       SetSelectionParam (2);
       M2 = ExtractDMag (&code[2], &mode[2], &catalog.average[i], &catalog.secfilt[i*Nsec], &catalog.measure[m], &N2);
-      if (N2 == 0) goto skip;
+      if (N2 == 0) {
+	if (KeepNulls) {
+	  ALLOCATE (M2, double, 1);
+	  N2 = 1;
+	  M2[0] = NO_MAG;
+	} else {
+	  goto skip;
+	}
+      }
 
       for (i1 = 0; i1 < N1; i1++) {
