Exemple #1
0
    def setup(self):
        data=read.load(self.offsets[0],file=self.filename,type=self.type)

        if self.xrange==None:
            self.xrange=[data.getBounds()[0],data.getBounds()[1]]
        if self.yrange==None:
            self.yrange=[data.getBounds()[2],data.getBounds()[3]]
Exemple #2
0
    def readData(self):


        if self.type != 'vti':
            if self.xrange[0] <=0. :
                self.data=read.load(self.offset,file=self.filenameout,type=self.type,mirrorPlane=0)
            else:
                self.data=read.load(self.offset,file=self.filenameout,type=self.type)
        else:
            self.data=read.loadvti(self.offset,file=self.filenameout)
            self.nx=self.data.nx
            self.ny=self.data.nx


        if self.xrange == None:
            self.xrange = np.array(self.data.getBounds()[0:2])
        if self.yrange == None:
            self.yrange = np.array(self.data.getBounds()[2:4])

        self.Lx = self.xrange[1] - self.xrange[0]
        self.Ly = self.yrange[1] - self.yrange[0] 
Exemple #3
0
    def run(self):
        self.setup()
        
        offsets=np.arange(self.offsets[1]+1-self.offsets[0])+self.offsets[0]
        for offset in offsets:
            fo=''.join([self.filenameout,str(offset).zfill(4),'.png'])
            data=read.load(offset,file=self.filename,type=self.type)
            
#            exec ''.join(['var=',self.function])            
            var = self.function(data)
            self.polyplot = polyplot(var,data=data,
                                     nlevels=self.nlevels,grid=self.grid,cmap=self.cmap,
                                     orientation=self.orientation,
                                     xrange=self.xrange,yrange=self.yrange,
                                     min=self.min,max=self.max,
                                     filenameout=fo
                                     
                )
            self.polyplot.save(fo)
            plt.close()
Exemple #4
0
def getFromOffset(offset,filenameout='data',type='pvtu'):
    data = read.load(offset,file=filenameout,type=type)
    myradii=get(data)
    myradii['offset'] = offset
    return myradii