Changeset 26204
- Timestamp:
- Nov 19, 2009, 5:32:10 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm (modified) (2 diffs)
-
pstamp/scripts/pstamp_get_image_job.pl (modified) (2 diffs)
-
pstamp/scripts/pstamp_job_run.pl (modified) (1 diff)
-
pstamp/scripts/pstampparse.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
r26201 r26204 328 328 $stage_id = $image->{exp_id}; 329 329 } elsif ($img_type eq "chip") { 330 $stage_id = $image->{chip };330 $stage_id = $image->{chip_id}; 331 331 } elsif ($img_type eq "warp") { 332 332 $stage_id = $image->{warp_id}; … … 336 336 $stage_id = $image->{stack_id}; 337 337 } 338 $ image->{stage_id} = $stage_id;339 $ image->{stage} = $img_type;340 $ image->{image_db} = $image_db;338 $out->{stage_id} = $stage_id; 339 $out->{stage} = $img_type; 340 $out->{image_db} = $image_db; 341 341 342 342 # find the mask and weight images -
trunk/pstamp/scripts/pstamp_get_image_job.pl
r26151 r26204 53 53 die $err if $err; 54 54 55 my $params_file = $output_base . ". params";55 my $params_file = $output_base . ".mdc"; 56 56 if (! open(INPUT, "<$params_file") ) { 57 57 die("failed to open params file: $params_file"); 58 58 } 59 59 60 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 61 60 62 my $params = join "", (<INPUT>); 61 63 62 print STDERR "\nparams is $params\n"; 64 my $data = $mdcParser->parse($params) or die("failed to parse metadata config doc"); 65 my $components = parse_md_list($data); 66 my $n = scalar @$components; 67 if ($n != 1) { 68 die("params file $params_file contains unexpected number of components: $n"); 69 } 70 my $comp = $components->[0]; 71 my $stage = $comp->{stage}; 72 my $stage_id = $comp->{stage_id}; 73 my $component = $comp->{component}; 74 my $path_base = $comp->{path_base}; 75 my $camera = $comp->{camera}; 76 my $magicked = $comp->{magicked}; 63 77 64 my ($stage, $stage_id, $component, $path_base, $camera) = split " ", $params; 65 if (!$camera or !$path_base or !$component or !$stage_id or !$stage) { 66 die "failed to parse params: $params"; 78 if ($verbose) { 79 print STDERR "\nstage is $stage\n"; 80 print STDERR "stage_id is $stage_id\n"; 81 print STDERR "path_base is $path_base\n"; 82 print STDERR "path_base is $path_base\n"; 83 print STDERR "CAMERA is $camera\n"; 84 print STDERR "magicked is " . (defined $magicked ? $magicked : "undefined") . "\n"; 67 85 } 68 86 69 print STDERR "\nCAMERA is $camera\n"; 87 if (!$camera or !$path_base or !$component or !$stage_id or !$stage) { 88 die "failed to parse params from: $params_file"; 89 } 90 70 91 71 92 my $out_dir = dirname($output_base); 72 my $prefix = basename($output_base) ;93 my $prefix = basename($output_base) . "_"; 73 94 my $results_file = $output_base . ".bundle_results"; 74 95 … … 86 107 $command .= " --path_base $path_base --outdir $out_dir --results_file $results_file"; 87 108 $command .= " --prefix $prefix"; 88 # ignore magic for now 89 $command .= " --no_magic"; 90 109 $command .= " --magicked" if $magicked; 91 110 $command .= " --dbname $dbname" if $dbname; 111 $command .= " --verbose" if $verbose; 92 112 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 93 113 run(command => $command, verbose => $verbose); -
trunk/pstamp/scripts/pstamp_job_run.pl
r26151 r26204 153 153 $command .= " --dbname $dbname" if $dbname; 154 154 $command .= " --dbserver $dbserver" if $dbserver; 155 $command .= " --verbose $verbose" if $verbose; 155 156 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 156 157 run(command => $command, verbose => $verbose); -
trunk/pstamp/scripts/pstampparse.pl
r26151 r26204 394 394 print ARGSLIST "$args\n"; 395 395 close ARGSLIST or my_die("failed to close $argslist", $PS_EXIT_UNKNOWN_ERROR); 396 397 write_params($output_base, $image); 396 398 397 399 my $newState = "run"; … … 638 640 my $exp_id = $image->{exp_id}; 639 641 640 my $output_base = "$out_dir/${rownum}_${job_num}_"; 641 my $params = "${output_base}.params"; 642 643 # copy the argument list to a file 644 open PARAMS, ">$params" or my_die("failed to open $params", $PS_EXIT_UNKNOWN_ERROR); 645 print PARAMS "$stage $image->{stage_id} $image->{component} $image->{path_base} $image->{camera}\n"; 646 close PARAMS or my_die("failed to close $params", $PS_EXIT_UNKNOWN_ERROR); 642 my $output_base = "$out_dir/${rownum}_${job_num}"; 643 644 write_params($output_base, $image); 647 645 648 646 my $newState = "run"; … … 877 875 } 878 876 877 sub write_params { 878 my $output_base = shift; 879 my $image = shift; 880 881 # write the contents of this "image" as a metadata config doc 882 # Simply treat all values as strings. This is ok since we are only going to 883 # read it from another perl script 884 my $mdc_file = "${output_base}.mdc"; 885 open P, ">$mdc_file" or my_die("failed to open $mdc_file", $PS_EXIT_UNKNOWN_ERROR); 886 887 print P "params METADATA\n"; 888 889 foreach my $key (keys %$image) { 890 my $value = $image->{$key}; 891 if (defined $value) { 892 printf P " %-20s STR %s\n", $key, $value; 893 } else { 894 printf STDERR "skipping undefined value for $key\n"; 895 } 896 } 897 898 print P "END\n"; 899 close P or my_die("failed to close $mdc_file", $PS_EXIT_UNKNOWN_ERROR); 900 } 901 879 902 sub my_die 880 903 {
Note:
See TracChangeset
for help on using the changeset viewer.
