{ "cells": [ { "cell_type": "markdown", "id": "2d922667-7bf9-49d2-88b9-c49d1ca12a68", "metadata": {}, "source": [ "# Vane Calibration\n", "This notebook shows how to calibrate data that uses a vane (or a hot load) to determine the system temperature.\n", "In the case of the GBT this applies mainly to [Argus](https://gbtdocs.readthedocs.io/en/latest/references/receivers/argus.html), although the [Q-band receiver](https://gbtdocs.readthedocs.io/en/latest/references/receivers/q-band.html) also has a vane.\n", "For the background on the calibration please refer to [Frayer et al. 2019](https://ui.adsabs.harvard.edu/abs/2019nrao.reptE...1F/abstract).\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", " sb = sdf.getfs()\n", " v = sdf.getvane()\n", " ta = sb.timeaverage()\n", " ta.baseline()\n", " ta.average()\n", " ta.plot()\n", " ta1.oshow()\n", "\n", "\n", "## Loading Modules\n", "We start by loading the modules we will use for this example. \n" ] }, { "cell_type": "code", "execution_count": 1, "id": "34883649-57da-4253-b62d-fa2d0f78ba83", "metadata": {}, "outputs": [], "source": [ "# These modules are required for the data reduction.\n", "from dysh.fits import GBTFITSLoad\n", "from astropy import units as u\n", "from dysh.log import init_logging\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": "35caed50-0264-41a9-ba24-715f56207b5b", "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." ] }, { "cell_type": "code", "execution_count": 2, "id": "74d688a7-01ad-4660-930e-ce7d1abacd8a", "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": "b4daeab5-7ca1-4017-af89-d3ea1ad17ff3", "metadata": {}, "source": [ "## Data Retrieval\n", "\n", "Download the example SDFITS data, if necessary." ] }, { "cell_type": "code", "execution_count": 3, "id": "49f46581-d217-4560-a0ed-e6206c0761da", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "18:42:09.754 I Resolving example=vane -> fs-Argus/data/AGBT20B_295_02.raw.vegas/AGBT20B_295_02.raw.vegas.A.fits\n", "18:42:09.755 I url: http://www.gb.nrao.edu/dysh//example_data/fs-Argus/data/AGBT20B_295_02.raw.vegas/AGBT20B_295_02.raw.vegas.A.fits\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Odd-1, did not find /home/teuben/GBT/dysh_data/example_data/fs-Argus/data/AGBT20B_295_02.raw.vegas/AGBT20B_295_02.raw.vegas.A.fits\n", "AGBT20B_295_02.raw.vegas.A.fits already downloaded\n" ] } ], "source": [ "filename = dysh_data(example=\"vane\")" ] }, { "cell_type": "markdown", "id": "57d5074d-868d-499b-a71a-4bd0677678cc", "metadata": {}, "source": [ "## Data Loading\n", "\n", "Next, we use \n", "[GBTFITSLoad](https://dysh.readthedocs.io/en/latest/reference/modules/dysh.fits.html#dysh.fits.GBTFITSLoad)\n", "to load the data, and then its \n", "[summary](https://dysh.readthedocs.io/en/latest/reference/modules/dysh.fits.html#dysh.fits.GBTFITSLoad.summary)\n", "method to inspect its contents." ] }, { "cell_type": "code", "execution_count": 4, "id": "ee66b9b7-b900-4b7f-9c2e-40315f88154d", "metadata": {}, "outputs": [], "source": [ "sdfits = GBTFITSLoad(filename)" ] }, { "cell_type": "code", "execution_count": 5, "id": "92f55874-3482-47cc-8f07-fa4917fe819b", "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", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 10 | \n", "VANE | \n", "65.0 | \n", "Track | \n", "1 | \n", "93.173777 | \n", "93.173777 | \n", "1 | \n", "1 | \n", "25 | \n", "2 | \n", "166.9878 | \n", "43.5400 | \n", "
| 11 | \n", "SKY | \n", "65.0 | \n", "Track | \n", "1 | \n", "93.173777 | \n", "93.173777 | \n", "1 | \n", "1 | \n", "25 | \n", "2 | \n", "166.9875 | \n", "43.5399 | \n", "
| 12 | \n", "G24.789 | \n", "65.0 | \n", "Track | \n", "1 | \n", "93.173777 | \n", "93.173777 | \n", "1 | \n", "1 | \n", "151 | \n", "2 | \n", "167.4363 | \n", "43.6122 | \n", "