Пример #1
0
def test_customRes(base_dir: str, res: int, box: int, n_simulations: int,
                   Latin_json: str):
    """
    Create a custom Latin Hyper Cube multi-spec file.
    """
    # This is just creating a list of filenames
    test_dir = lambda i: os.path.join(base_dir, fn_outdir(i, res, box))

    all_submission_dirs = [test_dir(i) for i in range(n_simulations)]

    # test lowRes hdf5
    test_create_hdf5(all_submission_dirs,
                     Latin_json=os.path.join(base_dir, Latin_json))
Пример #2
0
def test_lowRes(base_dir: str = "data/lowRes/") -> None:
    """
    Test dm-only test lowRes: 64^3 parts
    """
    # lowRes : 64^3 particles and 256 Mpc/h
    res = 128
    box = 256

    # Latin Hyper Cube sampling
    n_simulations = 100

    test_dir = lambda i: os.path.join(base_dir, fn_outdir(i, res, box))

    all_submission_dirs = [test_dir(i) for i in range(n_simulations)]

    # test lowRes hdf5
    test_create_hdf5(all_submission_dirs,
                     Latin_json=os.path.join(base_dir, "matterLatin_low.json"))
Пример #3
0
def test_mediumRes_HRsamples(
        base_dir: str = "data/mediumRes_HRsamples/") -> None:
    """
    Test dm-only test mediumRes_HRsamples: 256^3 parts,
    but sampling on the same samples as highRes
    """
    # lowRes : 256^3 particles and 256 Mpc/h
    res = 256
    box = 256

    # Latin Hyper Cube sampling
    n_simulations = 10

    test_dir = lambda i: os.path.join(base_dir, fn_outdir(i, res, box))

    all_submission_dirs = [test_dir(i) for i in range(n_simulations)]

    # test highRes hdf5
    test_create_hdf5(all_submission_dirs,
                     Latin_json=os.path.join(base_dir,
                                             "matterLatin_high.json"))