diff --git a/sotodlib/core/hardware.py b/sotodlib/core/hardware.py index dfa9e425c..48b206d7f 100644 --- a/sotodlib/core/hardware.py +++ b/sotodlib/core/hardware.py @@ -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."}) diff --git a/sotodlib/scripts/hardware_trim.py b/sotodlib/scripts/hardware_trim.py index be835f387..4989e1e89 100644 --- a/sotodlib/scripts/hardware_trim.py +++ b/sotodlib/scripts/hardware_trim.py @@ -56,7 +56,7 @@ def main(): have the format ':'. 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() diff --git a/sotodlib/sim_hardware.py b/sotodlib/sim_hardware.py index e3cdbce8c..3b6a89779 100644 --- a/sotodlib/sim_hardware.py +++ b/sotodlib/sim_hardware.py @@ -697,7 +697,7 @@ 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 @@ -705,101 +705,195 @@ def get_example(): # 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 @@ -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" @@ -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): @@ -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] @@ -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() @@ -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): diff --git a/sotodlib/toast/pipeline_tools/hardware.py b/sotodlib/toast/pipeline_tools/hardware.py index 5e6140f58..49d386523 100644 --- a/sotodlib/toast/pipeline_tools/hardware.py +++ b/sotodlib/toast/pipeline_tools/hardware.py @@ -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( diff --git a/sotodlib/toast/sim_hwpss.py b/sotodlib/toast/sim_hwpss.py index 85c9a34fc..0d36ede79 100644 --- a/sotodlib/toast/sim_hwpss.py +++ b/sotodlib/toast/sim_hwpss.py @@ -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 diff --git a/sotodlib/toast/sim_sso.py b/sotodlib/toast/sim_sso.py index a46365c72..4ca95eed9 100644 --- a/sotodlib/toast/sim_sso.py +++ b/sotodlib/toast/sim_sso.py @@ -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 diff --git a/sotodlib/vis_hardware.py b/sotodlib/vis_hardware.py index 6e41806f0..b1a0740cc 100644 --- a/sotodlib/vis_hardware.py +++ b/sotodlib/vis_hardware.py @@ -9,12 +9,18 @@ default_band_colors = { - "f030": (0.4, 0.4, 1.0, 0.2), - "f040": (0.4, 0.4, 1.0, 0.2), - "f090": (0.4, 1.0, 0.4, 0.2), - "f150": (0.4, 1.0, 0.4, 0.2), - "f230": (1.0, 0.4, 0.4, 0.2), - "f290": (1.0, 0.4, 0.4, 0.2), + "LAT_f030": (0.4, 0.4, 1.0, 0.2), + "LAT_f040": (0.4, 0.4, 1.0, 0.2), + "LAT_f090": (0.4, 1.0, 0.4, 0.2), + "LAT_f150": (0.4, 1.0, 0.4, 0.2), + "LAT_f230": (1.0, 0.4, 0.4, 0.2), + "LAT_f290": (1.0, 0.4, 0.4, 0.2), + "SAT_f030": (0.4, 0.4, 1.0, 0.2), + "SAT_f040": (0.4, 0.4, 1.0, 0.2), + "SAT_f090": (0.4, 1.0, 0.4, 0.2), + "SAT_f150": (0.4, 1.0, 0.4, 0.2), + "SAT_f230": (1.0, 0.4, 0.4, 0.2), + "SAT_f290": (1.0, 0.4, 0.4, 0.2), } diff --git a/tests/test_hardware.py b/tests/test_hardware.py index ce0cfce84..0e6e5b112 100644 --- a/tests/test_hardware.py +++ b/tests/test_hardware.py @@ -93,14 +93,14 @@ def test_sim_full(self): # "A" polarization configuration and are located in pixels 20-29. wbhw = hw.select( match={"wafer_slot": ["w25", "w26"], - "band": "f090", + "band": "SAT_f090", "pol": "A", "pixel": "02."}) - dbpath = os.path.join(self.outdir, "w25-26_p20-29_f090_A.toml.gz") + dbpath = os.path.join(self.outdir, "w25-26_p20-29_SAT_f090_A.toml.gz") wbhw.dump(dbpath, overwrite=True, compress=True) check = Hardware(dbpath) self.assertTrue(len(check.data["detectors"]) == 20) - chkpath = os.path.join(self.outdir, "w25-26_p20-29_f090_A.txt") + chkpath = os.path.join(self.outdir, "w25-26_p20-29_SAT_f090_A.txt") with open(chkpath, "w") as f: for d in check.data["detectors"]: f.write("{}\n".format(d)) diff --git a/tests/test_time_constant.py b/tests/test_time_constant.py index 0b12b1f6f..44ee2d354 100644 --- a/tests/test_time_constant.py +++ b/tests/test_time_constant.py @@ -58,7 +58,7 @@ def setUp(self): dets = sim_telescope_detectors(hwfull, "SAT4") hwfull.data["detectors"] = dets hw = hwfull.select( - match={"wafer_slot": "w42", "band": "f030", "pixel": "00[01]"}) + match={"wafer_slot": "w42", "band": "SAT_f030", "pixel": "00[01]"}) # print(hw.data["detectors"], flush=True) detquats = {k: v["quat"] for k, v in hw.data["detectors"].items()} diff --git a/tests/test_toast_load.py b/tests/test_toast_load.py index 3343c7294..9a8e9a4e7 100644 --- a/tests/test_toast_load.py +++ b/tests/test_toast_load.py @@ -61,7 +61,7 @@ def setUp(self): dets = sim_telescope_detectors(hwfull, "SAT4") hwfull.data["detectors"] = dets hw = hwfull.select( - match={"wafer_slot": "w42", "band": "f030", "pixel": "00[01]"}) + match={"wafer_slot": "w42", "band": "SAT_f030", "pixel": "00[01]"}) # print(hw.data["detectors"], flush=True) detquats = {k: v["quat"] for k, v in hw.data["detectors"].items()} @@ -391,6 +391,7 @@ def test_load_compressed(self): uncompressed_size = sizes["uncompressed"] - sizes["uncompressed_all_but_one"] compressed_size = sizes["compressed"] - sizes["compressed_all_but_one"] very_compressed_size = sizes["very_compressed"] - sizes["very_compressed_all_but_one"] + ratio1 = compressed_size / uncompressed_size assert ratio1 < 1 ratio2 = very_compressed_size / uncompressed_size