Hope How-Huan Chen added file figures/rho_Oph/rho_Oph.ipynb  over 5 years ago

Commit id: ae00a7d0a9a627d288ce588ba113c09e415a5b2f

deletions | additions      

         

{  "cells": [  {  "cell_type": "code",  "execution_count": 1,  "metadata": {},  "outputs": [],  "source": [  "%matplotlib inline\n",  "\n",  "import matplotlib.pyplot as plt\n",  "import numpy as np"  ]  },  {  "cell_type": "markdown",  "metadata": {},  "source": [  "## README\n",  "\n",  "This ipython notebook includes codes used to make the image shown in the Authorea article. It shows a nearby star forming region, Ophiuchus."  ]  },  {  "cell_type": "markdown",  "metadata": {},  "source": [  "### Load the data\n",  "\n",  "The data include a (column) density map of Ophiuchus. The map is derived from near-infrared extinction observations."  ]  },  {  "cell_type": "code",  "execution_count": null,  "metadata": {},  "outputs": [],  "source": [  "data = np.loadtxt('rho_Oph.txt')"  ]  },  {  "cell_type": "code",  "execution_count": null,  "metadata": {},  "outputs": [],  "source": [  "fig = plt.figure(figsize = (12., 10.))\n",  "ax = fig.gca()\n",  "\n",  "# show the figure in the arcsinh stretch\n",  "ax.imshow(np.arcsinh(data),\n",  " origin = 'bottom',\n",  " cmap = 'gist_heat')\n",  "\n",  "# name of the region\n",  "ax.text(1000., 100., 'The Ophiuchus Cloud',\n",  " fontsize = 24.,\n",  " color = 'w',\n",  " horizontalalignment = 'right')\n",  "\n",  "# remove the ticks\n",  "ax.set_xticks([])\n",  "ax.set_yticks([])\n",  "\n",  "# save the figure\n",  "#plt.savefig('rho_Oph.png')"  ]  }  ],  "metadata": {  "kernelspec": {  "display_name": "Python [conda env:py3]",  "language": "python",  "name": "conda-env-py3-py"  },  "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.7.0"  }  },  "nbformat": 4,  "nbformat_minor": 2  }