Changeset 35353
- Timestamp:
- Apr 3, 2013, 4:01:29 PM (13 years ago)
- Location:
- trunk/pstamp/scripts
- Files:
-
- 2 edited
-
psmkreq (modified) (13 diffs)
-
pstamp_request_file (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/psmkreq
r34611 r35353 28 28 my ($ra, $dec, $x, $y, $list, $output, $req_name, $req_name_base); 29 29 30 my ($image, $mask, $variance, $cmf, $psf, $backmdl, $inverse); 31 my ($unconvolved, $use_imfile_id, $no_wait); 30 my ($image, $mask, $variance, $jpeg, $cmf, $psf, $backmdl, $inverse); 31 my ($convolved, $unconvolved, $uncompressed, $use_imfile_id, $no_wait); 32 33 # new header keywords for version 2 34 my $action = 'PROCESS'; 35 my $email = 'null'; 32 36 33 37 my $default_size = 100; … … 52 56 my $comment; 53 57 58 # new request specification columns for version 2 59 my $survey_name ='null'; 60 my $release_name = 'null'; 61 my $run_type ='null'; 62 my $fwhm_min = 0; 63 my $fwhm_max = 0; 64 65 54 66 my $missing_tools; 55 67 my $pstamp_request_file = can_run('pstamp_request_file') or (warn "Can't find required program pstamp_request_file" and $missing_tools = 1); … … 62 74 GetOptions( 63 75 'list=s' => \$list, # list of coordinates if undef ra and dec or x and y are required 64 'ra=s' => \$ra, #76 'ra=s' => \$ra, 65 77 'dec=s' => \$dec, 66 78 'x=s' => \$x, … … 87 99 'comment=s' => \$comment, 88 100 101 'survey=s' => \$survey_name, 102 'release=s' => \$release_name, 103 'run_type=s' => \$run_type, 104 'fwhm_min=s' => \$fwhm_min, 105 'fwhm_max=s' => \$fwhm_max, 106 89 107 'option_mask=i' => \$option_mask, 90 108 'image' => \$image, 91 109 'mask' => \$mask, 110 'jpeg' => \$jpeg, 92 111 'variance' => \$variance, 93 112 'cmf' => \$cmf, … … 96 115 'inverse' => \$inverse, 97 116 'unconvolved' => \$unconvolved, 117 'convolved' => \$convolved, 118 'uncompressed' => \$uncompressed, 98 119 'use_imfile_id' => \$use_imfile_id, 99 120 'do_not_wait' => \$no_wait, 121 122 'action=s' => \$action, 123 'email=s' => \$email, 100 124 101 125 'verbose' => \$verbose, … … 156 180 } 157 181 182 if ($stage eq 'stack') { 183 # default is to do convolved stack 184 unless (defined $option_mask || $convolved) { 185 $unconvolved = 1; 186 } 187 } 188 158 189 checkFilter($filter, 'null', $filter) if $filter; 159 190 checkMJD($mjd_min, 0, "") if $mjd_min; … … 167 198 $option_mask |= $PSTAMP_SELECT_MASK if $mask; 168 199 $option_mask |= $PSTAMP_SELECT_VARIANCE if $variance; 200 $option_mask |= $PSTAMP_SELECT_JPEG if $jpeg; 201 202 # if no image was requested make a stamp of the image 169 203 $option_mask = $PSTAMP_SELECT_IMAGE if $option_mask == 0; 170 204 171 # if no image was requested make a stamp of the image172 205 173 206 $option_mask |= $PSTAMP_SELECT_CMF if $cmf; … … 207 240 } else { 208 241 $rows = []; 209 push @$rows, buildRow("", $comment, $x, $y, $filter, $mjd_min, $mjd_max);242 push @$rows, buildRow("", $comment, 1, $x, $y, $filter, $mjd_min, $mjd_max); 210 243 } 211 244 212 245 my ($tdf, $table_def_name) = tempfile ("/tmp/tabledef.XXXX", UNLINK => !$save_temps); 213 print $tdf "$req_name 1\n"; 246 my $line = "$req_name 2 $action $email"; 247 print "$line\n" if $verbose; 248 print $tdf "$line\n"; 214 249 my $rownum = 0; 215 250 foreach my $row (@$rows) { 216 251 $rownum++; 217 252 my $line = "$rownum $row->{ra}\t$row->{dec}\t$width $height" 218 . " $coord_mask $job_type $option_mask $project $ req_type"253 . " $coord_mask $job_type $option_mask $project $survey_name $release_name $req_type" 219 254 . " $stage $id $tess_id $component $data_group" 220 . " $row->{filter} $row->{mjd_min} $row->{mjd_max} ";255 . " $row->{filter} $row->{mjd_min} $row->{mjd_max} $run_type $fwhm_min $fwhm_max"; 221 256 222 257 if ($row->{comment} and $row->{comment} ne '') { … … 235 270 $command .= " --output $output" if $output; 236 271 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 237 run(command => $command, verbose => 0);272 run(command => $command, verbose => $verbose); 238 273 unless ($success) { 239 274 print STDERR @$stderr_buf; … … 274 309 275 310 my $row = {}; 276 $row->{ra} = checkRA($vals[0], $linenumber); 277 $row->{dec} = checkDEC($vals[1], $linenumber); 278 $row->{filter} = checkFilter($vals[2], $filter, $linenumber); 279 $row->{mjd_min} = checkMJD($vals[3], $mjd_min, $linenumber);; 280 $row->{mjd_max} = checkMJD($vals[4], $mjd_max, $linenumber);; 311 $row->{rownum} = checkRownum($vals[0], $linenumber); 312 $row->{ra} = checkRA($vals[1], $linenumber); 313 $row->{dec} = checkDEC($vals[2], $linenumber); 314 $row->{filter} = checkFilter($vals[3], $filter, $linenumber); 315 $row->{mjd_min} = checkMJD($vals[4], $mjd_min, $linenumber);; 316 $row->{mjd_max} = checkMJD($vals[5], $mjd_max, $linenumber);; 281 317 $row->{comment} = $comment; 282 318 … … 305 341 my $linenumber = shift; 306 342 307 my $result;343 my $result; 308 344 if ($c =~ /\:/) { 309 345 # sexagesmial format not valid for pixel coordinates … … 329 365 } 330 366 367 sub checkRownum { 368 my $rownum = shift; 369 my $linenumber = shift; 370 die "rownum can not be null at $linenumber\n" unless defined $rownum; 371 372 # XXX: For now just check that rownum is defined and a single word 373 # extend this. Should we require a number? 374 my @words = split " ", $rownum; 375 die "$rownum is not a vaild rownum at $linenumber\n" unless (scalar @words) == 1; 376 } 377 331 378 sub checkRA { 332 379 my $ra = shift; … … 335 382 336 383 if ($ra =~ /\:/) { 384 # assume RA is in hours:minutes:seconds 337 385 return $checked * 360. / 24.; 338 386 } else { -
trunk/pstamp/scripts/pstamp_request_file
r34447 r35353 54 54 value => undef 55 55 }, 56 { name => 'USERNAME',57 writetype => TSTRING,58 comment => 'username for request (optional)',59 value => undef60 },56 # { name => 'USERNAME', 57 # writetype => TSTRING, 58 # comment => 'username for request (optional)', 59 # value => undef 60 # }, 61 61 { name => 'EMAIL', 62 62 writetype => TSTRING, … … 97 97 { name => 'MJD_MIN', type => 'D', writetype => TDOUBLE }, 98 98 { name => 'MJD_MAX', type => 'D', writetype => TDOUBLE }, 99 # new in version 2 99 100 { name => 'RUN_TYPE', type => '16A', writetype => TSTRING }, 101 { name => 'FWHM_MIN', type => 'D', writetype => TDOUBLE }, 102 { name => 'FWHM_MAX', type => 'D', writetype => TDOUBLE }, 100 103 101 104 { name => 'COMMENT ', type => '64A', writetype => TSTRING }, … … 346 349 } 347 350 # trim leading whitespace from comment 348 $comment =~ s/^\s+// ;351 $comment =~ s/^\s+// if $comment; 349 352 if ($comment) { 350 353 if ($comment =~ /#/) {
Note:
See TracChangeset
for help on using the changeset viewer.
