예제 #1
0
def simulate_calibration(i_theta,
                         n=1000,
                         fixm=False,
                         fixz=False,
                         fixalign=False):
    f_sub, beta = get_grid_point(i_theta)
    logger.info(
        "Generating calibration data with %s images at theta %s / 625: f_sub = %s, beta = %s",
        n,
        i_theta + 1,
        f_sub,
        beta,
    )
    theta, x, _, _, _, z = augmented_data(
        f_sub=f_sub,
        beta=beta,
        n_images=n,
        mine_gold=False,
        draw_host_mass=not fixm,
        draw_host_redshift=not fixz,
        draw_alignment=not fixalign,
    )
    results = {}
    results["theta"] = theta
    results["x"] = x
    results["z"] = z
    return results
예제 #2
0
def simulate_calibration_ref(n=1000, fixm=False, fixz=False, fixalign=False):
    logger.info("Generating calibration data with %s images from prior", n)
    f_sub, beta = draw_params_from_prior(n)
    theta, x, _, _, _, z = augmented_data(
        f_sub=f_sub,
        beta=beta,
        n_images=n,
        mine_gold=False,
        draw_host_mass=not fixm,
        draw_host_redshift=not fixz,
        draw_alignment=not fixalign,
    )
    results = {}
    results["theta"] = theta
    results["x"] = x
    results["z"] = z
    return results
예제 #3
0
def simulate_test_point(n=1000, fixm=False, fixz=False, fixalign=False):
    f_sub, beta = get_reference_point()
    logger.info(
        "Generating point test data with %s images at f_sub = %s, beta = %s",
        n,
        f_sub,
        beta,
    )
    theta, x, _, _, _, z = augmented_data(
        f_sub=f_sub,
        beta=beta,
        n_images=n,
        mine_gold=False,
        draw_host_mass=not fixm,
        draw_host_redshift=not fixz,
        draw_alignment=not fixalign,
    )
    results = {}
    results["theta"] = theta
    results["x"] = x
    results["z"] = z
    return results
예제 #4
0
def simulate_train(n=10000,
                   n_thetas_marginal=1000,
                   fixm=False,
                   fixz=False,
                   fixalign=False):
    logger.info("Generating training data with %s images", n)

    # Parameter points from prior
    f_sub, beta = draw_params_from_prior(n)
    f_sub_alt = np.hstack((f_sub[n // 2:], f_sub[:n // 2]))
    beta_alt = np.hstack((beta[n // 2:], beta[:n // 2]))

    # Samples from numerator
    logger.info("Generating %s images", n)
    theta, theta_alt, x, t_xz, t_xz_alt, log_r_xz, log_r_xz_alt, _, z = augmented_data(
        f_sub=f_sub,
        beta=beta,
        f_sub_alt=f_sub_alt,
        beta_alt=beta_alt,
        n_images=n,
        n_thetas_marginal=n_thetas_marginal,
        mine_gold=True,
        draw_host_mass=not fixm,
        draw_host_redshift=not fixz,
        draw_alignment=not fixalign,
    )
    results = {}
    results["theta"] = theta
    results["theta_alt"] = theta_alt
    results["x"] = x
    results["t_xz"] = t_xz
    results["t_xz_alt"] = t_xz_alt
    results["log_r_xz"] = log_r_xz
    results["log_r_xz_alt"] = log_r_xz_alt
    results["z"] = z

    return results