Skip to content

Commit

Permalink
symlink gcorr_total file to iter directory
Browse files Browse the repository at this point in the history
  • Loading branch information
arahlin committed Nov 1, 2023
1 parent 8825167 commit 9a57d6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions scripts/gcorr/iterate.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@
for spec in specs:
stag = "cmb_{}".format(spec)
gcorr_data["gcorr"][spec] = np.ones_like(bp["qb"][stag])
np.savez_compressed(
os.path.join(ref_dir, tag, "gcorr_{}_total.npz".format(tag)), **gcorr_data
)
ref_file = os.path.join(ref_dir, tag, "gcorr_{}_total.npz".format(tag))
np.savez_compressed(ref_file, **gcorr_data)
os.symlink(ref_file, ref_file.replace(ref_dir, rundir))

else:
# check plots directory to find what iteration we're at
Expand Down Expand Up @@ -211,7 +211,7 @@
sp.call("rsync -a {}/transfer* {}/.".format(rundirf, rundirf_iter).split())
sp.call("rsync -a {}/ERROR* {}/.".format(rundirf, rundirf_iter).split())
sp.call("rsync -a {}/logs* {}/.".format(rundirf, rundirf_iter).split())
sp.call("rsync -a {}/gcorr* {}/.".format(rundirf, rundirf_iter))
sp.call("rsync -aL {}/gcorr* {}/.".format(rundirf, rundirf_iter))

# Remove transfer functions and bandpowers from run directory
sp.call("rm -rf {}/bandpowers*".format(rundirf).split())
Expand Down
5 changes: 4 additions & 1 deletion xfaster/gcorr_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,12 @@ def run_xfaster_gcorr(
for tag in tags:
opts["output_tag"] = tag
opts["data_subset"] = os.path.join(gopts["data_subset"], "*{}".format(tag))
opts["gcorr_file"] = os.path.abspath(
gfile = os.path.realpath(
os.path.join(opts["output_root"], tag, "gcorr_{}_total.npz".format(tag))
)
opts["gcorr_file"] = gfile
if reload_gcorr:
assert os.path.exists(gfile), "Missing gcorr file {}".format(gfile)

for s in seeds:
opts["sim_index_default"] = s
Expand Down

0 comments on commit 9a57d6f

Please sign in to comment.