PLUTO
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
jet.py
Go to the documentation of this file.
1
import
os
2
import
sys
3
from
numpy
import
*
4
from
matplotlib.pyplot
import
*
5
import
pyPLUTO
as
pp
6
7
plutodir = os.environ[
'PLUTO_DIR'
]
8
wdir = plutodir+
'/Test_Problems/MHD/Jet/'
9
nlinf = pp.nlast_info(w_dir=wdir)
10
11
D = pp.pload(nlinf[
'nlast'
],w_dir=wdir)
# Loading the data into a pload object D.
12
I = pp.Image()
13
I.pldisplay(D, D.rho,x1=D.x1,x2=D.x2,label1=
'x'
,label2=
'y'
,
14
title=
r'Density $\rho$ [MHD jet]'
,cbar=(
True
,
'vertical'
),figsize=[7,12])
15
16
# Code to plot field lines. Requires 2 arrays xarr and yarr as
17
# the starting point of integration i.e. x and y co-ordinate of the field point.
18
I.myfieldlines(D,linspace(D.x1.min(),D.x1.max(),10),linspace(D.x2.min(),D.x2.min(),10),
19
colors=
'w'
,ls=
'-'
,lw=1.5)
20
21
savefig(
'jet_final.png'
)
# Only to be saved as either .png or .jpg
22
show()
pyplot
Tools
pyPLUTO
examples
jet.py
Generated by
1.8.10