Exemple #1
0
    def plotMemberProfiles( self, *name, **arg ):
        """
        Plot profiles of all member trajectories seperately::
          plotMemberProfiles( name1, [name2, .. ],[ arg1=x,..])
            -> biggles.Table

        :param name: profile name(s)
        :type  name: str
        :param arg: pairs for biggles.Curve() and/or xlabel=..,ylabel=..
        :type  arg: key=value

        :return: biggles plot object
        :rtype: biggles.FramedArray()   
        """
        if not biggles:
            raise ImportError('biggles module could not be imported.')
        
        rows = self.n_members // 2 + self.n_members % 2
        page = biggles.FramedArray( rows , 2)

        biggles.configure('fontsize_min', 1)
        colors = T.colorSpectrum( len( name ) , '00FF00', 'FF00FF') 

        ml = self.memberList()

        i = 0
        minV = maxV = None

        for t in ml:

            for j in range( len(name)):

                p = t.profile( name[j] )

                if minV is None or minV > min( p ):
                    minV = min(p)
                if maxV is None or maxV < max( p ):
                    maxV = max(p)

                page[i//2, i%2].add( biggles.Curve( list(range( len(p))), list(p),
                                                   color=colors[j], **arg ) )

                page[i//2, i%2].add( biggles.PlotLabel( 0.8, 0.8-j/8.0, name[j],
                                                       color=colors[j]) )

            page[i//2, i%2].add( biggles.PlotLabel( 0.1, 0.9, 'Traj %i' % i))

            i += 1

        if self.n_members % 2 != 0:
            line = biggles.Line( (0,minV), (len(p),maxV) )
            page[ self.n_members//2, 1 ].add( line )

        page.uniform_limits = 1
        page.xlabel = arg.get('xlabel',None)
        page.ylabel = arg.get('ylabel',None)

        return page
Exemple #2
0
def markOutliers( traj, z, page ):

    outliers = N.nonzero( traj.outliers( z=z, mask=traj.ref.maskCA() ) )

    for o in outliers:
        t = traj.takeMember( o )

        ## cross out outliers in plot
        prof = N.array( t.profiles['rmsCA_ref'] ).tolist()
        prof.extend( t.profiles['rmsCA_last'] )
        maxV = max( prof )
        
        line = biggles.Line( (0,0), (len(t),maxV) )

        page[ o / 2, o % 2 ].add( line )