IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 19, 2009, 5:32:10 PM (16 years ago)
Author:
bills
Message:

change "params" file for get_image jobs to be mdc doc that contains "all" of
the data for the component. Various other changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/pstamp_get_image_job.pl

    r26151 r26204  
    5353die $err if $err;
    5454
    55 my $params_file = $output_base . ".params";
     55my $params_file = $output_base . ".mdc";
    5656if (! open(INPUT, "<$params_file") ) {
    5757    die("failed to open params file: $params_file");
    5858}
    5959
     60my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
     61
    6062my $params = join "", (<INPUT>);
    6163
    62 print STDERR "\nparams is $params\n";
     64my $data = $mdcParser->parse($params) or die("failed to parse metadata config doc");
     65my $components = parse_md_list($data);
     66my $n = scalar @$components;
     67if ($n != 1) {
     68    die("params file $params_file contains unexpected number of components: $n");
     69}
     70my $comp = $components->[0];
     71my $stage = $comp->{stage};
     72my $stage_id = $comp->{stage_id};
     73my $component = $comp->{component};
     74my $path_base = $comp->{path_base};
     75my $camera = $comp->{camera};
     76my $magicked = $comp->{magicked};
    6377
    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";
     78if ($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";
    6785}
    6886
    69 print STDERR "\nCAMERA is $camera\n";
     87if (!$camera or !$path_base or !$component or !$stage_id or !$stage) {
     88       die "failed to parse params from: $params_file";
     89}
     90
    7091
    7192my $out_dir = dirname($output_base);
    72 my $prefix = basename($output_base);
     93my $prefix = basename($output_base) . "_";
    7394my $results_file = $output_base . ".bundle_results";
    7495
     
    86107    $command .= " --path_base $path_base --outdir $out_dir --results_file $results_file";
    87108    $command .= " --prefix $prefix";
    88     # ignore magic for now
    89     $command .= " --no_magic";
    90 
     109    $command .= " --magicked" if $magicked;
    91110    $command .= " --dbname $dbname" if $dbname;
     111    $command .= " --verbose" if $verbose;
    92112    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    93113        run(command => $command, verbose => $verbose);
Note: See TracChangeset for help on using the changeset viewer.