{ "cells": [ { "cell_type": "markdown", "id": "88e808b0-5df1-4836-b02f-8d28585f4904", "metadata": {}, "source": [ "# SubBeamNod Data Reduction\n", "\n", "This notebook shows how to use dysh to calibrate an SubBeamNod observation via two different methods. It retrieves and calibrates SubBeamNod scans using `GBTFITSLoad.subbeamnod()` which returns a `ScanBlock` object. \n", "\n", "## Dysh commands\n", "\n", "The following dysh commands are introduced (leaving out all the function arguments):\n", "\n", " filename = dysh_data()\n", " sdf = GBTFITSLoad()\n", " sdf.select()\n", " sb = sdf.subbeamnod()\n", " ta = sb.timeaverage()\n", " ta.baseline()\n", " ta.average()\n", " ta.plot()\n", "\n", "## Loading Modules\n", "We start by loading the modules we will use for the data reduction. \n" ] }, { "cell_type": "code", "execution_count": 1, "id": "71a0f9ba-9f38-408d-ba57-2630c1525a64", "metadata": {}, "outputs": [], "source": [ "# These modules are required for working with the data.\n", "from dysh.log import init_logging\n", "from dysh.fits.gbtfitsload import GBTFITSLoad\n", "\n", "# These modules are used for file I/O\n", "from dysh.util.files import dysh_data\n", "from pathlib import Path" ] }, { "cell_type": "markdown", "id": "ae0b0478-ca2a-4de4-bebd-692dff0105d2", "metadata": {}, "source": [ "## Setup \n", "dysh uses a logger to communicate. If you are working in the command\n", "line, then the logging is setup for you. If you are working in a\n", "jupyter lab instance, then you need to set it up. You can do so using\n", "the init_logging function imported above. As an argument, init_logging\n", "takes a number, the verbosity level. level 0 is for error messages\n", "only, 1 for warning, 2 for info and 3 for debug. Here we set it to\n", "level 2.\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "70cec341-9e79-48d9-afba-a0f84bd52e00", "metadata": {}, "outputs": [], "source": [ "init_logging(2)\n", "\n", "# also create a local \"output\" directory where temporary notebook files can be stored.\n", "output_dir = Path.cwd() / \"output\"\n", "output_dir.mkdir(exist_ok=True)" ] }, { "cell_type": "markdown", "id": "efc7bb5b-7979-4863-a4a2-7270760c2ee9", "metadata": {}, "source": [ "## Data Retrieval\n", "\n", "Download the example SDFITS data, if necessary." ] }, { "cell_type": "code", "execution_count": 3, "id": "f07cfb32-6864-4ac4-94f8-4c2b66b981c4", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "20:09:18.591 I Resolving example=subbeamnod -> subbeamnod/data/AGBT13A_124_06/AGBT13A_124_06.raw.acs/AGBT13A_124_06.raw.acs.fits\n" ] } ], "source": [ "filename = dysh_data(example=\"subbeamnod\")" ] }, { "cell_type": "markdown", "id": "cf925ad1-e149-46dd-9728-53ea2142fbf8", "metadata": {}, "source": [ "## Data Loading\n", "\n", "Next, we use `GBTFITSLoad` to load the data, and then its `summary` method to inspect its contents." ] }, { "cell_type": "code", "execution_count": 4, "id": "1b12df99-20b2-4f8b-95c3-802be4ffaf3c", "metadata": {}, "outputs": [], "source": [ "sdfits = GBTFITSLoad(filename)" ] }, { "cell_type": "markdown", "id": "337f7f2e-038d-4479-ba29-a66f46440b30", "metadata": {}, "source": [ "The returned `sdfits` can be probed for information.\n", "You can also print a concise (or verbose if you choose verbose=True) summary of the data." ] }, { "cell_type": "code", "execution_count": 5, "id": "259fec35-f69a-4061-ad37-c2235102af4c", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| SCAN | \n", "OBJECT | \n", "VELOCITY | \n", "PROC | \n", "PROCSEQN | \n", "RESTFREQ | \n", "DOPFREQ | \n", "# IF | \n", "# POL | \n", "# INT | \n", "# FEED | \n", "AZIMUTH | \n", "ELEVATION | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 44 | \n", "vIIzw31 | \n", "16090.0 | \n", "SubBeamNod | \n", "1 | \n", "48.940955 | \n", "48.990955 | \n", "2 | \n", "2 | \n", "100 | \n", "2 | \n", "353.8967 | \n", "47.7582 | \n", "