IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 15, 2007, 2:23:33 PM (19 years ago)
Author:
Paul Price
Message:

Adding --no-op option which turns off processing (so one can track only the database work flow) for everything except the phase 0 scripts (need to have some real data in the database in order to track it).

File:
1 edited

Legend:

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

    r11829 r11837  
    3333use Pod::Usage qw( pod2usage );
    3434
    35 my ($exp_tag, $camera, $dbname, $workdir, $no_update);
     35my ($exp_tag, $camera, $dbname, $workdir, $no_update, $no_op);
    3636GetOptions(
    3737    'exp_tag|e=s'       => \$exp_tag,
     
    3939    'dbname|d=s'        => \$dbname, # Database name
    4040    'workdir|w=s'       => \$workdir,
    41     'no-update'         => \$no_update
     41    'no-update'         => \$no_update,
     42    'no-op'             => \$no_op,
    4243) or pod2usage( 2 );
    4344
     
    111112        my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
    112113        $stats->add_data(@backgrounds);
    113         $bg = $stats->mean();
    114         $bg_mean_stdev = $stats->standard_deviation() || 0.0;
     114        $bg = ($stats->mean() or 'NAN');
     115        $bg_mean_stdev = ($stats->standard_deviation() or 'NAN');
    115116    }
    116117    {
    117118        my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
    118119        $stats->add_data(@variances);
    119         $bg_stdev = sqrt( $stats->mean() );
     120        $bg_stdev = (sqrt( $stats->mean() ) or 'NAN');
    120121    }
    121122}
     
    169170my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT", $outputRoot); # MEF psastro output
    170171
    171 # run psastro +mosastro on the set of chips
    172 # XXX note that this is wrong if imfiles are cells
    173 if (@$files > 1) {
    174     my $command = "$psastro -list $list3Name $outputRoot +mosastro -chipastro";
    175     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    176         run(command => $command, verbose => 1);
    177     unless ($success) {
    178         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    179         &my_die("Unable to perform psastro: $error_code", $exp_tag, $error_code);
    180     }
    181     &my_die("Unable to find expected output file: $fpaObjects", $exp_tag, $PS_EXIT_PROG_ERROR) unless -f $fpaObjects;
    182 } else {
    183     $fpaObjects = $chipObjects;
    184 }
    185 
    186 # run addstar on either the single chip output or the single fpa output
    187 # XXX this construct requires the user to have a valid .ptolemyrc
    188 # XXX which in turn points at ippconfig/dvo.site
    189 {
    190     my $command = "addstar -D CAMERA $camera $fpaObjects";
    191     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    192         run(command => $command, verbose => 1);
    193     unless ($success) {
    194         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    195         &my_die("Unable to perform addstar: $error_code", $exp_tag, $error_code);
    196     }
    197 }
    198 
    199 # Make the jpeg for binning 1
    200 {
    201     my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run
    202     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    203         run(command => $command, verbose => 1);
    204     unless ($success) {
    205         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    206         &my_die("Unable to perform ppImage: $error_code", $exp_tag, $error_code);
    207     }
    208     &my_die("Unable to find expected output file: $jpeg1", $exp_tag, $PS_EXIT_PROG_ERROR) unless -f $jpeg1;
    209 }
    210 
    211 # Make the jpeg for binning 2
    212 {
    213     my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run
    214     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    215         run(command => $command, verbose => 1);
    216     unless ($success) {
    217         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    218         &my_die("Unable to perform ppImage: $error_code", $exp_tag, $error_code);
    219     }
    220     &my_die("Unable to find expected output file: $jpeg2", $exp_tag, $PS_EXIT_PROG_ERROR) unless -f $jpeg2;
     172unless ($no_op) {
     173
     174    # run psastro +mosastro on the set of chips
     175    # XXX note that this is wrong if imfiles are cells
     176    if (@$files > 1) {
     177        my $command = "$psastro -list $list3Name $outputRoot +mosastro -chipastro";
     178        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     179            run(command => $command, verbose => 1);
     180        unless ($success) {
     181            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     182            &my_die("Unable to perform psastro: $error_code", $exp_tag, $error_code);
     183        }
     184        &my_die("Unable to find expected output file: $fpaObjects", $exp_tag, $PS_EXIT_PROG_ERROR) unless -f $fpaObjects;
     185    } else {
     186        $fpaObjects = $chipObjects;
     187    }
     188
     189    # run addstar on either the single chip output or the single fpa output
     190    # XXX this construct requires the user to have a valid .ptolemyrc
     191    # XXX which in turn points at ippconfig/dvo.site
     192    {
     193        my $command = "addstar -D CAMERA $camera $fpaObjects";
     194        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     195            run(command => $command, verbose => 1);
     196        unless ($success) {
     197            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     198            &my_die("Unable to perform addstar: $error_code", $exp_tag, $error_code);
     199        }
     200    }
     201   
     202    # Make the jpeg for binning 1
     203    {
     204        my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run
     205        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     206            run(command => $command, verbose => 1);
     207        unless ($success) {
     208            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     209            &my_die("Unable to perform ppImage: $error_code", $exp_tag, $error_code);
     210        }
     211        &my_die("Unable to find expected output file: $jpeg1", $exp_tag, $PS_EXIT_PROG_ERROR) unless -f $jpeg1;
     212    }
     213
     214    # Make the jpeg for binning 2
     215    {
     216        my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run
     217        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     218            run(command => $command, verbose => 1);
     219        unless ($success) {
     220            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     221            &my_die("Unable to perform ppImage: $error_code", $exp_tag, $error_code);
     222        }
     223        &my_die("Unable to find expected output file: $jpeg2", $exp_tag, $PS_EXIT_PROG_ERROR) unless -f $jpeg2;
     224    }
    221225}
    222226
     
    226230$jpeg1  = $ipprc->convert_filename_relative($jpeg1);
    227231$jpeg2  = $ipprc->convert_filename_relative($jpeg2);
     232
    228233unless ($no_update) {
    229234    my $command = "$p3tool -addprocessedexp -exp_tag $exp_tag -uri UNKNOWN " .
Note: See TracChangeset for help on using the changeset viewer.