{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Terrestiral Planets: Adding a Surface\n", "\n", "Three major changes differences you need to make note of for terrestrial planets in both reflected, emission and transmission geometry: \n", "\n", "1. Adding a surface reflectivity \n", "2. Ensuring the code knows that your lower boundary condition is a hard surface \n", "3. Ensuring that the reference pressure is lower than the lower pressure of your surface. `PICASO` default is 1 bar, which is often times too high." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function(root) {\n", " function now() {\n", " return new Date();\n", " }\n", "\n", " const force = true;\n", "\n", " if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n", " root._bokeh_onload_callbacks = [];\n", " root._bokeh_is_loading = undefined;\n", " }\n", "\n", " const JS_MIME_TYPE = 'application/javascript';\n", " const HTML_MIME_TYPE = 'text/html';\n", " const EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n", " const CLASS_NAME = 'output_bokeh rendered_html';\n", "\n", " /**\n", " * Render data to the DOM node\n", " */\n", " function render(props, node) {\n", " const script = document.createElement(\"script\");\n", " node.appendChild(script);\n", " }\n", "\n", " /**\n", " * Handle when an output is cleared or removed\n", " */\n", " function handleClearOutput(event, handle) {\n", " const cell = handle.cell;\n", "\n", " const id = cell.output_area._bokeh_element_id;\n", " const server_id = cell.output_area._bokeh_server_id;\n", " // Clean up Bokeh references\n", " if (id != null && id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", "\n", " if (server_id !== undefined) {\n", " // Clean up Bokeh references\n", " const cmd_clean = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n", " cell.notebook.kernel.execute(cmd_clean, {\n", " iopub: {\n", " output: function(msg) {\n", " const id = msg.content.text.trim();\n", " if (id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", " }\n", " }\n", " });\n", " // Destroy server and session\n", " const cmd_destroy = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n", " cell.notebook.kernel.execute(cmd_destroy);\n", " }\n", " }\n", "\n", " /**\n", " * Handle when a new output is added\n", " */\n", " function handleAddOutput(event, handle) {\n", " const output_area = handle.output_area;\n", " const output = handle.output;\n", "\n", " // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n", " if ((output.output_type != \"display_data\") || (!Object.prototype.hasOwnProperty.call(output.data, EXEC_MIME_TYPE))) {\n", " return\n", " }\n", "\n", " const toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n", "\n", " if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n", " toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n", " // store reference to embed id on output_area\n", " output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n", " }\n", " if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n", " const bk_div = document.createElement(\"div\");\n", " bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n", " const script_attrs = bk_div.children[0].attributes;\n", " for (let i = 0; i < script_attrs.length; i++) {\n", " toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n", " toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n", " }\n", " // store reference to server id on output_area\n", " output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n", " }\n", " }\n", "\n", " function register_renderer(events, OutputArea) {\n", "\n", " function append_mime(data, metadata, element) {\n", " // create a DOM node to render to\n", " const toinsert = this.create_output_subarea(\n", " metadata,\n", " CLASS_NAME,\n", " EXEC_MIME_TYPE\n", " );\n", " this.keyboard_manager.register_events(toinsert);\n", " // Render to node\n", " const props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n", " render(props, toinsert[toinsert.length - 1]);\n", " element.append(toinsert);\n", " return toinsert\n", " }\n", "\n", " /* Handle when an output is cleared or removed */\n", " events.on('clear_output.CodeCell', handleClearOutput);\n", " events.on('delete.Cell', handleClearOutput);\n", "\n", " /* Handle when a new output is added */\n", " events.on('output_added.OutputArea', handleAddOutput);\n", "\n", " /**\n", " * Register the mime type and append_mime function with output_area\n", " */\n", " OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n", " /* Is output safe? */\n", " safe: true,\n", " /* Index of renderer in `output_area.display_order` */\n", " index: 0\n", " });\n", " }\n", "\n", " // register the mime type if in Jupyter Notebook environment and previously unregistered\n", " if (root.Jupyter !== undefined) {\n", " const events = require('base/js/events');\n", " const OutputArea = require('notebook/js/outputarea').OutputArea;\n", "\n", " if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n", " register_renderer(events, OutputArea);\n", " }\n", " }\n", "\n", " \n", " if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n", " root._bokeh_timeout = Date.now() + 5000;\n", " root._bokeh_failed_load = false;\n", " }\n", "\n", " const NB_LOAD_WARNING = {'data': {'text/html':\n", " \"
\\n\"+\n", " \"

\\n\"+\n", " \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n", " \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n", " \"

\\n\"+\n", " \"\\n\"+\n", " \"\\n\"+\n", " \"from bokeh.resources import INLINE\\n\"+\n", " \"output_notebook(resources=INLINE)\\n\"+\n", " \"\\n\"+\n", " \"
\"}};\n", "\n", " function display_loaded() {\n", " const el = document.getElementById(\"1002\");\n", " if (el != null) {\n", " el.textContent = \"BokehJS is loading...\";\n", " }\n", " if (root.Bokeh !== undefined) {\n", " if (el != null) {\n", " el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n", " }\n", " } else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(display_loaded, 100)\n", " }\n", " }\n", "\n", "\n", " function run_callbacks() {\n", " try {\n", " root._bokeh_onload_callbacks.forEach(function(callback) {\n", " if (callback != null)\n", " callback();\n", " });\n", " } finally {\n", " delete root._bokeh_onload_callbacks\n", " }\n", " console.debug(\"Bokeh: all callbacks have finished\");\n", " }\n", "\n", " function load_libs(css_urls, js_urls, callback) {\n", " if (css_urls == null) css_urls = [];\n", " if (js_urls == null) js_urls = [];\n", "\n", " root._bokeh_onload_callbacks.push(callback);\n", " if (root._bokeh_is_loading > 0) {\n", " console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n", " return null;\n", " }\n", " if (js_urls == null || js_urls.length === 0) {\n", " run_callbacks();\n", " return null;\n", " }\n", " console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n", " root._bokeh_is_loading = css_urls.length + js_urls.length;\n", "\n", " function on_load() {\n", " root._bokeh_is_loading--;\n", " if (root._bokeh_is_loading === 0) {\n", " console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n", " run_callbacks()\n", " }\n", " }\n", "\n", " function on_error(url) {\n", " console.error(\"failed to load \" + url);\n", " }\n", "\n", " for (let i = 0; i < css_urls.length; i++) {\n", " const url = css_urls[i];\n", " const element = document.createElement(\"link\");\n", " element.onload = on_load;\n", " element.onerror = on_error.bind(null, url);\n", " element.rel = \"stylesheet\";\n", " element.type = \"text/css\";\n", " element.href = url;\n", " console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n", " document.body.appendChild(element);\n", " }\n", "\n", " for (let i = 0; i < js_urls.length; i++) {\n", " const url = js_urls[i];\n", " const element = document.createElement('script');\n", " element.onload = on_load;\n", " element.onerror = on_error.bind(null, url);\n", " element.async = false;\n", " element.src = url;\n", " console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " document.head.appendChild(element);\n", " }\n", " };\n", "\n", " function inject_raw_css(css) {\n", " const element = document.createElement(\"style\");\n", " element.appendChild(document.createTextNode(css));\n", " document.body.appendChild(element);\n", " }\n", "\n", " \n", " const js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.4.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.4.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.4.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-2.4.2.min.js\"];\n", " const css_urls = [];\n", " \n", "\n", " const inline_js = [\n", " function(Bokeh) {\n", " Bokeh.set_log_level(\"info\");\n", " },\n", " function(Bokeh) {\n", " \n", " \n", " }\n", " ];\n", "\n", " function run_inline_js() {\n", " \n", " if (root.Bokeh !== undefined || force === true) {\n", " \n", " for (let i = 0; i < inline_js.length; i++) {\n", " inline_js[i].call(root, root.Bokeh);\n", " }\n", " if (force === true) {\n", " display_loaded();\n", " }} else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(run_inline_js, 100);\n", " } else if (!root._bokeh_failed_load) {\n", " console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n", " root._bokeh_failed_load = true;\n", " } else if (force !== true) {\n", " const cell = $(document.getElementById(\"1002\")).parents('.cell').data().cell;\n", " cell.output_area.append_execute_result(NB_LOAD_WARNING)\n", " }\n", "\n", " }\n", "\n", " if (root._bokeh_is_loading === 0) {\n", " console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n", " run_inline_js();\n", " } else {\n", " load_libs(css_urls, js_urls, function() {\n", " console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n", " run_inline_js();\n", " });\n", " }\n", "}(window));" ], "application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n const force = true;\n\n if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n \n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n const NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\n\"+\n \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n \"

\\n\"+\n \"\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n const el = document.getElementById(\"1002\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n }\n if (js_urls == null || js_urls.length === 0) {\n run_callbacks();\n return null;\n }\n console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error(url) {\n console.error(\"failed to load \" + url);\n }\n\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.async = false;\n element.src = url;\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n \n const js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.4.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.4.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.4.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-2.4.2.min.js\"];\n const css_urls = [];\n \n\n const inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n function(Bokeh) {\n \n \n }\n ];\n\n function run_inline_js() {\n \n if (root.Bokeh !== undefined || force === true) {\n \n for (let i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\n if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n const cell = $(document.getElementById(\"1002\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));" }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import pandas as pd\n", "import numpy as np\n", "#picaso\n", "from picaso import justdoit as jdi \n", "from picaso import justplotit as jpi\n", "#plotting\n", "jpi.output_notebook()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Connect to Opacity Database" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "opacity = jdi.opannection(wave_range=[0.3,1])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Load blank slate" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "sum_planet = jdi.inputs()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Set Planet & Star Properties " ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "#phase angle \n", "sum_planet.phase_angle(0) #radians\n", "\n", "#define gravity\n", "sum_planet.gravity(gravity=9.8, gravity_unit=jdi.u.Unit('m/(s**2)')) #any astropy units available\n", "\n", "#define star \n", "sum_planet.star(opacity,5000,0,4.0) #pysynphot database, temp, metallicity, logg " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Add Surface Reflectivity\n", "\n", "For reflected light it is important to specify the surface albedo in case there are wavelength bands that are optically thin from molecular absorption. In those cases you will see the surface reflection in your spectra. \n", "\n", "For emission, it is important the surface reflectivity routine also tells the code that you have a \"hard surface\" boundary condition (opposed to a high pressure surface). Therefore if you are running reflected light, or thermal emission you will have to run the `surface_reflect` routine. \n", "\n", "**Therefore, it is critical that you run this routine for all terrestrial cases (reflected light and thermal emission**" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Turning off Raman for Non-H2 atmosphere\n" ] } ], "source": [ "sum_planet.atmosphere(df=pd.DataFrame({'pressure':np.logspace(-6,0,40),\n", " 'temperature':np.linspace(100,270,40), #very fake temperature profile with a 270 K suface\n", " 'H2O':np.zeros(40)+0.01,\n", " 'CO2':np.zeros(40)+1-0.01}))\n", "\n", "sum_planet.surface_reflect(0.3,opacity.wno) #this inputs the surface reflectivity and tells the code \n", " #there is a hard surface\n", "\n", " \n", "#can also input a wavelength dependent quantity here\n", "#fake_surface= np.linspace(0.01,0.9, opacity.nwno)\n", "#sum_planet.surface_reflect(fake_surface,opacity.wno)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note you can turn off these printout messages with `verbose=False` in the `atmosphere` function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Create 1D Albedo Spectrum" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "df = sum_planet.spectrum(opacity)" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "wno, alb, fpfs = df['wavenumber'],df['albedo'],df['fpfs_reflected']\n", "wno, alb = jpi.mean_regrid(wno, alb, R=150)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " const docs_json = {\"cc8b9bb4-494a-423f-9651-47b4acf88d06\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1231\"}],\"center\":[{\"id\":\"1234\"},{\"id\":\"1238\"}],\"height\":345,\"left\":[{\"id\":\"1235\"},{\"id\":\"1259\"}],\"renderers\":[{\"id\":\"1257\"}],\"title\":{\"id\":\"1282\"},\"toolbar\":{\"id\":\"1246\"},\"width\":500,\"x_range\":{\"id\":\"1223\"},\"x_scale\":{\"id\":\"1227\"},\"y_range\":{\"id\":\"1225\"},\"y_scale\":{\"id\":\"1229\"}},\"id\":\"1222\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"81tTwSf77z9wqmRuwc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vposcg/0j+Ug71Au2PSP/lwwTLnftI/XYgXaPGZ0j84zkwiDbXSP8HoNfs00tI/5VMYge/t0j88j85wNQDTP3Ghp+8VBdM/RLeXcsNF0z/81uXXh2bTP2+NlNuehdM/BiTlDMSk0z/4hrEHmsPTP8heLEIy49M//DhWIm0F1D8FpO4XESXUP+3DFkiKQNQ/P2sUae9n1D9QGnYt34zUP8LwuXx4sNQ/PgrKQwTU1D96zB4cjPfUP3ppVyQHGtU/aV64S5861T9dT4hnrGXVP7BszEDUjdU/YN2jXa6z1T8ZN7UWc93VP/w9mqquBdY/c9Yil4Mu1j8h/lcgnFfWPzO3mIqxf9Y/tcysdhus1j9Q9c1MR9fWPxvF/g2hBNc/qbg4MZEx1z/Chmp/kF7XP8tpmDESi9c/DuklM2q71z8xBObMS+vXP1/eDfhnGtg/TavPg6lM2D8mGFb0BH/YP/izf/99sdg/auv6llnk2D+j+MLKsxjZPzg7H8iFTdk/Kn7CIiiD2T9MBXrgf7nZP2xMgVLt8Nk/UBW+vdEo2j/GAUy5XGHaP+5/83Sjmto/rFwH8qPU2j+jYOvFWw/bPynIQhbISts/7Sx3leWG2z++Aqx/sMPbP4F8LZgkAdw/209pJz0/3D+NjH/59H3cP6XfeF1Gvdw/cbEuJSv93D8wXPClnD3dPyka77mTft0/Q0DyHFzA3T8=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[181]}},\"selected\":{\"id\":\"1291\"},\"selection_policy\":{\"id\":\"1290\"}},\"id\":\"1253\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1236\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis\":{\"id\":\"1235\"},\"coordinates\":null,\"dimension\":1,\"group\":null,\"ticker\":null},\"id\":\"1238\",\"type\":\"Grid\"},{\"attributes\":{\"axis_label\":\"Spectrum\",\"axis_label_text_font\":\"times\",\"axis_label_text_font_size\":\"14pt\",\"axis_label_text_font_style\":\"bold\",\"coordinates\":null,\"formatter\":{\"id\":\"1285\"},\"group\":null,\"major_label_policy\":{\"id\":\"1286\"},\"major_label_text_font\":\"times\",\"major_label_text_font_size\":\"14pt\",\"ticker\":{\"id\":\"1236\"}},\"id\":\"1235\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1225\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1244\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1240\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"source\":{\"id\":\"1253\"}},\"id\":\"1258\",\"type\":\"CDSView\"},{\"attributes\":{\"axis\":{\"id\":\"1231\"},\"coordinates\":null,\"group\":null,\"ticker\":null},\"id\":\"1234\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1290\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1232\",\"type\":\"BasicTicker\"},{\"attributes\":{\"coordinates\":null,\"group\":null},\"id\":\"1282\",\"type\":\"Title\"},{\"attributes\":{\"bottom_units\":\"screen\",\"coordinates\":null,\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"group\":null,\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"1245\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1288\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#0072B2\",\"line_width\":3,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1255\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1286\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"1229\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1223\",\"type\":\"DataRange1d\"},{\"attributes\":{\"overlay\":{\"id\":\"1245\"}},\"id\":\"1241\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1285\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1239\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1289\",\"type\":\"AllLabels\"},{\"attributes\":{\"coordinates\":null,\"data_source\":{\"id\":\"1253\"},\"glyph\":{\"id\":\"1254\"},\"group\":null,\"hover_glyph\":null,\"muted_glyph\":{\"id\":\"1256\"},\"nonselection_glyph\":{\"id\":\"1255\"},\"view\":{\"id\":\"1258\"}},\"id\":\"1257\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis_label\":\"Wavelength [\\u03bcm]\",\"axis_label_text_font\":\"times\",\"axis_label_text_font_size\":\"14pt\",\"axis_label_text_font_style\":\"bold\",\"coordinates\":null,\"formatter\":{\"id\":\"1288\"},\"group\":null,\"major_label_policy\":{\"id\":\"1289\"},\"major_label_text_font\":\"times\",\"major_label_text_font_size\":\"14pt\",\"ticker\":{\"id\":\"1232\"}},\"id\":\"1231\",\"type\":\"LinearAxis\"},{\"attributes\":{\"line_color\":\"#0072B2\",\"line_width\":3,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1254\",\"type\":\"Line\"},{\"attributes\":{\"tools\":[{\"id\":\"1239\"},{\"id\":\"1240\"},{\"id\":\"1241\"},{\"id\":\"1242\"},{\"id\":\"1243\"},{\"id\":\"1244\"}]},\"id\":\"1246\",\"type\":\"Toolbar\"},{\"attributes\":{\"click_policy\":\"mute\",\"coordinates\":null,\"group\":null,\"location\":[0,0]},\"id\":\"1259\",\"type\":\"Legend\"},{\"attributes\":{\"line_alpha\":0.2,\"line_color\":\"#0072B2\",\"line_width\":3,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1256\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1243\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"1227\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1242\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1291\",\"type\":\"Selection\"}],\"root_ids\":[\"1222\"]},\"title\":\"Bokeh Application\",\"version\":\"2.4.2\"}};\n", " const render_items = [{\"docid\":\"cc8b9bb4-494a-423f-9651-47b4acf88d06\",\"root_ids\":[\"1222\"],\"roots\":{\"1222\":\"3a6bbd1d-fe2e-4d20-a46e-b9777a4c350d\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " let attempts = 0;\n", " const timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1222" } }, "output_type": "display_data" } ], "source": [ "jpi.show(jpi.spectrum([wno], [alb], plot_width=500))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "What about contrast units? " ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['Semi-major axis not supplied. If you want fpfs, add it to `star` function. ',\n", " 'Planet Radius not supplied. If you want fpfs, add it to `gravity` function with a mass.']" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fpfs" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Get Contrast Units \n", "\n", "In order to get contrast units we have to make sure to give the `gravity` and `star` functions semi major axis, mass and radius." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "sum_planet.star(opacity,5000,0,4.0,semi_major=1, semi_major_unit=jdi.u.Unit('au')) \n", "sum_planet.gravity(radius=1.,radius_unit=jdi.u.Unit('R_earth'), \n", " mass=1,mass_unit=jdi.u.Unit('M_earth')) \n", "df = sum_planet.spectrum(opacity)\n", "wno, alb, fpfs = df['wavenumber'],df['albedo'],df['fpfs_reflected']\n", "wno, fpfs = jdi.mean_regrid(wno, fpfs , R=150)\n" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " const docs_json = {\"4ab822e0-323a-43f6-9ced-efa310ebbb9d\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1116\"}],\"center\":[{\"id\":\"1119\"},{\"id\":\"1123\"}],\"height\":345,\"left\":[{\"id\":\"1120\"},{\"id\":\"1144\"}],\"renderers\":[{\"id\":\"1142\"}],\"title\":{\"id\":\"1156\"},\"toolbar\":{\"id\":\"1131\"},\"width\":500,\"x_range\":{\"id\":\"1108\"},\"x_scale\":{\"id\":\"1112\"},\"y_range\":{\"id\":\"1110\"},\"y_scale\":{\"id\":\"1114\"}},\"id\":\"1107\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1159\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"81tTwSf77z9wqmRuwcTvP7pzF6S3ju8/jW8FxQlZ7z8cEtQ0tyPvP5jEMli/7u4/2CDZlCG67j/uL4VR3YXuP8ir+fXxUe4/ukP86l4e7j8H5FOaI+vtP0gAx24/uO0/z+AZ1LGF7T/h8gw3elPtP8kbWwWYIe0/2Q64rQrw7D8kps6f0b7sPyA+P0zsjew/CBSeJFpd7D8Jp3GbGi3sPyQcMSQt/es/5KRCM5HN6z+v6Pk9Rp7rP+xwlrpLb+s/uBdCIKFA6z9deQ/nRRLrP2Zo+Ic55Oo/TWTcfHu26j/XEn9AC4nqP/e7hk7oW+o/U8h6IxIv6j9RQsI8iALqP7FZohhK1uk/ru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mHcey3UQ/pJ7ik7wGRT/4OwB/oy5FP/VtHMqLWEU/pwJzbxSCRT/T9ANqrKtFP3y/xp3S1EU/q1xIBoABRj/uxNdtwi1GP2BPYXpRWUY/nnwjh8WHRj8DEFxkU7ZGPzDAtZn+5EY/WfsrkAYURz/1YxgFcERHP4cjJPlJdUc/A/e30+WmRz/8eqf6KtlHP5DiLuhxDEg/oNW+LSlASD9uTfeYfHRIP3nQc79/qUg/q4pO9DDfSD8LW8UnjhVJP46hg+OUTEk/jDE4R0KEST+yDooFk7xJP63LeWGD9Uk/fS49LA8vSj/wnaLDMWlKP4kpCRHmo0o/R0L5iCbfSj/wPGkr7RpLPxZTt4QzV0s/it29DUCUSz8=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[181]}},\"selected\":{\"id\":\"1165\"},\"selection_policy\":{\"id\":\"1164\"}},\"id\":\"1138\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"overlay\":{\"id\":\"1130\"}},\"id\":\"1126\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1163\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"1127\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1162\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"bottom_units\":\"screen\",\"coordinates\":null,\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"group\":null,\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"1130\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"axis\":{\"id\":\"1116\"},\"coordinates\":null,\"group\":null,\"ticker\":null},\"id\":\"1119\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1121\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1110\",\"type\":\"DataRange1d\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#0072B2\",\"line_width\":3,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1140\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1124\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1164\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis_label\":\"Wavelength [\\u03bcm]\",\"axis_label_text_font\":\"times\",\"axis_label_text_font_size\":\"14pt\",\"axis_label_text_font_style\":\"bold\",\"coordinates\":null,\"formatter\":{\"id\":\"1162\"},\"group\":null,\"major_label_policy\":{\"id\":\"1163\"},\"major_label_text_font\":\"times\",\"major_label_text_font_size\":\"14pt\",\"ticker\":{\"id\":\"1117\"}},\"id\":\"1116\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1125\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1160\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"1108\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1165\",\"type\":\"Selection\"},{\"attributes\":{\"line_alpha\":0.2,\"line_color\":\"#0072B2\",\"line_width\":3,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1141\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1112\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1129\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1128\",\"type\":\"ResetTool\"},{\"attributes\":{\"axis\":{\"id\":\"1120\"},\"coordinates\":null,\"dimension\":1,\"group\":null,\"ticker\":null},\"id\":\"1123\",\"type\":\"Grid\"},{\"attributes\":{\"coordinates\":null,\"data_source\":{\"id\":\"1138\"},\"glyph\":{\"id\":\"1139\"},\"group\":null,\"hover_glyph\":null,\"muted_glyph\":{\"id\":\"1141\"},\"nonselection_glyph\":{\"id\":\"1140\"},\"view\":{\"id\":\"1143\"}},\"id\":\"1142\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1117\",\"type\":\"BasicTicker\"},{\"attributes\":{\"coordinates\":null,\"group\":null},\"id\":\"1156\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1114\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis_label\":\"Spectrum\",\"axis_label_text_font\":\"times\",\"axis_label_text_font_size\":\"14pt\",\"axis_label_text_font_style\":\"bold\",\"coordinates\":null,\"formatter\":{\"id\":\"1159\"},\"group\":null,\"major_label_policy\":{\"id\":\"1160\"},\"major_label_text_font\":\"times\",\"major_label_text_font_size\":\"14pt\",\"ticker\":{\"id\":\"1121\"}},\"id\":\"1120\",\"type\":\"LinearAxis\"},{\"attributes\":{\"source\":{\"id\":\"1138\"}},\"id\":\"1143\",\"type\":\"CDSView\"},{\"attributes\":{\"tools\":[{\"id\":\"1124\"},{\"id\":\"1125\"},{\"id\":\"1126\"},{\"id\":\"1127\"},{\"id\":\"1128\"},{\"id\":\"1129\"}]},\"id\":\"1131\",\"type\":\"Toolbar\"},{\"attributes\":{\"click_policy\":\"mute\",\"coordinates\":null,\"group\":null,\"location\":[0,0]},\"id\":\"1144\",\"type\":\"Legend\"},{\"attributes\":{\"line_color\":\"#0072B2\",\"line_width\":3,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1139\",\"type\":\"Line\"}],\"root_ids\":[\"1107\"]},\"title\":\"Bokeh Application\",\"version\":\"2.4.2\"}};\n", " const render_items = [{\"docid\":\"4ab822e0-323a-43f6-9ced-efa310ebbb9d\",\"root_ids\":[\"1107\"],\"roots\":{\"1107\":\"14bfa61b-7b64-4e46-a650-2b3c817d91e5\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " let attempts = 0;\n", " const timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " clearInterval(timer);\n", " embed_document(root);\n", " } else {\n", " attempts++;\n", " if (attempts > 100) {\n", " clearInterval(timer);\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " }\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1107" } }, "output_type": "display_data" } ], "source": [ "jpi.show(jpi.spectrum([wno], [fpfs*1e6], plot_width=500))" ] } ], "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.8.12" }, "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 } }, "nbformat": 4, "nbformat_minor": 2 }