PLUTO
|
Public Member Functions | |
def | pldisplay (self, D, var, kwargs) |
def | multi_disp (self, args, kwargs) |
def | oplotbox |
def | field_interp (self, var1, var2, x, y, dx, dy, xp, yp) |
def | field_line (self, var1, var2, x, y, dx, dy, x0, y0) |
def | myfieldlines (self, Data, x0arr, y0arr, stream=False, kwargs) |
def | getSphData (self, Data, w_dir=None, datatype=None, kwargs) |
def | getPolarData |
def | pltSphData (self, Data, w_dir=None, datatype=None, kwargs) |
This Class has all the routines for the imaging the data and plotting various contours and fieldlines on these images. CALLED AFTER pyPLUTO.pload object is defined
Definition at line 1247 of file pyPLUTO.py.
def pyPLUTO.pyPLUTO.Image.field_interp | ( | self, | |
var1, | |||
var2, | |||
x, | |||
y, | |||
dx, | |||
dy, | |||
xp, | |||
yp | |||
) |
This method interpolates value of vector fields (var1 and var2) on field points (xp and yp). The field points are obtained from the method field_line. **Inputs:** var1 -- 2D Vector field in X direction\n var2 -- 2D Vector field in Y direction\n x -- 1D X array\n y -- 1D Y array\n dx -- 1D grid spacing array in X direction\n dy -- 1D grid spacing array in Y direction\n xp -- field point in X direction\n yp -- field point in Y direction\n **Outputs:** A list with 2 elements where the first element corresponds to the interpolate field point in 'x' direction and the second element is the field point in 'y' direction.
Definition at line 1410 of file pyPLUTO.py.
def pyPLUTO.pyPLUTO.Image.field_line | ( | self, | |
var1, | |||
var2, | |||
x, | |||
y, | |||
dx, | |||
dy, | |||
x0, | |||
y0 | |||
) |
This method is used to obtain field lines (same as fieldline.pro in PLUTO IDL tools). **Inputs:** var1 -- 2D Vector field in X direction\n var2 -- 2D Vector field in Y direction\n x -- 1D X array\n y -- 1D Y array\n dx -- 1D grid spacing array in X direction\n dy -- 1D grid spacing array in Y direction\n x0 -- foot point of the field line in X direction\n y0 -- foot point of the field line in Y direction\n **Outputs:** This routine returns a dictionary with keys - \n qx -- list of the field points along the 'x' direction. qy -- list of the field points along the 'y' direction. **Usage:** See the myfieldlines routine for the same.
Definition at line 1444 of file pyPLUTO.py.
def pyPLUTO.pyPLUTO.Image.getPolarData | ( | self, | |
Data, | |||
ang_coord, | |||
rphi = False |
|||
) |
To get the Cartesian Co-ordinates from Polar. **Inputs:** Data -- pyPLUTO pload Object\n ang_coord -- The Angular co-ordinate (theta or Phi) *Optional Keywords:* rphi -- Default value FALSE is for R-THETA data, Set TRUE for R-PHI data.\n **Outputs**: 2D Arrays of X, Y from the Radius and Angular co-ordinates.\n They are used in pcolormesh in the Image.pldisplay functions.
Definition at line 1642 of file pyPLUTO.py.
def pyPLUTO.pyPLUTO.Image.getSphData | ( | self, | |
Data, | |||
w_dir = None , |
|||
datatype = None , |
|||
kwargs | |||
) |
This method transforms the vector and scalar fields from Spherical co-ordinates to Cylindrical. **Inputs**: Data -- pyPLUTO.pload object\n w_dir -- /path/to/the/working/directory/\n datatype -- If the data is of 'float' type then datatype = 'float' else by default the datatype is set to 'double'. *Optional Keywords*: rphi -- [Default] is set to False implies that the r-theta plane is transformed. If set True then the r-phi plane is transformed.\n x2cut -- Applicable for 3D data and it determines the co-ordinate of the x2 plane while r-phi is set to True.\n x3cut -- Applicable for 3D data and it determines the co-ordinate of the x3 plane while r-phi is set to False.
Definition at line 1562 of file pyPLUTO.py.
def pyPLUTO.pyPLUTO.Image.multi_disp | ( | self, | |
args, | |||
kwargs | |||
) |
def pyPLUTO.pyPLUTO.Image.myfieldlines | ( | self, | |
Data, | |||
x0arr, | |||
y0arr, | |||
stream = False , |
|||
kwargs | |||
) |
This method overplots the magnetic field lines at the footpoints given by (x0arr[i],y0arr[i]). **Inputs:** Data -- pyPLUTO.pload object\n x0arr -- array of x co-ordinates of the footpoints\n y0arr -- array of y co-ordinates of the footpoints\n stream -- keyword for two different ways of calculating the field lines.\n True -- plots contours of rAphi (needs to store vector potential)\n False -- plots the fieldlines obtained from the field_line routine. (Default option) *Optional Keywords:* colors -- A list of matplotlib colors to represent the lines. The length of this list should be same as that of x0arr.\n lw -- Integer value that determines the linewidth of each line.\n ls -- Determines the linestyle of each line. **Usage:** Assume that the magnetic field is a given as **B** = B0$\hat{y}$. Then to show this field lines we have to define the x and y arrays of field foot points.\n ``x0arr = linspace(0.0,10.0,20)``\n ``y0arr = linspace(0.0,0.0,20)``\n ``import pyPLUTO as pp``\n ``D = pp.pload(45)``\n ``I = pp.Image()``\n ``I.myfieldlines(D,x0arr,y0arr,colors='k',ls='--',lw=1.0)``
Definition at line 1510 of file pyPLUTO.py.
def pyPLUTO.pyPLUTO.Image.oplotbox | ( | self, | |
AMRLevel, | |||
lrange = [0 , |
|||
cval = ['b' , |
|||
r, | |||
g, | |||
m, | |||
w, | |||
k, | |||
islice = -1 , |
|||
jslice = -1 , |
|||
kslice = -1 , |
|||
geom = 'CARTESIAN' |
|||
) |
This method overplots the AMR boxes up to the specified level. **Input:** AMRLevel -- AMR object loaded during the reading and stored in the pload object *Optional Keywords:* lrange -- [level_min,level_max] to be overplotted. By default it shows all the loaded levels\n cval -- list of colors for the levels to be overplotted.\n [ijk]slice -- Index of the 2D slice to look for so that the adequate box limits are plotted. By default oplotbox considers you are plotting a 2D slice of the z=min(x3) plane.\n geom -- Specified the geometry. Currently, CARTESIAN (default) and POLAR geometries are handled.
Definition at line 1344 of file pyPLUTO.py.
def pyPLUTO.pyPLUTO.Image.pldisplay | ( | self, | |
D, | |||
var, | |||
kwargs | |||
) |
This method allows the user to display a 2D data using the matplotlib's pcolormesh. **Inputs:** D -- pyPLUTO pload object.\n var -- 2D array that needs to be displayed. *Required Keywords:* x1 -- The 'x' array\n x2 -- The 'y' array *Optional Keywords:* vmin -- The minimum value of the 2D array (Default : min(var))\n vmax -- The maximum value of the 2D array (Default : max(var))\n title -- Sets the title of the image.\n label1 -- Sets the X Label (Default: 'XLabel')\n label2 -- Sets the Y Label (Default: 'YLabel')\n polar -- A list to project Polar data on Cartesian Grid.\n polar = [True, True] -- Projects r-phi plane.\n polar = [True, False] -- Project r-theta plane.\n polar = [False, False] -- No polar plot (Default)\n cbar -- Its a tuple to set the colorbar on or off. \n cbar = (True,'vertical') -- Displays a vertical colorbar\n cbar = (True,'horizontal') -- Displays a horizontal colorbar\n cbar = (False,'') -- Displays no colorbar. **Usage:** ``import pyPLUTO as pp``\n ``wdir = '/path/to/the data files/'``\n ``D = pp.pload(1,w_dir=wdir)``\n ``I = pp.Image()``\n ``I.pldisplay(D, D.v2, x1=D.x1, x2=D.x2, cbar=(True,'vertical'),\ title='Velocity',label1='Radius',label2='Height')``
Definition at line 1252 of file pyPLUTO.py.
def pyPLUTO.pyPLUTO.Image.pltSphData | ( | self, | |
Data, | |||
w_dir = None , |
|||
datatype = None , |
|||
kwargs | |||
) |
This method plots the transformed data obtained from getSphData using the matplotlib's imshow **Inputs:** Data -- pyPLUTO.pload object\n w_dir -- /path/to/the/working/directory/\n datatype -- Datatype. *Required Keywords*: plvar -- A string which represents the plot variable.\n *Optional Keywords*: logvar -- [Default = False] Set it True for plotting the log of a variable.\n rphi -- [Default = False - for plotting in r-theta plane] Set it True for plotting the variable in r-phi plane.
Definition at line 1680 of file pyPLUTO.py.