{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Custom ephemeris\n", "## Example of usage on ATREIDES sample:\n", "In this notebook we will show how to use custom ephemeris on ATREIDES targets.\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import PTO.database.catalog as cat" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Creating and Loading Custom Exoplanet Data\n", "In the next cell, we will create a custom CSV file for exoplanet data using the ATREIDES catalog.\n", "\n", "This csv file is a blank example on how to use add custom planets." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ " \u001b[32mINFO \u001b[0m | \u001b[32mFile custom.csv created successfully.\u001b[0m\n" ] } ], "source": [ "ATREIDES = cat.CatalogComposite()\n", "ATREIDES.create_exoplanet_csv('custom.csv')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Printing the table (assuming it is loaded with the `load_exoplanet_csv`) will grant only the header, as no lines are added. This is to be done by the user manually. Furthermore this allows simple interface with external codes.\n", "\n", "In principle one can add other columns to the csv file (csv delimiter = ';') and the table will be loaded correctly." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Load and print table\n", "ATREIDES.load_exoplanet_csv('custom.csv')\n", "ATREIDES.table" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Lets add the ephemeris inside the csv file. This step is left to the user according to the situation. Only the mandatory keys for calculation of the transit windows are given. In this notebook we use predefined csv file instead, for actual use just update the csv file just generated.\n", "\n", "Technically, magnitude is not relevant to the transit window, but contains useful information for given instrument, and as such is requested." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ATREIDES.load_exoplanet_csv('ATREIDES_custom.csv')\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "# To ensure full table is displayed\n", "pd.set_option(\"display.max_rows\", None)\n", "# Print table\n", "ATREIDES.table" ] }, { "cell_type": "markdown", "metadata": {}, "source": [] } ], "metadata": { "kernelspec": { "display_name": ".venv", "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.10.12" } }, "nbformat": 4, "nbformat_minor": 2 }