PLUTO
GUI_pyPLUTO.App Class Reference

Public Member Functions

def __init__ (self, master)
 
def loaddata (self)
 PLOT PROPERTIES #################################. More...
 
def getmyvar (self)
 
def logchkcall (self)
 
def contchkcall (self)
 
def arrchkcall (self)
 
def aspchkcall (self)
 
def polchkcall (self)
 
def setslice (self)
 
def plotclear (self)
 
def plotfinal (self)
 
def plotsurface (self)
 
def getvarrange (self)
 
def getxaxisrange (self)
 
def getyaxisrange (self)
 
def getplotvar (self)
 
def getsurfvar (self)
 
def drawpolar (self)
 
def drawcontour (self)
 
def drawarrow (self)
 
def epssave (self)
 
def pngsave (self)
 
def pdfsave (self)
 
def jpgsave (self)
 

Public Attributes

 datatype
 
 I
 
 Tool
 
 lb1
 
 enstep
 
 LoadedNstep
 
 PresentTime
 
 myData
 
 varkeys
 
 wdir
 
 Geom
 
 ldatabutton
 
 D
 
 myvar
 
 logchk
 
 contchk
 
 arrchk
 
 aspchk
 
 polchk
 
 slicename
 
 a
 
 image
 
 contlevlist
 
 contlevstr
 
 flevel
 
 varcont
 
 cs1
 
 varminval
 
 varmaxval
 
 xminval
 
 xmaxval
 
 yminval
 
 ymaxval
 
 sucess
 
 var
 
 x
 
 y
 
 SphData
 
 extent
 
 dRR
 
 dZZ
 
 isnotnan
 
 maxPl
 
 minPl
 
 normrange
 
 xcont
 
 ycont
 
 Ymesh
 
 xcong
 
 ycong
 
 vel1
 
 vel2
 
 xveccong
 
 yveccong
 
 normVp
 
 mag1
 
 mag2
 

Static Public Attributes

tuple SliceList = ("Along x1","Along x2","Along x3","Along x1-x2","Along x2-x3","Along x3-x1")
 MARK THE CUTS #################################. More...
 

Detailed Description

Definition at line 20 of file GUI_pyPLUTO.py.

Constructor & Destructor Documentation

def GUI_pyPLUTO.App.__init__ (   self,
  master 
)

Definition at line 21 of file GUI_pyPLUTO.py.

21  def __init__(self,master):
22 
23  # create toplevel window
24  frame = Frame(master)
25 
26  frame.grid(ipadx=10,ipady=10)
27 
28  try:
29  sys.argv[1]
30  except:
31  self.datatype = None
32  else:
33  self.datatype = sys.argv[1].split('--')[1]
34 
35  if self.datatype == 'hdf5':
36  print "GUI currently doesnot support pyPLUTO AMR Reader!!"
37  sys.exit()
38 
39  self.I = pp.Image()
40  self.Tool = pp.Tools()
41 
42 
43 
44  self.lb1=Label(frame, text="Nstep").grid(row=0,column=0)
45 
46 
47 
48  self.enstep = Entry(frame,width=8)
49  self.enstep.grid(row=0,column=1)
50  self.enstep.insert(0, "0")
51 
52  self.LoadedNstep = StringVar()
53  self.PresentTime = StringVar()
54 
55  self.myData = self.loaddata()
56  self.varkeys = self.myData.vars
57  self.wdir = self.myData.wdir
58 
59 
60  if self.myData.n3 != 1:
61  self.Geom = '3D'
62  elif self.myData.n3 == 1 and self.myData.n2 != 1:
63  self.Geom = '2D'
64  else:
65  self.Geom = '1D'
66 
67 
68 
69  self.ldatabutton=Button(frame,text="Load data",command=self.loaddata)
70  self.ldatabutton.grid(row=0,column=2)
71 
def loaddata(self)
PLOT PROPERTIES #################################.
Definition: GUI_pyPLUTO.py:304
def __init__(self, master)
Definition: GUI_pyPLUTO.py:21

Member Function Documentation

def GUI_pyPLUTO.App.arrchkcall (   self)

Definition at line 337 of file GUI_pyPLUTO.py.

337  def arrchkcall(self):
338  self.arrchk = self.arrowvar.get()
339  if self.arrchk == 1:
340  self.arrmenu.config(state='normal')
341  self.arrspb.config(state='normal')
342  else:
343  self.arrmenu.config(state='disabled')
344  self.arrspb.config(state='disabled')
345 
def arrchkcall(self)
Definition: GUI_pyPLUTO.py:337
def GUI_pyPLUTO.App.aspchkcall (   self)

Definition at line 346 of file GUI_pyPLUTO.py.

346  def aspchkcall(self):
347  self.aspchk=self.preaspect.get()
348 
def aspchkcall(self)
Definition: GUI_pyPLUTO.py:346
def GUI_pyPLUTO.App.contchkcall (   self)

Definition at line 328 of file GUI_pyPLUTO.py.

328  def contchkcall(self):
329  self.contchk = self.contvar.get()
330  if self.contchk == 1:
331  self.contmenu.config(state='normal')
332  self.xlevb.config(state='normal')
333  else:
334  self.contmenu.config(state='disabled')
335  self.xlevb.config(state='disabled')
336 
def contchkcall(self)
Definition: GUI_pyPLUTO.py:328
def GUI_pyPLUTO.App.drawarrow (   self)

Definition at line 746 of file GUI_pyPLUTO.py.

746  def drawarrow(self):
747  if self.polarvar.get() != 1:
748  if self.slicename == "Along x1-x2":
749  self.Xmesh, self.Ymesh = meshgrid(self.D.x1.T,self.D.x2.T)
750  self.xcong = self.Tool.congrid(self.Xmesh,2*(int(self.arrspb.get()),),method='linear')
751  self.ycong = self.Tool.congrid(self.Ymesh,2*(int(self.arrspb.get()),),method='linear')
752  if self.plarr.get() == 'Vp' or self.plarr.get() =='Vp_norm':
753  if self.D.n3 == 1:
754  self.vel1 = self.D.vx1[:,:].T
755  self.vel2 = self.D.vx2[:,:].T
756  else:
757  self.vel1 = self.D.vx1[:,:,int(self.ex3.get())].T
758  self.vel2 = self.D.vx2[:,:,int(self.ex3.get())].T
759 
760  self.xveccong = self.Tool.congrid(self.vel1,2*(int(self.arrspb.get()),),method='linear')
761  self.yveccong = self.Tool.congrid(self.vel2,2*(int(self.arrspb.get()),),method='linear')
762  self.normVp = sqrt(self.xveccong**2 + self.yveccong**2)
763  if self.plarr.get() == 'Vp_norm':
764  self.xveccong = self.xveccong/self.normVp
765  self.yveccong = self.yveccong/self.normVp
766  if self.plarr.get() == 'Bp' or self.plarr.get() =='Bp_norm':
767  if self.D.n3 == 1:
768  self.mag1 = self.D.bx1[:,:].T
769  self.mag2 = self.D.bx2[:,:].T
770  else:
771  self.mag1 = self.D.bx1[:,:,int(self.ex3.get())].T
772  self.mag2 = self.D.bx2[:,:,int(self.ex3.get())].T
773 
774  self.xveccong = self.Tool.congrid(self.mag1,2*(int(self.arrspb.get()),),method='linear')
775  self.yveccong = self.Tool.congrid(self.mag2,2*(int(self.arrspb.get()),),method='linear')
776  self.normVp = sqrt(self.xveccong**2 + self.yveccong**2)
777  if self.plarr.get() == 'Bp_norm':
778  self.xveccong = self.xveccong/self.normVp
779  self.yveccong = self.yveccong/self.normVp
780 
781  elif self.slicename == "Along x2-x3":
782  self.Xmesh, self.Ymesh = meshgrid(self.D.x2.T,self.D.x3.T)
783  self.xcong = self.Tool.congrid(self.Xmesh,2*(int(self.arrspb.get()),),method='linear')
784  self.ycong = self.Tool.congrid(self.Ymesh,2*(int(self.arrspb.get()),),method='linear')
785  if self.plarr.get() == 'Vp' or self.plarr.get() =='Vp_norm':
786  self.vel1 = self.D.vx2[int(self.ex1.get()),:,:].T
787  self.vel2 = self.D.vx3[int(self.ex1.get()),:,:].T
788  self.xveccong = self.Tool.congrid(self.vel1,2*(int(self.arrspb.get()),),method='linear')
789  self.yveccong = self.Tool.congrid(self.vel2,2*(int(self.arrspb.get()),),method='linear')
790  self.normVp = sqrt(self.xveccong**2 + self.yveccong**2)
791  if self.plarr.get() == 'Vp_norm':
792  self.xveccong = self.xveccong/self.normVp
793  self.yveccong = self.yveccong/self.normVp
794  if self.plarr.get() == 'Bp' or self.plarr.get() =='Bp_norm':
795  self.mag1 = self.D.bx2[int(self.ex1.get()),:,:].T
796  self.mag2 = self.D.bx3[int(self.ex1.get()),:,:].T
797  self.xveccong = self.Tool.congrid(self.mag1,2*(int(self.arrspb.get()),),method='linear')
798  self.yveccong = self.Tool.congrid(self.mag2,2*(int(self.arrspb.get()),),method='linear')
799  self.normVp = sqrt(self.xveccong**2 + self.yveccong**2)
800  if self.plarr.get() == 'Bp_norm':
801  self.xveccong = self.xveccong/self.normVp
802  self.yveccong = self.yveccong/self.normVp
803  else:
804  self.Xmesh, self.Ymesh = meshgrid(self.D.x1.T,self.D.x3.T)
805  self.xcong = self.Tool.congrid(self.Xmesh,2*(int(self.arrspb.get()),),method='linear')
806  self.ycong = self.Tool.congrid(self.Ymesh,2*(int(self.arrspb.get()),),method='linear')
807  if self.plarr.get() == 'Vp' or self.plarr.get() =='Vp_norm':
808  self.vel1 = self.D.vx1[:,int(self.ex2.get()),:].T
809  self.vel2 = self.D.vx3[:,int(self.ex2.get()),:].T
810  self.xveccong = self.Tool.congrid(self.vel1,2*(int(self.arrspb.get()),),method='linear')
811  self.yveccong = self.Tool.congrid(self.vel2,2*(int(self.arrspb.get()),),method='linear')
812  self.normVp = sqrt(self.xveccong**2 + self.yveccong**2)
813  if self.plarr.get() == 'Vp_norm':
814  self.xveccong = self.xveccong/self.normVp
815  self.yveccong = self.yveccong/self.normVp
816  if self.plarr.get() == 'Bp' or self.plarr.get() =='Bp_norm':
817  self.mag1 = self.D.bx1[:,int(self.ex2.get()),:].T
818  self.mag2 = self.D.bx3[:,int(self.ex2.get()),:].T
819  self.xveccong = self.Tool.congrid(self.mag1,2*(int(self.arrspb.get()),),method='linear')
820  self.yveccong = self.Tool.congrid(self.mag2,2*(int(self.arrspb.get()),),method='linear')
821  self.normVp = sqrt(self.xveccong**2 + self.yveccong**2)
822  if self.plarr.get() == 'Bp_norm':
823  self.xveccong = self.xveccong/self.normVp
824  self.yveccong = self.yveccong/self.normVp
825  else:
826  self.xcong = self.Tool.congrid(self.R,2*(int(self.arrspb.get()),),method='linear')
827  self.ycong = self.Tool.congrid(self.Z,2*(int(self.arrspb.get()),),method='linear')
828  if self.plarr.get() == 'Vp' or self.plarr.get() =='Vp_norm':
829  if self.slicename == "Along x1-x2":
830  self.vel1 = self.SphData['v1c']
831  self.vel2 = self.SphData['v2c']
832  else:
833  self.vel1 = self.SphData['v1c']
834  self.vel2 = self.SphData['v3c']
835 
836  self.xveccong = self.Tool.congrid(self.vel1,2*(int(self.arrspb.get()),),method='linear')
837  self.yveccong = self.Tool.congrid(self.vel2,2*(int(self.arrspb.get()),),method='linear')
838  self.normVp = sqrt(self.xveccong**2 + self.yveccong**2)
839  if self.plarr.get() == 'Vp_norm':
840  self.xveccong = self.xveccong/self.normVp
841  self.yveccong = self.yveccong/self.normVp
842  if self.plarr.get() == 'Bp' or self.plarr.get() =='Bp_norm':
843 
844  if self.slicename == "Along x1-x2":
845  self.mag1 = self.SphData['b1c']
846  self.mag2 = self.SphData['b2c']
847  else:
848  self.mag1 = self.SphData['b1c']
849  self.mag2 = self.SphData['b3c']
850 
851  self.xveccong = self.Tool.congrid(self.mag1,2*(int(self.arrspb.get()),),method='linear')
852  self.yveccong = self.Tool.congrid(self.mag2,2*(int(self.arrspb.get()),),method='linear')
853  self.normVp = sqrt(self.xveccong**2 + self.yveccong**2)
854  if self.plarr.get() == 'Bp_norm':
855  self.xveccong = self.xveccong/self.normVp
856  self.yveccong = self.yveccong/self.normVp
857 
def drawarrow(self)
Definition: GUI_pyPLUTO.py:746
def GUI_pyPLUTO.App.drawcontour (   self)

