chanter 0.0.3__py3-none-any.whl → 0.0.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/galaxy_fitter.py CHANGED
@@ -20,6 +20,7 @@ class galaxyfitter(object):
20
20
  model = modelgalaxy(fit_instruc)
21
21
  wavs, flux = model.get_spectrum()
22
22
  effwavs, phot = model.get_photometry(wavs, flux, filt_files)
23
+
23
24
  return phot
24
25
 
25
26
  # Liklihood function for a certain point in parameter space
@@ -73,14 +74,13 @@ class galaxyfitter(object):
73
74
  # Run fitter
74
75
  t0 = time.time()
75
76
 
76
- print('Computing '+str(id)+'...')
77
77
  # Load data
78
78
  dat= photdata.T
79
79
  dat[0] = 2.99792458E-05 * ((1e-6 * dat[0]) / ((effwavs)**2))
80
80
  dat[1] = 2.99792458E-05 * ((1e-6 * dat[1]) / ((effwavs)**2))
81
81
 
82
82
  # Run the nested sampler over the likelihood function
83
- sampler = Sampler(prior, lambda param_dict: self.log_likelihood(dat, self.gen_phot, filt_files, param_dict))
83
+ sampler = Sampler(prior, lambda param_dict: self.log_likelihood(dat, self.gen_phot, filt_files, param_dict), n_live=1000)
84
84
  success = sampler.run(verbose=True, discard_exploration=True, timeout=1800)
85
85
 
86
86
  # Plot results
chanter/model_galaxy.py CHANGED
@@ -50,7 +50,7 @@ def resample_igm_grid(wavs):
50
50
  hdul = fits.open(os.path.dirname(os.path.realpath(__file__)) + '/grids/ssps.fits')
51
51
  master_base = np.array((hdul[1].data, hdul[2].data, hdul[3].data, hdul[4].data, hdul[5].data, hdul[6].data, hdul[7].data))
52
52
 
53
- rest_target_wavs = np.arange(100., 50000., 10.)
53
+ rest_target_wavs = np.arange(100., 50000., 25.)
54
54
  grid = resample_ssp_wavs(rest_target_wavs)
55
55
  igm_grid = resample_igm_grid(rest_target_wavs)
56
56
 
@@ -225,22 +225,25 @@ class modelgalaxy(object):
225
225
 
226
226
  self.get_spectrum()
227
227
 
228
- ax.step(self.wavs, self.flux, **kwargs)
228
+ ax.plot(self.wavs, self.flux, **kwargs)
229
229
  ax.set_ylabel('Observed Flux / erg s$^{-1}$ cm$^{-2}$ Å$^{-1}$')
230
230
  ax.set_xlabel('Observed Wavelength / Å')
231
231
 
232
232
 
233
233
 
234
- def plot_sfh(self):
234
+ def plot_sfh(self, ax):
235
235
  ssp_age = grid[0].T[0, 1:]
236
236
  sfrs = self.sfr(ssp_age, self.fit_instructions["exponential"]["age"], self.fit_instructions["exponential"]["tau"], self.fit_instructions["exponential"]["massformed"])
237
- fig, ax = plt.subplots()
237
+
238
238
  ax.set_xlabel('Age / Gyr')
239
239
  ax.set_ylabel(' Star Formation / M$_{sun}$ Gyr$^{-1}$')
240
- ax.plot((self.universe_age-self.lookback_time) - ssp_age, sfrs/1e9, color='black')
240
+ ax.plot((self.universe_age-self.lookback_time) - ssp_age, sfrs/1e9, color='black', lw=1)
241
+ ax.axvline((self.universe_age-self.lookback_time) - ssp_age[0], 0, 1, color='black', ls='dashed', lw=1)
242
+
243
+ #ax.plot(-ssp_age, sfrs/1e9, color='black')
241
244
  ax.invert_xaxis()
245
+ ax.set_xlim(self.universe_age,0)
242
246
  ax.set_ylim(0, )
243
- return fig, ax
244
247
 
245
248
 
246
249
 
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: chanter
3
+ Version: 0.0.5
4
+ Summary: Simple galaxy spectral modelling and fitting
5
+ Author: Struan Stevenson
6
+ Author-email: struan.stevenson@ed.ac.uk
7
+ Requires-Dist: numpy
8
+ Requires-Dist: astropy
9
+ Requires-Dist: matplotlib
10
+ Requires-Dist: spectres
11
+ Requires-Dist: nautilus-sampler
12
+ Dynamic: author
13
+ Dynamic: author-email
14
+ Dynamic: description
15
+ Dynamic: requires-dist
16
+ Dynamic: summary
17
+
18
+ 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.
@@ -1,11 +1,11 @@
1
1
  chanter/__init__.py,sha256=bubSIcCkkzRcatq5ry6iSidWzj4YK8HqTvelHLunHJs,119
2
- chanter/galaxy_fitter.py,sha256=JYDRc-iW5ZgDHprw4FCshrsBnG8ENvs3MEDNUtlFYxQ,3683
3
- chanter/model_galaxy.py,sha256=LpgMw23oRsfAH3acS1yx0PKvJxN0LPyAJAQSR0H3FYQ,7832
2
+ chanter/galaxy_fitter.py,sha256=viqrSky3DaO2tC_j4GYxYq5GogZoShWtR5CjUEX5LA0,3655
3
+ chanter/model_galaxy.py,sha256=kYkuEO0VTyr9S84efzHYOoWXaYAp8VYXid6y4QZePaI,7993
4
4
  chanter/grids/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  chanter/utils/__init__.py,sha256=hn-ho-lJeT0evKXL1tV5jX0cR4meSlJmPcdxC49cLok,34
6
6
  chanter/utils/filter_set.py,sha256=EITLa2c3FG3n1-v7KatKRwHCRyfZ4TTjsi_WM7Bz64k,6819
7
7
  chanter/utils/make_igm_grid.py,sha256=s9NeRmgOsj_OxvxXixIdPSSQZPlsLcPedIRr4soZUcU,10304
8
- chanter-0.0.3.dist-info/METADATA,sha256=AoXqJlWkuelZZRVB5TqGcpbLNHMMueeW0qwp_wsXXR0,353
9
- chanter-0.0.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
10
- chanter-0.0.3.dist-info/top_level.txt,sha256=Q23dLK1syz0D-XIZ6zeY6TOZ7BQsC-BLqRiVQE7_udk,8
11
- chanter-0.0.3.dist-info/RECORD,,
8
+ chanter-0.0.5.dist-info/METADATA,sha256=Q-RRZsxKqDtJ0u40IIQDSNqun3bCq8NJmNImURTCyZE,799
9
+ chanter-0.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
+ chanter-0.0.5.dist-info/top_level.txt,sha256=Q23dLK1syz0D-XIZ6zeY6TOZ7BQsC-BLqRiVQE7_udk,8
11
+ chanter-0.0.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,15 +0,0 @@
1
- Metadata-Version: 2.2
2
- Name: chanter
3
- Version: 0.0.3
4
- Summary: Galaxy spectral fitting
5
- Author: Struan Stevenson
6
- Author-email: struan.stevenson@ed.ac.uk
7
- Requires-Dist: numpy
8
- Requires-Dist: astropy
9
- Requires-Dist: matplotlib
10
- Requires-Dist: spectres
11
- Requires-Dist: nautilus-sampler
12
- Dynamic: author
13
- Dynamic: author-email
14
- Dynamic: requires-dist
15
- Dynamic: summary