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

f090 = Band(
    center=90e9,  # in Hz
    width=20e9,  # in Hz
    NET_RJ=40e-6,  # in K sqrt(s)
    knee=1e0,    # in Hz
    gain_error=5e-2)

f150 = Band(
    center=150e9,
    width=30e9,
    NET_RJ=60e-6,
    knee=1e0,
    gain_error=5e-2)

array = {"field_of_view": 0.5,
         "shape": "circle",
         "beam_spacing": 1.5,
         "primary_size": 10,
         "polarized": True,
         "bands": [f090, f150][:1]}

instrument = maria.get_instrument(array=array)

print(instrument.arrays)
          n     FOV baseline   bands polarized
array1  326  28.68’      0 m  [f090]      True

We can see the resulting polarization footprint in the instrument plot:

[2]:
print(instrument)
instrument.plot()
Instrument(1 array)
├ arrays:
│            n     FOV baseline   bands polarized
│  array1  326  28.68’      0 m  [f090]      True
│
└ bands:
      name  center   width    η         NEP      NET_RJ         NET_CMB    FWHM
   0  f090  90 GHz  20 GHz  0.5  5.445 aW√s  40 uK_RJ√s  49.13 uK_CMB√s  1.458’
../_images/tutorials_polarized-observations_4_1.png

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(stokes=[["I", "Q"],
                       ["U", "V"]])
2026-04-26 20:18:56.979 INFO: Fetching https://github.com/thomaswmorris/maria-data/raw/master/maps/einstein.h5
Downloading: 100%|██████████| 931k/931k [00:00<00:00, 47.0MB/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: IQUV
  nu(1):
    values: [90.] GHz
  y(685):
    height: 1°
    res: 5.255”
  x(685):
    width: 1°
    res: 5.255”
  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: 15.02 MB
../_images/tutorials_polarized-observations_6_2.png
[4]:
from maria import Planner

planner = Planner(target=input_map, site="llano_de_chajnantor", constraints={"el": (60, 90)})
plans = planner.generate_plans(total_duration=600,  # in seconds
                               sample_rate=50)  # in Hz

plans[0].plot()
print(plans)
PlanList(1 plans, 600 s):
                           start_time duration   target(ra,dec)    center(az,el)
chunk
0      2026-04-27 12:00:16.152 +00:00    600 s  (360°, -23.01°)  (95.9°, 61.25°)
../_images/tutorials_polarized-observations_7_1.png
[5]:
sim = maria.Simulation(
    instrument,
    plans=plans,
    site="llano_de_chajnantor",
    atmosphere="2d",
    atmosphere_kwargs={"weather": {"pwv": 0.5}},
    map=input_map,
    map_kwargs={"bilinear_sampling": True},
)

print(sim)
Simulation
├ Instrument(1 array)
│ ├ arrays:
│ │            n     FOV baseline   bands polarized
│ │  array1  326  28.68’      0 m  [f090]      True
│ │
│ └ bands:
│       name  center   width    η         NEP      NET_RJ         NET_CMB    FWHM
│    0  f090  90 GHz  20 GHz  0.5  5.445 aW√s  40 uK_RJ√s  49.13 uK_CMB√s  1.458’
├ Site:
│   region: chajnantor
│   timezone: America/Santiago
│   location:
│     longitude: 67°45’17.28” W
│     latitude:  23°01’45.84” S
│     altitude: 5.064 km
│   seasonal: True
│   diurnal: True
├ PlanList(1 plans, 600 s):
│                            start_time duration   target(ra,dec)    center(az,el)
│ chunk
│ 0      2026-04-27 12:00:16.152 +00:00    600 s  (360°, -23.01°)  (95.9°, 61.25°)
├ '2d'
└ ProjectionMap:
    data(4, 1, 1, 685, 685):
      min: -1.000e-02
      max: 2.540e-01
      units: K_RJ
      quantity: rayleigh_jeans_temperature
    stokes(4):
      components: IQUV
    nu(1):
      values: [90.] GHz
    t(1):
      values: [1.77723474e+09] s
    y(685):
      height: 1°
      res: 5.255”
    x(685):
      width: 1°
      res: 5.255”
    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: 15.02 MB
[6]:
tods = sim.run()

print(tods)
tods[0].plot()
2026-04-26 20:19:08.879 INFO: Simulating observation 1 of 1
Constructing atmosphere: 100%|██████████| 8/8 [00:10<00:00,  1.36s/it]
Generating turbulence: 100%|██████████| 8/8 [00:01<00:00,  5.02it/s]
Sampling turbulence: 100%|██████████| 8/8 [00:05<00:00,  1.46it/s]
Computing atmospheric emission: 100%|██████████| 1/1 [00:01<00:00,  1.14s/it, band=f090]
Sampling map: 100%|██████████| 1/1 [00:09<00:00,  9.55s/it, band=f090, channel=(0 Hz, inf Hz)]
Generating noise: 100%|██████████| 1/1 [00:00<00:00,  1.68it/s, band=f090]
2026-04-26 20:19:46.530 INFO: Simulated observation 1 of 1 in 37.63 s
[TOD(shape=(326, 30000), fields=['atmosphere', 'map', 'noise'], units='K_RJ', start=2026-04-27 12:10:16.131 +00:00, duration=600.0s, sample_rate=50.0Hz, metadata={'atmosphere': True, 'sim_time': <Arrow [2026-04-26T20:19:40.378471+00:00]>, 'altitude': 5064.0, 'region': 'chajnantor', 'pwv': 0.5, 'base_temperature': 274.556})]
../_images/tutorials_polarized-observations_9_2.png
[7]:
from maria.mappers import BinMapper

mapper = BinMapper(
    stokes="IQU",
    frame="ra/dec",
    width=input_map.width.deg,
    height=input_map.height.deg,
    resolution=2 * input_map.resolution.deg,
    tod_preprocessing={
        "remove_spline": {"knot_spacing": 60, "remove_el_gradient": True},
        "remove_modes": {"modes_to_remove": 1},
    },
    map_postprocessing={
        "gaussian_filter": {"sigma": 1},
    },
    units="mK_RJ",
    tods=tods,
)

output_map = mapper.run()

print(output_map)
2026-04-26 20:19:52.347 INFO: Inferring center {'ra': '23ʰ59ᵐ59.30ˢ', 'dec': '-23°00’22.76”'} for mapper.
Preprocessing TODs: 100%|██████████| 1/1 [00:01<00:00,  1.11s/it]
Mapping: 100%|██████████| 1/1 [00:03<00:00,  3.85s/it, tod=1/1]
ProjectionMap:
  data(3, 1, 1, 342, 342):
    min: -1.164e+02
    max: 1.350e+02
    units: mK_RJ
    quantity: rayleigh_jeans_temperature
  stokes(3):
    components: IQU
  nu(1):
    values: [90.] GHz
  t(1):
    values: [1.77729152e+09] s
  y(342):
    height: 59.91’
    res: 10.51”
  x(342):
    width: 59.91’
    res: 10.51”
  frame: ra/dec
  center:
    ra: 23ʰ59ᵐ59.30ˢ
    dec: -23°00’22.76”
  beam(maj, min, psi): (1.458’, 1.458’, 0 rad)
  memory: 2.807 MB

Note that we can’t see any of the circular polarization, since our instrument isn’t sensitive to it.

[8]:
output_map.plot(stokes=["I", "Q", "U"])
../_images/tutorials_polarized-observations_12_0.png