Skip to content

Commit

Permalink
add new files
Browse files Browse the repository at this point in the history
  • Loading branch information
keskitalo committed Aug 3, 2022
1 parent 2f5bcc0 commit 140f966
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 1 deletion.
90 changes: 90 additions & 0 deletions AoA/sims/rescale.lat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import os
import sys

import healpy as hp
import numpy as np

# Scalings as of 06/27/2022

scalings = {
"splat_for_spsat" : {
20 : 99.70,
30 : 99.70,
40 : 99.70,
90 : 398.89,
150 : 371.84,
220 : 366.45,
280 : 253.28,
},
"chlat_wide" : {
30 : 199.37,
40 : 199.37,
90 : 797.46,
150 : 797.46,
220 : 787.49,
280 : 538.29,
},
"chlat_for_spsat" : {
30 : 204.20,
40 : 204.20,
90 : 816.79,
150 : 761.60,
220 : 750.56,
280 : 518.77,
},
"chlat_for_spsat_w_wide" : {
30 : 204.20,
40 : 204.20,
90 : 816.79,
150 : 761.60,
220 : 750.56,
280 : 518.77,
},
"chlat_for_chsat_so" : {
30 : 99.68,
40 : 99.68,
90 : 398.73,
150 : 398.73,
220 : 393.75,
280 : 269.14,
},
"chlat_for_chsat_s4" : {
30 : 97.65,
40 : 97.65,
90 : 390.59,
150 : 390.59,
220 : 385.71,
280 : 263.65,
},
#"chlat_for_chsat_s4" : {
# 30 : 105.54,
# 40 : 105.54,
# 90 : 422.17,
# 150 : 393.65,
# 220 : 387.94,
# 280 : 268.14,
#},
}

for flavor in scalings:
outdir = f"scaled_outputs/lat/{flavor}"
os.makedirs(outdir, exist_ok=True)

for freq, scale in scalings[flavor].items():
indir = f"outputs/lat/{flavor}/f{freq:03}"

inmap = f"{indir}/mapmaker_hits.fits"
outmap = f"{outdir}/hits_{freq:03}.fits"
print(f"Reading {inmap}")
hits = hp.read_map(inmap, None)
hits = (hits * scale).astype(int)
hp.write_map(outmap, hits, overwrite=True)
print(f"Wrote {outmap}")

inmap = f"{indir}/mapmaker_cov.fits"
outmap = f"{outdir}/cov_{freq:03}.fits"
print(f"Reading {inmap}")
cov = hp.read_map(inmap, None)
cov /= scale
hp.write_map(outmap, cov, overwrite=True)
print(f"Wrote {outmap}")
63 changes: 63 additions & 0 deletions AoA/sims/rescale.sat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import os
import sys

import healpy as hp
import numpy as np

# Scalings as of 06/27/2022 according to https://docs.google.com/spreadsheets/d/10_j-p4FmWuYgcpzr9Pvw6ZOQArhX2-OlDlvvkw9jd0w/edit#gid=1137632390

scalings = {
"spsat" : {
30 : 6.13,
40 : 6.13,
85 : 294.10,
95 : 294.10,
145 : 290.02,
155 : 290.02,
220 : 136.16,
280 : 95.31,
},
"chsat_so" : {
30 : 4.73,
40 : 4.73,
85 : 227.12,
95 : 227.12,
145 : 223.97,
155 : 223.97,
220 : 110.72,
280 : 77.51,
},
"chsat_s4" : {
30 : 4.56,
40 : 4.56,
85 : 219.07,
95 : 219.07,
145 : 216.02,
155 : 216.02,
220 : 105.75,
280 : 74.02,
},
}

for flavor in scalings:
outdir = f"scaled_outputs/sat/{flavor}"
os.makedirs(outdir, exist_ok=True)

for freq, scale in scalings[flavor].items():
indir = f"outputs/sat/{flavor}/f{freq:03}"

inmap = f"{indir}/mapmaker_hits.fits"
outmap = f"{outdir}/hits_{freq:03}.fits"
print(f"Reading {inmap}")
hits = hp.read_map(inmap, None)
hits = (hits * scale).astype(int)
hp.write_map(outmap, hits, overwrite=True)
print(f"Wrote {outmap}")

inmap = f"{indir}/mapmaker_cov.fits"
outmap = f"{outdir}/cov_{freq:03}.fits"
print(f"Reading {inmap}")
cov = hp.read_map(inmap, None)
cov /= scale
hp.write_map(outmap, cov, overwrite=True)
print(f"Wrote {outmap}")
2 changes: 1 addition & 1 deletion AoA/sims/run.lat.slurm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ echo " ntask = ${ntask}"
#for flavor in splat_for_spsat splat_for_spsat chlat_for_chsat_so chlat_for_chsat_s4 chlat_for_spsat chlat_wide chlat_for_spsat_wo_wide; do
#for flavor in splat_for_spsat chlat_for_chsat_so chlat_for_chsat_s4 chlat_for_spsat chlat_wide; do
#for flavor in chlat_for_chsat_s4 chlat_for_chsat_so chlat_for_spsat chlat_for_spsat_w_wide chlat_wide splat_for_spsat; do
for flavor in chlat_for_spsat_w_wide; do
for flavor in splat_for_spsat; do
case $flavor in
splat_for_spsat)
bands=( f020 f030 f040 f090 f150 f220 f280 )
Expand Down

0 comments on commit 140f966

Please sign in to comment.