示例#1
0
obliquity = 0
sol_phase = 1
p_rotation = 2 * np.pi / w_rot
p_orb = 2 * np.pi / w_orb
times = np.linspace(start=0.0, stop=1.0, num=1400)
measurement_std = 0.001

# DO NOT CHANGE THIS.
phi_orb = abs(5 * (np.pi / 3) + sol_phase)
phi_rot = abs(2 * np.pi - sol_phase)

# NUMERIC
true_params = {
    'log_orbital_period': np.log(p_orbit),
    'log_rotation_period': np.log(p_rotation),
    'logit_cos_inc': logit(np.cos(inclination)),
    'logit_cos_obl': logit(np.cos(obliquity)),
    'logit_phi_orb': logit(phi_orb, low=0, high=2 * np.pi),
    'logit_obl_orientation': logit(phi_rot, low=0, high=2 * np.pi)
}
truth = IlluminationMapPosterior(times,
                                 np.zeros_like(times),
                                 measurement_std,
                                 nside=nside)
truth.fix_params(true_params)
p = np.concatenate([np.zeros(truth.nparams), one_point_map])
numeric_lightcurve = truth.lightcurve(p)

run_times_analytic = np.array([])
run_times_numeric = np.array([])
nside_resolutions = np.array([1, 2, 4, 8])
示例#2
0
epoch_starts = [50*day, 120*day, 210*day, 280*day]                      # 4 epochs of observation; total of 140 data points

times = np.array([])                                                    # creating a time array for observations
for epoch_start in epoch_starts:
    epoch_times = np.linspace(epoch_start, epoch_start + epoch_duration, nobs_per_epoch)
    times = np.concatenate([times, epoch_times])
    
measurement_std = 0.001                                                 # standard deviation of measurements from truth

# Posterior parameters
truth = IlluminationMapPosterior(times, np.zeros_like(times), measurement_std, nside=sim_nside)
# Parameters for the gaussian process and the maps; same as those used in sim_map.py
# We fix all parameters except for the rotation period, and assume other parameters are known
true_params = {
    'log_orbital_period':np.log(p_orbit),   
    'logit_cos_inc':logit(np.cos(inclination)),
    'logit_cos_obl':logit(np.cos(obliquity)),
    'logit_phi_orb':logit(phi_orb, low=0, high=2*np.pi),
    'logit_obl_orientation':logit(phi_rot, low=0, high=2*np.pi),
    'mu':0.5,
    'log_sigma':np.log(0.25),
    'logit_wn_rel_amp':logit(0.02),
    'logit_spatial_scale':logit(30. * np.pi/180),
    'log_error_scale': np.log(1.)}
truth.fix_params(true_params)                                           # fixing the parameters with the measurements
p = np.concatenate([[np.log(day)], sim_map])                            # create an array with the map and the rotation period

# Generate and save a lightcurve
true_lightcurve = truth.lightcurve(p)                                   # lightcurve from known parameters, map and period
obs_lightcurve = true_lightcurve.copy()                                 # copy the lightcurve and add noise (below)
obs_lightcurve += truth.sigma_reflectance * np.random.randn(len(true_lightcurve))