Skip to content

Commit

Permalink
Merge pull request #134 from simonsobs/noise_update
Browse files Browse the repository at this point in the history
Allow for different noises between SAT/LAT bands
  • Loading branch information
smsimon authored Jun 11, 2021
2 parents cc18e65 + 2e1019c commit fdf5f10
Show file tree
Hide file tree
Showing 10 changed files with 187 additions and 70 deletions.
2 changes: 1 addition & 1 deletion sotodlib/core/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def select(self, telescopes=None, tube_slots=None, match=dict()):
(recall the "." matches a single character)::
new = hw.select(match={"wafer_slot": ["w25", "w26"],
"band": "f090",
"band": "SAT_f090",
"pol": "A",
"pixel": "02."})
Expand Down
2 changes: 1 addition & 1 deletion sotodlib/scripts/hardware_trim.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def main():
have the format '<property>:<regex or list>'. The regex\
expression should be valid to pass to the 're' module. If \
passing a list, this should be comma-separated. For example, \
--match 'band:MF.*' 'wafer_slot:w25,w26' 'pol:A' "
--match 'band:SAT_MF.*' 'wafer_slot:w25,w26' 'pol:A' "
)

args = parser.parse_args()
Expand Down
186 changes: 145 additions & 41 deletions sotodlib/sim_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,109 +697,203 @@ def get_example():
bnd["low"] = 21.7
bnd["high"] = 29.7
bnd["bandpass"] = ""
bnd["NET"] = 300.0
bnd["NET"] = 501.1
bnd["fknee"] = 50.0
bnd["fmin"] = 0.01
bnd["alpha"] = 3.5
# Noise elevation scaling fits from Carlos Sierra
# These numbers are for V3 LAT baseline
bnd["A"] = 0.09
bnd["C"] = 0.87
bands["f030"] = bnd
bands["LAT_f030"] = bnd

bnd = OrderedDict()
bnd["center"] = 38.9
bnd["low"] = 30.9
bnd["high"] = 46.9
bnd["bandpass"] = ""
bnd["NET"] = 300.0
bnd["NET"] = 309.9
bnd["fknee"] = 50.0
bnd["fmin"] = 0.01
bnd["alpha"] = 3.5
bnd["A"] = 0.25
bnd["C"] = 0.64
bands["f040"] = bnd
bands["LAT_f040"] = bnd

bnd = OrderedDict()
bnd["center"] = 92.0
bnd["low"] = 79.0
bnd["high"] = 105.0
bnd["bandpass"] = ""
bnd["NET"] = 300.0
bnd["NET"] = 337.4
bnd["fknee"] = 50.0
bnd["fmin"] = 0.01
bnd["alpha"] = 3.5
bnd["A"] = 0.14
bnd["C"] = 0.80
bands["f090"] = bnd
bands["LAT_f090"] = bnd

bnd = OrderedDict()
bnd["center"] = 147.5
bnd["low"] = 130.0
bnd["high"] = 165.0
bnd["bandpass"] = ""
bnd["NET"] = 400.0
bnd["NET"] = 445.5
bnd["fknee"] = 50.0
bnd["fmin"] = 0.01
bnd["alpha"] = 3.5
bnd["A"] = 0.17
bnd["C"] = 0.76
bands["f150"] = bnd
bands["LAT_f150"] = bnd

bnd = OrderedDict()
bnd["center"] = 225.7
bnd["low"] = 196.7
bnd["high"] = 254.7
bnd["bandpass"] = ""
bnd["NET"] = 400.0
bnd["NET"] = 953.2
bnd["fknee"] = 50.0
bnd["fmin"] = 0.01
bnd["alpha"] = 3.5
bnd["A"] = 0.30
bnd["C"] = 0.58
bands["f230"] = bnd
bands["LAT_f230"] = bnd

bnd = OrderedDict()
bnd["center"] = 285.4
bnd["low"] = 258.4
bnd["high"] = 312.4
bnd["bandpass"] = ""
bnd["NET"] = 400.0
bnd["NET"] = 2333.0
bnd["fknee"] = 50.0
bnd["fmin"] = 0.01
bnd["alpha"] = 3.5
bnd["A"] = 0.36
bnd["C"] = 0.49
bands["f290"] = bnd
bands["LAT_f290"] = bnd

bnd = OrderedDict()
bnd["center"] = 25.7
bnd["low"] = 21.7
bnd["high"] = 29.7
bnd["bandpass"] = ""
bnd["NET"] = 386.1
bnd["fknee"] = 50.0
bnd["fmin"] = 0.01
bnd["alpha"] = 3.5
# Noise elevation scaling fits from Carlos Sierra
# These numbers are for V3 SAT baseline
bnd["A"] = 0.10
bnd["C"] = 0.87
bands["SAT_f030"] = bnd

bnd = OrderedDict()
bnd["center"] = 38.9
bnd["low"] = 30.9
bnd["high"] = 46.9
bnd["bandpass"] = ""
bnd["NET"] = 258.8
bnd["fknee"] = 50.0
bnd["fmin"] = 0.01
bnd["alpha"] = 3.5
bnd["A"] = 0.26
bnd["C"] = 0.66
bands["SAT_f040"] = bnd

