{ "cells": [ { "cell_type": "markdown", "id": "empty-contractor", "metadata": {}, "source": [ "# Downloading packages\n", "\n", "**Note: Instrument packages are kept in a separate repository: [the Instrument Reference Database (IRDB)](https://github.com/AstarVienna/irdb)**\n", "\n", "Before simulating anything we need to get the relevant instrument packages. Packages are split into the following categories\n", "\n", "- Locations (e.g. Armazones, LaPalma)\n", "- Telescopes (e.g. ELT, GTC)\n", "- Instruments (e.g. MICADO, METIS, MORFEO, OSIRIS, MAAT)\n", "\n", "We need to amke sure we have all the packages required to built the optical system. E.g. observing with MICADO is useless without including the ELT." ] }, { "cell_type": "code", "execution_count": null, "id": "collaborative-glass", "metadata": {}, "outputs": [], "source": [ "import scopesim as sim\n", "\n", "from tempfile import TemporaryDirectory\n", "tmpdir = TemporaryDirectory()\n", "sim.rc.__config__[\"!SIM.file.local_packages_path\"] = tmpdir.name" ] }, { "cell_type": "markdown", "id": "round-watts", "metadata": {}, "source": [ "## scopesim.download_packages()\n", "\n", "### Stable packages\n", "\n", "The simplest way is to simply get the latest stable versions of the packages by calling their names.\n", "\n", "Call `list_packages()` or see the [IRDB](https://github.com/AstarVienna/irdb) for names." ] }, { "cell_type": "code", "execution_count": null, "id": "blind-algorithm", "metadata": {}, "outputs": [], "source": [ "sim.list_packages()" ] }, { "cell_type": "code", "execution_count": null, "id": "happy-column", "metadata": {}, "outputs": [], "source": [ "sim.download_packages([\"Armazones\", \"ELT\", \"MICADO\"])" ] }, { "cell_type": "markdown", "id": "handled-fraud", "metadata": {}, "source": [ "### Development version\n", "\n", "Use the `release=\"latest\"` parameter to get the latest stable development verions of the packages" ] }, { "cell_type": "code", "execution_count": null, "id": "egyptian-absolute", "metadata": {}, "outputs": [], "source": [ "sim.download_packages(\"test_package\", release=\"latest\")" ] }, { "cell_type": "markdown", "id": "indie-house", "metadata": {}, "source": [ "### Bleeding-edge versions from GitHub\n", "\n", "We can also pull the latest verisons of a package from GitHub. This is useful if you are the one writing the package and want to test how it works on a different machine.\n", "\n", "The following strings will work:\n", "\n", "- Latest from a branch: `release=\"github:\"`\n", "- From a specific tag: `release=\"github:\"`\n", "- From a specific commit: `release=\"github:\"`" ] }, { "cell_type": "code", "execution_count": null, "id": "happy-thought", "metadata": {}, "outputs": [], "source": [ "sim.download_packages(\"test_package\", release=\"github:dev_master\")" ] }, { "cell_type": "code", "execution_count": null, "id": "neither-netscape", "metadata": {}, "outputs": [], "source": [ "sim.download_packages(\"LFOA\", release=\"github:3c136cd59ceeca551c01c6fa79f87377997f33f9\")" ] } ], "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 }