IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 14, 2006, 12:52:27 PM (20 years ago)
Author:
Paul Price
Message:

Added exp_type to phase0imfile.pl, so that phase0exp.pl can access the types, check for consistency, and decide if it's a detrend

File:
1 edited

Legend:

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

    r8309 r8327  
    1010use Data::Dumper;
    1111
    12 use constant TYPE => "OBSTYPE"; # Observation type keyword
    13 use constant DETRENDS => ( "bias", "dark", "flat", "fringe" ); # Observation types to mark as detrend
     12use constant TYPE => "exp_type"; # Observation type keyword
     13use constant DETRENDS => [ "bias", "dark", "flat", "fringe" ]; # Observation types to mark as detrend
    1414use constant DETREND_FLAG => "-detrend"; # Flag to use to mark detrend exposure
    1515
     
    8484        if (not defined $values{$constant}) {
    8585            $values{$constant} = $value;
    86         } elsif ($values{$constant} != $value) {
     86        } elsif ($values{$constant} ne $value) {
    8787            die "Value of $constant for " . $imfile->{PHASE0_CLASSID} .
    8888                " doesn't match previous value.\n";
     
    120120    foreach my $variable (@{VARIABLES()}) {
    121121        my $array = $values{$variable}; # Array of values
    122         my $stats = Statistics::Descriptive->new; # Statistics calculator
     122        my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
    123123        $stats->add_data(@$array);
    124124        $command .= " -" . $variable . " " . $stats->mean();
     
    127127    # Add the statistics
    128128    {
    129         my $stats = Statistics::Descriptive->new; # Statistics calculator
     129        my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
    130130        $stats->add_data(@backgrounds);
    131131        $command .= " -" . PHASE0_BG() . " " . $stats->mean();
     
    133133    }
    134134    {
    135         my $stats = Statistics::Descriptive->new; # Statistics calculator
     135        my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
    136136        $stats->add_data(@stdevs);
    137137        $command .= " -" . PHASE0_BG_MEAN_STDEV() . " " . $stats->mean();
     
    146146    }
    147147 
    148     print "$command\n";
    149    
    150 #    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    151 #       run(command => $command, verbose => 1);
    152 #    die "Unable to run phase0 update for $expid: $error_code\n" if not $success;
     148    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     149        run(command => $command, verbose => 1);
     150    die "Unable to run phase0 update for $expid: $error_code\n" if not $success;
    153151}
    154152
Note: See TracChangeset for help on using the changeset viewer.