{ "cells": [ { "cell_type": "markdown", "id": "b8db18fd", "metadata": {}, "source": [ "# What do I reference? \n", "\n", "This notebook shows you how to get the references you need based on:\n", "- your `full_output` data bundle\n", "- specified molecules\n", "- specified methods (e.g. 1d spectra vs climate) " ] }, { "cell_type": "code", "execution_count": null, "id": "b13c9271", "metadata": {}, "outputs": [], "source": [ "import picaso.justdoit as jdi\n", "import picaso.references as pref" ] }, { "cell_type": "markdown", "id": "4a7c4a03", "metadata": {}, "source": [ "Let's set up a quick little model run so that we can see how the reference function works" ] }, { "cell_type": "code", "execution_count": null, "id": "000e4824", "metadata": {}, "outputs": [], "source": [ "opa = jdi.opannection(wave_range=[0.3,1]) #lets just use all defaults\n", "planet=jdi.inputs()\n", "planet.phase_angle(0) #radians\n", "planet.gravity(gravity=25, gravity_unit=jdi.u.Unit('m/(s**2)')) #any astropy units available\n", "planet.star(opa, 5000,0,4.0) #opacity db, pysynphot database, temp, metallicity, logg\n", "planet.atmosphere(filename=jdi.jupiter_pt(), sep='\\s+')\n", "full_output=planet.spectrum(opa, full_output=True)" ] }, { "cell_type": "markdown", "id": "978a1928", "metadata": {}, "source": [ "## Get opacity data references based on model output" ] }, { "cell_type": "code", "execution_count": null, "id": "7b54700d", "metadata": {}, "outputs": [], "source": [ "refs = pref.References() \n", "opa_latex, bibdb = refs.get_opa(full_output=full_output['full_output'])" ] }, { "cell_type": "code", "execution_count": null, "id": "c88e3e0f", "metadata": {}, "outputs": [], "source": [ "print(opa_latex)" ] }, { "cell_type": "code", "execution_count": null, "id": "f7a50176", "metadata": {}, "outputs": [], "source": [ "bibdb.entries[0:2]" ] }, { "cell_type": "markdown", "id": "dc01bb22", "metadata": {}, "source": [ "### Write to bibtex file" ] }, { "cell_type": "code", "execution_count": null, "id": "5c5e75f0", "metadata": {}, "outputs": [], "source": [ "pref.create_bib(bibdb, 'molecule.bib')" ] }, { "cell_type": "markdown", "id": "ae01ca41", "metadata": {}, "source": [ "## Get opacity data references for certain molecules" ] }, { "cell_type": "code", "execution_count": null, "id": "d19ea5fd", "metadata": {}, "outputs": [], "source": [ "opa_latex, bibdb = refs.get_opa(molecules=['H2O','CO2'])" ] }, { "cell_type": "code", "execution_count": null, "id": "29078324", "metadata": {}, "outputs": [], "source": [ "print(opa_latex)" ] }, { "cell_type": "code", "execution_count": null, "id": "138fa680", "metadata": {}, "outputs": [], "source": [ "bibdb.entries" ] } ], "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.11.5" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": true, "toc_position": {}, "toc_section_display": true, "toc_window_display": false }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 5 }