chanter 0.1.3__py3-none-any.whl → 0.1.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chanter/examples/__init__.py +0 -0
- chanter/examples/create_galaxy_example.py +47 -0
- chanter/examples/filters/F090W.txt +2050 -0
- chanter/examples/filters/F115W.txt +2050 -0
- chanter/examples/filters/F150W.txt +2049 -0
- chanter/examples/filters/F200W.txt +2049 -0
- chanter/examples/filters/F277W.txt +2536 -0
- chanter/examples/filters/F356W.txt +2158 -0
- chanter/examples/filters/F410M.txt +629 -0
- chanter/examples/filters/F444W.txt +2238 -0
- chanter/examples/filters/__init__.py +0 -0
- chanter/examples/filters/f435w.txt +1454 -0
- chanter/examples/filters/f606w.txt +297 -0
- chanter/examples/filters/f814w.txt +330 -0
- chanter/examples/filters/filt_list.txt +11 -0
- chanter/examples/fit_galaxy_example.py +58 -0
- {chanter-0.1.3.dist-info → chanter-0.1.5.dist-info}/METADATA +1 -1
- chanter-0.1.5.dist-info/RECORD +30 -0
- chanter-0.1.3.dist-info/RECORD +0 -14
- {chanter-0.1.3.dist-info → chanter-0.1.5.dist-info}/WHEEL +0 -0
- {chanter-0.1.3.dist-info → chanter-0.1.5.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import chanter as ch
|
|
2
|
+
import matplotlib.pyplot as plt
|
|
3
|
+
import numpy as np
|
|
4
|
+
from nautilus import Prior
|
|
5
|
+
import json
|
|
6
|
+
|
|
7
|
+
# Define the filter curve filepaths
|
|
8
|
+
filt_list = np.loadtxt('filters/filt_list.txt', dtype="str")
|
|
9
|
+
|
|
10
|
+
# Define the observed photometry (microJy), along with their errors.
|
|
11
|
+
phot_data = np.array(([ [0.00000114, 0.00000011],
|
|
12
|
+
[0.00281023, 0.00028102],
|
|
13
|
+
[0.03039540, 0.00303954],
|
|
14
|
+
[0.04083275, 0.00408327],
|
|
15
|
+
[0.06158577, 0.00615858],
|
|
16
|
+
[0.08333301, 0.00833330],
|
|
17
|
+
[0.15811047, 0.01581105],
|
|
18
|
+
[0.63260459, 0.06326046],
|
|
19
|
+
[0.96879516, 0.09687952],
|
|
20
|
+
[1.15809244, 0.11580924],
|
|
21
|
+
[1.30375688, 0.13037569] ]))
|
|
22
|
+
|
|
23
|
+
# Define the priors for each parameter
|
|
24
|
+
prior = Prior()
|
|
25
|
+
prior.add_parameter("age", dist=(0., 14.))
|
|
26
|
+
prior.add_parameter("tau", dist=(0.1, 15.))
|
|
27
|
+
prior.add_parameter("massformed", dist=(0, 13.))
|
|
28
|
+
prior.add_parameter("Av", dist=(0, 8.))
|
|
29
|
+
prior.add_parameter("redshift", dist=(0., 10.))
|
|
30
|
+
|
|
31
|
+
# Fit observed photometry
|
|
32
|
+
fitter = ch.galaxyfitter()
|
|
33
|
+
median_instructions, wavs, spectrum_samples, photometry_samples = fitter.fit(phot_data.copy(), prior, filt_list)
|
|
34
|
+
|
|
35
|
+
# Print the median galaxy parameters
|
|
36
|
+
print(json.dumps(median_instructions, sort_keys=True, indent=4))
|
|
37
|
+
|
|
38
|
+
# Define figure
|
|
39
|
+
fig, ax = plt.subplots()
|
|
40
|
+
|
|
41
|
+
# Plot the observed photometry
|
|
42
|
+
filt = ch.utils.filter_set(filt_list)
|
|
43
|
+
effwavs = filt.eff_wavs
|
|
44
|
+
phot_data_erg = phot_data.copy()
|
|
45
|
+
phot_data_erg.T[0] = 2.99792458E-05 * ((1e-6 * phot_data_erg.T[0]) / ((effwavs)**2))
|
|
46
|
+
phot_data_erg.T[1] = 2.99792458E-05 * ((1e-6 * phot_data_erg.T[1]) / ((effwavs)**2))
|
|
47
|
+
ax.errorbar(effwavs, phot_data_erg.T[0], phot_data_erg.T[1], ls='none', marker='D', capsize=3, color='xkcd:cherry', mec='black', mew=1, ecolor='black', zorder=5)
|
|
48
|
+
|
|
49
|
+
# Plot the fitted model
|
|
50
|
+
ax.plot(wavs,np.median(fitter.spectrum_samples, axis=0), color='darkcyan', alpha=0.5)
|
|
51
|
+
ax.scatter(effwavs,np.median(fitter.photometry_samples, axis=0), color='darkcyan', marker='D')
|
|
52
|
+
ax.set_xlim(100, 50000)
|
|
53
|
+
ax.set_ylim(0,)
|
|
54
|
+
ax.set_ylabel('Observed Flux / erg s$^{-1}$ cm$^{-2}$ Å$^{-1}$')
|
|
55
|
+
ax.set_xlabel('Observed Wavelength / Å')
|
|
56
|
+
plt.show()
|
|
57
|
+
|
|
58
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
chanter/__init__.py,sha256=bubSIcCkkzRcatq5ry6iSidWzj4YK8HqTvelHLunHJs,119
|
|
2
|
+
chanter/galaxy_fitter.py,sha256=g_66TJC2TpNudVz6qHOtwDADISWhhFs1v5g3oObNCcA,4201
|
|
3
|
+
chanter/model_galaxy.py,sha256=o_A_hqcIVUPphhQYDIk0fpCCArZZkOHbf3IDtQBCDN4,8789
|
|
4
|
+
chanter/examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
chanter/examples/create_galaxy_example.py,sha256=sMTZ8GVk5ZE5LAQQpek8HPB_wp6qC-k0gNthqyImV1w,1046
|
|
6
|
+
chanter/examples/fit_galaxy_example.py,sha256=675bD2gc7qan7qEL1qNo9v4J_UFilPfBqjz8PdDKwJ8,2250
|
|
7
|
+
chanter/examples/filters/F090W.txt,sha256=SRCSnEjMTn6xdgYQhdhthL7oF1Jb2D_dJCutf3bpbQc,102471
|
|
8
|
+
chanter/examples/filters/F115W.txt,sha256=kJ0C0m3a8O4Ydu0W3t_u6bAABhIdOITHm8KkYyhHWJg,102471
|
|
9
|
+
chanter/examples/filters/F150W.txt,sha256=dxnp1updYLmvacuQEHQ6rPgew8jjgK0wAnTYYFCP8KQ,102421
|
|
10
|
+
chanter/examples/filters/F200W.txt,sha256=6mFIgTFZNP9cJQY5crxBgOJZWJy3pBXKQwGDUhrUqVw,102421
|
|
11
|
+
chanter/examples/filters/F277W.txt,sha256=XwtfeZP78vEVO6URyj0Cm_XDQNpySJSOrvMXSUcm_CM,126771
|
|
12
|
+
chanter/examples/filters/F356W.txt,sha256=7uOosVyI7vsMrqN0q98d5wHCppZSDhJVqsHBZoBfW6s,107871
|
|
13
|
+
chanter/examples/filters/F410M.txt,sha256=WEanmoACh0M2b7TIchEmFzI3eh0aWnfj60tYP6HZuWs,11059
|
|
14
|
+
chanter/examples/filters/F444W.txt,sha256=0N4f_O44TH7Oz6MIWtXyI_qdjQfanWdcXzGdLMMzwvs,111871
|
|
15
|
+
chanter/examples/filters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
+
chanter/examples/filters/f435w.txt,sha256=OsaZlVWGLh9IgFh_EaWz368U4iI7D20WRrsVpA5Pqcc,31108
|
|
17
|
+
chanter/examples/filters/f606w.txt,sha256=BkvezaZv9YFJbX6EamHCYFMmKjWVlbdqKR7Q1xAeB8s,14850
|
|
18
|
+
chanter/examples/filters/f814w.txt,sha256=WqnPhIql9nEGWswtRrUYrcnngfCwdT5o8tsZ4ekljlo,16500
|
|
19
|
+
chanter/examples/filters/filt_list.txt,sha256=0Z4EMEg5BgcdL-hOR2JnsE9KQmO9u27zSepH_ql3f84,384
|
|
20
|
+
chanter/grids/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
|
+
chanter/grids/d_igm_grid_inoue14.fits,sha256=T5Fb71OZjOqY9YkdZaEe3zPt1lOQZNoFXTZ-N_Y_Cnc,9843840
|
|
22
|
+
chanter/grids/lyman_series_coefs_inoue_2014_table2.txt,sha256=xFZsQQ8aV27G--iK0WJgBY0idFnNirWduCswT8TJ8y8,2721
|
|
23
|
+
chanter/grids/ssps_5.fits,sha256=Vfr_8DMIoY-IZYTxVhiqP8nFeypVOEJ6FasBUNp52NQ,23480640
|
|
24
|
+
chanter/utils/__init__.py,sha256=hn-ho-lJeT0evKXL1tV5jX0cR4meSlJmPcdxC49cLok,34
|
|
25
|
+
chanter/utils/filter_set.py,sha256=EITLa2c3FG3n1-v7KatKRwHCRyfZ4TTjsi_WM7Bz64k,6819
|
|
26
|
+
chanter/utils/make_igm_grid.py,sha256=nO3NvO-l15oG65mgf48FH3QdatxCfgPT_kqwZzO14CA,10280
|
|
27
|
+
chanter-0.1.5.dist-info/METADATA,sha256=rAIKTpNDItkHjjw_VYNFJFGqxyYZFxoZ8j265z6JJP0,1016
|
|
28
|
+
chanter-0.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
29
|
+
chanter-0.1.5.dist-info/top_level.txt,sha256=Q23dLK1syz0D-XIZ6zeY6TOZ7BQsC-BLqRiVQE7_udk,8
|
|
30
|
+
chanter-0.1.5.dist-info/RECORD,,
|
chanter-0.1.3.dist-info/RECORD
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
chanter/__init__.py,sha256=bubSIcCkkzRcatq5ry6iSidWzj4YK8HqTvelHLunHJs,119
|
|
2
|
-
chanter/galaxy_fitter.py,sha256=g_66TJC2TpNudVz6qHOtwDADISWhhFs1v5g3oObNCcA,4201
|
|
3
|
-
chanter/model_galaxy.py,sha256=o_A_hqcIVUPphhQYDIk0fpCCArZZkOHbf3IDtQBCDN4,8789
|
|
4
|
-
chanter/grids/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
chanter/grids/d_igm_grid_inoue14.fits,sha256=T5Fb71OZjOqY9YkdZaEe3zPt1lOQZNoFXTZ-N_Y_Cnc,9843840
|
|
6
|
-
chanter/grids/lyman_series_coefs_inoue_2014_table2.txt,sha256=xFZsQQ8aV27G--iK0WJgBY0idFnNirWduCswT8TJ8y8,2721
|
|
7
|
-
chanter/grids/ssps_5.fits,sha256=Vfr_8DMIoY-IZYTxVhiqP8nFeypVOEJ6FasBUNp52NQ,23480640
|
|
8
|
-
chanter/utils/__init__.py,sha256=hn-ho-lJeT0evKXL1tV5jX0cR4meSlJmPcdxC49cLok,34
|
|
9
|
-
chanter/utils/filter_set.py,sha256=EITLa2c3FG3n1-v7KatKRwHCRyfZ4TTjsi_WM7Bz64k,6819
|
|
10
|
-
chanter/utils/make_igm_grid.py,sha256=nO3NvO-l15oG65mgf48FH3QdatxCfgPT_kqwZzO14CA,10280
|
|
11
|
-
chanter-0.1.3.dist-info/METADATA,sha256=3UT-q4_uwfZhSEODE10RYujq9rBF8cf4qxMqWxDUbgw,1016
|
|
12
|
-
chanter-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
-
chanter-0.1.3.dist-info/top_level.txt,sha256=Q23dLK1syz0D-XIZ6zeY6TOZ7BQsC-BLqRiVQE7_udk,8
|
|
14
|
-
chanter-0.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|