mirror of
https://github.com/Richard-Sti/csiborgtools_public.git
synced 2025-05-14 06:31:11 +00:00
Add cleaner paths (#43)
* ignore venv * ignore pylians if unavaible * Edit loading paths * Edit paths * Stop having default paths * Add nb * Add glamdring paths --------- Co-authored-by: Richard Stiskalek <dc-stis1@login8b.pri.cosma7.alces.network> Co-authored-by: Richard Stiskalek <dc-stis1@login8a.pri.cosma7.alces.network>
This commit is contained in:
parent
1344fa40b6
commit
e0d3854277
15 changed files with 1421 additions and 50 deletions
|
@ -46,7 +46,7 @@ rank = comm.Get_rank()
|
|||
nproc = comm.Get_size()
|
||||
MAS = "CIC" # mass asignment scheme
|
||||
|
||||
paths = csiborgtools.read.CSiBORGPaths()
|
||||
paths = csiborgtools.read.CSiBORGPaths(**csiborgtools.paths_glamdring)
|
||||
box = csiborgtools.units.BoxUnits(paths)
|
||||
reader = csiborgtools.read.ParticleReader(paths)
|
||||
ics = paths.ic_ids(tonew=False)
|
||||
|
|
|
@ -60,7 +60,7 @@ fperm = join(dumpdir, "fields", fname + ".npy")
|
|||
dtype = {"names": ["delta", "phi"], "formats": [numpy.float32] * 2}
|
||||
|
||||
# CSiBORG simulation paths
|
||||
paths = csiborgtools.read.CSiBORGPaths()
|
||||
paths = csiborgtools.read.CSiBORGPaths(**csiborgtools.paths_glamdring)
|
||||
ics = paths.ic_ids(tonew=False)
|
||||
nsims = len(ics)
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ comm = MPI.COMM_WORLD
|
|||
rank = comm.Get_rank()
|
||||
nproc = comm.Get_size()
|
||||
|
||||
paths = csiborgtools.read.CSiBORGPaths()
|
||||
paths = csiborgtools.read.CSiBORGPaths(**csiborgtools.paths_glamdring)
|
||||
dumpdir = "/mnt/extraspace/rstiskalek/csiborg/"
|
||||
loaddir = join(dumpdir, "temp")
|
||||
cols_collect = [("npart", numpy.int64), ("totpartmass", numpy.float64),
|
||||
|
@ -118,8 +118,7 @@ for i, nsim in enumerate(paths.ic_ids(tonew=False)):
|
|||
out_collected = csiborgtools.read.combine_splits(
|
||||
utils.Nsplits, nsnap, nsim, partreader, cols_collect,
|
||||
remove_splits=True, verbose=False)
|
||||
fname = join(paths.dumpdir, "ramses_out_{}_{}.npy"
|
||||
.format(str(nsim).zfill(5), str(nsnap).zfill(5)))
|
||||
fname = paths.hcat_path(nsim)
|
||||
print("Saving results to `{}`.".format(fname))
|
||||
numpy.save(fname, out_collected)
|
||||
|
||||
|
|
|
@ -44,25 +44,23 @@ parser = ArgumentParser()
|
|||
parser.add_argument("--dump_clumps", type=lambda x: bool(strtobool(x)))
|
||||
args = parser.parse_args()
|
||||
|
||||
paths = csiborgtools.read.CSiBORGPaths()
|
||||
paths = csiborgtools.read.CSiBORGPaths(**csiborgtools.paths_glamdring)
|
||||
nsims = paths.ic_ids(tonew=True)
|
||||
|
||||
# Output files
|
||||
dumpdir = "/mnt/extraspace/rstiskalek/csiborg/"
|
||||
ftemp = join(dumpdir, "temp_initmatch", "temp_{}_{}_{}.npy")
|
||||
fpermcm = join(dumpdir, "initmatch", "clump_{}_cm.npy")
|
||||
fpermpart = join(dumpdir, "initmatch", "clump_{}_particles.npy")
|
||||
ftemp = join(paths.dumpdir, "temp_initmatch", "temp_{}_{}_{}.npy")
|
||||
fpermcm = join(paths.dumpdir, "initmatch", "clump_{}_cm.npy")
|
||||
fpermpart = join(paths.dumpdir, "initmatch", "clump_{}_particles.npy")
|
||||
|
||||
for nsim in nsims:
|
||||
if rank == 0:
|
||||
print("{}: reading simulation {}.".format(datetime.now(), nsim),
|
||||
flush=True)
|
||||
nsnap_min = min(paths.get_snapshots(nsim))
|
||||
nsnap_max = max(paths.get_snapshots(nsim))
|
||||
reader = csiborgtools.read.ParticleReader(paths)
|
||||
|
||||
# Read and sort the initial particle files by their particle IDs
|
||||
part0 = reader.read_particle(nsnap_min, nsim, ["x", "y", "z", "M", "ID"],
|
||||
part0 = reader.read_particle(1, nsim, ["x", "y", "z", "M", "ID"],
|
||||
verbose=False)
|
||||
part0 = part0[numpy.argsort(part0["ID"])]
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ ics = [7444, 7468, 7492, 7516, 7540, 7564, 7588, 7612, 7636, 7660, 7684,
|
|||
9820, 9844]
|
||||
dumpdir = "/mnt/extraspace/rstiskalek/csiborg/knn"
|
||||
fout = join(dumpdir, "auto", "knncdf_{}_{}.p")
|
||||
paths = csiborgtools.read.CSiBORGPaths()
|
||||
paths = csiborgtools.read.CSiBORGPaths(**csiborgtools.paths_glamdring)
|
||||
knncdf = csiborgtools.clustering.kNN_CDF()
|
||||
|
||||
###############################################################################
|
||||
|
|
|
@ -58,7 +58,7 @@ ics = [7444, 7468, 7492, 7516, 7540, 7564, 7588, 7612, 7636, 7660, 7684,
|
|||
9292, 9316, 9340, 9364, 9388, 9412, 9436, 9460, 9484, 9508, 9532,
|
||||
9556, 9580, 9604, 9628, 9652, 9676, 9700, 9724, 9748, 9772, 9796,
|
||||
9820, 9844]
|
||||
paths = csiborgtools.read.CSiBORGPaths()
|
||||
paths = csiborgtools.read.CSiBORGPaths(**csiborgtools.paths_glamdring)
|
||||
dumpdir = "/mnt/extraspace/rstiskalek/csiborg/knn"
|
||||
fout = join(dumpdir, "cross", "knncdf_{}_{}_{}.p")
|
||||
knncdf = csiborgtools.clustering.kNN_CDF()
|
||||
|
|
|
@ -35,7 +35,7 @@ parser.add_argument("--sigma", type=float)
|
|||
args = parser.parse_args()
|
||||
|
||||
# File paths
|
||||
paths = csiborgtools.read.CSiBORGPaths()
|
||||
paths = csiborgtools.read.CSiBORGPaths(**csiborgtools.paths_glamdring)
|
||||
fout = join(utils.dumpdir, "overlap",
|
||||
"cross_{}_{}.npz".format(args.nsim0, args.nsimx))
|
||||
smooth_kwargs = {"sigma": args.sigma, "mode": "constant", "cval": 0.0}
|
||||
|
|
|
@ -32,7 +32,7 @@ comm = MPI.COMM_WORLD
|
|||
rank = comm.Get_rank()
|
||||
nproc = comm.Get_size()
|
||||
|
||||
paths = csiborgtools.read.CSiBORGPaths()
|
||||
paths = csiborgtools.read.CSiBORGPaths(**csiborgtools.paths_glamdring)
|
||||
sims = paths.ic_ids(False)
|
||||
partcols = ["x", "y", "z", "vx", "vy", "vz", "M", "level"]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue