IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36419


Ignore:
Timestamp:
Jan 3, 2014, 1:56:07 PM (13 years ago)
Author:
bills
Message:

Changes to the full force stages of the pipeline

Location:
branches/bills_branches/bills_201312/ippScripts
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/bills_branches/bills_201312/ippScripts/Build.PL

    r36374 r36419  
    133133        scripts/queuestaticsky.pl
    134134        scripts/psphot_fullforce_warp.pl
     135        scripts/psphot_fullforce_summary.pl
    135136    )],
    136137    dist_abstract => 'Scripts for running the Pan-STARRS IPP',
  • branches/bills_branches/bills_201312/ippScripts/scripts/psphot_fullforce_warp.pl

    r36394 r36419  
    6060pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    6161pod2usage(
    62     -msg => "Required options: --ff_id --sourceroot --skycell_id --warp_path_base --outroot --camera",
     62    -msg => "Required options: --ff_id --warp_id --sourceroot --skycell_id --warp_path_base --outroot --camera",
    6363    -exitval => 3,
    6464          ) unless defined $ff_id,
    6565    and defined $sourceroot
    66     and (defined $path_base or defined $warp_id) # if we don't have warp's path_base we need warp_id
     66    and defined $path_base
     67    and defined $warp_id
    6768    and defined $skycell_id
    6869    and defined $camera
    6970    and defined $outroot;
    7071
    71 my $ipprc = PS::IPP::Config->new($camera) or my_die( "Unable to set up", $ff_id, $skycell_id, $PS_EXIT_CONFIG_ERROR );
     72my $ipprc = PS::IPP::Config->new($camera) or my_die( "Unable to set up", $ff_id, $warp_id, $skycell_id, $PS_EXIT_CONFIG_ERROR );
    7273
    7374my $neb;
     
    8081
    8182$ipprc->redirect_to_logfile($logDest) or my_die( "Unable to redirect output",
    82     $ff_id, $skycell_id, $PS_EXIT_SYS_ERROR ) if $redirect;
    83 
    84 if (!$path_base) {
     83    $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR ) if $redirect;
     84
     85if (0) {
     86# if (!$path_base) {
    8587    # If path_base is not supplied, look it up in the database.
    8688    my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
     
    9496            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    9597            &my_die("Unable to perform warptool -warpskyfile -inputskyfile: $error_code",
    96                 $ff_id, $skycell_id, $error_code);
     98                $ff_id, $warp_id, $skycell_id, $error_code);
    9799        }
    98100
    99101        my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
    100             &my_die("Unable to parse metadata config doc", $ff_id, $skycell_id, $PS_EXIT_PROG_ERROR);
     102            &my_die("Unable to parse metadata config doc", $ff_id, $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR);
    101103        $files = parse_md_list($metadata) or
    102             &my_die("Unable to parse metadata list", $ff_id, $skycell_id, $PS_EXIT_PROG_ERROR);
    103     }
    104 
    105     &my_die("Input list does not contain exactly one elements", $ff_id, $skycell_id, $PS_EXIT_SYS_ERROR)
     104            &my_die("Unable to parse metadata list", $ff_id, $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR);
     105    }
     106
     107    &my_die("Input list does not contain exactly one elements", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR)
    106108        unless scalar @$files == 1;
    107109
     
    109111
    110112    $path_base = $warp->{path_base};
    111     &my_die("Couldn't find input path in warptool output", $ff_id, $skycell_id, $PS_EXIT_UNKNOWN_ERROR)
     113    &my_die("Couldn't find input path in warptool output", $ff_id, $warp_id, $skycell_id, $PS_EXIT_UNKNOWN_ERROR)
    112114        unless defined $path_base;
    113115
     
    119121unless ($recipe_psphot) {
    120122    &my_die("Couldn't find selected reduction for PSPHOT: $reduction\n",
    121         $ff_id, $skycell_id, $PS_EXIT_CONFIG_ERROR);
     123        $ff_id, $warp_id, $skycell_id, $PS_EXIT_CONFIG_ERROR);
    122124}
    123125
     
    149151
    150152# check that the inputs exist (and have non-zero size)
    151 &my_die("Couldn't find input: $input", $ff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input);
    152 &my_die("Couldn't find input: $inputMask", $ff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputMask);
    153 &my_die("Couldn't find input: $inputVariance", $ff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputVariance);
    154 &my_die("Couldn't find input: $inputPSF", $ff_id, $skycell_id, $PS_EXIT_SYS_ERROR) if ($inputPSF && !$ipprc->file_exists($inputPSF));
    155 &my_die("Couldn't find input: $inputSources", $ff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputSources);
     153&my_die("Couldn't find input: $input", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input);
     154&my_die("Couldn't find input: $inputMask", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputMask);
     155&my_die("Couldn't find input: $inputVariance", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputVariance);
     156&my_die("Couldn't find input: $inputPSF", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) if ($inputPSF && !$ipprc->file_exists($inputPSF));
     157&my_die("Couldn't find input: $inputSources", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputSources);
    156158
    157159my $dump_config = 1;
     
    192194        unless ($success) {
    193195            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    194             &my_die("Unable to perform ppSub: $error_code", $ff_id, $skycell_id, $error_code);
     196            &my_die("Unable to perform ppSub: $error_code", $ff_id, $warp_id, $skycell_id, $error_code);
    195197        }
    196198
     
    206208            unless ($success) {
    207209                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    208                 &my_die("Unable to perform ppStatsFromMetadata: $error_code", $ff_id, $skycell_id, $error_code);
     210                &my_die("Unable to perform ppStatsFromMetadata: $error_code", $ff_id, $warp_id, $skycell_id, $error_code);
    209211            }
    210212            foreach my $line (@$stdout_buf) {
     
    225227# Add the result to the database
    226228{
    227     my $command = "$fftool -ff_id $ff_id";
     229    my $command = "$fftool -ff_id $ff_id -warp_id $warp_id";
    228230    $command .= " -addresult -path_base $outroot";
    229231    $command .= " $cmdflags";
     
    238240            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    239241            my $err_message = "Unable to perform fftool -addwarped" ;
    240                 &my_die("$err_message: $error_code", $ff_id, $skycell_id, $error_code);
     242                &my_die("$err_message: $error_code", $ff_id, $warp_id, $skycell_id, $error_code);
    241243        }
    242244    } else {
     
    261263    my $error;
    262264    my $output = $ipprc->prepare_output($filerule, $outroot, undef, $delete, \$error)
    263                     or &my_die("failed to prepare output file for: $filerule", $ff_id, $skycell_id, $error);
     265                    or &my_die("failed to prepare output file for: $filerule", $ff_id, $warp_id, $skycell_id, $error);
    264266    return $output;
    265267}
     
    274276    }
    275277
    276     &my_die("Couldn't find expected output file: $file",  $ff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($file);
     278    &my_die("Couldn't find expected output file: $file",  $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($file);
    277279
    278280    # Funpack to confirm we've really made things correctly
    279281    my $diskfile = $ipprc->file_resolve($file);
    280282    if ($diskfile =~ /fits/) {
    281         my $funpack  = can_run('funpack') or &my_die ("Can't find funpack", $ff_id, $skycell_id, $PS_EXIT_SYS_ERROR);
     283        my $funpack  = can_run('funpack') or &my_die ("Can't find funpack", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR);
    282284        my $check_command = "$funpack -S $diskfile > /dev/null";
    283285        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    284286            run(command => $check_command, verbose => $verbose);
    285287        if (!$success) {
    286             &my_die("Output file not a valid fits file: $file", $ff_id, $skycell_id, $PS_EXIT_SYS_ERROR);
     288            &my_die("Output file not a valid fits file: $file", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR);
    287289        }
    288290    }
     
    290292
    291293    if ($replicate and $neb) {
    292         $ipprc->replicate_file($file) or &my_die("failed to replicate: $file\n",  $ff_id, $skycell_id, $PS_EXIT_SYS_ERROR);
     294        $ipprc->replicate_file($file) or &my_die("failed to replicate: $file\n",  $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR);
    293295    }
    294296}
     
    298300{
    299301    my $msg = shift;            # Warning message on die
    300     my $ff_id = shift;         # full force warp identifier
     302    my $ff_id = shift;          # full force run identifier
     303    my $warp_id = shift;        # full force warp id
    301304    my $skycell_id = shift;     # Skycell identifier
    302305    my $exit_code = shift;      # Exit code to add
     
    306309    warn($msg);
    307310    if (defined $ff_id and defined $skycell_id) {
    308         my $command = "$fftool -ff_id $ff_id -fault $exit_code";
     311        my $command = "$fftool -ff_id $ff_id -warp_id $warp_id -fault $exit_code";
    309312        $command .= " -addresult";
    310313        $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400));
Note: See TracChangeset for help on using the changeset viewer.