Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
82d556e8
Commit
82d556e8
authored
6 years ago
by
Folkert Nobels
Browse files
Options
Downloads
Patches
Plain Diff
Rename python file and format with black
parent
e2342e4d
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!705
Star formation following Schaye08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/IsolatedGalaxy_starformation/plotSolution.py
+113
-55
113 additions, 55 deletions
examples/IsolatedGalaxy_starformation/plotSolution.py
with
113 additions
and
55 deletions
examples/IsolatedGalaxy_starformation/
ks_
plot
ter
.py
→
examples/IsolatedGalaxy_starformation/plot
Solution
.py
+
113
−
55
View file @
82d556e8
import
matplotlib
import
matplotlib
matplotlib
.
use
(
"
Agg
"
)
matplotlib
.
use
(
"
Agg
"
)
from
pylab
import
*
from
pylab
import
*
from
scipy
import
stats
from
scipy
import
stats
...
@@ -36,12 +37,12 @@ f = h5.File(filename, "r")
...
@@ -36,12 +37,12 @@ f = h5.File(filename, "r")
# Physical constants
# Physical constants
k_in_cgs
=
1.38064852e-16
k_in_cgs
=
1.38064852e-16
mH_in_cgs
=
1.6737236e-24
mH_in_cgs
=
1.6737236e-24
year_in_cgs
=
3600.
*
24
*
365.
year_in_cgs
=
3600.
0
*
24
*
365.
0
Msun_in_cgs
=
1.98848e33
Msun_in_cgs
=
1.98848e33
# Gemoetry info
# Gemoetry info
boxsize
=
f
[
"
/Header
"
].
attrs
[
"
BoxSize
"
]
boxsize
=
f
[
"
/Header
"
].
attrs
[
"
BoxSize
"
]
centre
=
boxsize
/
2.
centre
=
boxsize
/
2.
0
# Read units
# Read units
unit_length_in_cgs
=
f
[
"
/Units
"
].
attrs
[
"
Unit length in cgs (U_L)
"
]
unit_length_in_cgs
=
f
[
"
/Units
"
].
attrs
[
"
Unit length in cgs (U_L)
"
]
...
@@ -56,31 +57,33 @@ KS_thresh_slope = float(f["/Parameters"].attrs["SchayeSF:MetDep_SFthresh_Slope"]
...
@@ -56,31 +57,33 @@ KS_thresh_slope = float(f["/Parameters"].attrs["SchayeSF:MetDep_SFthresh_Slope"]
KS_thresh_norm
=
float
(
f
[
"
/Parameters
"
].
attrs
[
"
SchayeSF:thresh_norm_HpCM3
"
])
KS_thresh_norm
=
float
(
f
[
"
/Parameters
"
].
attrs
[
"
SchayeSF:thresh_norm_HpCM3
"
])
KS_gas_fraction
=
float
(
f
[
"
/Parameters
"
].
attrs
[
"
SchayeSF:fg
"
])
KS_gas_fraction
=
float
(
f
[
"
/Parameters
"
].
attrs
[
"
SchayeSF:fg
"
])
KS_thresh_max_norm
=
float
(
f
[
"
/Parameters
"
].
attrs
[
"
SchayeSF:thresh_max_norm_HpCM3
"
])
KS_thresh_max_norm
=
float
(
f
[
"
/Parameters
"
].
attrs
[
"
SchayeSF:thresh_max_norm_HpCM3
"
])
KS_gamma_effective
=
float
(
f
[
"
/Parameters
"
].
attrs
[
"
EAGLEEntropyFloor:Jeans_gamma_effective
"
])
KS_gamma_effective
=
float
(
f
[
"
/Parameters
"
].
attrs
[
"
EAGLEEntropyFloor:Jeans_gamma_effective
"
]
)
EAGLE_Z
=
float
(
f
[
"
/Parameters
"
].
attrs
[
"
EAGLEChemistry:init_abundance_metal
"
])
EAGLE_Z
=
float
(
f
[
"
/Parameters
"
].
attrs
[
"
EAGLEChemistry:init_abundance_metal
"
])
# Read gas properties
# Read gas properties
gas_pos
=
f
[
"
/PartType0/Coordinates
"
][:,:]
gas_pos
=
f
[
"
/PartType0/Coordinates
"
][:,
:]
gas_mass
=
f
[
"
/PartType0/Masses
"
][:]
gas_mass
=
f
[
"
/PartType0/Masses
"
][:]
gas_rho
=
f
[
"
/PartType0/Density
"
][:]
gas_rho
=
f
[
"
/PartType0/Density
"
][:]
gas_T
=
f
[
"
/PartType0/Temperature
"
][:]
gas_T
=
f
[
"
/PartType0/Temperature
"
][:]
gas_SFR
=
f
[
"
/PartType0/SFR
"
][:]
gas_SFR
=
f
[
"
/PartType0/SFR
"
][:]
gas_XH
=
f
[
"
/PartType0/ElementAbundance
"
][:,
0
]
gas_XH
=
f
[
"
/PartType0/ElementAbundance
"
][:,
0
]
gas_Z
=
f
[
"
/PartType0/Metallicity
"
][:]
gas_Z
=
f
[
"
/PartType0/Metallicity
"
][:]
gas_hsml
=
f
[
"
/PartType0/SmoothingLength
"
][:]
gas_hsml
=
f
[
"
/PartType0/SmoothingLength
"
][:]
# Centre the box
# Centre the box
gas_pos
[:,
0
]
-=
centre
[
0
]
gas_pos
[:,
0
]
-=
centre
[
0
]
gas_pos
[:,
1
]
-=
centre
[
1
]
gas_pos
[:,
1
]
-=
centre
[
1
]
gas_pos
[:,
2
]
-=
centre
[
2
]
gas_pos
[:,
2
]
-=
centre
[
2
]
# Turn the mass into better units
# Turn the mass into better units
gas_mass
*=
(
unit_mass_in_cgs
/
Msun_in_cgs
)
gas_mass
*=
unit_mass_in_cgs
/
Msun_in_cgs
# Turn the SFR into better units
# Turn the SFR into better units
gas_SFR
=
np
.
maximum
(
gas_SFR
,
np
.
zeros
(
np
.
size
(
gas_SFR
)))
gas_SFR
=
np
.
maximum
(
gas_SFR
,
np
.
zeros
(
np
.
size
(
gas_SFR
)))
gas_SFR
/=
(
unit_time_in_cgs
/
year_in_cgs
)
gas_SFR
/=
unit_time_in_cgs
/
year_in_cgs
gas_SFR
*=
(
unit_mass_in_cgs
/
Msun_in_cgs
)
gas_SFR
*=
unit_mass_in_cgs
/
Msun_in_cgs
# Make it a Hydrogen number density
# Make it a Hydrogen number density
gas_nH
=
gas_rho
*
unit_mass_in_cgs
/
unit_length_in_cgs
**
3
gas_nH
=
gas_rho
*
unit_mass_in_cgs
/
unit_length_in_cgs
**
3
...
@@ -89,32 +92,32 @@ gas_nH *= gas_XH
...
@@ -89,32 +92,32 @@ gas_nH *= gas_XH
# Equations of state
# Equations of state
eos_cool_rho
=
np
.
logspace
(
-
5
,
5
,
1000
)
eos_cool_rho
=
np
.
logspace
(
-
5
,
5
,
1000
)
eos_cool_T
=
eos_cool_rho
**
0.
*
8000.
eos_cool_T
=
eos_cool_rho
**
0.
0
*
8000.
0
eos_Jeans_rho
=
np
.
logspace
(
-
1
,
5
,
1000
)
eos_Jeans_rho
=
np
.
logspace
(
-
1
,
5
,
1000
)
eos_Jeans_T
=
(
eos_Jeans_rho
/
10
**
(
-
1
))
**
(
1.
/
3.
)
*
8000.
eos_Jeans_T
=
(
eos_Jeans_rho
/
10
**
(
-
1
))
**
(
1.
0
/
3.
0
)
*
8000.
0
# Plot the phase space diagram
# Plot the phase space diagram
figure
()
figure
()
subplot
(
111
,
xscale
=
"
log
"
,
yscale
=
"
log
"
)
subplot
(
111
,
xscale
=
"
log
"
,
yscale
=
"
log
"
)
plot
(
eos_cool_rho
,
eos_cool_T
,
'
k--
'
,
lw
=
0.6
)
plot
(
eos_cool_rho
,
eos_cool_T
,
"
k--
"
,
lw
=
0.6
)
plot
(
eos_Jeans_rho
,
eos_Jeans_T
,
'
k--
'
,
lw
=
0.6
)
plot
(
eos_Jeans_rho
,
eos_Jeans_T
,
"
k--
"
,
lw
=
0.6
)
scatter
(
gas_nH
,
gas_T
,
s
=
0.2
)
scatter
(
gas_nH
,
gas_T
,
s
=
0.2
)
xlabel
(
"
${
\\
rm Density}~n_{
\\
rm H}~[{
\\
rm cm^{-3}}]$
"
,
labelpad
=
0
)
xlabel
(
"
${
\\
rm Density}~n_{
\\
rm H}~[{
\\
rm cm^{-3}}]$
"
,
labelpad
=
0
)
ylabel
(
"
${
\\
rm Temperature}~T~[{
\\
rm K}]$
"
,
labelpad
=
2
)
ylabel
(
"
${
\\
rm Temperature}~T~[{
\\
rm K}]$
"
,
labelpad
=
2
)
xlim
(
1e-4
,
3e3
)
xlim
(
1e-4
,
3e3
)
ylim
(
500.
,
2e5
)
ylim
(
500.
0
,
2e5
)
savefig
(
"
rhoT.png
"
,
dpi
=
200
)
savefig
(
"
rhoT.png
"
,
dpi
=
200
)
# Plot the phase space diagram for SF gas
# Plot the phase space diagram for SF gas
figure
()
figure
()
subplot
(
111
,
xscale
=
"
log
"
,
yscale
=
"
log
"
)
subplot
(
111
,
xscale
=
"
log
"
,
yscale
=
"
log
"
)
plot
(
eos_cool_rho
,
eos_cool_T
,
'
k--
'
,
lw
=
1
)
plot
(
eos_cool_rho
,
eos_cool_T
,
"
k--
"
,
lw
=
1
)
plot
(
eos_Jeans_rho
,
eos_Jeans_T
,
'
k--
'
,
lw
=
1
)
plot
(
eos_Jeans_rho
,
eos_Jeans_T
,
"
k--
"
,
lw
=
1
)
scatter
(
gas_nH
[
gas_SFR
>
0.
],
gas_T
[
gas_SFR
>
0.
],
s
=
0.2
)
scatter
(
gas_nH
[
gas_SFR
>
0.
0
],
gas_T
[
gas_SFR
>
0.
0
],
s
=
0.2
)
xlabel
(
"
${
\\
rm Density}~n_{
\\
rm H}~[{
\\
rm cm^{-3}}]$
"
,
labelpad
=
0
)
xlabel
(
"
${
\\
rm Density}~n_{
\\
rm H}~[{
\\
rm cm^{-3}}]$
"
,
labelpad
=
0
)
ylabel
(
"
${
\\
rm Temperature}~T~[{
\\
rm K}]$
"
,
labelpad
=
2
)
ylabel
(
"
${
\\
rm Temperature}~T~[{
\\
rm K}]$
"
,
labelpad
=
2
)
xlim
(
1e-4
,
3e3
)
xlim
(
1e-4
,
3e3
)
ylim
(
500.
,
2e5
)
ylim
(
500.
0
,
2e5
)
savefig
(
"
rhoT_SF.png
"
,
dpi
=
200
)
savefig
(
"
rhoT_SF.png
"
,
dpi
=
200
)
########################################################################3
########################################################################3
...
@@ -123,7 +126,7 @@ savefig("rhoT_SF.png", dpi=200)
...
@@ -123,7 +126,7 @@ savefig("rhoT_SF.png", dpi=200)
figure
()
figure
()
subplot
(
111
,
xscale
=
"
log
"
,
yscale
=
"
log
"
)
subplot
(
111
,
xscale
=
"
log
"
,
yscale
=
"
log
"
)
scatter
(
gas_nH
,
gas_SFR
,
s
=
0.2
)
scatter
(
gas_nH
,
gas_SFR
,
s
=
0.2
)
plot
([
1
,
100
],
2e-5
*
np
.
array
([
1
,
100
])
**
0.266667
,
'
k--
'
,
lw
=
1
)
plot
([
1
,
100
],
2e-5
*
np
.
array
([
1
,
100
])
**
0.266667
,
"
k--
"
,
lw
=
1
)
xlabel
(
"
${
\\
rm Density}~n_{
\\
rm H}~[{
\\
rm cm^{-3}}]$
"
,
labelpad
=
0
)
xlabel
(
"
${
\\
rm Density}~n_{
\\
rm H}~[{
\\
rm cm^{-3}}]$
"
,
labelpad
=
0
)
ylabel
(
"
${
\\
rm SFR}~[{
\\
rm M_
\\
odot~
\\
cdot~yr^{-1}}]$
"
,
labelpad
=-
7
)
ylabel
(
"
${
\\
rm SFR}~[{
\\
rm M_
\\
odot~
\\
cdot~yr^{-1}}]$
"
,
labelpad
=-
7
)
xlim
(
1e-4
,
3e3
)
xlim
(
1e-4
,
3e3
)
...
@@ -133,7 +136,14 @@ savefig("rho_SFR.png", dpi=200)
...
@@ -133,7 +136,14 @@ savefig("rho_SFR.png", dpi=200)
########################################################################3
########################################################################3
# Select gas in a pillow box around the galaxy
# Select gas in a pillow box around the galaxy
mask
=
(
gas_pos
[:,
0
]
>
-
15
)
&
(
gas_pos
[:,
0
]
<
15
)
&
(
gas_pos
[:,
1
]
>
-
15
)
&
(
gas_pos
[:,
1
]
<
15
)
&
(
gas_pos
[:,
2
]
<
1.
)
&
(
gas_pos
[:,
2
]
>
-
1.
)
mask
=
(
(
gas_pos
[:,
0
]
>
-
15
)
&
(
gas_pos
[:,
0
]
<
15
)
&
(
gas_pos
[:,
1
]
>
-
15
)
&
(
gas_pos
[:,
1
]
<
15
)
&
(
gas_pos
[:,
2
]
<
1.0
)
&
(
gas_pos
[:,
2
]
>
-
1.0
)
)
gas_pos
=
gas_pos
[
mask
,
:]
gas_pos
=
gas_pos
[
mask
,
:]
gas_SFR
=
gas_SFR
[
mask
]
gas_SFR
=
gas_SFR
[
mask
]
gas_nH
=
gas_nH
[
mask
]
gas_nH
=
gas_nH
[
mask
]
...
@@ -163,7 +173,7 @@ ylim(-12, 12)
...
@@ -163,7 +173,7 @@ ylim(-12, 12)
savefig
(
"
edge_on.png
"
,
dpi
=
200
)
savefig
(
"
edge_on.png
"
,
dpi
=
200
)
# Now a SF map
# Now a SF map
rcParams
.
update
({
"
figure.figsize
"
:
(
4.15
,
3.15
)})
rcParams
.
update
({
"
figure.figsize
"
:
(
4.15
,
3.15
)})
figure
()
figure
()
subplot
(
111
)
subplot
(
111
)
scatter
(
gas_pos
[:,
0
],
gas_pos
[:,
1
],
s
=
0.1
,
c
=
gas_SFR
)
scatter
(
gas_pos
[:,
0
],
gas_pos
[:,
1
],
s
=
0.1
,
c
=
gas_SFR
)
...
@@ -182,38 +192,42 @@ savefig("SF_face_on.png", dpi=200)
...
@@ -182,38 +192,42 @@ savefig("SF_face_on.png", dpi=200)
x_edges
=
np
.
linspace
(
-
15
,
15
,
31
)
x_edges
=
np
.
linspace
(
-
15
,
15
,
31
)
y_edges
=
np
.
linspace
(
-
15
,
15
,
31
)
y_edges
=
np
.
linspace
(
-
15
,
15
,
31
)
map_mass
,
_
,
_
,
_
=
stats
.
binned_statistic_2d
(
gas_pos
[:,
0
],
gas_pos
[:,
1
],
gas_mass
,
statistic
=
'
sum
'
,
bins
=
(
x_edges
,
y_edges
))
map_mass
,
_
,
_
,
_
=
stats
.
binned_statistic_2d
(
map_SFR
,
_
,
_
,
_
=
stats
.
binned_statistic_2d
(
gas_pos
[:,
0
],
gas_pos
[:,
1
],
gas_SFR
,
statistic
=
'
sum
'
,
bins
=
(
x_edges
,
y_edges
))
gas_pos
[:,
0
],
gas_pos
[:,
1
],
gas_mass
,
statistic
=
"
sum
"
,
bins
=
(
x_edges
,
y_edges
)
)
map_SFR
,
_
,
_
,
_
=
stats
.
binned_statistic_2d
(
gas_pos
[:,
0
],
gas_pos
[:,
1
],
gas_SFR
,
statistic
=
"
sum
"
,
bins
=
(
x_edges
,
y_edges
)
)
qv
=
QuickView
(
qv
=
QuickView
(
gas_pos
,
gas_pos
,
mass
=
gas_mass
,
mass
=
gas_mass
,
r
=
"
infinity
"
,
r
=
"
infinity
"
,
xsize
=
len
(
x_edges
)
-
1
,
xsize
=
len
(
x_edges
)
-
1
,
ysize
=
len
(
y_edges
)
-
1
,
ysize
=
len
(
y_edges
)
-
1
,
p
=
0
,
# Viewing angle theta
p
=
0
,
# Viewing angle theta
roll
=
0
,
# Viewing angle phi
roll
=
0
,
# Viewing angle phi
plot
=
False
,
plot
=
False
,
logscale
=
False
,
logscale
=
False
,
hsml
=
gas_hsml
hsml
=
gas_hsml
,
)
)
map_mass2
=
qv
.
get_image
()
map_mass2
=
qv
.
get_image
()
extent_mass
=
qv
.
get_extent
()
extent_mass
=
qv
.
get_extent
()
gas_SFR
[
gas_SFR
<=
0
]
=
1e-10
gas_SFR
[
gas_SFR
<=
0
]
=
1e-10
qv
=
QuickView
(
qv
=
QuickView
(
gas_pos
,
gas_pos
,
mass
=
gas_SFR
,
mass
=
gas_SFR
,
r
=
"
infinity
"
,
r
=
"
infinity
"
,
xsize
=
len
(
x_edges
)
-
1
,
xsize
=
len
(
x_edges
)
-
1
,
ysize
=
len
(
y_edges
)
-
1
,
ysize
=
len
(
y_edges
)
-
1
,
p
=
0
,
# Viewing angle theta
p
=
0
,
# Viewing angle theta
roll
=
0
,
# Viewing angle phi
roll
=
0
,
# Viewing angle phi
plot
=
False
,
plot
=
False
,
logscale
=
False
,
logscale
=
False
,
hsml
=
gas_hsml
hsml
=
gas_hsml
,
)
)
map_SFR2
=
qv
.
get_image
()
map_SFR2
=
qv
.
get_image
()
...
@@ -234,7 +248,7 @@ savefig("Map_mass.png", dpi=200)
...
@@ -234,7 +248,7 @@ savefig("Map_mass.png", dpi=200)
# Mass map 2
# Mass map 2
figure
()
figure
()
subplot
(
111
)
subplot
(
111
)
imshow
(
np
.
log10
(
map_mass2
),
extent
=
extent_mass
)
imshow
(
np
.
log10
(
map_mass2
),
extent
=
extent_mass
)
colorbar
()
colorbar
()
xlim
(
-
12
,
12
)
xlim
(
-
12
,
12
)
ylim
(
-
12
,
12
)
ylim
(
-
12
,
12
)
...
@@ -245,7 +259,7 @@ savefig("Map_mass_SPHVIEWER.png", dpi=200)
...
@@ -245,7 +259,7 @@ savefig("Map_mass_SPHVIEWER.png", dpi=200)
# SF map
# SF map
figure
()
figure
()
subplot
(
111
)
subplot
(
111
)
pcolormesh
(
x_edges
,
y_edges
,
np
.
log10
(
map_SFR
),
vmax
=
-
.
5
,
vmin
=-
4.5
)
pcolormesh
(
x_edges
,
y_edges
,
np
.
log10
(
map_SFR
),
vmax
=-
0
.5
,
vmin
=-
4.5
)
colorbar
()
colorbar
()
xlim
(
-
12
,
12
)
xlim
(
-
12
,
12
)
ylim
(
-
12
,
12
)
ylim
(
-
12
,
12
)
...
@@ -254,11 +268,11 @@ ylabel("${\\rm Pos}~y~[{\\rm kpc}]$", labelpad=-3)
...
@@ -254,11 +268,11 @@ ylabel("${\\rm Pos}~y~[{\\rm kpc}]$", labelpad=-3)
savefig
(
"
Map_SFR.png
"
,
dpi
=
200
)
savefig
(
"
Map_SFR.png
"
,
dpi
=
200
)
plot_map_SFR2
=
np
.
zeros
(
np
.
shape
(
map_SFR2
))
plot_map_SFR2
=
np
.
zeros
(
np
.
shape
(
map_SFR2
))
plot_map_SFR2
[
map_SFR2
>
1e-6
]
=
map_SFR2
[
map_SFR2
>
1e-6
]
plot_map_SFR2
[
map_SFR2
>
1e-6
]
=
map_SFR2
[
map_SFR2
>
1e-6
]
# SF map 2
# SF map 2
figure
()
figure
()
subplot
(
111
)
subplot
(
111
)
imshow
(
np
.
log10
(
plot_map_SFR2
),
extent
=
extent_SFR
,
vmax
=
-
.
5
,
vmin
=-
4.5
)
imshow
(
np
.
log10
(
plot_map_SFR2
),
extent
=
extent_SFR
,
vmax
=-
0
.5
,
vmin
=-
4.5
)
colorbar
()
colorbar
()
xlim
(
-
12
,
12
)
xlim
(
-
12
,
12
)
ylim
(
-
12
,
12
)
ylim
(
-
12
,
12
)
...
@@ -272,45 +286,89 @@ savefig("Map_SFR_SPHVIEWER.png", dpi=200)
...
@@ -272,45 +286,89 @@ savefig("Map_SFR_SPHVIEWER.png", dpi=200)
map_SFR
[
map_SFR
<
1e-6
]
=
1e-6
map_SFR
[
map_SFR
<
1e-6
]
=
1e-6
# Theoretical threshold (assumes all gas has the same Z)
# Theoretical threshold (assumes all gas has the same Z)
KS_n_thresh
=
KS_thresh_norm
*
(
gas_Z
[
0
]
/
KS_thresh_Z0
)
**
KS_thresh_slope
KS_n_thresh
=
KS_thresh_norm
*
(
gas_Z
[
0
]
/
KS_thresh_Z0
)
**
KS_thresh_slope
if
np
.
isfinite
(
KS_n_thresh
)
==
False
:
if
np
.
isfinite
(
KS_n_thresh
)
==
False
:
KS_n_thresh
=
KS_thresh_max_norm
KS_n_thresh
=
KS_thresh_max_norm
KS_sigma_thresh
=
29.
*
np
.
sqrt
(
KS_gas_fraction
)
*
np
.
sqrt
(
KS_n_thresh
)
KS_sigma_thresh
=
29.
0
*
np
.
sqrt
(
KS_gas_fraction
)
*
np
.
sqrt
(
KS_n_thresh
)
# Theoretical KS law
# Theoretical KS law
KS_sigma_mass
=
np
.
logspace
(
-
1
,
3
,
100
)
KS_sigma_mass
=
np
.
logspace
(
-
1
,
3
,
100
)
KS_sigma_SFR
=
KS_law_norm
*
KS_sigma_mass
**
KS_law_slope
KS_sigma_SFR
=
KS_law_norm
*
KS_sigma_mass
**
KS_law_slope
# KS relation
# KS relation
rcParams
.
update
({
"
figure.figsize
"
:
(
3.15
,
3.15
),
"
figure.subplot.left
"
:
0.18
,
})
rcParams
.
update
({
"
figure.figsize
"
:
(
3.15
,
3.15
),
"
figure.subplot.left
"
:
0.18
})
figure
()
figure
()
subplot
(
111
,
xscale
=
"
log
"
,
yscale
=
"
log
"
)
subplot
(
111
,
xscale
=
"
log
"
,
yscale
=
"
log
"
)
plot
(
KS_sigma_mass
,
KS_sigma_SFR
,
'
k--
'
,
lw
=
0.6
)
plot
(
KS_sigma_mass
,
KS_sigma_SFR
,
"
k--
"
,
lw
=
0.6
)
plot
([
KS_sigma_thresh
,
KS_sigma_thresh
],
[
1e-8
,
1e8
],
'
k--
'
,
lw
=
0.6
)
plot
([
KS_sigma_thresh
,
KS_sigma_thresh
],
[
1e-8
,
1e8
],
"
k--
"
,
lw
=
0.6
)
text
(
KS_sigma_thresh
*
0.95
,
2.2
,
"
$
\\
Sigma_{
\\
rm c} = %.2f~{
\\
rm M_
\\
odot
\\
cdot pc^{-2}}$
"
%
KS_sigma_thresh
,
va
=
"
top
"
,
ha
=
"
right
"
,
rotation
=
90
,
fontsize
=
7
)
text
(
text
(
16
,
10
**
(
-
3.5
),
"
$n_{
\\
rm H,c} = %.3f~{
\\
rm cm^{-3}}$
"
%
KS_n_thresh
,
fontsize
=
7
)
KS_sigma_thresh
*
0.95
,
text
(
16
,
2e-6
,
"
${
\\
rm K
\\
textendash S~law}$:
\n
$
\\
Sigma_{
\\
rm SFR} = A
\\
times
\\
Sigma_g^n$
\n
$n=%.1f$
\n
$A=%.3f
\\
times10^{-4}~{
\\
rm M_
\\
odot / yr^{1} / kpc^{2}}$
\n
$f_{
\\
rm g} = %.1f$
\n
$\gamma_{
\\
rm eos} = %.3f$
\n
$Z=%1.4f$
"
%
(
KS_law_slope
,
KS_law_norm
*
10
**
4
,
KS_gas_fraction
,
KS_gamma_effective
,
EAGLE_Z
),
fontsize
=
7
)
2.2
,
"
$
\\
Sigma_{
\\
rm c} = %.2f~{
\\
rm M_
\\
odot
\\
cdot pc^{-2}}$
"
%
KS_sigma_thresh
,
va
=
"
top
"
,
ha
=
"
right
"
,
rotation
=
90
,
fontsize
=
7
,
)
text
(
16
,
10
**
(
-
3.5
),
"
$n_{
\\
rm H,c} = %.3f~{
\\
rm cm^{-3}}$
"
%
KS_n_thresh
,
fontsize
=
7
)
text
(
16
,
2e-6
,
"
${
\\
rm K
\\
textendash S~law}$:
\n
$
\\
Sigma_{
\\
rm SFR} = A
\\
times
\\
Sigma_g^n$
\n
$n=%.1f$
\n
$A=%.3f
\\
times10^{-4}~{
\\
rm M_
\\
odot / yr^{1} / kpc^{2}}$
\n
$f_{
\\
rm g} = %.1f$
\n
$\gamma_{
\\
rm eos} = %.3f$
\n
$Z=%1.4f$
"
%
(
KS_law_slope
,
KS_law_norm
*
10
**
4
,
KS_gas_fraction
,
KS_gamma_effective
,
EAGLE_Z
,
),
fontsize
=
7
,
)
scatter
(
map_mass
.
flatten
()
/
1e6
,
map_SFR
.
flatten
(),
s
=
0.4
)
scatter
(
map_mass
.
flatten
()
/
1e6
,
map_SFR
.
flatten
(),
s
=
0.4
)
xlim
(
0.3
,
900
)
xlim
(
0.3
,
900
)
ylim
(
3e-7
,
3
)
ylim
(
3e-7
,
3
)
xlabel
(
"
$
\\
Sigma_g~[{
\\
rm M_
\\
odot
\\
cdot pc^{-2}}]$
"
,
labelpad
=
0
)
xlabel
(
"
$
\\
Sigma_g~[{
\\
rm M_
\\
odot
\\
cdot pc^{-2}}]$
"
,
labelpad
=
0
)
ylabel
(
"
$
\\
Sigma_{
\\
rm SFR}~[{
\\
rm M_
\\
odot
\\
cdot yr^{-1}
\\
cdot kpc^{-2}}]$
"
,
labelpad
=
0
)
ylabel
(
"
$
\\
Sigma_{
\\
rm SFR}~[{
\\
rm M_
\\
odot
\\
cdot yr^{-1}
\\
cdot kpc^{-2}}]$
"
,
labelpad
=
0
)
savefig
(
"
KS_law.png
"
,
dpi
=
200
)
savefig
(
"
KS_law.png
"
,
dpi
=
200
)
close
()
close
()
plot_map_SFR2
[
plot_map_SFR2
<=
0
]
=
1e-6
plot_map_SFR2
[
plot_map_SFR2
<=
0
]
=
1e-6
rcParams
.
update
({
"
figure.figsize
"
:
(
3.15
,
3.15
),
"
figure.subplot.left
"
:
0.18
,
})
rcParams
.
update
({
"
figure.figsize
"
:
(
3.15
,
3.15
),
"
figure.subplot.left
"
:
0.18
})
figure
()
figure
()
subplot
(
111
,
xscale
=
"
log
"
,
yscale
=
"
log
"
)
subplot
(
111
,
xscale
=
"
log
"
,
yscale
=
"
log
"
)
plot
(
KS_sigma_mass
,
KS_sigma_SFR
,
'
k--
'
,
lw
=
0.6
)
plot
(
KS_sigma_mass
,
KS_sigma_SFR
,
"
k--
"
,
lw
=
0.6
)
plot
([
KS_sigma_thresh
,
KS_sigma_thresh
],
[
1e-8
,
1e8
],
'
k--
'
,
lw
=
0.6
)
plot
([
KS_sigma_thresh
,
KS_sigma_thresh
],
[
1e-8
,
1e8
],
"
k--
"
,
lw
=
0.6
)
text
(
KS_sigma_thresh
*
0.95
,
2.2
,
"
$
\\
Sigma_{
\\
rm c} = %.2f~{
\\
rm M_
\\
odot
\\
cdot pc^{-2}}$
"
%
KS_sigma_thresh
,
va
=
"
top
"
,
ha
=
"
right
"
,
rotation
=
90
,
fontsize
=
7
)
text
(
text
(
16
,
10
**
(
-
3.5
),
"
$n_{
\\
rm H,c} = %.3f~{
\\
rm cm^{-3}}$
"
%
KS_n_thresh
,
fontsize
=
7
)
KS_sigma_thresh
*
0.95
,
text
(
16
,
2e-6
,
"
${
\\
rm K
\\
textendash S~law}$:
\n
$
\\
Sigma_{
\\
rm SFR} = A
\\
times
\\
Sigma_g^n$
\n
$n=%.1f$
\n
$A=%.3f
\\
times10^{-4}~{
\\
rm M_
\\
odot / yr^{1} / kpc^{2}}$
\n
$f_{
\\
rm g} = %.1f$
\n
$\gamma_{
\\
rm eos} = %.3f$
\n
$Z=%1.4f$
"
%
(
KS_law_slope
,
KS_law_norm
*
10
**
4
,
KS_gas_fraction
,
KS_gamma_effective
,
EAGLE_Z
),
fontsize
=
7
)
2.2
,
"
$
\\
Sigma_{
\\
rm c} = %.2f~{
\\
rm M_
\\
odot
\\
cdot pc^{-2}}$
"
%
KS_sigma_thresh
,
va
=
"
top
"
,
ha
=
"
right
"
,
rotation
=
90
,
fontsize
=
7
,
)
text
(
16
,
10
**
(
-
3.5
),
"
$n_{
\\
rm H,c} = %.3f~{
\\
rm cm^{-3}}$
"
%
KS_n_thresh
,
fontsize
=
7
)
text
(
16
,
2e-6
,
"
${
\\
rm K
\\
textendash S~law}$:
\n
$
\\
Sigma_{
\\
rm SFR} = A
\\
times
\\
Sigma_g^n$
\n
$n=%.1f$
\n
$A=%.3f
\\
times10^{-4}~{
\\
rm M_
\\
odot / yr^{1} / kpc^{2}}$
\n
$f_{
\\
rm g} = %.1f$
\n
$\gamma_{
\\
rm eos} = %.3f$
\n
$Z=%1.4f$
"
%
(
KS_law_slope
,
KS_law_norm
*
10
**
4
,
KS_gas_fraction
,
KS_gamma_effective
,
EAGLE_Z
,
),
fontsize
=
7
,
)
scatter
(
map_mass2
.
flatten
()
/
1e6
,
plot_map_SFR2
.
flatten
(),
s
=
0.4
)
scatter
(
map_mass2
.
flatten
()
/
1e6
,
plot_map_SFR2
.
flatten
(),
s
=
0.4
)
xlim
(
0.3
,
900
)
xlim
(
0.3
,
900
)
ylim
(
3e-7
,
3
)
ylim
(
3e-7
,
3
)
xlabel
(
"
$
\\
Sigma_g~[{
\\
rm M_
\\
odot
\\
cdot pc^{-2}}]$
"
,
labelpad
=
0
)
xlabel
(
"
$
\\
Sigma_g~[{
\\
rm M_
\\
odot
\\
cdot pc^{-2}}]$
"
,
labelpad
=
0
)
ylabel
(
"
$
\\
Sigma_{
\\
rm SFR}~[{
\\
rm M_
\\
odot
\\
cdot yr^{-1}
\\
cdot kpc^{-2}}]$
"
,
labelpad
=
0
)
ylabel
(
"
$
\\
Sigma_{
\\
rm SFR}~[{
\\
rm M_
\\
odot
\\
cdot yr^{-1}
\\
cdot kpc^{-2}}]$
"
,
labelpad
=
0
)
savefig
(
"
KS_law_SPHVIEWER.png
"
,
dpi
=
200
)
savefig
(
"
KS_law_SPHVIEWER.png
"
,
dpi
=
200
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment