Index: trunk/pstamp/scripts/psmkreq
===================================================================
--- trunk/pstamp/scripts/psmkreq	(revision 29305)
+++ trunk/pstamp/scripts/psmkreq	(revision 34447)
@@ -52,4 +52,11 @@
 my $comment;
 
+my $survey_name = 'null';
+my $release = 'null';
+my $stack_type = 'null';
+my $bgrestore;
+my $jpeg;
+my $nocompress;
+
 my $missing_tools;
 my $pstamp_request_file  = can_run('pstamp_request_file')  or (warn "Can't find required program pstamp_request_file"  and $missing_tools = 1);
@@ -68,5 +75,6 @@
     'width=i'           => \$width,
     'height=i'          => \$height,
-    'pixcenter'         => \$pixcenter,
+# pixcenter is deprecated
+#    'pixcenter'         => \$pixcenter,
     'arcseconds'        => \$arcseconds,
     'coord_mask=i'      => \$coord_mask,
@@ -87,9 +95,14 @@
     'comment=s'         => \$comment,
 
+    # new columns for version 2
+    'survey=s'          => \$survey_name,
+    'release=s'         => \$release,
+    'stack_type'        => \$stack_type,
+
     'option_mask=i'     => \$option_mask,
     'image'             => \$image,
     'mask'              => \$mask,
     'variance'          => \$variance,
-    'cmf'               => \$cmf,
+    'sources'           => \$cmf,
     'psf'               => \$psf,
     'backmdl'           => \$backmdl,
@@ -99,4 +112,8 @@
     'do_not_wait'       => \$no_wait,
 
+    # new options for version 2
+    'no_compress'       => \$nocompress,
+    'bgrestore'         => \$bgrestore,
+
     'verbose'           => \$verbose,
     'save-temps'        => \$save_temps,
@@ -110,7 +127,7 @@
 
 pod2usage( -msg => "Invalid job_type: $job_type", -exitval =>1 )
-        unless ($job_type eq 'stamp' or $job_type eq 'get_image');
-
-if ($job_type eq 'stamp') {
+        unless ($job_type eq 'stamp' or $job_type eq 'get_image' or $job_type eq 'listtargets');
+
+if (($job_type eq 'stamp') or ($job_type eq 'listtargets')) {
     if (defined $list) {
         pod2usage( -msg => "--ra --dec --x --y are not used with --list", -exitval =>1 )
@@ -152,6 +169,7 @@
 $id = 0 if !$id;
 
-unless ($stage eq 'raw' or $stage eq 'chip' or $stage eq 'warp' or $stage eq 'diff' or $stage eq 'stack') {
-    die "$stage is not a valid value for stage\n";
+
+unless (($job_type eq 'listtargets' and $stage eq 'exposure') or $stage eq 'raw' or $stage eq 'chip' or $stage eq 'warp' or $stage eq 'diff' or $stage eq 'stack') {
+    die "$stage is not a valid stage for $job_type jobs\n";
 }
 
@@ -207,16 +225,16 @@
 } else {
     $rows = [];
-    push @$rows, buildRow("", $comment, $x, $y, $filter, $mjd_min, $mjd_max);
+    push @$rows, buildRow("", $comment, $x, $y, $filter, $mjd_min, $mjd_max, $survey_name, $release, $stack_type);
 }
 
 my ($tdf, $table_def_name) = tempfile ("/tmp/tabledef.XXXX", UNLINK => !$save_temps);
-print $tdf "$req_name 1\n";
+print $tdf "$req_name 2\n";
 my $rownum = 0;
 foreach my $row (@$rows) {
     $rownum++;
     my $line = "$rownum $row->{ra}\t$row->{dec}\t$width $height"
-        . " $coord_mask $job_type $option_mask $project $req_type"
+        . " $coord_mask $job_type $option_mask $project $row->{survey_name} $row->{release} $req_type"
         . " $stage $id $tess_id $component $data_group"
-        . " $row->{filter} $row->{mjd_min} $row->{mjd_max}";
+        . " $row->{filter} $row->{mjd_min} $row->{mjd_max} $row->{stack_type}";
 
     if ($row->{comment} and $row->{comment} ne '') {
@@ -230,4 +248,7 @@
 }
 close $tdf;
+
+system "cat $table_def_name";
+#exit 0;
 
 {
@@ -277,6 +298,9 @@
     $row->{dec}     = checkDEC($vals[1], $linenumber);
     $row->{filter}  = checkFilter($vals[2], $filter, $linenumber);
-    $row->{mjd_min} = checkMJD($vals[3], $mjd_min, $linenumber);;
-    $row->{mjd_max} = checkMJD($vals[4], $mjd_max, $linenumber);;
+    $row->{mjd_min} = checkMJD($vals[3], $mjd_min, $linenumber);
+    $row->{mjd_max} = checkMJD($vals[4], $mjd_max, $linenumber);
+    $row->{survey_name}  = $vals[5];
+    $row->{release} = $vals[6];
+    $row->{stack_type} = $vals[7];
     $row->{comment} = $comment;
 
