ACID-code-v2 0.2.1__tar.gz → 0.2.2__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.
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/PKG-INFO +1 -1
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/src/ACID_code_v2/ACID.py +56 -11
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/src/ACID_code_v2.egg-info/PKG-INFO +1 -1
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/src/ACID_code_v2.egg-info/SOURCES.txt +0 -1
- acid_code_v2-0.2.1/src/ACID_code_v2/mcmc_utils.py +0 -60
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/.gitattributes +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/.github/workflows/publish.yml +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/.gitignore +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/.other_scripts/5_residual_profiles.py +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/.other_scripts/8_master_out_profiles.py +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/.readthedocs.yaml +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/.vscode/launch.json +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/LICENSE +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/README.md +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/acid.yml +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/docs/ACID.rst +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/docs/conf.py +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/docs/index.rst +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/docs/installation.rst +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/docs/make.bat +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/docs/requirements.txt +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/docs/using_ACID.rst +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/example/.make_syn_dat.py +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/example/example_linelist.txt +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/example/sample_spec_1.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/example/sample_spec_2.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/example/sample_spec_3.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/example/tutorial_code.py +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/pyproject.toml +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/setup.cfg +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/src/ACID_code_v2/LSD.py +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/src/ACID_code_v2/__init__.py +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/src/ACID_code_v2/utils.py +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/src/ACID_code_v2.egg-info/dependency_links.txt +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/src/ACID_code_v2.egg-info/requires.txt +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/src/ACID_code_v2.egg-info/top_level.txt +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/.DS_Store +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-28T21:11:56.678_blaze_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-28T21:11:56.678_flat_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-28T21:11:56.678_flat_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-28T21:11:56.678_lamp_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-28T21:11:56.678_lamp_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-28T21:11:56.678_order_profile.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_bis_G2_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_bis_G2_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_bis_K5_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_ccf_G2_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_ccf_G2_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_ccf_K5_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_e2ds_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_e2ds_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_s1d_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_s1d_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_bis_G2_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_bis_G2_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_bis_K5_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_ccf_G2_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_ccf_G2_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_ccf_K5_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_e2ds_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_e2ds_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_s1d_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_s1d_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_bis_G2_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_bis_G2_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_bis_K5_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_ccf_G2_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_ccf_G2_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_ccf_K5_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_e2ds_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_e2ds_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_s1d_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_s1d_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_bis_G2_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_bis_G2_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_bis_K5_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_ccf_G2_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_ccf_G2_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_ccf_K5_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_e2ds_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_e2ds_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_s1d_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_s1d_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_bis_G2_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_bis_G2_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_bis_K5_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_ccf_G2_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_ccf_G2_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_ccf_K5_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_e2ds_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_e2ds_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_s1d_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_s1d_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_bis_G2_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_bis_G2_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_bis_K5_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_ccf_G2_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_ccf_G2_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_ccf_K5_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_e2ds_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_e2ds_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_s1d_A.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_s1d_B.fits +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/tests.py +0 -0
- {acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/tutorial_test.py +0 -0
|
@@ -8,7 +8,6 @@ from functools import partial
|
|
|
8
8
|
from multiprocessing import Pool
|
|
9
9
|
from . import utils
|
|
10
10
|
from . import LSD
|
|
11
|
-
from . import mcmc_utils
|
|
12
11
|
|
|
13
12
|
warnings.filterwarnings("ignore")
|
|
14
13
|
importlib.reload(LSD)
|
|
@@ -233,11 +232,57 @@ def model_func(inputs, x):
|
|
|
233
232
|
|
|
234
233
|
return mdl
|
|
235
234
|
|
|
235
|
+
def log_likelihood(theta, x, y, yerr):
|
|
236
|
+
## maximum likelihood estimation for the mcmc model.
|
|
237
|
+
model = model_func(theta, x)
|
|
238
|
+
|
|
239
|
+
lnlike = -0.5 * np.sum(((y) - (model)) ** 2 / yerr**2 + np.log(yerr**2)+ np.log(2*np.pi))
|
|
240
|
+
|
|
241
|
+
return lnlike
|
|
242
|
+
|
|
243
|
+
def log_prior(theta):
|
|
244
|
+
## imposes the prior restrictions on the inputs - rejects if profile point is less than -10 or greater than 0.5.
|
|
245
|
+
check = 0
|
|
246
|
+
z = theta[:k_max]
|
|
247
|
+
|
|
248
|
+
for i in range(len(theta)):
|
|
249
|
+
if i < k_max: ## must lie in z
|
|
250
|
+
if -10 <= theta[i] <= 0.5:
|
|
251
|
+
pass
|
|
252
|
+
else:
|
|
253
|
+
check = 1
|
|
254
|
+
|
|
255
|
+
if check == 0:
|
|
256
|
+
|
|
257
|
+
# excluding the continuum points in the profile (in flux)
|
|
258
|
+
z_cont = []
|
|
259
|
+
v_cont = []
|
|
260
|
+
for i in range(0, 5):
|
|
261
|
+
z_cont.append(np.exp(z[len(z)-i-1])-1)
|
|
262
|
+
v_cont.append(velocities[len(velocities)-i-1])
|
|
263
|
+
z_cont.append(np.exp(z[i])-1)
|
|
264
|
+
v_cont.append(velocities[i])
|
|
265
|
+
|
|
266
|
+
z_cont = np.array(z_cont)
|
|
267
|
+
v_cont = np.array(v_cont)
|
|
268
|
+
|
|
269
|
+
p_pent = np.sum((np.log((1/np.sqrt(2*np.pi*0.01**2)))-0.5*(z_cont/0.01)**2))
|
|
270
|
+
|
|
271
|
+
return p_pent
|
|
272
|
+
|
|
273
|
+
return -np.inf
|
|
274
|
+
|
|
275
|
+
def log_probability(theta):
|
|
276
|
+
## calculates log probability - used for mcmc
|
|
277
|
+
lp = log_prior(theta)
|
|
278
|
+
if not np.isfinite(lp):
|
|
279
|
+
return -np.inf
|
|
280
|
+
final = lp + log_likelihood(theta, x, y, yerr)
|
|
281
|
+
return final
|
|
282
|
+
|
|
236
283
|
def residual_mask(wavelengths, data_spec_in, data_err, initial_inputs, poly_ord, linelist,
|
|
237
284
|
velocities=np.arange(-25, 25, 0.82), pix_chunk=20, dev_perc=25,
|
|
238
|
-
tell_lines=
|
|
239
|
-
4861.34, 5183.62, 5270.39, 5889.95, 5895.92, 6562.81,
|
|
240
|
-
7593.70, 8226.96], n_sig=1):
|
|
285
|
+
tell_lines=None, n_sig=1, alpha=None):
|
|
241
286
|
## iterative residual masking - mask continuous areas first - then possibly progress to masking the narrow lines
|
|
242
287
|
|
|
243
288
|
forward = model_func(initial_inputs, wavelengths)
|
|
@@ -568,7 +613,7 @@ def ACID(input_wavelengths, input_spectra, input_spectral_errors, line, frame_sn
|
|
|
568
613
|
yerr, model_inputs_resi, mask_idx = residual_mask(x, y, yerr, model_inputs, poly_ord,
|
|
569
614
|
linelist, pix_chunk=pix_chunk,
|
|
570
615
|
dev_perc=dev_perc, tell_lines=telluric_lines,
|
|
571
|
-
n_sig=n_sig)
|
|
616
|
+
n_sig=n_sig, alpha=alpha)
|
|
572
617
|
|
|
573
618
|
# if verbose:
|
|
574
619
|
# t4 = time.time()
|
|
@@ -593,9 +638,6 @@ def ACID(input_wavelengths, input_spectra, input_spectral_errors, line, frame_sn
|
|
|
593
638
|
pos = np.array(pos)
|
|
594
639
|
pos = np.transpose(pos)
|
|
595
640
|
|
|
596
|
-
# Inistialise MCMC class:
|
|
597
|
-
mcmc_class = mcmc_utils.Model(model_func, x, y, yerr, velocities, k_max)
|
|
598
|
-
|
|
599
641
|
if verbose:
|
|
600
642
|
t5 = time.time()
|
|
601
643
|
# print('MCMC set up takes: %s'%(t5-t4))
|
|
@@ -619,7 +661,7 @@ def ACID(input_wavelengths, input_spectra, input_spectral_errors, line, frame_sn
|
|
|
619
661
|
if sys.platform != "win32":
|
|
620
662
|
ctx = mp.get_context("fork")
|
|
621
663
|
with ctx.Pool(processes = cores) as pool:
|
|
622
|
-
sampler = emcee.EnsembleSampler(nwalkers, ndim,
|
|
664
|
+
sampler = emcee.EnsembleSampler(nwalkers, ndim, log_probability, pool=pool)
|
|
623
665
|
sampler.run_mcmc(pos, nsteps, progress=True, store=True)
|
|
624
666
|
|
|
625
667
|
# with Pool() as pool: # Original code
|
|
@@ -633,7 +675,7 @@ def ACID(input_wavelengths, input_spectra, input_spectral_errors, line, frame_sn
|
|
|
633
675
|
|
|
634
676
|
|
|
635
677
|
else:
|
|
636
|
-
sampler = emcee.EnsembleSampler(nwalkers, ndim,
|
|
678
|
+
sampler = emcee.EnsembleSampler(nwalkers, ndim, log_probability)
|
|
637
679
|
sampler.run_mcmc(pos, nsteps, progress=True)
|
|
638
680
|
|
|
639
681
|
print('MCMC run takes: %s'%(time.time()-t5))
|
|
@@ -799,7 +841,8 @@ def ACID(input_wavelengths, input_spectra, input_spectral_errors, line, frame_sn
|
|
|
799
841
|
|
|
800
842
|
return all_frames
|
|
801
843
|
|
|
802
|
-
def ACID_HARPS(filelist, line, vgrid, order_range=None, save_path = './',
|
|
844
|
+
def ACID_HARPS(filelist, line, vgrid, order_range=None, save_path = './',
|
|
845
|
+
file_type = 'e2ds', name="test", **kwargs):
|
|
803
846
|
"""Accurate Continuum fItting and Deconvolution for HARPS e2ds and s1d spectra (DRS pipeline 3.5)
|
|
804
847
|
|
|
805
848
|
Fits the continuum of the given spectra and performs LSD on the continuum corrected spectra,
|
|
@@ -850,6 +893,8 @@ def ACID_HARPS(filelist, line, vgrid, order_range=None, save_path = './', file_t
|
|
|
850
893
|
global frame_wavelengths
|
|
851
894
|
global frame_errors
|
|
852
895
|
global sns
|
|
896
|
+
global run_name
|
|
897
|
+
run_name = name
|
|
853
898
|
|
|
854
899
|
if order_range is None:
|
|
855
900
|
order_range = np.arange(10, 70)
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import numpy as np
|
|
2
|
-
from ACID_code_v2.ACID import model_func
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class Model:
|
|
6
|
-
def __init__(self, model_func, x, y, yerr, velocities, k_max):
|
|
7
|
-
self.model_func = model_func
|
|
8
|
-
self.x = x
|
|
9
|
-
self.y = y
|
|
10
|
-
self.yerr = yerr
|
|
11
|
-
self.velocities = velocities
|
|
12
|
-
self.k_max = k_max
|
|
13
|
-
|
|
14
|
-
def log_likelihood(self, theta, x, y, yerr):
|
|
15
|
-
## maximum likelihood estimation for the mcmc model.
|
|
16
|
-
model = model_func(theta, x)
|
|
17
|
-
|
|
18
|
-
lnlike = -0.5 * np.sum(((y) - (model)) ** 2 / yerr**2 + np.log(yerr**2)+ np.log(2*np.pi))
|
|
19
|
-
|
|
20
|
-
return lnlike
|
|
21
|
-
|
|
22
|
-
def log_prior(self, theta):
|
|
23
|
-
## imposes the prior restrictions on the inputs - rejects if profile point is less than -10 or greater than 0.5.
|
|
24
|
-
check = 0
|
|
25
|
-
z = theta[:self.k_max]
|
|
26
|
-
|
|
27
|
-
for i in range(len(theta)):
|
|
28
|
-
if i < self.k_max: ## must lie in z
|
|
29
|
-
if -10 <= theta[i] <= 0.5:
|
|
30
|
-
pass
|
|
31
|
-
else:
|
|
32
|
-
check = 1
|
|
33
|
-
|
|
34
|
-
if check == 0:
|
|
35
|
-
|
|
36
|
-
# excluding the continuum points in the profile (in flux)
|
|
37
|
-
z_cont = []
|
|
38
|
-
v_cont = []
|
|
39
|
-
for i in range(0, 5):
|
|
40
|
-
z_cont.append(np.exp(z[len(z)-i-1])-1)
|
|
41
|
-
v_cont.append(self.velocities[len(self.velocities)-i-1])
|
|
42
|
-
z_cont.append(np.exp(z[i])-1)
|
|
43
|
-
v_cont.append(self.velocities[i])
|
|
44
|
-
|
|
45
|
-
z_cont = np.array(z_cont)
|
|
46
|
-
v_cont = np.array(v_cont)
|
|
47
|
-
|
|
48
|
-
p_pent = np.sum((np.log((1/np.sqrt(2*np.pi*0.01**2)))-0.5*(z_cont/0.01)**2))
|
|
49
|
-
|
|
50
|
-
return p_pent
|
|
51
|
-
|
|
52
|
-
return -np.inf
|
|
53
|
-
|
|
54
|
-
def log_probability(self, theta):
|
|
55
|
-
## calculates log probability - used for mcmc
|
|
56
|
-
lp = self.log_prior(theta)
|
|
57
|
-
if not np.isfinite(lp):
|
|
58
|
-
return -np.inf
|
|
59
|
-
final = lp + self.log_likelihood(theta, self.x, self.y, self.yerr)
|
|
60
|
-
return final
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-28T21:11:56.678_blaze_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-28T21:11:56.678_flat_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-28T21:11:56.678_flat_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-28T21:11:56.678_lamp_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-28T21:11:56.678_lamp_B.fits
RENAMED
|
File without changes
|
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_bis_G2_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_bis_G2_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_bis_K5_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_ccf_G2_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_ccf_G2_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_ccf_K5_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_e2ds_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_e2ds_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_s1d_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:02:50.897_s1d_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_bis_G2_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_bis_G2_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_bis_K5_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_ccf_G2_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_ccf_G2_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_ccf_K5_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_e2ds_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_e2ds_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_s1d_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:08:22.216_s1d_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_bis_G2_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_bis_G2_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_bis_K5_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_ccf_G2_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_ccf_G2_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_ccf_K5_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_e2ds_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_e2ds_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_s1d_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:13:54.107_s1d_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_bis_G2_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_bis_G2_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_bis_K5_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_ccf_G2_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_ccf_G2_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_ccf_K5_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_e2ds_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_e2ds_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_s1d_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:19:25.377_s1d_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_bis_G2_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_bis_G2_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_bis_K5_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_ccf_G2_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_ccf_G2_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_ccf_K5_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_e2ds_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_e2ds_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_s1d_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:24:57.238_s1d_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_bis_G2_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_bis_G2_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_bis_K5_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_ccf_G2_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_ccf_G2_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_ccf_K5_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_e2ds_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_e2ds_B.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_s1d_A.fits
RENAMED
|
File without changes
|
{acid_code_v2-0.2.1 → acid_code_v2-0.2.2}/tests/data/HARPS.2007-08-29T00:30:28.617_s1d_B.fits
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|