Example #1
0
    # Set I/O paths.
    cosmo_dir = data_dir/"external"/"cosmology"

    input_dir = data_dir/"external"/"simulations"
    input_filename = progrc.series + '-{}.txt'.format(progrc.serial_number)

    output_dir = data_dir/"raw"/"survey_validation"
    output_filename = "likelihood-({})".format(",".join([
        "source={}".format(input_filename.replace('.txt', '')),
        "map=cubic", "scale=[{},None,{}]".format(progrc.kmin, progrc.kmax),
        "orders=[0]", "excl_monop=False", "rsd=False",
        "mask=None", "selection=None"
    ]))

    confirm_directory(output_dir)

    # Make catalogue measurements.
    measurements = \
        make_catalogue_measurements(kmin=progrc.kmin, kmax=progrc.kmax)

    np.savez(
        output_dir/output_filename.replace("likelihood", "pk"),
        **measurements
    )

    # Make model predictions.
    cosmo = BaseModel(cosmo_dir/progrc.cosmology_file)

    mode_modifications = float(progrc.NG) \
        * scale_dependence_modification(cosmo, Z)(measurements['k'])
    # Set I/O paths.
    cosmo_dir = data_dir / "external" / "cosmology"
    cosmo_file = "simulation-GadgetAHF.txt"

    survey_product_dir = data_dir / "processed" / "survey_products"
    couplings_file = "couplings-({}).npz".format(",".join(
        ["rmax={:.1f}", "kmax={}", "mask={}", "selection={}"]))

    raw_product_dir = data_dir / "raw" / "survey_products"
    corr_estimate_file = "covar-estimate-({}).npy".format(",".join([
        "source=1-2500",
        "map=spherical",
        "boxsize=1000.0",
        "scale=[None,{}]".format(KMAX),
        "orders=None",
        "mask={}".format(MASK_TAG),
        "selection={}".format(SELECTION_TAG),
    ]))

    output_dir = data_dir / "raw" / "survey_validation"
    output_filename = "spherical-model-validation-({})".format(",".join([
        "scale=[None,{}]".format(KMAX), "rsd=False", "mask={}", "selection={}"
    ]))

    # Validate spherical modelling.
    confirm_directory(output_dir)  # NOTE: Not used yet.
    ratios_fullsky = validate_fullsky_spherical_model()
    ratios_partsky = validate_spherical_correlator_model()
    print("Spherical-to-Cartesian relative difference:", ratios_fullsky)