IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14140


Ignore:
Timestamp:
Jul 11, 2007, 2:38:42 PM (19 years ago)
Author:
eugene
Message:

adding test to run psastro and addstar only if chip objects exist

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/camera_exp.pl

    r14115 r14140  
    138138
    139139my $chipObjects;
     140my $chipObjectsExist = 0;
    140141foreach my $file (@$files) {
    141142    # use the path_base as OUTPUT root and convert the filenames with ipprc->filename:
     
    147148    print $list2File ($ipprc->filename("PPIMAGE.BIN2", $file->{path_base}, $class_id) . "\n");
    148149    print $list3File ($chipObjects . "\n");
     150
     151     # if any of the output chip astrometry files exist, we can run psastro / addstar below
     152    if ($ipprc->file_exists($chipObjects)) {
     153        $chipObjectsExist = 1;
     154    }
    149155}
    150156close $list1File;
     
    168174unless ($no_op) {
    169175
    170     # run psastro +mosastro on the set of chips
    171     # XXX note that this is wrong if imfiles are cells
    172     # XXX add a ppStats call which will collect the astrometry stats
    173     if (scalar @$files > 1) {
    174         my $command = "$psastro -list $list3Name $outputRoot +mosastro -chipastro " .
    175             "-F PSASTRO.OUTPUT PSASTRO.OUTPUT.MEF";
    176         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    177             run(command => $command, verbose => 1);
    178         unless ($success) {
    179             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    180             &my_die("Unable to perform psastro: $error_code", $cam_id, $error_code);
    181         }
    182     } else {
    183         $ipprc->file_copy($chipObjects, $fpaObjects) unless $chipObjects eq $fpaObjects;
    184     }
    185     &my_die("Unable to find expected output file: $fpaObjects", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($fpaObjects);
    186 
    187     # run addstar on either the single chip output or the single fpa output
    188     # XXX this construct requires the user to have a valid .ptolemyrc
    189     # XXX which in turn points at ippconfig/dvo.site
    190     {
    191         my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar
    192         my $command = "addstar -D CAMERA $camdir " . $ipprc->file_resolve($fpaObjects);
    193        
    194         if (defined $dvodbReal) {
    195             $command .= " -D CATDIR $dvodbReal";
    196         }
    197 
    198         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    199             run(command => $command, verbose => 1);
    200         unless ($success) {
    201             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    202             &my_die("Unable to perform addstar: $error_code", $cam_id, $error_code);
     176    # only run psastro / addstar if any of the output chip astrometry files exist
     177    if ($chipObjectsExist) {
     178        # run psastro +mosastro on the set of chips or copy the chipObjects to fpaObjects
     179        # XXX note that this is wrong if imfiles are cells
     180        # XXX add a ppStats call which will collect the astrometry stats
     181        if (scalar @$files > 1) {
     182            my $command = "$psastro -list $list3Name $outputRoot +mosastro -chipastro " .
     183                "-F PSASTRO.OUTPUT PSASTRO.OUTPUT.MEF";
     184            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     185                run(command => $command, verbose => 1);
     186            unless ($success) {
     187                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     188                &my_die("Unable to perform psastro: $error_code", $cam_id, $error_code);
     189            }
     190        } else {
     191            $ipprc->file_copy($chipObjects, $fpaObjects) unless $chipObjects eq $fpaObjects;
     192        }
     193        &my_die("Unable to find expected output file: $fpaObjects", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($fpaObjects);
     194
     195        # run addstar on either the single chip output or the single fpa output
     196        # XXX this construct requires the user to have a valid .ptolemyrc
     197        # XXX which in turn points at ippconfig/dvo.site
     198        {
     199            my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar
     200            my $command = "addstar -D CAMERA $camdir " . $ipprc->file_resolve($fpaObjects);
     201           
     202            if (defined $dvodbReal) {
     203                $command .= " -D CATDIR $dvodbReal";
     204            }
     205
     206            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     207                run(command => $command, verbose => 1);
     208            unless ($success) {
     209                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     210                &my_die("Unable to perform addstar: $error_code", $cam_id, $error_code);
     211            }
    203212        }
    204213    }
Note: See TracChangeset for help on using the changeset viewer.