IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 10, 2007, 3:18:44 PM (19 years ago)
Author:
eugene
Message:

applying the update to Stats.pm using dtype and new methods

File:
1 edited

Legend:

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

    r14048 r14115  
    8383   [   
    8484       #          PPSTATS KEYWORD         STATISTIC          CHIPTOOL FLAG
    85        { name => "ROBUST_MEDIAN",      type => "mean",  flag => "-bg" },
    86        { name => "ROBUST_MEDIAN",      type => "stdev", flag => "-bg_mean_stdev" },
    87        { name => "ROBUST_STDEV",       type => "rms",   flag => "-bg_stdev" },
    88        { name => "FRINGE_0",           type => "mean",  flag => "-fringe_0" },
    89        { name => "FRINGE_ERR_0",       type => "rms",   flag => "-fringe_1" },
    90        { name => "FRINGE_0",           type => "stdev", flag => "-fringe_2" },
    91        { name => "FRINGE_RESID_0",     type => "mean",  flag => "-user_1" },
    92        { name => "FRINGE_RESID_ERR_0", type => "rms",   flag => "-user_2" },
    93        { name => "FRINGE_RESID_0",     type => "stdev", flag => "-user_3" },
     85       { name => "ROBUST_MEDIAN",      type => "mean",  flag => "-bg",            dtype => "float" },
     86       { name => "ROBUST_MEDIAN",      type => "stdev", flag => "-bg_mean_stdev", dtype => "float" },
     87       { name => "ROBUST_STDEV",       type => "rms",   flag => "-bg_stdev",      dtype => "float" },
     88       { name => "FRINGE_0",           type => "mean",  flag => "-fringe_0",      dtype => "float" },
     89       { name => "FRINGE_ERR_0",       type => "rms",   flag => "-fringe_1",      dtype => "float" },
     90       { name => "FRINGE_0",           type => "stdev", flag => "-fringe_2",      dtype => "float" },
     91       { name => "FRINGE_RESID_0",     type => "mean",  flag => "-user_1",        dtype => "float" },
     92       { name => "FRINGE_RESID_ERR_0", type => "rms",   flag => "-user_2",        dtype => "float" },
     93       { name => "FRINGE_RESID_0",     type => "stdev", flag => "-user_3",        dtype => "float" },
    9494   ];
     95my $stats = PS::IPP::Metadata::Stats->new($STATS); # Stats parser
     96
    9597my $BINNED_STATS =
    9698   [   
    9799       { name => "ROBUST_STDEV",   type => "rms",   flag => "-bin_stdev" },
    98100   ];
     101my $binnedStats = PS::IPP::Metadata::Stats->new($BINNED_STATS); # Stats parser
    99102
    100103# Flags to specify the particular detrend to use
     
    167170
    168171    # Parse the statistics on the residual image
    169     my $stats = PS::IPP::Metadata::Stats->new($STATS); # Stats parser
    170172    $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
    171173
     
    179181    }
    180182
     183    # Parse the output contents into a metadata
     184    my $binnedMetadata = $mdcParser->parse(join "", @$stdout_buf) or &my_die("Unable to parse metadata output", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
     185
    181186    # parse the binned image statistics
    182     my $binnedMetadata = $mdcParser->parse(join "", @$stdout_buf) or &my_die("Unable to parse metadata output", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
    183 
    184     my $binnedStats = PS::IPP::Metadata::Stats->new($BINNED_STATS); # Stats parser
    185187    $binnedStats->parse($binnedMetadata) or &my_die("Unable to find all values in statistics output.", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
    186188}
     
    196198$command .= " -path_base $outputRoot";
    197199$command .= " -dbname $dbname" if defined $dbname;
    198 
    199 # add in the elements from the selected stats above
    200 foreach my $entry (@$STATS, @$BINNED_STATS) {
    201     my $value = $entry->{value};
    202     my $flag = $entry->{flag};
    203     $command .= " $flag $value";
    204 }
     200$command .= $stats->cmdflags();
     201$command .= $binnedStats->cmdflags();
    205202
    206203# Add the processed file to the database
Note: See TracChangeset for help on using the changeset viewer.