Changeset 33383
- Timestamp:
- Feb 28, 2012, 1:49:45 PM (14 years ago)
- Location:
- tags/ipp-20120216
- Files:
-
- 13 edited
-
PS-IPP-PStamp (modified) (1 prop)
-
PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm (modified) (1 diff)
-
PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm (modified) (2 diffs)
-
ippconfig/recipes/filerules-mef.mdc (modified) (1 diff)
-
ippconfig/recipes/filerules-simple.mdc (modified) (1 diff)
-
ippconfig/recipes/filerules-split.mdc (modified) (1 diff)
-
ippconfig/recipes/jpeg.mdc (modified) (1 diff)
-
pstamp (modified) (1 prop)
-
pstamp/scripts/dqueryparse.pl (modified) (4 diffs)
-
pstamp/scripts/pstamp_job_run.pl (modified) (2 diffs)
-
pstamp/src/ppstampArguments.c (modified) (2 diffs)
-
pstamp/src/ppstampOptions.h (modified) (1 diff)
-
pstamp/src/ppstampParseCamera.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20120216/PS-IPP-PStamp
- Property svn:mergeinfo set to
-
tags/ipp-20120216/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
r33249 r33383 850 850 { 851 851 my $command = "$whichimage $ra $dec"; 852 $command .= " --tess_id $requested_tess_id" if $requested_tess_id; 852 853 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 853 854 run(command => $command, verbose => $verbose); -
tags/ipp-20120216/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm
r32635 r33383 27 27 $PSTAMP_SELECT_PSF 28 28 $PSTAMP_SELECT_BACKMDL 29 $PSTAMP_SELECT_JPEG 29 30 $PSTAMP_SELECT_INVERSE 30 31 $PSTAMP_SELECT_UNCONV … … 64 65 our $PSTAMP_SELECT_PSF = 16; 65 66 our $PSTAMP_SELECT_BACKMDL = 32; 67 our $PSTAMP_SELECT_JPEG = 64; 66 68 our $PSTAMP_SELECT_INVERSE = 1024; 67 69 our $PSTAMP_SELECT_UNCONV = 2048; -
tags/ipp-20120216/ippconfig/recipes/filerules-mef.mdc
r32950 r33383 311 311 PPSTAMP.OUTPUT.MASK OUTPUT {OUTPUT}.mk.fits MASK COMP_MASK FPA TRUE NONE 312 312 PPSTAMP.OUTPUT.VARIANCE OUTPUT {OUTPUT}.wt.fits VARIANCE COMP_WT FPA TRUE NONE 313 PPSTAMP.OUTPUT.JPEG OUTPUT {OUTPUT}.jpg JPEG NONE FPA TRUE NONE 314 PPSTAMP.OUTPUT.JPEG.FLIP OUTPUT {OUTPUT}.jpg JPEG NONE FPA TRUE NONE 313 315 PPSTAMP.CHIP.MEF OUTPUT {OUTPUT}.ch.fits IMAGE NONE CHIP FALSE MEF 314 316 -
tags/ipp-20120216/ippconfig/recipes/filerules-simple.mdc
r32751 r33383 291 291 PPSTAMP.OUTPUT.MASK OUTPUT {OUTPUT}.mk.fits MASK COMP_MASK FPA TRUE NONE 292 292 PPSTAMP.OUTPUT.VARIANCE OUTPUT {OUTPUT}.wt.fits VARIANCE COMP_WT FPA TRUE NONE 293 PPSTAMP.OUTPUT.JPEG OUTPUT {OUTPUT}.jpg JPEG NONE FPA TRUE NONE 294 PPSTAMP.OUTPUT.JPEG.FLIP OUTPUT {OUTPUT}.jpg JPEG NONE FPA TRUE NONE 293 295 PPSTAMP.CHIP OUTPUT {OUTPUT}.ch.fits IMAGE NONE CHIP FALSE NONE 294 296 -
tags/ipp-20120216/ippconfig/recipes/filerules-split.mdc
r32950 r33383 322 322 PPSTAMP.OUTPUT.MASK OUTPUT {OUTPUT}.mk.fits MASK COMP_MASK FPA TRUE NONE 323 323 PPSTAMP.OUTPUT.VARIANCE OUTPUT {OUTPUT}.wt.fits VARIANCE COMP_WT FPA TRUE NONE 324 PPSTAMP.OUTPUT.JPEG OUTPUT {OUTPUT}.jpg JPEG NONE FPA TRUE NONE 325 PPSTAMP.OUTPUT.JPEG.FLIP OUTPUT {OUTPUT}.jpg JPEG NONE FPA TRUE NONE 324 326 # mosaic image used for making stamps of raw images. Not saved. 325 327 PPSTAMP.CHIP OUTPUT {OUTPUT}.ch.fits IMAGE NONE CHIP FALSE MEF 326 PPSTAMP.OUTPUT.JPEG1 OUTPUT {OUTPUT}.jpg JPEG NONE FPA TRUE NONE327 328 328 329 PPSIM.OUTPUT OUTPUT {OUTPUT}.{CHIP.NAME}.fits IMAGE NONE CHIP TRUE SPLIT -
tags/ipp-20120216/ippconfig/recipes/jpeg.mdc
r29554 r33383 254 254 END 255 255 256 PPSTAMP.OUTPUT.JPEG METADATA 257 COLORMAP STR greyscale 258 SCALE.MODE STR RANGE 259 SCALE.MIN F32 -5.0 260 SCALE.MAX F32 +10.0 261 OPTIONS STR -SB,+X,+Y 262 END 263 264 PPSTAMP.OUTPUT.JPEG.FLIP METADATA 265 COLORMAP STR greyscale 266 SCALE.MODE STR RANGE 267 SCALE.MIN F32 -5.0 268 SCALE.MAX F32 +10.0 269 OPTIONS STR -SB,-X,+Y 270 END -
tags/ipp-20120216/pstamp
- Property svn:mergeinfo set to
-
tags/ipp-20120216/pstamp/scripts/dqueryparse.pl
r33342 r33383 17 17 use Pod::Usage qw( pod2usage ); 18 18 use File::Temp qw( tempfile tempdir); 19 use POSIX; # for strftime 19 20 20 21 use PS::IPP::PStamp::RequestFile qw( :standard ); … … 98 99 my_die("$request_file is version $extver expecting 1 or 2", $PS_EXIT_PROG_ERROR) 99 100 if ($extver ne 1) and ($extver ne 2); 101 102 if ($req_id) { 103 my $command = "$pstamptool -listreq -name $req_name -not_req_id $req_id"; 104 # set verbose to false so that error message about request not found doesn't appear in parse_error.txt 105 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 106 run(command => $command, verbose => 0); 107 if ($success) { 108 # -listreq succeeded duplicate request name 109 print STDERR "QUERY_ID $req_name has already been used\n"; 110 $command = "$pstamptool -addjob -job_type none -rownum 0 -state stop -fault $PSTAMP_DUP_REQUEST -req_id $req_id"; 111 unless ($no_update) { 112 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 113 run(command => $command, verbose => $verbose); 114 if (!$success) { 115 my_die("$command failed", $PS_EXIT_UNKNOWN_ERROR); 116 } 117 } else { 118 print STDERR "skipping $command\n"; 119 } 120 121 my $datestr = strftime "%Y%m%d%H%M%S.$req_id", gmtime; 122 $req_name = "ERROR.$datestr"; 123 } 124 $command = "$pstamptool -updatereq -req_id $req_id -set_name $req_name -set_outProduct $product"; 125 unless ($no_update) { 126 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 127 run(command => $command, verbose => $verbose); 128 unless ($success) { 129 my_die("$command failed", $PS_EXIT_UNKNOWN_ERROR); 130 } 131 } else { 132 print STDERR "skipping $command\n"; 133 } 134 exit (0); 135 } 136 100 137 101 138 … … 357 394 my $component = $query{$fpa_id}{COMPONENT_ID}[$i]; 358 395 print "Need to UPDATE $stage $stage_id $component from $data_state\n"; 359 #### my ($req_id, $outdir, $label, $state, $stage, $stage_id, $component, $need_magic, $imagedb) = @_;360 396 $dep_id = queue_update_run($req_id, $outdir, $label, $data_state, $stage, $stage_id, $component, 0, $imagedb); 361 397 } … … 413 449 } 414 450 415 # XXX: flesh this out once we have a request without duplicate ROWNUMS416 451 foreach my $rownum (keys %faulted_rows ) { 452 my $outputBase = "$outdir/$job_num" . "_"; 417 453 my $fault = $faulted_rows{$rownum}; 418 454 $fault = $PSTAMP_NO_IMAGE_MATCH if ($fault eq 'no_fault'); 419 455 print STDERR "insert faulted job for $rownum: $fault\n"; 456 my $command = "$pstamptool -addjob -req_id $req_id -outputBase $outputBase -job_type detect_query -state stop -rownum $rownum -fault $fault"; 457 unless ($no_update) { 458 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 459 run(command => $command, verbose => $verbose); 460 if ($success) { 461 my $job_id = join "", @$stdout_buf; 462 print " Queued job: $job_id\n"; 463 } else { 464 my $exit_status = $error_code >> 8; 465 $exit_status = $PS_EXIT_UNKNOWN_ERROR unless $exit_status; 466 my_die("Unable to perform $command error code: $error_code", $exit_status); 467 } 468 } else { 469 print STDERR "skipping $command\n"; 470 } 471 $job_num++; 420 472 } 421 473 -
tags/ipp-20120216/pstamp/scripts/pstamp_job_run.pl
r33342 r33383 225 225 226 226 my $command = "$ppstamp $outputBase $argString $fileArgs"; 227 $command .= " -write_jpeg" if ($options & $PSTAMP_SELECT_JPEG); 227 228 $command .= " -dbname $dbname" if $dbname; 228 229 $command .= " -dbserver $dbserver" if $dbserver; … … 249 250 250 251 # Note: we are assuming the contents of the PSTAMP filerules here. 251 my %extensions = ( $PSTAMP_SELECT_IMAGE => "fits", 252 $PSTAMP_SELECT_MASK => "mk.fits", 253 $PSTAMP_SELECT_VARIANCE => "wt.fits"); 254 255 my $output_mask = $options & ($PSTAMP_SELECT_IMAGE | $PSTAMP_SELECT_MASK | $PSTAMP_SELECT_VARIANCE); 252 my %extensions = ( $PSTAMP_SELECT_IMAGE => "fits", 253 $PSTAMP_SELECT_MASK => "mk.fits", 254 $PSTAMP_SELECT_VARIANCE => "wt.fits", 255 $PSTAMP_SELECT_JPEG => "jpg"); 256 257 my $output_mask = $options & ($PSTAMP_SELECT_IMAGE | $PSTAMP_SELECT_MASK | $PSTAMP_SELECT_VARIANCE | $PSTAMP_SELECT_JPEG); 256 258 257 259 foreach my $key (keys (%extensions)) { -
tags/ipp-20120216/pstamp/src/ppstampArguments.c
r29885 r33383 21 21 fprintf(stderr, "\n"); 22 22 fprintf(stderr, "Optional arguments:\n"); 23 fprintf(stderr, " [-class_id class_id] selects class_id (only used with -pixcenter)\n"); 24 fprintf(stderr, " [-astrom astrom.cmp] : provide an alternative astrometry calibration\n"); 25 fprintf(stderr, " [-mask mk_image] : mask image\n"); 26 fprintf(stderr, " [-variance var_image] : variance image\n"); 27 fprintf(stderr, " [-no_censor_masked] : do not set masked pixels to NAN\n"); 23 fprintf(stderr, " [-class_id class_id] : selects class_id (only used with -pixcenter)\n"); 24 fprintf(stderr, " [-astrom astrom.cmp] : provide an alternative astrometry calibration\n"); 25 fprintf(stderr, " [-mask mk_image] : mask image\n"); 26 fprintf(stderr, " [-variance var_image] : variance image\n"); 27 fprintf(stderr, " [-stage stage] : stage of input image (raw, chip, warp, stack, diff)\n"); 28 fprintf(stderr, " [-write_jpeg] : write a JPEG format of the image stamp\n"); 29 // fprintf(stderr, " [-no_censor_masked] : do not set masked pixels to NAN\n"); 28 30 fprintf(stderr, "\n"); 29 31 … … 84 86 psArgumentRemove(argnum, &argc, argv); 85 87 } 88 if ((argnum = psArgumentGet(argc, argv, "-write_jpeg"))) { 89 psArgumentRemove(argnum, &argc, argv); 90 options->writeJPEG = true; 91 } else { 92 options->writeJPEG = false; 93 } 86 94 87 95 pmConfigFileSetsMD(config->arguments, &argc, argv, "ASTROM", "-astrom", "-astromlist"); -
tags/ipp-20120216/pstamp/src/ppstampOptions.h
r29885 r33383 16 16 psRegion roi; // roi in chip coordinates 17 17 bool censorMasked; 18 18 bool writeJPEG; 19 19 } ppstampOptions; 20 20 -
tags/ipp-20120216/pstamp/src/ppstampParseCamera.c
r29379 r33383 8 8 9 9 // Set up the ppstamp output Image file 10 bool setupOutput(pmConfig *config, pmFPAfile *input, psString stage, bool doMask, bool doWeight )10 bool setupOutput(pmConfig *config, pmFPAfile *input, psString stage, bool doMask, bool doWeight, pmFPAfile **pOutput) 11 11 { 12 12 pmFPAfile *output; … … 22 22 return false; 23 23 } 24 *pOutput = output; 24 25 25 26 output->save = true; … … 33 34 outWeight->save = true; 34 35 } 36 35 37 36 38 return true; … … 76 78 77 79 78 79 80 // XXX: create a filerule for PPSTAMP.ASTROM 80 81 pmFPAfile *astrom = pmFPAfileDefineFromArgs(&status, config, "PSWARP.ASTROM", "ASTROM"); … … 95 96 96 97 // Set up the output target 97 if (!setupOutput(config, input, options->stage, doMask, doWeight)) { 98 pmFPAfile *output; 99 if (!setupOutput(config, input, options->stage, doMask, doWeight, &output)) { 98 100 psError(PS_ERR_UNKNOWN, false, "Unable to setup output."); 99 101 return false; 100 102 } 101 103 102 pmFPAfile *chipImage = pmFPAfileDefineChipMosaic(config, input->fpa, "PPSTAMP.CHIP");104 pmFPAfile *chipImage = pmFPAfileDefineChipMosaic(config, output->fpa, "PPSTAMP.CHIP"); 103 105 if (!chipImage) { 104 106 psError(PS_ERR_IO, false, _("Unable to generate new file from PPSTAMP.CHIP")); … … 108 110 psError(PS_ERR_IO, true, "PPSTAMP.CHIP is not of type IMAGE"); 109 111 return NULL; 112 } 113 114 if (options->writeJPEG) { 115 char *filerule; 116 // If stage is chip flip the X axis otherwise don't flip. 117 // XXX: is this the right thing to do? 118 // Shouldn't the JPEG match the stamp even for chip stage? 119 if (!options->stage || strcmp(options->stage, "chip")) { 120 filerule = "PPSTAMP.OUTPUT.JPEG"; 121 } else { 122 filerule = "PPSTAMP.OUTPUT.JPEG.FLIP"; 123 } 124 pmFPAfile *jpg = pmFPAfileDefineOutput(config, output->fpa, filerule); 125 if (!jpg) { 126 psError(PS_ERR_IO, false, "Unable to generate new file from %s", filerule); 127 return NULL; 128 } 129 if (jpg->type != PM_FPA_FILE_JPEG) { 130 psError(PS_ERR_IO, true, "%s is not of type JPEG", filerule); 131 return NULL; 132 } 133 jpg->save = true; 110 134 } 111 135
Note:
See TracChangeset
for help on using the changeset viewer.
