Simulating observations with MUSTANG-2¶
MUSTANG-2 is a bolometric array on the Green Bank Telescope. In this notebook we simulate an observation of the Crab Nebula (M1).
[1]:
import maria
from maria.io import fetch
input_map = maria.map.load(fetch("maps/crab_nebula.fits"), nu=93e9)
input_map.plot()
print(input_map)
2025-11-24 21:12:16.758 INFO: Fetching https://github.com/thomaswmorris/maria-data/raw/master/maps/crab_nebula.fits
Downloading: 100%|████████████████| 2.00M/2.00M [00:00<00:00, 18.1MB/s]
ProjectionMap:
shape(nu, y, x): (1, 500, 500)
stokes: naive
nu: [93.] GHz
t: naive
z: naive
quantity: rayleigh_jeans_temperature
units: K_RJ
min: 0.000e+00
max: 5.876e-02
rms: 9.295e-03
center:
ra: 05ʰ34ᵐ31.80ˢ
dec: 22°01’3.00”
size(y, x): (8.83’, 8.83’)
resolution(y, x): (1.06”, 1.06”)
beam(maj, min, rot): [[0. 0. 0.]] rad
memory: 4 MB
[2]:
from maria import Planner
planner = Planner(target=input_map, site="green_bank", constraints={"el": (60, 90)})
plans = planner.generate_plans(total_duration=900, sample_rate=100)
plans[0].plot()
print(plans)
PlanList(1 plans, 900 s):
start_time duration target(ra,dec) center(az,el)
chunk
0 2025-11-25 04:42:17.964 +00:00 900 s (83.63°, 22.02°) (117.5°, 61.65°)
[3]:
instrument = maria.get_instrument("MUSTANG-2")
print(instrument)
instrument.plot()
Instrument(1 array)
├ arrays:
│ n FOV baseline bands polarized
│ array1 217 4.2’ 0 m [m2/f093] False
│
└ bands:
name center width η NEP NET_RJ NET_CMB FWHM
0 m2/f093 86.21 GHz 20.98 GHz 0.1 15 aW√s 0.5711 mK_RJ√s 0.6905 mK_CMB√s 9.133”
[4]:
sim = maria.Simulation(
instrument,
plans=plans,
site="green_bank",
map=input_map,
atmosphere="2d",
)
print(sim)
2025-11-24 21:12:26.537 INFO: Fetching https://github.com/thomaswmorris/maria-data/raw/master/atmosphere/spectra/am/v3/green_bank.h5
Downloading: 100%|████████████████| 22.0M/22.0M [00:00<00:00, 151MB/s]
2025-11-24 21:12:27.855 INFO: Fetching https://github.com/thomaswmorris/maria-data/raw/master/atmosphere/weather/era5/green_bank.h5
Downloading: 100%|████████████████| 12.0M/12.0M [00:00<00:00, 39.0MB/s]
Simulation
├ Instrument(1 array)
│ ├ arrays:
│ │ n FOV baseline bands polarized
│ │ array1 217 4.2’ 0 m [m2/f093] False
│ │
│ └ bands:
│ name center width η NEP NET_RJ NET_CMB FWHM
│ 0 m2/f093 86.21 GHz 20.98 GHz 0.1 15 aW√s 0.5711 mK_RJ√s 0.6905 mK_CMB√s 9.133”
├ Site:
│ region: green_bank
│ timezone: America/New_York
│ location:
│ longitude: 79°50’23.28” W
│ latitude: 38°25’59.16” N
│ altitude: 825 m
│ seasonal: True
│ diurnal: True
├ PlanList(1 plans, 900 s):
│ start_time duration target(ra,dec) center(az,el)
│ chunk
│ 0 2025-11-25 04:42:17.964 +00:00 900 s (83.63°, 22.02°) (117.5°, 61.65°)
├ '2d'
└ ProjectionMap:
shape(stokes, nu, t, y, x): (1, 1, 1, 500, 500)
stokes: I
nu: [93.] GHz
t: [1.76401874e+09]
z: naive
quantity: rayleigh_jeans_temperature
units: K_RJ
min: 0.000e+00
max: 5.876e-02
rms: 9.295e-03
center:
ra: 05ʰ34ᵐ31.80ˢ
dec: 22°01’3.00”
size(y, x): (8.83’, 8.83’)
resolution(y, x): (1.06”, 1.06”)
beam(maj, min, rot): [[0. 0. 0.]] rad
memory: 4 MB
[5]:
tods = sim.run()
tods[0].plot()
2025-11-24 21:12:28.659 INFO: Simulating observation 1 of 1
Constructing atmosphere: 100%|████████████████| 8/8 [00:01<00:00, 6.57it/s]
Generating turbulence: 100%|████████████████| 8/8 [00:00<00:00, 21.92it/s]
Sampling turbulence: 100%|████████████████| 8/8 [00:03<00:00, 2.38it/s]
Computing atmospheric emission: 100%|████████████████| 1/1 [00:00<00:00, 1.03it/s, band=m2/f093]
Sampling map: 100%|████████████████| 1/1 [00:08<00:00, 8.77s/it, band=m2/f093]
Generating noise: 100%|████████████████| 1/1 [00:00<00:00, 1.05it/s, band=m2/f093]
2025-11-24 21:12:57.247 INFO: Simulated observation 1 of 1 in 28.58 s
[6]:
from maria.mappers import BinMapper
mapper = BinMapper(
tod_preprocessing={
"remove_modes": {"modes_to_remove": 1},
"remove_spline": {"knot_spacing": 60, "remove_el_gradient": True},
},
map_postprocessing={
"gaussian_filter": {"sigma": 1},
},
units="uK_RJ",
tods=tods,
)
self = mapper
output_map = mapper.run()
2025-11-24 21:13:04.934 INFO: Inferring center {'ra': '05ʰ34ᵐ31.90ˢ', 'dec': '22°01’3.94”'} for mapper.
2025-11-24 21:13:04.948 INFO: Inferring mapper width 12.6’ for mapper from observation patch.
2025-11-24 21:13:04.949 INFO: Inferring mapper height 12.6’ to match supplied width.
2025-11-24 21:13:04.961 INFO: Inferring mapper resolution 5.904” for mapper from observation patch.
2025-11-24 21:13:04.963 INFO: Inferring mapper stokes parameters 'I' for mapper.
Preprocessing TODs: 100%|████████████████| 1/1 [00:01<00:00, 1.44s/it]
Mapping: 100%|██████████| 1/1 [00:01<00:00, 1.98s/it, tod=1/1]
[7]:
output_map.plot()