{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Getting Started" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this tutorial, you'll learn the basics of using the `py21cmsense` library. See the [README](https://github.com/steven-murray/21cmSense) or the [CLI-tutorial](https://21cmsense.readthedocs.io/en/latest/tutorials/cli_tutorial.html) for information on the CLI interface." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2019-11-26T00:04:00.481824Z", "start_time": "2019-11-26T00:03:59.808909Z" } }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "from astropy import units as un\n", "\n", "%matplotlib inline\n", "\n", "from py21cmsense import GaussianBeam, Observation, Observatory, PowerSpectrum, hera" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## A Really Quick Demo" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's first just show how to go from nothing to a power spectrum sensitivity in a few lines. You'll need the four main components of the sensitivity -- a `PrimaryBeam` (in this case, the default `GaussianBeam`), an `Observatory`, an `Observation` and a `Sensitivity` (in this case, a `PowerSpectrum` one).\n", "\n", "We can literally construct the whole thing at once:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2019-11-26T00:04:00.491258Z", "start_time": "2019-11-26T00:04:00.484169Z" } }, "outputs": [], "source": [ "sensitivity = PowerSpectrum(\n", " observation=Observation(\n", " observatory=Observatory(\n", " antpos=hera(hex_num=7, separation=14 * un.m),\n", " beam=GaussianBeam(frequency=135.0 * un.MHz, dish_size=14 * un.m),\n", " latitude=38 * un.deg,\n", " )\n", " )\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "