- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfargo2python.py
More file actions
Latest commit
136 lines (121 loc) · 4.44 KB
/
Copy pathfargo2python.py
File metadata and controls
136 lines (121 loc) · 4.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# ===================================================================
# FARGO to PYTHON
# code written by Clement Baruteau (CB), with contributions from
# Pablo Benitez-Llambay and Gaylor Wafflard-Fernandez
# ===================================================================
#
# program can run with either Python 2.X or Python 3.X.
#
# NB: logarithmic color scale requires matplotblib version > 3.0 to
# display color bar properly
#
# ===================================================================
# =========================================
# TO DO LIST
# =========================================
# - think of a better handling of 3D case? Right now I can only plot the primitive fields in a
# vertical plane, not the fields built upon primitive ones (like the vorticity etc.).
# - show RH around planet
# - axifield (minor): add 1D visc evolving profiles, add planet position via dashed line
# =========================================
# Plotting parameters
importmatplotlib
matplotlib.rcParams.update({'font.size': 24})
matplotlib.rc('font', family='Arial')
# =====================
# 1. IMPORT GLOBAL VARIABLES
# =====================
importpar
ifpar.allfluids=='Yes':
matplotlib.rcParams.update({'font.size': 20})
# =====================
# 2. DISPLAY 2D FIELDS
# =====================
ifpar.onedprofile=='No'andpar.plot_field==True:
fromplot_twodfieldimport*
plottwodfield()
# =====================
# 3. DISPLAY AZIMUTHALLY-AVERAGED RADIAL 1D PROFILES
# =====================
ifpar.onedprofile!='No'andpar.plot_field==True:
ifpar.onedspacetime=='Yes':
fromplot_spacetimediagramimport*
plotspacetimediagram()
else:
fromplot_onedprofileimport*
plotonedprofile()
# =====================
# 4. DISPLAY TIME EVOLUTION OF DISC TORQUE OR POWER ON PLANET(s)
# =====================
ifpar.plot_tqwk!='No':
fromplot_tqwkimport*
plottqwk()
# =====================
# 5. DISPLAY TIME EVOLUTION OF PLANET ORBITAL ELEMENTS
# =====================
ifpar.plot_planet!='No':
fromplot_planetimport*
plotplanet()
# =====================
# 6. DISPLAY STUFF FOR DUST PARTICLES (only for Dusty-FARGO ADSG)
# =====================
ifpar.plot_dust!='No'andpar.fargo3d=='No':
fromplot_dustimport*
plotdust()
# =====================
# 7. DISC'S CENTER OF MASS
# =====================
if ( ('plot_disccom'inopen('paramsf2p.dat').read()) and (par.plot_disccom!='No') ):
fromplot_disccomimport*
plotdisccom()
# =====================
# 8. DISC MASS (time)
# =====================
if ( ('plot_discmass'inopen('paramsf2p.dat').read()) and (par.plot_discmass!='No') ):
fromplot_discmassimport*
plotdiscmass()
# =====================
# 9. ratio of orbit-crossing and librating inverse vortensities (time)
# =====================
if ( ('plot_libcross'inopen('paramsf2p.dat').read()) and (par.plot_libcross!='No') ):
fromplot_libcrossimport*
plotlibcross()
# =====================
# 10. disc turbulent properties
# =====================
if ( ('plot_turb'inopen('paramsf2p.dat').read()) and (par.plot_turb!='No') ):
fromplot_turbimport*
ifpar.plot_turb=='power_spectrum':
plotpowerspectrum()
ifpar.plot_turb=='auto_correlation':
plotautocorrelationtimescale()
ifpar.plot_turb=='alphas':
plot_alphas()
ifpar.plot_turb=='histo_field':
plot_histofield()
ifpar.plot_turb=='histo_torque':
plot_histotorque()
ifpar.plot_turb=='time_alphareynolds':
plot_time_alphaRey()
ifpar.plot_turb=='time_alphagrav':
plot_time_alphaGrav()
ifpar.plot_turb=='time_alphagrav_ext':
plot_time_alphaGrav_external()
# =====================
# 11. DISC'S ECCENTRICITY OR PERICENTRE ARGUMENT
# =====================
if ( ('plot_discecc'inopen('paramsf2p.dat').read()) and (par.plot_discecc!='No') ):
fromplot_discbinaryimport*
plotdiscecc()
if ( ('plot_discperarg'inopen('paramsf2p.dat').read()) and (par.plot_discperarg!='No') ):
fromplot_discbinaryimport*
plotdiscperarg()
# =====================
# 12. FOURIER ANALYSIS
# =====================
if ( ('plot_fourier'inopen('paramsf2p.dat').read()) and (par.plot_fourier!='No') ):
fromplot_fourierimport*
if (par.plot_fourier=='naodens'orpar.plot_fourier=='rossby'):
plotmaxnaodens_orminrossby()
else:
plotfourier()