Пример #1
0
    'line': 1,
    'rv_offset': -21.0,
    'data': ['emission_line_fits_1.p']
}, {
    'line': 2,
    'rv_offset': -25.0,
    'data': ['emission_line_fits_2.p']
}]

# Optimise lines individually.
for o in OBSERVATIONS:

    # Load observations.
    obs = {}
    label = 'EtaCar_CrossValidation_{}'.format(o['line'])
    raw_obs = unpickle_observations(OBSERVATIONS_PATH, o['data'])

    # Pre-set velocity offsets as per Kepler model.
    raw_obs['Velocity'] -= o['rv_offset']
    obs[o['line']] = raw_obs

    # Load interpolation objects.
    emissivity = Emissivity(setup_mode=False,
                            pickle_dir='interp_jar/rt_code_v1')

    # Optimise.
    op = MCMCOptimiser(kernel_type='RTInterp',
                       interp_dims='Point',
                       emissivity_obj=emissivity,
                       epoch_density=1000)
    op.debug = DEBUG
Пример #2
0
import numpy as np
import matplotlib.pyplot as plt

from config import OBSERVATIONS_PATH
from ckm.core.motion import windy_star
from ckm.radiative.emissivity import Emissivity
from ckm.core.utils import unpickle_observations

# Setup
OBSERVATIONS = ['emission_line_fits_1.p', 'emission_line_fits_2.p']

# Load observations.
obs = unpickle_observations(OBSERVATIONS_PATH,
                            OBSERVATIONS,
                            time_of_periastron=2555555,
                            period=1000,
                            n_periods=2)

# Load interpolation objects.
emissivity = Emissivity(setup_mode=False, pickle_dir='interp_jar/rt_code_v1')

# Configure params and epochs and kernel.
windy_star.configure_params(period=1000,
                            eccentricity=0.7,
                            rv_semi_amplitude=60,
                            argument_of_periastron=250,
                            rv_offset=-20)
windy_star.configure_epochs(epochs=np.linspace(0, 2, 1000))
windy_star.configure_kernel(kernel_mode='RTInterp',
                            kernel_line=4,
                            interp_dims='Point',
Пример #3
0
from ckm.optimise.mcmc_kepler import MCMCOptimiser
from ckm.core.utils import unpickle_observations, pickle_mcmc_results


todo_list = [('emission_line_1', 'emission_line_fits_1.p'),
             ('emission_line_2', 'emission_line_fits_2.p')]

for task in todo_list:

    # Setup
    DEBUG = False
    OBSERVATIONS_LABEL = task[0]
    OBSERVATIONS = [task[1]]

    # Load observations.
    obs = unpickle_observations(OBSERVATIONS_PATH, OBSERVATIONS)

    # Optimise.
    op = MCMCOptimiser()
    op.debug = DEBUG
    simulation_chain, convergence = op.optimise_kepler_model(
        observations=obs,
        fixed_params={'Period': 1000},
        guess=np.array([2555555, 0.60, 60, 250, 0]),
        priors={'TimeOfPeriastron': (2555535, 2555575),
                'Eccentricity': (0.10, 0.90),
                'RVSemiAmplitude': (10, 120),
                'ArgumentOfPeriastron': (180, 360),
                'RVOffset': (-100, 100)},
        walkers=128, burn=6000, run=6000)