Skip to content

Commit 15bf940

Browse files
authored
Merge branch 'thomaswmorris:master' into master
2 parents 719b071 + a5664e4 commit 15bf940

4 files changed

Lines changed: 14 additions & 12 deletions

File tree

docs/source/tutorials/maximum-likelihood-mapper.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
"import maria\n",
1818
"from maria.io import fetch\n",
1919
"\n",
20-
"input_map = maria.map.load(fetch(\"maps/cluster2.fits\"), nu=150e9)\n",
20+
"input_map = maria.map.load(fetch(\"maps/cluster1.fits\"), nu=150e9).to(\"uK_RJ\")\n",
2121
"input_map.data *= 2e1\n",
2222
"\n",
23-
"input_map[..., 256:-256, 256:-256].to(\"K_RJ\").plot(cmap=\"cmb\")\n",
23+
"input_map.plot(cmap=\"cmb\")\n",
2424
"print(input_map)"
2525
]
2626
},
@@ -33,9 +33,9 @@
3333
"from maria import Planner\n",
3434
"\n",
3535
"planner = Planner(target=input_map, site=\"cerro_toco\", constraints={\"el\": (70, 90)})\n",
36-
"plans = planner.generate_plans(total_duration=900, \n",
37-
" max_chunk_duration=900, \n",
38-
" sample_rate=50,\n",
36+
"plans = planner.generate_plans(total_duration=3600, \n",
37+
" max_chunk_duration=3600, \n",
38+
" sample_rate=25,\n",
3939
" scan_options={\"radius\": input_map.width.deg / 2})\n",
4040
"\n",
4141
"plans[0].plot()\n",
@@ -58,7 +58,7 @@
5858
" knee=1e1, \n",
5959
" gain_error=2e-2)\n",
6060
"\n",
61-
"array = {\"field_of_view\": 0.2, \n",
61+
"array = {\"field_of_view\": 0.15, \n",
6262
" \"beam_spacing\": 1.25,\n",
6363
" \"primary_size\": 25, \n",
6464
" \"shape\": \"circle\",\n",
@@ -107,8 +107,8 @@
107107
"from maria.mappers import MaximumLikelihoodMapper\n",
108108
"\n",
109109
"ml_mapper = MaximumLikelihoodMapper(tods=tods, \n",
110-
" width=0.75 * input_map.width.deg,\n",
111-
" height=0.75 * input_map.height.deg,\n",
110+
" width=0.8 * input_map.width.deg,\n",
111+
" height=0.8 * input_map.height.deg,\n",
112112
" resolution=10 * input_map.resolution.deg,\n",
113113
" units=\"mK_RJ\")\n",
114114
"print(f\"{ml_mapper.loss() = }\")"

maria/mappers/ml_mapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __init__(
9898
"remove_modes": {"modes_to_remove": 1},
9999
"remove_spline": {"knot_spacing": 20, "remove_el_gradient": True},
100100
},
101-
map_postprocessing={"gaussian_filter": {"sigma": 2}},
101+
# map_postprocessing={"gaussian_filter": {"sigma": 2}},
102102
progress_bars=False,
103103
)
104104

maria/sim/map.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ def _sample_maps(self, obs):
9696
# ideally we would do this for each nu bin, but that's slow
9797
smoothed_map = self.map.smooth(fwhm=band_fwhm)
9898

99+
logger.debug(f"Convolved map with beam width {band_fwhm} for band {band.name}")
100+
99101
for channel_index, (nu_min, nu_max) in enumerate(self.map.nu_bin_bounds):
100102
channel_s = ttime.monotonic()
101103
channel_map = smoothed_map.to("K_RJ", band=band)[:, [channel_index]]

maria/spectrum/atmosphere.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ def __repr__(self):
7070
altitude: {Quantity(self.altitude, "m")}"""
7171

7272
def _interpolate_quantity(self, quantity, nu, pwv=None, base_temperature=None, elevation=None):
73-
pwv = pwv or np.median(self.side_zenith_pwv)
74-
base_temperature = base_temperature or np.median(self.side_base_temperature)
75-
elevation = elevation or np.radians(45)
73+
pwv = pwv if pwv is not None else np.median(self.side_zenith_pwv)
74+
base_temperature = base_temperature if base_temperature is not None else np.median(self.side_base_temperature)
75+
elevation = elevation if elevation is not None else np.radians(45)
7676

7777
min_pwv = self.side_zenith_pwv.min()
7878
max_pwv = self.side_zenith_pwv.max()

0 commit comments

Comments
 (0)