chanter 0.0.9__tar.gz → 0.1.0__tar.gz
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-0.1.0/PKG-INFO +25 -0
- chanter-0.1.0/README.md +5 -0
- {chanter-0.0.9 → chanter-0.1.0}/chanter/galaxy_fitter.py +18 -4
- {chanter-0.0.9 → chanter-0.1.0}/chanter/model_galaxy.py +4 -1
- chanter-0.1.0/chanter.egg-info/PKG-INFO +25 -0
- {chanter-0.0.9 → chanter-0.1.0}/chanter.egg-info/requires.txt +1 -0
- {chanter-0.0.9 → chanter-0.1.0}/setup.py +3 -3
- chanter-0.0.9/PKG-INFO +0 -24
- chanter-0.0.9/README.md +0 -5
- chanter-0.0.9/chanter.egg-info/PKG-INFO +0 -24
- {chanter-0.0.9 → chanter-0.1.0}/chanter/__init__.py +0 -0
- {chanter-0.0.9 → chanter-0.1.0}/chanter/grids/__init__.py +0 -0
- {chanter-0.0.9 → chanter-0.1.0}/chanter/utils/__init__.py +0 -0
- {chanter-0.0.9 → chanter-0.1.0}/chanter/utils/filter_set.py +0 -0
- {chanter-0.0.9 → chanter-0.1.0}/chanter/utils/make_igm_grid.py +0 -0
- {chanter-0.0.9 → chanter-0.1.0}/chanter.egg-info/SOURCES.txt +0 -0
- {chanter-0.0.9 → chanter-0.1.0}/chanter.egg-info/dependency_links.txt +0 -0
- {chanter-0.0.9 → chanter-0.1.0}/chanter.egg-info/top_level.txt +0 -0
- {chanter-0.0.9 → chanter-0.1.0}/setup.cfg +0 -0
chanter-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: chanter
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Simple quiescent galaxy spectral modelling and fitting
|
|
5
|
+
Author: Struan Stevenson
|
|
6
|
+
Author-email: struan.stevenson@ed.ac.uk
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: numpy
|
|
9
|
+
Requires-Dist: astropy
|
|
10
|
+
Requires-Dist: matplotlib
|
|
11
|
+
Requires-Dist: spectres
|
|
12
|
+
Requires-Dist: nautilus-sampler
|
|
13
|
+
Requires-Dist: json
|
|
14
|
+
Dynamic: author
|
|
15
|
+
Dynamic: author-email
|
|
16
|
+
Dynamic: description
|
|
17
|
+
Dynamic: description-content-type
|
|
18
|
+
Dynamic: requires-dist
|
|
19
|
+
Dynamic: summary
|
|
20
|
+
|
|
21
|
+
# CHANTER
|
|
22
|
+
|
|
23
|
+
#### CHANTER is a simple quiecent galaxy spectral energy distribution (SED) modelling/fitting code, based on the larger BAGPIPES code, of astronomical literary fame. CHANTER provides the barebones of Stellar Population Synthesis (SPS), as well as redshift and dust/IGM attenuation effects, and is written in a simple and digestible format, ideal for learning the theory behind larger spectral fitting software codes. CHANTER does not yet include nebular attenuation, and therefore only models the SED of quiescent galaxies.
|
|
24
|
+
|
|
25
|
+
Currently, I cannot include the SSP/IGM grids in the package due to PyPi size limitations, but this is being appealed.
|
chanter-0.1.0/README.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# CHANTER
|
|
2
|
+
|
|
3
|
+
#### CHANTER is a simple quiecent galaxy spectral energy distribution (SED) modelling/fitting code, based on the larger BAGPIPES code, of astronomical literary fame. CHANTER provides the barebones of Stellar Population Synthesis (SPS), as well as redshift and dust/IGM attenuation effects, and is written in a simple and digestible format, ideal for learning the theory behind larger spectral fitting software codes. CHANTER does not yet include nebular attenuation, and therefore only models the SED of quiescent galaxies.
|
|
4
|
+
|
|
5
|
+
Currently, I cannot include the SSP/IGM grids in the package due to PyPi size limitations, but this is being appealed.
|
|
@@ -18,8 +18,10 @@ class galaxyfitter(object):
|
|
|
18
18
|
Free parameters.
|
|
19
19
|
"""
|
|
20
20
|
model = modelgalaxy(fit_instruc)
|
|
21
|
-
wavs, flux = model.get_spectrum()
|
|
22
|
-
|
|
21
|
+
self.wavs, flux = model.get_spectrum()
|
|
22
|
+
self.spectrum_samples.append(flux)
|
|
23
|
+
effwavs, phot = model.get_photometry(self.wavs, flux, filt_files)
|
|
24
|
+
self.photometry_samples.append(phot)
|
|
23
25
|
|
|
24
26
|
return phot
|
|
25
27
|
|
|
@@ -68,6 +70,7 @@ class galaxyfitter(object):
|
|
|
68
70
|
# Fit an array of photometry, output the best galaxy parameters
|
|
69
71
|
def fit(self, photdata, prior, filt_files):
|
|
70
72
|
|
|
73
|
+
|
|
71
74
|
filt = filter_set(filt_files)
|
|
72
75
|
effwavs = filt.eff_wavs
|
|
73
76
|
|
|
@@ -79,9 +82,13 @@ class galaxyfitter(object):
|
|
|
79
82
|
dat[0] = 2.99792458E-05 * ((1e-6 * dat[0]) / ((effwavs)**2))
|
|
80
83
|
dat[1] = 2.99792458E-05 * ((1e-6 * dat[1]) / ((effwavs)**2))
|
|
81
84
|
|
|
85
|
+
|
|
82
86
|
# Run the nested sampler over the likelihood function
|
|
87
|
+
self.spectrum_samples=[]
|
|
88
|
+
self.photometry_samples=[]
|
|
83
89
|
sampler = Sampler(prior, lambda param_dict: self.log_likelihood(dat, self.gen_phot, filt_files, param_dict), n_live=500)
|
|
84
|
-
success = sampler.run(verbose=True, discard_exploration=
|
|
90
|
+
success = sampler.run(verbose=True, discard_exploration=False, timeout=1800)
|
|
91
|
+
|
|
85
92
|
|
|
86
93
|
# Plot results
|
|
87
94
|
points, log_w, log_l = sampler.posterior()
|
|
@@ -94,6 +101,11 @@ class galaxyfitter(object):
|
|
|
94
101
|
samples = np.random.choice(points_i, size = points_i.shape[0], p=np.exp(log_w))
|
|
95
102
|
dic[key + "_50"] = np.percentile(samples, 50)
|
|
96
103
|
|
|
104
|
+
|
|
105
|
+
choicer = np.random.choice(np.arange(len(self.spectrum_samples)), size = len(self.spectrum_samples), p=np.exp(log_w))
|
|
106
|
+
self.spectrum_samples = np.take(np.array((self.spectrum_samples)), choicer, axis=0)
|
|
107
|
+
self.photometry_samples = np.take(np.array((self.photometry_samples)), choicer, axis=0)
|
|
108
|
+
|
|
97
109
|
exp = {}
|
|
98
110
|
exp["age"] = dic['age_50']
|
|
99
111
|
exp["tau"] = dic['tau_50']
|
|
@@ -106,10 +118,12 @@ class galaxyfitter(object):
|
|
|
106
118
|
fit_instructions["exponential"] = exp
|
|
107
119
|
fit_instructions["dust"] = dust
|
|
108
120
|
|
|
121
|
+
|
|
109
122
|
print('Finished in ' + str(time.time() - t0)+ ' seconds.')
|
|
110
123
|
print(' ')
|
|
111
124
|
|
|
112
|
-
|
|
125
|
+
|
|
126
|
+
return fit_instructions, self.wavs, self.spectrum_samples, self.photometry_samples
|
|
113
127
|
|
|
114
128
|
|
|
115
129
|
|
|
@@ -56,7 +56,10 @@ igm_grid = resample_igm_grid(rest_target_wavs)
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
'''
|
|
59
|
-
|
|
59
|
+
######
|
|
60
|
+
# Age resampling currently produces strange results. This is hence deactivated for now, which only serves to slow the code down and does
|
|
61
|
+
# not affect accuracy of results.
|
|
62
|
+
######
|
|
60
63
|
|
|
61
64
|
def resample_ssp_ages(grid_raw_ages, target_ages):
|
|
62
65
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: chanter
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Simple quiescent galaxy spectral modelling and fitting
|
|
5
|
+
Author: Struan Stevenson
|
|
6
|
+
Author-email: struan.stevenson@ed.ac.uk
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: numpy
|
|
9
|
+
Requires-Dist: astropy
|
|
10
|
+
Requires-Dist: matplotlib
|
|
11
|
+
Requires-Dist: spectres
|
|
12
|
+
Requires-Dist: nautilus-sampler
|
|
13
|
+
Requires-Dist: json
|
|
14
|
+
Dynamic: author
|
|
15
|
+
Dynamic: author-email
|
|
16
|
+
Dynamic: description
|
|
17
|
+
Dynamic: description-content-type
|
|
18
|
+
Dynamic: requires-dist
|
|
19
|
+
Dynamic: summary
|
|
20
|
+
|
|
21
|
+
# CHANTER
|
|
22
|
+
|
|
23
|
+
#### CHANTER is a simple quiecent galaxy spectral energy distribution (SED) modelling/fitting code, based on the larger BAGPIPES code, of astronomical literary fame. CHANTER provides the barebones of Stellar Population Synthesis (SPS), as well as redshift and dust/IGM attenuation effects, and is written in a simple and digestible format, ideal for learning the theory behind larger spectral fitting software codes. CHANTER does not yet include nebular attenuation, and therefore only models the SED of quiescent galaxies.
|
|
24
|
+
|
|
25
|
+
Currently, I cannot include the SSP/IGM grids in the package due to PyPi size limitations, but this is being appealed.
|
|
@@ -8,9 +8,9 @@ long_description = (this_directory / "README.md").read_text()
|
|
|
8
8
|
setup(
|
|
9
9
|
name='chanter',
|
|
10
10
|
|
|
11
|
-
version='0.0
|
|
11
|
+
version='0.1.0',
|
|
12
12
|
|
|
13
|
-
description='Simple galaxy spectral modelling and fitting',
|
|
13
|
+
description='Simple quiescent galaxy spectral modelling and fitting',
|
|
14
14
|
|
|
15
15
|
long_description=long_description,
|
|
16
16
|
|
|
@@ -24,6 +24,6 @@ setup(
|
|
|
24
24
|
|
|
25
25
|
package_data = {'': ['*.txt', '*.fits'],},
|
|
26
26
|
|
|
27
|
-
install_requires=["numpy", "astropy", "matplotlib", "spectres", "nautilus-sampler"],
|
|
27
|
+
install_requires=["numpy", "astropy", "matplotlib", "spectres", "nautilus-sampler", "json"],
|
|
28
28
|
|
|
29
29
|
)
|
chanter-0.0.9/PKG-INFO
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: chanter
|
|
3
|
-
Version: 0.0.9
|
|
4
|
-
Summary: Simple galaxy spectral modelling and fitting
|
|
5
|
-
Author: Struan Stevenson
|
|
6
|
-
Author-email: struan.stevenson@ed.ac.uk
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist: numpy
|
|
9
|
-
Requires-Dist: astropy
|
|
10
|
-
Requires-Dist: matplotlib
|
|
11
|
-
Requires-Dist: spectres
|
|
12
|
-
Requires-Dist: nautilus-sampler
|
|
13
|
-
Dynamic: author
|
|
14
|
-
Dynamic: author-email
|
|
15
|
-
Dynamic: description
|
|
16
|
-
Dynamic: description-content-type
|
|
17
|
-
Dynamic: requires-dist
|
|
18
|
-
Dynamic: summary
|
|
19
|
-
|
|
20
|
-
# CHANTER
|
|
21
|
-
|
|
22
|
-
#### CHANTER is a simple galaxy spectral energy distribution (SED) modelling/fitting code, based on the larger BAGPIPES code, of astronomical literary fame. CHANTER provides the barebones of Stellar Population Synthesis (SPS), as well as redshift and dust/IGM attenuation effects, and is written in a simple and digestible format, ideal for learning the theory behind larger spectral fitting software codes.
|
|
23
|
-
|
|
24
|
-
Currently, I cannot include the SSP/IGM grids in the package due to PyPi size limitations, but this is being appealed.
|
chanter-0.0.9/README.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
# CHANTER
|
|
2
|
-
|
|
3
|
-
#### CHANTER is a simple galaxy spectral energy distribution (SED) modelling/fitting code, based on the larger BAGPIPES code, of astronomical literary fame. CHANTER provides the barebones of Stellar Population Synthesis (SPS), as well as redshift and dust/IGM attenuation effects, and is written in a simple and digestible format, ideal for learning the theory behind larger spectral fitting software codes.
|
|
4
|
-
|
|
5
|
-
Currently, I cannot include the SSP/IGM grids in the package due to PyPi size limitations, but this is being appealed.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: chanter
|
|
3
|
-
Version: 0.0.9
|
|
4
|
-
Summary: Simple galaxy spectral modelling and fitting
|
|
5
|
-
Author: Struan Stevenson
|
|
6
|
-
Author-email: struan.stevenson@ed.ac.uk
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist: numpy
|
|
9
|
-
Requires-Dist: astropy
|
|
10
|
-
Requires-Dist: matplotlib
|
|
11
|
-
Requires-Dist: spectres
|
|
12
|
-
Requires-Dist: nautilus-sampler
|
|
13
|
-
Dynamic: author
|
|
14
|
-
Dynamic: author-email
|
|
15
|
-
Dynamic: description
|
|
16
|
-
Dynamic: description-content-type
|
|
17
|
-
Dynamic: requires-dist
|
|
18
|
-
Dynamic: summary
|
|
19
|
-
|
|
20
|
-
# CHANTER
|
|
21
|
-
|
|
22
|
-
#### CHANTER is a simple galaxy spectral energy distribution (SED) modelling/fitting code, based on the larger BAGPIPES code, of astronomical literary fame. CHANTER provides the barebones of Stellar Population Synthesis (SPS), as well as redshift and dust/IGM attenuation effects, and is written in a simple and digestible format, ideal for learning the theory behind larger spectral fitting software codes.
|
|
23
|
-
|
|
24
|
-
Currently, I cannot include the SSP/IGM grids in the package due to PyPi size limitations, but this is being appealed.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|