Index: trunk/tools/czartool/Plotter.pm
===================================================================
--- trunk/tools/czartool/Plotter.pm	(revision 29764)
+++ trunk/tools/czartool/Plotter.pm	(revision 29771)
@@ -599,4 +599,10 @@
     my ($self, $begin, $end) = @_;
 
+    # get exposures between these dates
+    my $exp_ids = undef;
+    if (!$self->{_gpc1Db}->getProcessedExposures($begin, $end, \$exp_ids)) {return 0;}
+    my $totalExp = @{$exp_ids};
+    if ($totalExp < 1) {return 0;}
+
     # set up file stuff
     my $prefix = $self->{_outputPath} ? $self->{_outputPath} : "."; # TODO should be function for this
@@ -604,8 +610,4 @@
     my $distOutputFile = "$prefix/czarplot_magic_mask_fraction_d.png";
     my $tmpFile = File::Temp->new( TEMPLATE => "czarplot_magic_mask_fraction.XXXXX", DIR => '/tmp', SUFFIX => 'dat');
-
-    my $exp_ids = undef;
-    if (!$self->{_gpc1Db}->getProcessedExposures($begin, $end, \$exp_ids)) {return 0;}
-
 
     # set up bins
@@ -628,5 +630,5 @@
         $mask = $self->{_gpc1Db}->getAverageMagicMaskFraction(@{$row}[0]);
 
-        if (!$mask) {print "can't get value for @{$row}[0]\n";next;}
+        if (!$mask) {next;}
         $expCount++;
 
@@ -641,5 +643,4 @@
 
     # write data to GNUPLOT data file
-    my $totalExp = @{$exp_ids};
     print "* Found mask values for $expCount exposures out of $totalExp\n";
     open (GNUDAT, ">".$tmpFile->filename);
@@ -665,5 +666,5 @@
     print GP
         "set term $self->{_outputFormat};" .
-        "set title \"Magic mask fraction for $expCount (of $totalExp) exposures between '$begin' and '$end'\";" .
+        "set title \"Magic mask fraction for $expCount exposures between '$begin' and '$end'\";" .
         "set grid;" .
         "set boxwidth;" .
