Polarized observations¶
This tutorial covers working with polarized instrument and maps, and recovering polarized maps from observations.
We start with a normal instrument, and create two orthogonally polarized copies of each detector by setting polarized: True in the Array config:
[1]:
import maria
from maria.instrument import Band
f150 = Band(
center=150e9,
width=30e9,
NET_RJ=60e-6,
knee=1e0,
gain_error=5e-2)
array = {"field_of_view": 0.2,
"shape": "circle",
"beam_spacing": 1.8,
"primary_size": 10,
"polarized": True,
"packing": "sunflower",
"bands": [f150]}
instrument = maria.get_instrument(array=array)
print(instrument.arrays)
n field_of_view max_baseline bands polarized primary_size
array1 88 11.98’ 0 m [f150] True 10 m
We can see the resulting polarization footprint in the instrument plot:
[2]:
print(instrument)
instrument.plot()
Instrument(1 array)
├ arrays:
│ n field_of_view max_baseline bands polarized primary_size
│ array1 88 11.98’ 0 m [f150] True 10 m
│
└ bands:
name center width η NEP NET_RJ NET_CMB FWHM
0 f150 150 GHz 30 GHz 0.5 13.22 aW√s 60 uK_RJ√s 104 uK_CMB√s 52.49”
Let’s observe the use the Einstein map, which has a faint polarization signature underneath the unpolarized signal of Einstein’s face. Remember that all maps are five dimensional (stokes, frequency, time, y, x); this map has four channels in the stokes dimensions (the I, Q, U, and V Stokes parameters). We can plot all the channels by giving plot a shaped set of stokes parameters.
[3]:
input_map = maria.map.get("maps/einstein.h5")
print(input_map)
input_map.plot(slices={"stokes": [["I", "Q"],
["U", "V"]]})
2026-12-01 05:54:20.620 INFO: Fetching https://github.com/thomaswmorris/maria-data/raw/master/maps/einstein.h5
Downloading: 100%|██████████| 932k/932k [00:00<00:00, 29.4MB/s]
ProjectionMap:
data(4, 1, 685, 685):
min: -1.000e-02
max: 2.540e-01
units: K_RJ
quantity: rayleigh_jeans_temperature
stokes(4):
components: ['I' 'Q' 'U' 'V']
nu(1):
values: [90.] GHz
eta(685):
height: 60’
res: -5.263”
xi(685):
width: 60’
res: 5.263”
frame: ra/dec
center:
ra: 00ʰ00ᵐ0.00ˢ
dec: -23°00’0.00”
beam(maj, min, psi): (0 rad, 0 rad, 0 rad)
memory: 7.508 MB
[4]:
from maria import Planner
planner = Planner(target=input_map, site="mauna_kea", constraints={"el": (45, 90)})
plans = planner.generate_plans(
total_duration=1800,
max_chunk_duration=1800,
sample_rate=25,
scan_type="raster",
scan_parameters={
"n": [(15, 1), (1, 16)],
"radius": 0.5 * input_map.width.deg,
"speed": 0.5,
})
plans[0].plot()
print(plans)
PlanList(1 plans, 1800 s):
start_time duration sample_rate target(ra,dec) center(az,el)
chunk
0 2026-12-01 05:54:22.986 +00:00 1800 s 25 Hz (360°, -23°) (189°, 46.82°)
[5]:
sim = maria.Simulation(
instrument,
plans=plans,
site="mauna_kea",
atmosphere="2d",
map=input_map,
)
print(sim)
2026-12-01 05:54:27.270 INFO: Initializing observation 1/1
2026-12-01 05:54:27.999 INFO: Fetching https://github.com/thomaswmorris/maria-data/raw/master/atmosphere/weather/era5/v2/mauna_kea.h5
Downloading: 100%|██████████| 15.6M/15.6M [00:00<00:00, 282MB/s]
2026-12-01 05:54:28.603 INFO: Fetching https://github.com/thomaswmorris/maria-data/raw/master/atmosphere/spectra/am/v4/mauna_kea.h5
Downloading: 100%|██████████| 62.0M/62.0M [00:00<00:00, 350MB/s]
Constructing atmosphere: 100%|██████████| 8/8 [00:43<00:00, 5.42s/it]
2026-12-01 05:55:13.601 INFO: Initialized observation 1/1 in 46.32 s
Simulation
├ Instrument(1 array)
│ ├ arrays:
│ │ n field_of_view max_baseline bands polarized primary_size
│ │ array1 88 11.98’ 0 m [f150] True 10 m
│ │
│ └ bands:
│ name center width η NEP NET_RJ NET_CMB FWHM
│ 0 f150 150 GHz 30 GHz 0.5 13.22 aW√s 60 uK_RJ√s 104 uK_CMB√s 52.49”
├ Site:
│ region: mauna_kea
│ timezone: Pacific/Honolulu
│ location:
│ longitude: 155°28’37.20” W
│ latitude: 19°49’22.08” N
│ altitude: 4.092 km
│ seasonal: True
│ diurnal: True
├ PlanList(1 plans, 1800 s):
│ start_time duration sample_rate target(ra,dec) center(az,el)
│ chunk
│ 0 2026-12-01 05:54:22.986 +00:00 1800 s 25 Hz (360°, -23°) (189°, 46.82°)
├ Atmosphere(8 processes with 8 layers):
│ ├ spectrum:
│ │ region: mauna_kea
│ └ weather:
│ region: mauna_kea
│ altitude: 4092 m
│ time: Nov 30 20:09:22 -10:00
│ pwv[mean, rms]: (2.02 mm, 60.59 um)
[6]:
tods = sim.run()
print(tods)
tods[0].plot()
2026-12-01 05:55:13.856 INFO: Simulating observation 1 of 1
Generating turbulence: 100%|██████████| 8/8 [00:01<00:00, 4.11it/s]
Sampling turbulence: 100%|██████████| 8/8 [00:03<00:00, 2.36it/s]
Computing atmospheric emission: 100%|██████████| 1/1 [00:00<00:00, 4.10it/s, band=f150]
Sampling source 'map': 100%|██████████| 1/1 [00:03<00:00, 3.71s/it, band=f150, message=Sampling channel (105 GHz, 195 GHz)]
Generating noise: 100%|██████████| 1/1 [00:00<00:00, 1.15it/s, band=f150]
2026-12-01 05:55:25.548 INFO: Simulated observation 1 of 1 in 11.69 s
[TOD(shape=(88, 45000), fields=['atmosphere', 'map', 'noise'], units='uK_RJ', start=2026-12-01 06:24:22.944 +00:00, duration=1800.0s, sample_rate=25.0Hz, metadata={'atmosphere': True, 'sim_time': <Arrow [2026-12-01T05:55:24.199165+00:00]>, 'altitude': 4092.0, 'region': 'mauna_kea', 'pwv': 2.02, 'effective_temperature': 238.755})]
[7]:
from maria.mapping import MaximumLikelihoodMapper
mapper = MaximumLikelihoodMapper(
frame="ra/dec",
resolution=2 * input_map.resolution.deg,
tod_preprocessing={
"remove_spline": {"knot_spacing": 300, "remove_el_gradient_order": 1},
},
tods=tods,
bilinear=False,
)
mapper.map.plot(slices="all")
2026-12-01 05:55:28.279 INFO: Inferring center {'ra': '23ʰ59ᵐ59.49ˢ', 'dec': '-22°59’56.59”'} for mapper
2026-12-01 05:55:28.285 INFO: Inferring mapper width 1.205° for mapper from observation patch
2026-12-01 05:55:28.285 INFO: Inferring mapper height 1.205° to match supplied width
2026-12-01 05:55:30.390 INFO: Inferring stokes parameters 'IQU' for mapper from detector sensitivities
Preprocessing TODs: 100%|██████████| 1/1 [00:02<00:00, 2.14s/it]
Computing pointing matrices: 100%|██████████| 1/1 [00:01<00:00, 1.51s/it]
[8]:
mapper.fit(epochs=2,
steps_per_epoch=25,
plot=True,
plot_kwargs={
"slices": "all",
"center_zero": True,
"contrast": 1e-3})
Updating noise model: 100%|██████████| 1/1 [00:01<00:00, 1.97s/it, tod=1/1]
Fitting map (epoch 1/2): 32%|███▏ | 161/500 [02:15<05:15, 1.07it/s, alpha=0.0394]2026-12-01 05:57:56.921 INFO: Reached stopping condition for conjugate gradient descent, terminating
Fitting map (epoch 1/2): 32%|███▏ | 161/500 [02:16<04:47, 1.18it/s, alpha=0.0394]
Updating noise model: 100%|██████████| 1/1 [00:01<00:00, 1.95s/it, tod=1/1]
Fitting map (epoch 2/2): 38%|███▊ | 190/500 [02:26<04:48, 1.07it/s, alpha=0.00155]2026-12-01 06:00:27.304 INFO: Reached stopping condition for conjugate gradient descent, terminating
Fitting map (epoch 2/2): 38%|███▊ | 190/500 [02:27<04:00, 1.29it/s, alpha=0.00155]
Note that we can’t see any of the circular polarization, since our instrument isn’t sensitive to it.