Skip to content

Commit

Permalink
Merge pull request #11 from SWIFTSIM/McConnell_data
Browse files Browse the repository at this point in the history
Mc connell & Ma 2013 M_star-M_BH data
  • Loading branch information
JBorrow authored Mar 16, 2020
2 parents 6b13da7 + 4b5fe09 commit 36b160f
Show file tree
Hide file tree
Showing 3 changed files with 171 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
from velociraptor.observations.objects import ObservationalData

import unyt
import numpy as np
import os
import sys

# Exec the master cosmology file passed as first argument
with open(sys.argv[1], "r") as handle:
exec(handle.read())

# Cosmology
h_sim = cosmology.h

input_filename = "../raw/McConnell_Ma_2013_ascii.txt"
delimiter = "\t"

output_filename = "McConnell2013_Data.hdf5"
output_directory = "../"

if not os.path.exists(output_directory):
os.mkdir(output_directory)

# Read the data
raw = np.loadtxt(input_filename, delimiter=delimiter, usecols=(2, 3, 4, 11))
M_BH = raw[:, 0] * unyt.Solar_Mass
M_BH_lo = raw[:, 1] * unyt.Solar_Mass
M_BH_up = raw[:, 2] * unyt.Solar_Mass
M_star = raw[:, 3] * unyt.Solar_Mass

# Only keep the data for which the stellar mass was measured
mask = M_star > 0
M_BH = M_BH[mask]
M_BH_lo = M_BH_lo[mask]
M_BH_up = M_BH_up[mask]
M_star = M_star[mask]

# Apply the 0.24 dex undertainty on the stellar mass
M_star_up = (10.0 ** (np.log10(M_star / unyt.Solar_Mass) + 0.24)) * unyt.Solar_Mass
M_star_lo = (10.0 ** (np.log10(M_star / unyt.Solar_Mass) - 0.24)) * unyt.Solar_Mass

# Define the scatter as offset from the mean value
x_scatter = unyt.unyt_array((M_star - M_star_lo, M_star_up - M_star))
y_scatter = unyt.unyt_array((M_BH - M_BH_lo, M_BH_up - M_BH))

# Meta-data
comment = (
"Data obtained assuming the total stellar mass is the same as the bulge mass. "
"No cosmology correction needed."
)
citation = "McConnell & Ma (2013) - data"
bibcode = "2013ApJ...764..184M"
name = "Black hole mass - stellar mass relation from 36 local galaxies."
plot_as = "points"
redshift = 0.0
h = h_sim

# Write everything
processed = ObservationalData()
processed.associate_x(
M_star, scatter=x_scatter, comoving=True, description="Galaxy Stellar Mass"
)
processed.associate_y(
M_BH, scatter=y_scatter, comoving=True, description="Black Hole Mass"
)
processed.associate_citation(citation, bibcode)
processed.associate_name(name)
processed.associate_comment(comment)
processed.associate_redshift(redshift)
processed.associate_plot_as(plot_as)
processed.associate_cosmology(cosmology)

output_path = f"{output_directory}/{output_filename}"

if os.path.exists(output_path):
os.remove(output_path)

processed.write(filename=output_path)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Cosmology
h_sim = cosmology.h

output_filename = "McConnell2013.hdf5"
output_filename = "McConnell2013_Fit.hdf5"
output_directory = "../"

if not os.path.exists(output_directory):
Expand All @@ -36,7 +36,7 @@
)
citation = "McConnell & Ma (2013) - fit"
bibcode = "2013ApJ...764..184M"
name = "Black hole mass - stellar mass relation from 72 local galaxies."
name = "Fit to the black hole mass - stellar mass relation from 72 local galaxies."
plot_as = "line"
redshift = 0.0
h = h_sim
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# This ASCII file matches Table 3 in McConnell & Ma 2013 (ApJ, 764, 184).
#
# Col. 1: Galaxy
# Col. 2: Distance (Mpc)
# Col. 3: MBH (Msun)
# Col. 4: MBH lower (68%)
# Col. 5: MBH upper (68%)
# Col. 6: method
# Col. 7: sigma (km/s)
# Col. 8: sigma lower (68%)
# Col. 9: sigma upper (68%)
# Col. 10: log(LV/Lsun)
# Col. 11: error in log(LV/Lsun)
# Col. 12: Mbulge/Msun
# Col. 13: radius of influence (arcsec)
# Col. 14: Morphology -- (E)lliptical, S0, (S)piral
# Col. 15: Profile -- (P)ower-law, (I)ntermediate, (C)ore, (U)ndetermined

