Changeset 26204 for trunk/pstamp/scripts/pstampparse.pl
- Timestamp:
- Nov 19, 2009, 5:32:10 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstampparse.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.