bnd = OrderedDict()
bnd["center"] = 92.0
bnd["low"] = 79.0
bnd["high"] = 105.0
bnd["bandpass"] = ""
bnd["NET"] = 248.8
bnd["fknee"] = 50.0
bnd["fmin"] = 0.01
bnd["alpha"] = 3.5
bnd["A"] = 0.17
bnd["C"] = 0.78
bands["SAT_f090"] = bnd

bnd = OrderedDict()
bnd["center"] = 147.5
bnd["low"] = 130.0
bnd["high"] = 165.0
bnd["bandpass"] = ""
bnd["NET"] = 311.1
bnd["fknee"] = 50.0
bnd["fmin"] = 0.01
bnd["alpha"] = 3.5
bnd["A"] = 0.23
bnd["C"] = 0.71
bands["SAT_f150"] = bnd

bnd = OrderedDict()
bnd["center"] = 225.7
bnd["low"] = 196.7
bnd["high"] = 254.7
bnd["bandpass"] = ""
bnd["NET"] = 614.4
bnd["fknee"] = 50.0
bnd["fmin"] = 0.01
bnd["alpha"] = 3.5
bnd["A"] = 0.43
bnd["C"] = 0.44
bands["SAT_f230"] = bnd

bnd = OrderedDict()
bnd["center"] = 285.4
bnd["low"] = 258.4
bnd["high"] = 312.4
bnd["bandpass"] = ""
bnd["NET"] = 1524.7
bnd["fknee"] = 50.0
bnd["fmin"] = 0.01
bnd["alpha"] = 3.5
bnd["A"] = 0.48
bnd["C"] = 0.38
bands["SAT_f290"] = bnd

cnf["bands"] = bands

wafer_slots = OrderedDict()

wtypes = ["UHF", "MF", "LF"]
wtypes = ["LAT_UHF", "SAT_UHF", "LAT_MF", "SAT_MF", "LAT_LF", "SAT_LF"]
wcnt = {
"LF": 1*7 + 1*3,
"MF": 2*7 + 2*2*3,
"UHF": 1*7 + 2*3
"LAT_LF": 1*3,
"LAT_MF": 4*3,
"LAT_UHF": 2*3,
"SAT_LF": 1*7,
"SAT_MF": 2*7,
"SAT_UHF": 1*7
}
wnp = {
"LF": 37,
"MF": 432,
"UHF": 432
"LAT_LF": 37,
"LAT_MF": 432,
"LAT_UHF": 432,
"SAT_LF": 37,
"SAT_MF": 432,
"SAT_UHF": 432
}
wpixmm = {
"LF": 18.0,
"MF": 5.3,
"UHF": 5.3
"LAT_LF": 18.0,
"LAT_MF": 5.3,
"LAT_UHF": 5.3,
"SAT_LF": 18.0,
"SAT_MF": 5.3,
"SAT_UHF": 5.3
}
wrhombgap = {
"MF": 0.71,
"UHF": 0.71,
"LAT_MF": 0.71,
"LAT_UHF": 0.71,
"SAT_MF": 0.71,
"SAT_UHF": 0.71
}
wbd = {
"LF": ["f030", "f040"],
"MF": ["f090", "f150"],
"UHF": ["f230", "f290"]
"LAT_LF": ["LAT_f030", "LAT_f040"],
"LAT_MF": ["LAT_f090", "LAT_f150"],
"LAT_UHF": ["LAT_f230", "LAT_f290"],
"SAT_LF": ["SAT_f030", "SAT_f040"],
"SAT_MF": ["SAT_f090", "SAT_f150"],
"SAT_UHF": ["SAT_f230", "SAT_f290"]
}
windx = 0
cardindx = 0
Expand All @@ -808,7 +902,7 @@ def get_example():
wn = "w{:02d}".format(windx)
wf = OrderedDict()
wf["type"] = wt
if (wt == "LF"):
if ((wt == "LAT_LF") or (wt == "SAT_LF")):
wf["packing"] = "S"
else:
wf["packing"] = "F"
Expand All @@ -827,12 +921,15 @@ def get_example():
tube_slots = OrderedDict()

woff = {
"LF": 0,
"MF": 0,
"UHF": 0
"LAT_LF": 0,
"LAT_MF": 0,
"LAT_UHF": 0,
"SAT_LF": 0,
"SAT_MF": 0,
"SAT_UHF": 0
}

ltubes = ["UHF", "UHF", "MF", "MF", "MF", "MF", "LF"]
ltubes = ["LAT_UHF", "LAT_UHF", "LAT_MF", "LAT_MF", "LAT_MF", "LAT_MF", "LAT_LF"]
ltubepos = [0, 1, 2, 3, 5, 6, 10]
ltube_cryonames=["c1", "i5", "i6", "i1", "i3", "i4", "o6"]
for tindx in range(7):
Expand All @@ -856,7 +953,7 @@ def get_example():
tb["receiver_name"] = ""
tube_slots[nm] = tb

stubes = ["MF", "MF", "UHF","LF"]
stubes = ["SAT_MF", "SAT_MF", "SAT_UHF","SAT_LF"]
for tindx in range(4):
nm = "ST{:d}".format(tindx+1)
ttyp = stubes[tindx]
Expand Down Expand Up @@ -889,19 +986,26 @@ def get_example():
# the sky at a plate scale of 0.00495 deg/mm.
tele["tubespace"] = 359.6
fwhm = OrderedDict()
fwhm["f030"] = 7.4
fwhm["f040"] = 5.1
fwhm["f090"] = 2.2
fwhm["f150"] = 1.4
fwhm["f230"] = 1.0
fwhm["f290"] = 0.9
fwhm["LAT_f030"] = 7.4
fwhm["LAT_f040"] = 5.1
fwhm["LAT_f090"] = 2.2
fwhm["LAT_f150"] = 1.4
fwhm["LAT_f230"] = 1.0
fwhm["LAT_f290"] = 0.9
tele["fwhm"] = fwhm
tele["platform_name"] = ""
telescopes["LAT"] = tele

fwhm_sat = OrderedDict()
fwhm_sat["SAT_f030"] = 7.4
fwhm_sat["SAT_f040"] = 5.1
fwhm_sat["SAT_f090"] = 2.2
fwhm_sat["SAT_f150"] = 1.4
fwhm_sat["SAT_f230"] = 1.0
fwhm_sat["SAT_f290"] = 0.9
sfwhm = OrderedDict()
scale = 0.09668 / 0.00495
for k, v in fwhm.items():
for k, v in fwhm_sat.items():
sfwhm[k] = float(int(scale * v * 10.0) // 10)

tele = OrderedDict()
Expand Down Expand Up @@ -981,7 +1085,7 @@ def get_example():

pl = ["A", "B"]
hand = ["L", "R"]
bandarr=["f030","f040"]
bandarr=["SAT_f030","SAT_f040"]

dets = OrderedDict()
for d in range(4):
Expand Down
15 changes: 9 additions & 6 deletions sotodlib/toast/pipeline_tools/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,19 @@ def add_hw_args(parser):
parser.add_argument(
"--bands",
required=True,
help="Comma-separated list of bands: f030 (27GHz), f040 (39GHz), "
"f090 (93GHz), f150 (145GHz), "
"f230 (225GHz), f290 (285GHz). "
help="Comma-separated list of bands: LAT_f030 (27GHz), LAT_f040 (39GHz), "
"LAT_f090 (93GHz), LAT_f150 (145GHz), "
"LAT_f230 (225GHz), LAT_f290 (285GHz), "
"SAT_f030 (27GHz), SAT_f040 (39GHz), "
"SAT_f090 (93GHz), SAT_f150 (145GHz), "
"SAT_f230 (225GHz), SAT_f290 (285GHz). "
)
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument(
"--tube_slots",
help="Comma-separated list of optics tube slots: c1 (UHF), i5 (UHF), "
" i6 (MF), i1 (MF), i3 (MF), i4 (MF), o6 (LF),"
" ST1 (MF), ST2 (MF), ST3 (UHF), ST4 (LF)."
help="Comma-separated list of optics tube slots: c1 (LAT_UHF), i5 (LAT_UHF), "
" i6 (LAT_MF), i1 (LAT_MF), i3 (LAT_MF), i4 (LAT_MF), o6 (LAT_LF),"
" ST1 (SAT_MF), ST2 (SAT_MF), ST3 (SAT_UHF), ST4 (SAT_LF)."

)
group.add_argument(
Expand Down
12 changes: 6 additions & 6 deletions sotodlib/toast/sim_hwpss.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ def exec(self, data):
signal = tod.local_signal(det, self._name)
band = focalplane[det]["band"]
freq = {
"f030" : "027",
"f040" : "039",
"f090" : "093",
"f150" : "145",
"f230" : "225",
"f290" : "278",
"SAT_f030" : "027",
"SAT_f040" : "039",
"SAT_f090" : "093",
"SAT_f150" : "145",
"SAT_f230" : "225",
"SAT_f290" : "278",
}[band]

# Get incident angle
Expand Down
11 changes: 7 additions & 4 deletions sotodlib/toast/sim_sso.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,17 @@ def _observe_sso(self, sso_az, sso_el, sso_dist, sso_dia, tod, comm, prefix, foc

if rank == 0:
log.info("{}Observing the SSO signal".format(prefix))


# FIXME: we should get the center frequency from the bandpass
band_dict = {'f030' : 27, 'f040': 39, 'f090': 93,
'150': 145 , 'f230': 225, 'f290': 285}
'f150': 145 , 'f230': 225, 'f290': 285}

for band in band_dict.keys():
if band in prefix:
freq = band_dict[band]
break
# FIXME we use the same, approximate center frequency for
# SAT and LAT
freq = band_dict[band[4:]]
break

for det in tod.local_dets:
# Cache the output signal
Expand Down
Loading

0 comments on commit fdf5f10

Please sign in to comment.