Index: trunk/ippScripts/scripts/detrend_resid.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_resid.pl	(revision 14115)
+++ trunk/ippScripts/scripts/detrend_resid.pl	(revision 14439)
@@ -81,20 +81,22 @@
 # values to extract from output metadata and the stats to calculate
 my $STATS = 
-   [   
+   [
        #          PPSTATS KEYWORD         STATISTIC          CHIPTOOL FLAG
-       { name => "ROBUST_MEDIAN",      type => "mean",  flag => "-bg",            dtype => "float" },
-       { name => "ROBUST_MEDIAN",      type => "stdev", flag => "-bg_mean_stdev", dtype => "float" },
-       { name => "ROBUST_STDEV",       type => "rms",   flag => "-bg_stdev",	  dtype => "float" },
-       { name => "FRINGE_0",           type => "mean",  flag => "-fringe_0",	  dtype => "float" },
-       { name => "FRINGE_ERR_0",       type => "rms",   flag => "-fringe_1",	  dtype => "float" },
-       { name => "FRINGE_0",           type => "stdev", flag => "-fringe_2",	  dtype => "float" },
-       { name => "FRINGE_RESID_0",     type => "mean",  flag => "-user_1",  	  dtype => "float" },
-       { name => "FRINGE_RESID_ERR_0", type => "rms",   flag => "-user_2",  	  dtype => "float" },
-       { name => "FRINGE_RESID_0",     type => "stdev", flag => "-user_3",  	  dtype => "float" },
+       { name => "ROBUST_MEDIAN",      type => "mean",  flag => "-bg",             dtype => "float" },
+       { name => "ROBUST_MEDIAN",      type => "stdev", flag => "-bg_mean_stdev",  dtype => "float" },
+       { name => "ROBUST_STDEV",       type => "rms",   flag => "-bg_stdev",	   dtype => "float" },
+       { name => "SAMPLE_SKEWNESS",    type => "max",   flag => "-bg_skewness",    dtype => "float" },
+       { name => "SAMPLE_KURTOSIS",    type => "max",   flag => "-bg_kurtosis",    dtype => "float" },
+       { name => "FRINGE_0",           type => "mean",  flag => "-fringe_0",	   dtype => "float" },
+       { name => "FRINGE_ERR_0",       type => "rms",   flag => "-fringe_1",	   dtype => "float" },
+       { name => "FRINGE_0",           type => "stdev", flag => "-fringe_2",	   dtype => "float" },
+       { name => "FRINGE_RESID_0",     type => "mean",  flag => "-fringe_resid_0", dtype => "float" },
+       { name => "FRINGE_RESID_ERR_0", type => "rms",   flag => "-fringe_resid_1", dtype => "float" },
+       { name => "FRINGE_RESID_0",     type => "stdev", flag => "-fringe_resid_2", dtype => "float" },
    ];
 my $stats = PS::IPP::Metadata::Stats->new($STATS); # Stats parser
 
 my $BINNED_STATS = 
-   [   
+   [
        { name => "ROBUST_STDEV",   type => "rms",   flag => "-bin_stdev" },
    ];
