IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 23, 2011, 2:59:12 PM (15 years ago)
Author:
heather
Message:

more debugging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/haf_add201112/ippScripts/scripts/addstar_run.pl

    r32832 r33021  
    108108
    109109# it was PSASTRO.OUTPUT
    110 my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT",     $stageroot) or &my_die("Missing entry from camera config", $add_id, $PS_EXIT_CONFIG_ERROR);
    111 
     110
     111
     112if ($stage =~ /cam/) {
     113    # if it is cam stage we need to be careful when grabbing the filename.
     114    # This breaks down into a few steps:
     115
     116    #get info about the cam_id
     117    my $magicked;
     118    {
     119       
     120        my $mdcParser = PS::IPP::Metadata::Config->new;
     121        my $command = "$camtool -processedexp -cam_id " . $stage_id;
     122        $command .= " -dbname $dbname" if defined $dbname;
     123        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     124            run(command => $command, verbose => $verbose);
     125        &my_die( "Unable to get info on camRun", $add_id, $PS_EXIT_SYS_ERROR) unless $success;
     126        if (scalar @$stdout_buf == 0 ) { #it lists nothing if it is the first
     127           &my_die( "empty camRun", $add_id, $PS_EXIT_SYS_ERROR
     128            print "listing nothing\n";
     129        } else {
     130            my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     131                &my_die("Unable to parse metadata config", $add_id, $PS_EXIT_PROG_ERROR);
     132            #this fails if there is nothing listed. I checked.
     133            my $components = parse_md_list($metadata) or
     134                &my_die("Unable to parse metadata list", $add_id, $PS_EXIT_PROG_ERROR);
     135            my $comp = $$components[0];
     136            my  $mparsed = $comp->{magicked};
     137           
     138            if (!defined($mparsed)) {
     139                &my_die("Unable to parse magicked", $add_id, $PS_EXIT_PROG_ERROR);
     140            } #but just to make sure, have it grab a minidvodb_name, to make sure it's not junk.
     141            print "found a value for magicked:$mparsed\n";
     142            $magicked = $mparsed;
     143        }
     144
     145
     146
     147    #is this cam_id magicked or not?
     148    if ($magicked) {
     149        my $fpaObjects = $ipprc->destreak_filename("PSASTRO.OUTPUT",     $stageroot) or &my_die("Missing entry from camera config", $add_id, $PS_EXIT_CONFIG_ERROR);
     150    } else {
     151
     152        my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT",     $stageroot) or &my_die("Missing entry from camera config", $add_id, $PS_EXIT_CONFIG_ERROR);
     153    }
     154
     155
     156} else {
     157
     158    my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT",     $stageroot) or &my_die("Missing entry from camera config", $add_id, $PS_EXIT_CONFIG_ERROR);
     159}
    112160if (($stage =~/staticsky/) || ($stage =~/stack/)) {
    113161    $fpaObjects =~ s/smf$/cmf/;
Note: See TracChangeset for help on using the changeset viewer.