{ "cells": [ { "cell_type": "markdown", "id": "restricted-uncle", "metadata": {}, "source": [ "# Science target templates\n", "\n", "The companion python package [ScopeSim-Templates](https://scopesim-templates.readthedocs.io/en/latest/) contains a library of helper functions for generating ScopeSim-friendly `Source` objects for various common astronomical sources.\n", "\n", "For more information, please see the [ScopeSim-Templates documentation](https://scopesim-templates.readthedocs.io/en/latest/)" ] }, { "cell_type": "code", "execution_count": null, "id": "refined-radius", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from matplotlib.colors import LogNorm\n", "\n", "import scopesim_templates as sim_tp" ] }, { "cell_type": "markdown", "id": "comparable-tuition", "metadata": {}, "source": [ "## A basic star cluster" ] }, { "cell_type": "code", "execution_count": null, "id": "ancient-blanket", "metadata": {}, "outputs": [], "source": [ "my_cluster = sim_tp.stellar.clusters.cluster(mass=1000.0, # [Msun]\n", " distance=8000, # [pc]\n", " core_radius=1) # [pc]\n", "my_cluster.plot()" ] }, { "cell_type": "markdown", "id": "applied-swiss", "metadata": {}, "source": [ "## A basic elliptical galaxy" ] }, { "cell_type": "code", "execution_count": null, "id": "numerous-shower", "metadata": {}, "outputs": [], "source": [ "# See the docstring of `elliptical` for more keywords\n", "my_elliptical = sim_tp.extragalactic.galaxies.elliptical(half_light_radius=30, # [arcsec]\n", " pixel_scale=0.1, # [arcsec]\n", " filter_name=\"Ks\",\n", " amplitude=10,\n", " normalization=\"total\", # [Ks=10 for integrated flux]\n", " n=4, # Sersic index \n", " ellipticity=0.5,\n", " angle=30)\n", "\n", "plt.figure(figsize=(12, 5))\n", "plt.subplot(121)\n", "plt.imshow(my_elliptical.fields[0].data, norm=LogNorm(), extent=[-25.6, 25.6, -25.6, 25.6])\n", "plt.xlabel(\"[arcsec]\")\n", "plt.subplot(122)\n", "wave = np.arange(5000, 25000) # [angstrom]\n", "plt.plot(wave, my_elliptical.spectra[0](wave))\n", "plt.xlabel(\"Wavelength [Angstrom]\")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.9.16" } }, "nbformat": 4, "nbformat_minor": 5 }