MW 0.008 4.1e6 3.5e6 4.7e6 star 103 83 123 0 0 0 43 S N/A
A1836 157.5 3.9e9 3.3e9 4.3e9 gas 288 274 302 11.26 0.06 0 0.27 E C
A3565 54.4 1.4e9 1.2e9 1.7e9 gas 322 306 338 11.24 0.06 0 0.22 E C
Circ 4.0 1.7e6 1.4e6 2.1e6 maser 158 140 176 0 0 0 0.02 S N/A
IC1459 30.9 2.8e9 1.6e9 3.9e9 star 315 299 331 10.96 0.06 3.07e11 0.81 E C
N221 0.73 2.6e6 2.1e6 3.1e6 star 75 72 78 8.52 0.02 7.62e8 0.57 E I
N224 0.73 1.4e8 1.1e8 2.2e8 star 160 152 168 0 0 0 6.5 S N/A
N524 24.2 8.6e8 8.2e8 9.6e8 star 235 223 247 10.62 0.04 0 0.57 S0 C
N821 23.4 1.7e8 9.2e7 2.4e8 star 209 199 219 10.36 0.05 1.92e11 0.14 E I
N1023 10.5 4.0e7 3.6e7 4.4e7 star 205 195 215 10.06 0.11 6.49e10 0.08 S0 P
N1194 55.5 6.8e7 6.5e7 7.1e7 maser 147.9 125.9 173.8 0 0 0 0.05 S0 U
N1300 20.1 7.1e7 5.3e7 1.05e8 gas 218 208 228 0 0 0 0.07 S N/A
N1316 21.0 1.7e8 1.4e8 2.0e8 star 226 215 237 11.18 0.05 0 0.14 E I
N1332 22.7 1.5e9 1.3e9 1.7e9 star 328 312 344 10.16 0.05 0 0.54 S0 P
N1374 19.6 5.9e8 5.4e8 6.5e8 star 174 165 183 10.10 0.05 5.79e10 0.89 E C
N1399 20.9 5.1e8 4.4e8 5.7e8 star 296 281 311 10.78 0.04 3.98e11 0.25 E C
N1399 20.9 1.3e9 6.3e8 1.8e9 star 296 281 311 10.78 0.04 3.98e11 0.63 E C
N1407 29.0 4.7e9 4.2e9 5.4e9 star 274 260 288 11.05 0.05 1.00e12 1.9 E C
N1550 53.0 3.9e9 3.2e9 4.6e9 star 289 275 303 10.87 0.05 0 0.78 E I
N2273 26.8 7.8e6 7.4e6 8.2e6 maser 144.5 128.8 162.2 0 0 0 0.01 S N/A
N2549 12.7 1.4e7 1.0e7 1.5e7 star 145 138 152 9.55 0.04 1.99e10 0.05 S0 P
N2787 7.5 4.1e7 3.6e7 4.5e7 gas 189 180 198 0 0 0 0.14 S0 P
N2960 75.3 1.21e7 1.16e7 1.26e7 maser 166.0 151.3 182.0 0 0 0 0.01 S N/A
N3031 4.1 8.0e7 6.9e7 1.0e8 gas 143 136 150 0 0 0 0.85 S N/A
N3091 52.7 3.7e9 3.2e9 3.8e9 star 307 292 322 11.00 0.05 0 0.66 E C
N3115 9.5 8.9e8 6.2e8 1.4e9 star 230 219 241 10.34 0.02 1.57e11 1.6 S0 P
N3227 17.0 1.5e7 7.0e6 2.0e7 star 133 121 145 0 0 0 0.04 S N/A
N3245 21.5 2.2e8 1.6e8 2.7e8 gas 205 195 215 0 0 7.00e10 0.21 S0 P
N3368 10.6 7.6e6 6.1e6 9.2e6 star 122 98 150 0 0 0 0.04 S N/A
N3377 11.0 1.8e8 8.5e7 2.7e8 star 145 138 152 9.93 0.04 2.35e10 0.69 E P
N3379 10.7 4.2e8 3.1e8 5.2e8 star 206 196 216 10.29 0.01 6.86e10 0.83 E C
N3384 11.5 1.1e7 5.9e6 1.6e7 star 143 136 150 9.89 0.09 1.90e10 0.04 S0 P
N3393 53.6 3.3e7 3.1e7 3.5e7 maser 147.9 138.0 158.5 0 0 0 0.03 S N/A
N3489 12.0 6.0e6 5.1e6 6.8e6 star 100 89 115 0 0 0 0.04 S0 U
N3585 20.6 3.3e8 2.7e8 4.8e8 star 213 203 223 10.66 0.08 1.60e11 0.31 S0 I
N3607 22.6 1.4e8 9.0e7 1.8e8 star 229 218 240 0 0 0 0.10 E C
N3608 22.8 4.7e8 3.7e8 5.7e8 star 182 173 191 10.34 0.04 7.66e10 0.55 E C
N3842 98.4 9.7e9 7.2e9 1.27e10 star 270 256 284 11.20 0.05 1.55e12 1.2 E C
N3998 14.3 8.5e8 7.8e8 9.2e8 star 272 258 286 9.91 0.04 0 0.71 S0 P
N4026 13.4 1.8e8 1.5e8 2.4e8 star 180 171 189 9.73 0.08 2.81e10 0.37 S0 P
N4258 7.0 3.67e7 3.66e7 3.68e7 maser 115 105 125 0 0 0 0.35 S N/A
N4261 32.6 5.3e8 4.2e8 6.4e8 gas 315 300 330 11.00 0.02 8.26e11 0.15 E C
N4291 26.6 9.8e8 6.7e8 1.29e9 star 242 230 254 10.25 0.05 9.96e10 0.56 E C
N4342 23.0 4.6e8 3.1e8 7.2e8 star 225 214 236 0 0 1.80e10 0.35 S0 P
N4374 18.5 9.2e8 8.4e8 1.02e9 gas 296 282 310 10.98 0.02 3.62e11 0.51 E C
N4388 19.8 8.8e6 8.6e6 9.0e6 maser 107.2 100.0 114.8 0 0 0 0.03 S N/A
N4459 16.0 7.0e7 5.6e7 8.3e7 gas 167 159 175 10.31 0.02 0 0.14 E P
N4472 16.7 2.5e9 2.4e9 3.1e9 star 300 285 315 11.05 0.05 8.98e11 1.3 E C
N4473 15.2 8.9e7 4.5e7 1.34e8 star 190 181 199 10.29 0.02 1.61e11 0.15 E C
N4486 16.7 6.2e9 5.8e9 6.5e9 star 324 308 352 11.08 0.02 1.31e12 3.1 E C
N4486A 18.4 1.4e7 8.9e6 1.9e7 star 111 106 116 9.48 0.02 0 0.06 E P
N4564 15.9 8.8e7 6.4e7 1.12e8 star 162 154 170 0 0 4.66e10 0.19 S0 P
N4594 10.0 6.7e8 6.3e8 7.2e8 star 230 218 242 0 0 0 1.1 S N/A
N4596 18.0 8.4e7 5.9e7 1.2e8 gas 136 130 142 0 0 0 0.22 S0 P
N4649 16.5 4.7e9 3.7e9 5.8e9 star 341 324 358 10.99 0.02 7.72e11 2.2 E C
N4697 12.5 2.0e8 1.8e8 2.2e8 star 177 169 185 10.46 0.04 1.29e11 0.46 E P
N4736 5.0 6.8e6 5.2e6 8.4e6 star 112 106 118 0 0 0 0.10 S N/A
N4826 7.3 1.6e6 1.2e6 2.0e6 star 96 91 101 0 0 0 0.02 S N/A
N4889 103.2 2.1e10 5.5e9 3.7e10 star 347 330 364 11.48 0.05 1.75e12 1.5 E C
N5077 44.9 8.0e8 4.7e8 1.3e9 gas 222 211 233 10.75 0.05 3.66e11 0.32 E C
N5128 4.1 5.9e7 4.9e7 7.0e7 star 150 143 157 10.60 0.03 0 0.60 S0/E C
N5516 60.1 4.0e9 2.9e9 4.1e9 star 306 280 332 11.22 0.05 0 0.63 E C
N5576 25.7 1.7e8 1.3e8 2.0e8 star 183 174 192 10.39 0.05 9.58e10 0.18 E C
N5845 25.9 4.9e8 3.3e8 6.4e8 star 234 223 245 9.75 0.05 3.36e10 0.31 E P
N6086 139.1 3.8e9 2.6e9 5.5e9 star 318 302 334 11.23 0.05 1.43e12 0.24 E C
N6251 106.0 6.0e8 4.0e8 8.0e8 gas 290 276 304 0 0 5.60e11 0.06 E P
N6264 145.4 3.03e7 2.99e7 3.08e7 maser 158.5 144.5 173.8 0 0 0 0.01 S N/A
N6323 110.5 9.8e6 9.7e6 9.9e6 maser 158.5 134.9 186.2 0 0 0 0.003 S N/A
N7052 70.9 4.0e8 2.4e8 6.8e8 gas 266 253 279 10.92 0.04 3.50e11 0.07 E C
N7582 22.3 5.5e7 4.4e7 7.1e7 gas 156 137 175 0 0 0 0.09 S N/A
N7619 53.9 2.3e9 2.2e9 3.5e9 star 313 297 329 11.07 0.05 0 0.39 E C
N7768 112.8 1.3e9 9.0e8 1.8e9 star 257 244 270 11.09 0.05 1.16e12 0.14 E C
U3789 48.4 1.08e7 1.03e7 1.14e7 maser 107.2 95.5 120.2 0 0 0 0.02 S N/A

0 comments on commit 36b160f

Please sign in to comment.