Definition at line 704 of file GUI_pyPLUTO.py.

704  def drawcontour(self):
705  if self.polarvar.get() != 1:
706  if self.slicename == "Along x1-x2":
707  self.xcont = self.D.x1
708  self.ycont = self.D.x2
709  self.Xmesh, self.Ymesh = meshgrid(self.D.x1.T,self.D.x2.T)
710  if self.D.n3 == 1:
711  if self.plcont.get() == 'x1*Ax3':
712  self.varcont = self.Xmesh*(self.D.Ax3.T)
713  elif self.plcont.get() == 'x1*bx3':
714  self.varcont = self.Xmesh*(self.D.bx3.T)
715  else:
716  self.varcont = self.D.__getattribute__(self.plcont.get())[:,:].T
717  else:
718  if self.plcont.get() == 'x1*Ax3':
719  self.varcont = self.Xmesh*(self.D.Ax3[:,:,int(self.ex3.get())].T)
720  elif self.plcont.get() == 'x1*bx3':
721  self.varcont = self.Xmesh*(self.D.bx3[:,:,int(self.ex3.get())].T)
722  else:
723  self.varcont = self.D.__getattribute__(self.plcont.get())[:,:,int(self.ex3.get())].T
724 
725  elif self.slicename == "Along x2-x3":
726  self.xcont = self.D.x2
727  self.ycont = self.D.x3
728  self.varcont = self.D.__getattribute__(self.plcont.get())[int(self.ex1.get()),:,:].T
729  else:
730  self.xcont = self.D.x1
731  self.ycont = self.D.x3
732  self.varcont = self.D.__getattribute__(self.plcont.get())[:,int(self.ex2.get()),:].T
733  else:
734  self.xcont = self.R
735  self.ycont = self.Z
736  if self.plcont.get() == 'x1*Ax3':
737  self.varcont = self.R*(self.SphData['Ax3'])
738  elif self.plcont.get() == 'x1*bx3':
739  self.varcont = self.R*(self.SphData['bx3'])
740  else:
741  if self.logvar.get() == 1 and self.plcont.get() == self.myvar:
742  self.varcont = 10**(self.SphData[self.plcont.get()])
743  else:
744  self.varcont = self.SphData[self.plcont.get()]
745 
def drawcontour(self)
Definition: GUI_pyPLUTO.py:704
def GUI_pyPLUTO.App.drawpolar (   self)

Definition at line 656 of file GUI_pyPLUTO.py.

656  def drawpolar(self):
657  self.sucess = False
658  if self.slicename == "Along x1-x2":
659  if self.D.n3 == 1:
660  self.R,self.Z,self.SphData = self.I.getSphData(self.D,w_dir=self.wdir,datatype=self.datatype, rphi=False)
661  self.sucess = True
662  else:
663  try:
664  int(self.ex3.get().strip().split()[0])
665  except (ValueError, IndexError):
666  print "Specify the value of x3 cut"
667  else:
668  self.R,self.Z,self.SphData = self.I.getSphData(self.D,w_dir=self.wdir,datatype=self.datatype, rphi=False,x3cut=int(self.ex3.get()))
669  self.sucess = True
670 
671  if self.slicename == "Along x3-x1":
672  try:
673  int(self.ex2.get().strip().split()[0])
674  except (ValueError, IndexError):
675  print "Specify the value of x2 cut"
676  else:
677  self.R,self.Z,self.SphData = self.I.getSphData(self.D,w_dir=self.wdir,datatype=self.datatype, rphi=True, x2cut=int(self.ex2.get()))
678  self.sucess = True
679 
680  if self.sucess == True:
681  self.extent=(min(self.R.flat),max(self.R.flat),min(self.Z.flat),max(self.Z.flat))
682  self.dRR=max(self.R.flat)-min(self.R.flat)
683  self.dZZ=max(self.Z.flat)-min(self.Z.flat)
684 
685  self.isnotnan=-isnan(self.SphData[self.myvar])
686  self.maxPl=max(self.SphData[self.myvar][self.isnotnan].flat)
687  self.minPl=min(self.SphData[self.myvar][self.isnotnan].flat)
688  self.normrange=False
689  if self.minPl<0:
690  self.normrange=True
691  if self.maxPl>-self.minPl:
692  self.minPl=-self.maxPl
693  else:
694  self.maxPl=-self.minPl
695  if (self.normrange and self.myvar !='rho' and self.myvar !='prs'):
696  self.SphData[self.myvar][-1][-1]=self.maxPl
697  self.SphData[self.myvar][-1][-2]=self.minPl
698  if self.logvar.get() == 1:
699  self.SphData[self.myvar] = log10(self.SphData[self.myvar])
700 
701  return self.sucess
702 
703 
def drawpolar(self)
Definition: GUI_pyPLUTO.py:656
double max
Definition: analysis.c:5

Here is the caller graph for this function:

def GUI_pyPLUTO.App.epssave (   self)

Definition at line 858 of file GUI_pyPLUTO.py.

858  def epssave(self):
859  self.f.savefig(self.myvar+'_'+self.enstep.get()+'.eps')
def epssave(self)
Definition: GUI_pyPLUTO.py:858
def GUI_pyPLUTO.App.getmyvar (   self)

Definition at line 317 of file GUI_pyPLUTO.py.

317  def getmyvar(self):
318  try:
319  self.v.get() != "None"
320  except KeyError:
321  print "Specify the variable to plot"
322  else:
323  self.myvar=self.v.get()
324 
def getmyvar(self)
Definition: GUI_pyPLUTO.py:317
def GUI_pyPLUTO.App.getplotvar (   self)

Definition at line 529 of file GUI_pyPLUTO.py.

529  def getplotvar(self):
530  self.sucess = False
531  if self.logvar.get() == 1:
532  self.var = log10(self.D.__getattribute__(self.myvar))
533  else:
534  self.var = self.D.__getattribute__(self.myvar)
535 
536  if self.Geom == '1D':
537  self.x = self.D.x1
538  self.sucess = True
539  else:
540  if self.slicename == "Along x1":
541  self.x = self.D.x1
542  if self.D.n3 == 1:
543  try:
544  int(self.ex2.get().strip().split()[0])
545  except (ValueError, IndexError):
546  print "Specify the value of x2 cut"
547  else:
548  self.var = self.var[:,int(self.ex2.get())]
549  self.sucess = True
550  else:
551  try:
552  int(self.ex2.get().strip().split()[0])
553  int(self.ex3.get().strip().split()[0])
554  except (ValueError, IndexError):
555  print "Specify the value of x2 or x3 cut"
556  else:
557  self.var = self.var[:,int(self.ex2.get()),int(self.ex3.get())]
558  self.sucess = True
559 
560  elif self.slicename == "Along x2":
561  self.x = self.D.x2
562  if self.D.n3 == 1:
563  try:
564  int(self.ex1.get().strip().split()[0])
565  except (ValueError, IndexError):
566  print "Specify the value of x1 cut"
567  else:
568  self.var = self.var[int(self.ex1.get()),:]
569  self.sucess = True
570  else:
571  try:
572  int(self.ex1.get().strip().split()[0])
573  int(self.ex3.get().strip().split()[0])
574  except (ValueError, IndexError):
575  print "Specify the value of x1 or x3 cut"
576  else:
577  self.var = self.var[int(self.ex1.get()),:,int(self.ex3.get())]
578  self.sucess = True
579 
580  else:
581  self.x = self.D.x3
582  try:
583  int(self.ex1.get().strip().split()[0])
584  int(self.ex2.get().strip().split()[0])
585  except (ValueError, IndexError):
586  print "Specify the value of x1 or x2 cut"
587  else:
588  self.var = self.var[int(self.ex1.get()),int(self.ex2.get()),:]
589  self.sucess = True
590 
591  return self.sucess
592 
def getplotvar(self)
Definition: GUI_pyPLUTO.py:529

Here is the caller graph for this function:

def GUI_pyPLUTO.App.getsurfvar (   self)

Definition at line 593 of file GUI_pyPLUTO.py.

593  def getsurfvar(self):
594  self.sucess = False
595  if self.logvar.get() == 1:
596  self.var = log10(self.D.__getattribute__(self.myvar))
597  else:
598  self.var = self.D.__getattribute__(self.myvar)
599 
600  if self.slicename == "Along x1-x2":
601  self.x = self.D.x1
602  self.y = self.D.x2
603  xmineed = (abs(self.x-self.getxaxisrange()[0])).argmin()
604  xmaneed = (abs(self.x-self.getxaxisrange()[1])).argmin()
605  ymineed = (abs(self.y-self.getyaxisrange()[0])).argmin()
606  ymaneed = (abs(self.y-self.getyaxisrange()[1])).argmin()
607  self.x = self.x[xmineed:xmaneed]
608  self.y = self.y[ymineed:ymaneed]
609  if self.D.n3 == 1:
610  self.var = self.var[xmineed:xmaneed,ymineed:ymaneed].T
611  self.sucess = True
612  else:
613  try:
614  int(self.ex3.get().strip().split()[0])
615  except (ValueError, IndexError):
616  print "Specify the value of x3 cut"
617  else:
618  self.var = self.var[xmineed:xmaneed,ymineed:ymaneed,int(self.ex3.get())].T
619  self.sucess = True
620 
621  elif self.slicename == "Along x2-x3":
622  self.x = self.D.x2
623  self.y = self.D.x3
624  xmineed = (abs(self.x-self.getxaxisrange()[0])).argmin()
625  xmaneed = (abs(self.x-self.getxaxisrange()[1])).argmin()
626  ymineed = (abs(self.y-self.getyaxisrange()[0])).argmin()
627  ymaneed = (abs(self.y-self.getyaxisrange()[1])).argmin()
628  self.x = self.x[xmineed:xmaneed]
629  self.y = self.y[ymineed:ymaneed]
630  try:
631  int(self.ex1.get().strip().split()[0])
632  except (ValueError, IndexError):
633  print "Specify the value of x1 cut"
634  else:
635  self.var = self.var[int(self.ex1.get()),xmineed:xmaneed,ymineed:ymaneed].T
636  self.sucess = True
637  else:
638  self.x = self.D.x1
639  self.y = self.D.x3
640  xmineed = (abs(self.x-self.getxaxisrange()[0])).argmin()
641  xmaneed = (abs(self.x-self.getxaxisrange()[1])).argmin()
642  ymineed = (abs(self.y-self.getyaxisrange()[0])).argmin()
643  ymaneed = (abs(self.y-self.getyaxisrange()[1])).argmin()
644  self.x = self.x[xmineed:xmaneed]
645  self.y = self.y[ymineed:ymaneed]
646  try:
647  int(self.ex2.get().strip().split()[0])
648  except (ValueError, IndexError):
649  print "Specify the value of x2 cut"
650  else:
651  self.var = self.var[xmineed:xmaneed,int(self.ex2.get()),ymineed:ymaneed].T
652  self.sucess = True
653 
654  return self.sucess
655 
def getsurfvar(self)
Definition: GUI_pyPLUTO.py:593
def getyaxisrange(self)
Definition: GUI_pyPLUTO.py:505
def getxaxisrange(self)
Definition: GUI_pyPLUTO.py:482
def GUI_pyPLUTO.App.getvarrange (   self)

Definition at line 458 of file GUI_pyPLUTO.py.

458  def getvarrange(self):
459  try:
460  float(self.varmin.get())
461  except:
462  if self.polarvar.get() != 1:
463  self.varminval = min(self.var)
464  else:
465  self.varminval = min(self.SphData[self.myvar][self.isnotnan].flat)#self.minPl
466  else:
467  self.varminval = float(self.varmin.get())
468 
469  try:
470  float(self.varmax.get())
471  except:
472  if self.polarvar.get() != 1:
473  self.varmaxval = max(self.var)
474  else:
475  self.varmaxval = max(self.SphData[self.myvar][self.isnotnan].flat)#self.maxPl
476  else:
477  self.varmaxval = float(self.varmax.get())
478 
479  return [self.varminval,self.varmaxval]
480 
481 
def getvarrange(self)
Definition: GUI_pyPLUTO.py:458
double max
Definition: analysis.c:5

Here is the caller graph for this function:

def GUI_pyPLUTO.App.getxaxisrange (   self)

Definition at line 482 of file GUI_pyPLUTO.py.

482  def getxaxisrange(self):
483  try:
484  float(self.xrmin.get())
485  except:
486  if self.polarvar.get() != 1:
487  self.xminval = min(self.x)
488  else:
489  self.xminval = min(self.R.flat)
490  else:
491  self.xminval = float(self.xrmin.get())
492 
493  try:
494  float(self.xrmax.get())
495  except:
496  if self.polarvar.get() != 1:
497  self.xmaxval = max(self.x)
498  else:
499  self.xmaxval = max(self.R.flat)
500  else:
501  self.xmaxval = float(self.xrmax.get())
502 
503  return [self.xminval,self.xmaxval]
504 
def getxaxisrange(self)
Definition: GUI_pyPLUTO.py:482
double max
Definition: analysis.c:5

Here is the caller graph for this function:

def GUI_pyPLUTO.App.getyaxisrange (   self)

Definition at line 505 of file GUI_pyPLUTO.py.

505  def getyaxisrange(self):
506  try:
507  float(self.yrmin.get())
508  except:
509  if self.polarvar.get() != 1:
510  self.yminval = min(self.y)
511  else:
512  self.yminval = min(self.Z.flat)
513  else:
514  self.yminval = float(self.yrmin.get())
515 
516  try:
517  float(self.yrmax.get())
518  except:
519  if self.polarvar.get() != 1:
520  self.ymaxval = max(self.y)
521  else:
522  self.ymaxval = max(self.Z.flat)
523  else:
524  self.ymaxval = float(self.yrmax.get())
525 
526  return [self.yminval,self.ymaxval]
527 
528 
def getyaxisrange(self)
Definition: GUI_pyPLUTO.py:505
double max
Definition: analysis.c:5

Here is the caller graph for this function:

def GUI_pyPLUTO.App.jpgsave (   self)

Definition at line 864 of file GUI_pyPLUTO.py.

864  def jpgsave(self):
865  self.f.savefig(self.myvar+'_'+self.enstep.get()+'.jpg')
866 
867 
868 
869 
870 
871 
872 
873 
874 root=Tk()
875 app=App(root)
876 root.title("pyPLUTO")
877 
def jpgsave(self)
Definition: GUI_pyPLUTO.py:864
def GUI_pyPLUTO.App.loaddata (   self)

PLOT PROPERTIES #################################.

X and Y LABELS ################################# X and Y RANGE####################### CONTOURS ################################# ARROWS ################################# VARIOUS PLOTTING BUTTONS ################################# INFORMATION ################################# VARIOUS FUNCTIONS #################################

Definition at line 304 of file GUI_pyPLUTO.py.

304  def loaddata(self):
305  try:
306  int(self.enstep.get().strip().split()[0])
307  except (ValueError, IndexError):
308  print "Specify the proper value of Nstep"
309  else:
310  mynstep=int(self.enstep.get())
311  self.D = pp.pload(mynstep,datatype=self.datatype)
312  self.LoadedNstep.set("Loaded Nstep = "+self.enstep.get())
313  self.PresentTime.set("Present Time = "+str(self.D.SimTime) + " [cu]")
314  return self.D
315 
316 
def loaddata(self)
PLOT PROPERTIES #################################.
Definition: GUI_pyPLUTO.py:304
def GUI_pyPLUTO.App.logchkcall (   self)

Definition at line 325 of file GUI_pyPLUTO.py.

325  def logchkcall(self):
326  self.logchk = self.logvar.get()
327 
def logchkcall(self)
Definition: GUI_pyPLUTO.py:325
def GUI_pyPLUTO.App.pdfsave (   self)

Definition at line 862 of file GUI_pyPLUTO.py.

862  def pdfsave(self):
863  self.f.savefig(self.myvar+'_'+self.enstep.get()+'.pdf')
def pdfsave(self)
Definition: GUI_pyPLUTO.py:862
def GUI_pyPLUTO.App.plotclear (   self)

Definition at line 376 of file GUI_pyPLUTO.py.

376  def plotclear(self):
377 
378  self.f.clf()
379  self.a = self.f.add_subplot(111)
380  self.canvas.show()
381 
def plotclear(self)
Definition: GUI_pyPLUTO.py:376

Here is the caller graph for this function:

def GUI_pyPLUTO.App.plotfinal (   self)

Definition at line 382 of file GUI_pyPLUTO.py.

382  def plotfinal(self):
383  if self.getplotvar() == True:
384  self.a.axis([self.getxaxisrange()[0],self.getxaxisrange()[1],self.getvarrange()[0],self.getvarrange()[1]])
385  self.a.plot(self.x,self.var)
386  self.a.set_aspect('auto')
387  self.a.set_xlabel(self.xlb.get())
388  self.a.set_ylabel(self.ylb.get())
389  self.canvas.show()
390 
def plotfinal(self)
Definition: GUI_pyPLUTO.py:382
def getplotvar(self)
Definition: GUI_pyPLUTO.py:529
def getxaxisrange(self)
Definition: GUI_pyPLUTO.py:482
def getvarrange(self)
Definition: GUI_pyPLUTO.py:458

Here is the call graph for this function:

def GUI_pyPLUTO.App.plotsurface (   self)

Definition at line 391 of file GUI_pyPLUTO.py.

391  def plotsurface(self):
392  tdum = time.time()
393  self.plotclear()
394 
395  if self.preaspect.get() == 1:
396  self.a.set_aspect('equal')
397  else:
398  self.a.set_aspect('auto')
399 
400 
401  if self.polarvar.get() == 1:
402  if self.drawpolar() == True:
403  self.a.axis([self.getxaxisrange()[0],self.getxaxisrange()[1],self.getyaxisrange()[0],self.getyaxisrange()[1]])
404  self.image = self.a.imshow(self.SphData[self.myvar], origin='lower',extent=self.extent, interpolation='nearest',cmap="jet", vmin=self.getvarrange()[0],vmax=self.getvarrange()[1])
405  self.f.colorbar(self.image)
406  else:
407  if self.getsurfvar() == True:
408  self.a.axis([self.getxaxisrange()[0],self.getxaxisrange()[1],self.getyaxisrange()[0],self.getyaxisrange()[1]])
409  self.image=self.a.pcolormesh(self.x,self.y,self.var,cmap='jet',vmin=self.getvarrange()[0],vmax=self.getvarrange()[1])
410  self.f.colorbar(self.image)
411 
412 
413  if self.contvar.get() == 1:
414  try:
415  self.plcont.get() != "None"
416  except KeyError:
417  print "Specify the variable for Contour"
418  else:
419  self.drawcontour()
420  self.contlevlist=[]
421  self.contlevstr = string.split(self.xlevb.get(),',')
422  try:
423  if self.contlevstr[0] == 'log':
424  self.flevel = self.contlevstr[1]
425  self.varcont = log10(self.varcont)
426  else:
427  self.flevel = self.contlevstr[0]
428 
429  float(self.flevel)
430  self.contlevlist = [float(self.flevel)]
431 
432  except:
433  self.contlevlist = 5
434  else:
435  for j in range(1,len(self.contlevstr)):
436  self.contlevlist.append(float(self.contlevstr[j]))
437 
438 
439  self.cs1 = self.a.contour(self.xcont,self.ycont,self.varcont,self.contlevlist,colors="w")
440  self.a.clabel(self.cs1,inline=True)
441 
442 
443  if self.arrowvar.get() == 1:
444  try:
445  self.plarr.get() != "None"
446  except KeyError:
447  print "Specify the variable for plotting the arrow"
448  else:
449  self.drawarrow()
450  self.a.quiver(self.xcong, self.ycong, self.xveccong, self.yveccong,color='w')
451 
452  self.a.set_xlabel(self.xlb.get())
453  self.a.set_ylabel(self.ylb.get())
454  self.canvas.show()
455 
456 
457 
def plotclear(self)
Definition: GUI_pyPLUTO.py:376
def getsurfvar(self)
Definition: GUI_pyPLUTO.py:593
def drawpolar(self)
Definition: GUI_pyPLUTO.py:656
def getyaxisrange(self)
Definition: GUI_pyPLUTO.py:505
def drawcontour(self)
Definition: GUI_pyPLUTO.py:704
def drawarrow(self)
Definition: GUI_pyPLUTO.py:746
def getxaxisrange(self)
Definition: GUI_pyPLUTO.py:482
def getvarrange(self)
Definition: GUI_pyPLUTO.py:458
def plotsurface(self)
Definition: GUI_pyPLUTO.py:391

