|
1 | 1 | # Copyright (c) 2022-2024 Simons Observatory. |
2 | 2 | # Full license can be found in the top level "LICENSE" file. |
3 | 3 |
|
| 4 | +import copy |
4 | 5 | import re |
5 | 6 | import sqlite3 |
6 | 7 | import yaml |
@@ -596,7 +597,7 @@ def _exec(self, data, detectors=None, **kwargs): |
596 | 597 |
|
597 | 598 | # If we have an observation with a specific wafer, modify the detector |
598 | 599 | # selection dictionary to include only that wafer. |
599 | | - obs_dets_select = dets_select |
| 600 | + obs_dets_select = copy.deepcopy(dets_select) |
600 | 601 | if obs_props[obindx]["wafer"] != "all": |
601 | 602 | if obs_dets_select is None: |
602 | 603 | obs_dets_select = dict() |
@@ -722,6 +723,8 @@ def _load_metadata(self, obs_name, session_name, gcomm, dets_select, preproc_con |
722 | 723 | # hence one reader). |
723 | 724 | if rank == 0: |
724 | 725 | # Load metadata |
| 726 | + msg = f"LoadContext {obs_name} metadata using dets_select={dets_select}" |
| 727 | + log.debug(msg) |
725 | 728 | ctx = open_context(context=self.context, context_file=self.context_file) |
726 | 729 | meta = ctx.get_meta(session_name, dets=dets_select) |
727 | 730 | if self.context_file is not None: |
@@ -755,7 +758,11 @@ def _load_metadata(self, obs_name, session_name, gcomm, dets_select, preproc_con |
755 | 758 | band = fp_cols[ |
756 | 759 | f"det_info{self.ax_pathsep}wafer{self.ax_pathsep}bandpass" |
757 | 760 | ].data |
758 | | - freq = [float(b[1:]) for b in band] |
| 761 | + |
| 762 | + fpat = re.compile(r"^f[\d]+$") |
| 763 | + freq = [ |
| 764 | + float(b[1:]) if fpat.match(b) is not None else 0.0 for b in band |
| 765 | + ] |
759 | 766 | bandcenter = np.array(freq) * u.GHz |
760 | 767 | bandwidth = bandcenter * self.bandwidth |
761 | 768 | fp_cols["bandcenter"] = Column(name="bandcenter", data=bandcenter) |
|
0 commit comments