{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Observing the CMB" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import maria\n", "from maria.band import get_band\n", "\n", "f090 = get_band(\"act/pa5/f090\")\n", "f150 = get_band(\"act/pa5/f150\")\n", "\n", "\n", "f090.NET_RJ = 10e-6\n", "f150.NET_RJ = 10e-6\n", "\n", "f090.knee = 1e1\n", "f150.knee = 1e1\n", "\n", "array = {\"field_of_view\": 0.7,\n", " \"beam_spacing\": 1.5,\n", " \"primary_size\": 10,\n", " \"packing\": \"sunflower\",\n", " \"shape\": \"circle\",\n", " \"polarized\": True,\n", " \"bands\": [f090, f150]}\n", "\n", "instrument = maria.get_instrument(array=array)\n", "\n", "print(instrument)\n", "instrument.plot()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "from maria import Plan\n", "from maria.plan import *\n", "\n", "plan = Plan.generate(duration=600, \n", " sample_rate=20, \n", " start_time=\"2026-03-05T12:00:00\",\n", " scan_center=(45, 45), \n", " scan_pattern=\"back-and-forth\",\n", " scan_options={\"x_throw\": 2, \"y_throw\": 0, \"speed\": 1e0},\n", " frame=\"az/el\", \n", " site=\"cerro_toco\")\n", "\n", "plan.plot(frames=[\"az/el\", \"ra/dec\", \"glon/glat\"])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sim = maria.Simulation(\n", " instrument=instrument,\n", " plans=[plan],\n", " site=\"cerro_toco\",\n", " cmb=\"generate\",\n", " cmb_kwargs={\"nside\": 1024},\n", ")\n", "\n", "print(sim)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "tods = sim.run()\n", "tods[0].plot()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from maria.mappers.ml_mapper import *\n", "\n", "ml_mapper = MaximumLikelihoodMapper(tods=tods,\n", " frame=\"ra/dec\",\n", " resolution=2 / 60, # degrees\n", " tod_preprocessing={\n", " \"remove_spline\": {\"knot_spacing\": 60, \"remove_el_gradient_order\": 3},\n", " },\n", " bilinear=False,\n", " k=0)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "print(ml_mapper.map)\n", "ml_mapper.map.plot(slices=dict(stokes=[\"I\", \"Q\", \"U\"], nu=[[0], [1]]), \n", " cmap=\"cmb\", contrast=1e-4)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.14.3" } }, "nbformat": 4, "nbformat_minor": 4 }