Here is the call graph for this function:

def GUI_pyPLUTO.App.pngsave (   self)

Definition at line 860 of file GUI_pyPLUTO.py.

860  def pngsave(self):
861  self.f.savefig(self.myvar+'_'+self.enstep.get()+'.png')
def pngsave(self)
Definition: GUI_pyPLUTO.py:860
def GUI_pyPLUTO.App.polchkcall (   self)

Definition at line 349 of file GUI_pyPLUTO.py.

349  def polchkcall(self):
350  self.polchk = self.polarvar.get()
351 
def polchkcall(self)
Definition: GUI_pyPLUTO.py:349
def GUI_pyPLUTO.App.setslice (   self)

Definition at line 352 of file GUI_pyPLUTO.py.

352  def setslice(self):
353  self.slicename=self.slvar.get()
354  if self.slicename == "Along x1" or self.slicename == "Along x2" or self.slicename == "Along x3":
355  self.surfbutton.config(state='disabled')
356  self.arrowchkb.config(state = 'disabled')
357  self.arrowvar.set(0)
358  self.chkb.config(state = 'disabled')
359  self.contvar.set(0)
360  self.pltbutton.config(state='active')
361  self.polchkb.config(state='disabled')
362  self.polarvar.set(0)
363  else:
364  self.pltbutton.config(state='disabled')
365  self.arrowchkb.config(state = 'normal')
366  self.chkb.config(state = 'normal')
367  self.surfbutton.config(state='active')
368  self.polchkb.config(state='normal')
369 
370  if self.slicename == "Along x2-x3":
371  self.polchkb.config(state='disabled')
372  self.polarvar.set(0)
373 
374 
375 
def setslice(self)
Definition: GUI_pyPLUTO.py:352

Member Data Documentation

GUI_pyPLUTO.App.a

Definition at line 379 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.arrchk

Definition at line 338 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.aspchk

Definition at line 347 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.contchk

Definition at line 329 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.contlevlist

Definition at line 420 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.contlevstr

Definition at line 421 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.cs1

Definition at line 439 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.D

Definition at line 311 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.datatype

Definition at line 31 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.dRR

Definition at line 682 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.dZZ

Definition at line 683 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.enstep

Definition at line 48 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.extent

Definition at line 681 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.flevel

Definition at line 424 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.Geom

Definition at line 61 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.I

Definition at line 39 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.image

Definition at line 404 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.isnotnan

Definition at line 685 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.lb1

Definition at line 44 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.ldatabutton

Definition at line 69 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.LoadedNstep

Definition at line 52 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.logchk

Definition at line 326 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.mag1

Definition at line 768 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.mag2

Definition at line 769 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.maxPl

Definition at line 686 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.minPl

Definition at line 687 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.myData

Definition at line 55 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.myvar

Definition at line 323 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.normrange

Definition at line 688 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.normVp

Definition at line 762 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.polchk

Definition at line 350 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.PresentTime

Definition at line 53 of file GUI_pyPLUTO.py.

tuple GUI_pyPLUTO.App.SliceList = ("Along x1","Along x2","Along x3","Along x1-x2","Along x2-x3","Along x3-x1")
static

MARK THE CUTS #################################.

VARIABLES TO PLOT ################################# SLICES CHOICE #################################

Definition at line 126 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.slicename

Definition at line 353 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.SphData

Definition at line 660 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.sucess

Definition at line 530 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.Tool

Definition at line 40 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.var

Definition at line 532 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.varcont

Definition at line 425 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.varkeys

Definition at line 56 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.varmaxval

Definition at line 473 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.varminval

Definition at line 463 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.vel1

Definition at line 754 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.vel2

Definition at line 755 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.wdir

Definition at line 57 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.x

Definition at line 537 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.xcong

Definition at line 750 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.xcont

Definition at line 707 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.xmaxval

Definition at line 497 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.xminval

Definition at line 487 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.xveccong

Definition at line 760 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.y

Definition at line 602 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.ycong

Definition at line 751 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.ycont

Definition at line 708 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.ymaxval

Definition at line 520 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.Ymesh

Definition at line 709 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.yminval

Definition at line 510 of file GUI_pyPLUTO.py.

GUI_pyPLUTO.App.yveccong

Definition at line 761 of file GUI_pyPLUTO.py.


The documentation for this class was generated from the following file: