Changeset 1011


Ignore:
Timestamp:
Jul 24, 2013, 2:13:49 PM (11 years ago)
Author:
aslmd
Message:

UTIL PYTHON planetoplot_v2. added quadratic mean: self.compute == qmean

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py

    r1003 r1011  
    16901690            else:
    16911691                if self.verbose: print "!! WARNING !! No area accounted for (computing on t and/or z axis)."
     1692        # prepare quadratic mean
     1693        if "qmean" in self.compute: self.field = self.field*self.field
    16921694        # now ready to compute [TBD: we would like to have e.g. mean over x,y and min over t ??]
    16931695        if self.method_t == "comp":
     
    17071709        if self.method_y == "comp":
    17081710            if self.verbose: print "**** OK. Computing over y axis."
    1709             if self.compute == "mean": self.field = ppcompute.mean(self.field,axis=2)
     1711            if "mean" in self.compute: self.field = ppcompute.mean(self.field,axis=2)
    17101712            elif self.compute == "min": self.field = ppcompute.min(self.field,axis=2)
    17111713            elif self.compute == "max": self.field = ppcompute.max(self.field,axis=2)
     
    17161718        if self.method_x == "comp":
    17171719            if self.verbose: print "**** OK. Computing over x axis."
    1718             if self.compute == "mean": self.field = ppcompute.mean(self.field,axis=3)
     1720            if "mean" in self.compute: self.field = ppcompute.mean(self.field,axis=3)
    17191721            elif self.compute == "min": self.field = ppcompute.min(self.field,axis=3)
    17201722            elif self.compute == "max": self.field = ppcompute.max(self.field,axis=3)
     
    17251727        # remove all dimensions with size 1 to prepare plot (and check the resulting dimension with dimplot)
    17261728        self.field = np.squeeze(self.field)
     1729        # take root mean square for quadratic mean
     1730        if self.compute == "qmean": self.field = np.sqrt(self.field)
     1731        # error handling and verbose
    17271732        if self.field.ndim != self.dimplot:
    17281733            print "!! ERROR !! Problem: self.field is different than plot dimensions", self.field.ndim, self.dimplot ; exit()
Note: See TracChangeset for help on using the changeset viewer.