{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Simulating observations with MUSTANG-2\n", "\n", "MUSTANG-2 is a bolometric array on the [Green Bank Telescope](https://en.wikipedia.org/wiki/Green_Bank_Telescope). In this notebook we simulate an observation of the Crab Nebula (M1)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import maria\n", "from maria.io import fetch\n", "\n", "input_map = maria.map.load(fetch(\"maps/crab_nebula.fits\"), nu=93e9)\n", "\n", "input_map.plot()\n", "print(input_map)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from maria import Planner\n", "\n", "planner = Planner(target=input_map, site=\"green_bank\", constraints={\"el\": (60, 90)})\n", "plans = planner.generate_plans(total_duration=900, sample_rate=100)\n", "\n", "plans[0].plot()\n", "print(plans)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "instrument = maria.get_instrument(\"MUSTANG-2\")\n", "\n", "print(instrument)\n", "instrument.plot()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sim = maria.Simulation(\n", " instrument,\n", " plans=plans,\n", " site=\"green_bank\",\n", " map=input_map,\n", " atmosphere=\"2d\",\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 import BinMapper\n", "\n", "mapper = BinMapper(\n", " tod_preprocessing={\n", " \"remove_modes\": {\"modes_to_remove\": 1},\n", " \"remove_spline\": {\"knot_spacing\": 60, \"remove_el_gradient\": True},\n", " },\n", " map_postprocessing={\n", " \"gaussian_filter\": {\"sigma\": 1},\n", " },\n", " units=\"uK_RJ\",\n", " tods=tods,\n", ")\n", "\n", "self = mapper\n", "\n", "output_map = mapper.run()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "output_map.plot()" ] } ], "metadata": { "kernelspec": { "display_name": "maria", "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.13.2" } }, "nbformat": 4, "nbformat_minor": 4 }