Index: /tags/ipp-20100701/pstamp/scripts/detectability_respond.pl
===================================================================
--- /tags/ipp-20100701/pstamp/scripts/detectability_respond.pl	(revision 28652)
+++ /tags/ipp-20100701/pstamp/scripts/detectability_respond.pl	(revision 28653)
@@ -436,5 +436,5 @@
 	    ];
     }
-    elsif ($CMFversion eq 'PS1_DV2') {
+    elsif ($CMFversion eq 'PS1_DV1') {
 	$column_defs = [
 	    { name => 'PSF_QF',   type => '1E', writetype => TDOUBLE },
@@ -458,4 +458,5 @@
 
     my $correct_error = 0;
+#    print STDERR "Ncols:" .  $#{ $column_defs } . "\n";
     foreach my $col (@$column_defs) {
 	my ($col_num,$col_type,$col_data);
@@ -467,5 +468,5 @@
 	$inFits->get_coltype($col_num, $col_type, undef, undef, $status) and check_fitsio($status);
 	$inFits->read_col($col_type, $col_num, 1, 1, $numRows, 0, $col_data, undef, $status) and check_fitsio($status);
-	
+#	print STDERR "$col\t>>" . $col->{name} . "<<\t>>" . @{ $col_data } . "<<\n";
 	if ($col->{name} eq 'PSF_QF') {
 	    @tmp_Qfact = @{ $col_data };
@@ -494,4 +495,6 @@
     }
     $inFits->close_file( $status ) and check_fitsio($status);    
+#    print STDERR "$CMFversion\n";
+#    print STDERR "Q: $#tmp_Qfact\t@tmp_Qfact\nN: $#tmp_Npix\t@tmp_Npix\n";
     return(\@tmp_Npix, \@tmp_Qfact, \@tmp_flux, \@tmp_flux_err);
 }
@@ -605,6 +608,23 @@
 	my $colName = $colNames[$i];# Column name
 	my $writeType = $colWriteType[$i];
+	unless(defined($writeType)) {
+	    print "write type undefined for $colName\n";
+	}
+	unless(defined($numRows)) {
+	    print "num Rows undefined for $colName\n";
+	}
+	unless(defined($status)) {
+	    print "status undefined for $colName\n";
+	}
+	unless(defined($colData{$colName})) {
+	    print "col data undefined for $colName\n";
+	}
+	unless(defined($colName)) {
+	    print "column name undefined for $i\n";
+	}
+#	print STDERR "$writeType $i $numRows $colName $status @{ $colData{$colName} }\n";
 	$outFits->write_col( $writeType, $i + 1, 1, 1, $numRows, $colData{$colName}, $status );
 	check_fitsio( $status );
+	
     }
     $outFits->close_file( $status );
