diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 06d185fd4c1..00000000000 --- a/Vagrantfile +++ /dev/null @@ -1,124 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! -VAGRANTFILE_API_VERSION = "2" - -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - # All Vagrant configuration is done here. The most common configuration - # options are documented and commented below. For a complete reference, - # please see the online documentation at vagrantup.com. - - # Every Vagrant virtual environment requires a box to build off of. - config.vm.box = "ubuntu/trusty64" - - config.vm.provision :shell, path: "bootstrap_trusty64.sh", privileged:false - - # Disable automatic box update checking. If you disable this, then - # boxes will only be checked for updates when the user runs - # `vagrant box outdated`. This is not recommended. - # config.vm.box_check_update = false - - # Create a forwarded port mapping which allows access to a specific port - # within the machine from a port on the host machine. In the example below, - # accessing "localhost:8080" will access port 80 on the guest machine. - # config.vm.network "forwarded_port", guest: 80, host: 8080 - - # Create a private network, which allows host-only access to the machine - # using a specific IP. - # config.vm.network "private_network", ip: "192.168.33.10" - - # Create a public network, which generally matched to bridged network. - # Bridged networks make the machine appear as another physical device on - # your network. - # config.vm.network "public_network" - - # If true, then any SSH connections made will enable agent forwarding. - # Default value: false - # config.ssh.forward_agent = true - - # Share an additional folder to the guest VM. The first argument is - # the path on the host to the actual folder. The second argument is - # the path on the guest to mount the folder. And the optional third - # argument is a set of non-required options. - # config.vm.synced_folder "../data", "/vagrant_data" - - # Provider-specific configuration so you can fine-tune various - # backing providers for Vagrant. These expose provider-specific options. - # Example for VirtualBox: - # - # config.vm.provider "virtualbox" do |vb| - # # Don't boot with headless mode - # vb.gui = true - # - # # Use VBoxManage to customize the VM. For example to change memory: - # vb.customize ["modifyvm", :id, "--memory", "1024"] - # end - # - # View the documentation for the provider you're using for more - # information on available options. - - # Enable provisioning with CFEngine. CFEngine Community packages are - # automatically installed. For example, configure the host as a - # policy server and optionally a policy file to run: - # - # config.vm.provision "cfengine" do |cf| - # cf.am_policy_hub = true - # # cf.run_file = "motd.cf" - # end - # - # You can also configure and bootstrap a client to an existing - # policy server: - # - # config.vm.provision "cfengine" do |cf| - # cf.policy_server_address = "10.0.2.15" - # end - - # Enable provisioning with Puppet stand alone. Puppet manifests - # are contained in a directory path relative to this Vagrantfile. - # You will need to create the manifests directory and a manifest in - # the file default.pp in the manifests_path directory. - # - # config.vm.provision "puppet" do |puppet| - # puppet.manifests_path = "manifests" - # puppet.manifest_file = "default.pp" - # end - - # Enable provisioning with chef solo, specifying a cookbooks path, roles - # path, and data_bags path (all relative to this Vagrantfile), and adding - # some recipes and/or roles. - # - # config.vm.provision "chef_solo" do |chef| - # chef.cookbooks_path = "../my-recipes/cookbooks" - # chef.roles_path = "../my-recipes/roles" - # chef.data_bags_path = "../my-recipes/data_bags" - # chef.add_recipe "mysql" - # chef.add_role "web" - # - # # You may also specify custom JSON attributes: - # chef.json = { mysql_password: "foo" } - # end - - # Enable provisioning with chef server, specifying the chef server URL, - # and the path to the validation key (relative to this Vagrantfile). - # - # The Opscode Platform uses HTTPS. Substitute your organization for - # ORGNAME in the URL and validation key. - # - # If you have your own Chef Server, use the appropriate URL, which may be - # HTTP instead of HTTPS depending on your configuration. Also change the - # validation key to validation.pem. - # - # config.vm.provision "chef_client" do |chef| - # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME" - # chef.validation_key_path = "ORGNAME-validator.pem" - # end - # - # If you're using the Opscode platform, your validator client is - # ORGNAME-validator, replacing ORGNAME with your organization name. - # - # If you have your own Chef Server, the default validation client name is - # chef-validator, unless you changed the configuration. - # - # chef.validation_client_name = "ORGNAME-validator" -end diff --git a/bootstrap_trusty64.sh b/bootstrap_trusty64.sh deleted file mode 100644 index b998a63517a..00000000000 --- a/bootstrap_trusty64.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -sudo apt-get install git --yes - -wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh -bash miniconda.sh -b - -export PATH=/home/vagrant/miniconda/bin:$PATH -conda update --yes conda - -conda create --yes -n tardis --file /vagrant/pip-requirements pip - -echo "export PATH=/home/vagrant/miniconda/bin:$PATH" >> .bashrc - -wget http://opensupernova.org/~ftsamis/tardis_example.tar.gz -tar zxvf tardis_example.tar.gz \ No newline at end of file diff --git a/docs/examples/run_simple_example.ipynb b/docs/examples/run_simple_example.ipynb new file mode 100644 index 00000000000..7cadb3d9a57 --- /dev/null +++ b/docs/examples/run_simple_example.ipynb @@ -0,0 +1,1222 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Simple Jupyter TARDIS Example ###" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/wkerzend/miniconda/envs/tardis3/lib/python3.6/site-packages/tqdm/autonotebook/__init__.py:14: TqdmExperimentalWarning: Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console)\n", + " \" (e.g. in jupyter console)\", TqdmExperimentalWarning)\n" + ] + } + ], + "source": [ + "from tardis import run_tardis\n", + "from tardis.io.atom_data.util import download_atom_data" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.io.atom_data.atom_web_download\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Downloading atomic data from https://media.githubusercontent.com/media/tardis-sn/tardis-refdata/master/atom_data/kurucz_cd23_chianti_H_He.h5 to /Users/wkerzend/projects/tardis/tardis-data/kurucz_cd23_chianti_H_He.h5 (\u001b[1matom_web_download.py\u001b[0m:37)\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "33dd6796be49474b81854df7f5cf0778", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HBox(children=(IntProgress(value=0, description='kurucz_cd23_chianti_H_He.h5', max=73704476, style=ProgressSty…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + } + ], + "source": [ + "# the data is automatically downloaded\n", + "download_atom_data('kurucz_cd23_chianti_H_He')" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.plasma.standard_plasmas\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Reading Atomic Data from kurucz_cd23_chianti_H_He.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:76)\n", + "[\u001b[1mtardis.io.atom_data.util\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Atom Data kurucz_cd23_chianti_H_He.h5 not found in local path. Exists in TARDIS Data repo /Users/wkerzend/projects/tardis/tardis-data/kurucz_cd23_chianti_H_He.h5 (\u001b[1mutil.py\u001b[0m:29)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /Users/wkerzend/miniconda/envs/tardis3/lib/python3.6/site-packages/IPython/core/interactiveshell.py:3267: PerformanceWarning: indexing past lexsort depth may impact performance.\n", + " exec(code_obj, self.user_global_ns, self.user_ns)\n", + " (\u001b[1mwarnings.py\u001b[0m:99)\n", + "[\u001b[1mtardis.io.atom_data.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Read Atom Data with UUID=6f7b09e887a311e7a06b246e96350010 and MD5=864f1753714343c41f99cb065710cace. (\u001b[1mbase.py\u001b[0m:175)\n", + "[\u001b[1mtardis.io.atom_data.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Non provided atomic data: synpp_refs, ion_cx_th_data, ion_cx_sp_data (\u001b[1mbase.py\u001b[0m:178)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /Users/wkerzend/miniconda/envs/tardis3/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", + " AstropyDeprecationWarning)\n", + " (\u001b[1mwarnings.py\u001b[0m:99)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /Users/wkerzend/python/tardis/tardis/plasma/properties/ion_population.py:59: FutureWarning: \n", + "Passing list-likes to .loc or [] with any missing label will raise\n", + "KeyError in the future, you can use .reindex() as an alternative.\n", + "\n", + "See the documentation here:\n", + "https://pandas.pydata.org/pandas-docs/stable/indexing.html#deprecate-loc-reindex-listlike\n", + " partition_function.index].dropna())\n", + " (\u001b[1mwarnings.py\u001b[0m:99)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /Users/wkerzend/miniconda/envs/tardis3/lib/python3.6/site-packages/astropy/units/equivalencies.py:90: RuntimeWarning: divide by zero encountered in double_scalars\n", + " (si.m, si.Hz, lambda x: _si.c.value / x),\n", + " (\u001b[1mwarnings.py\u001b[0m:99)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /Users/wkerzend/miniconda/envs/tardis3/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", + " AstropyDeprecationWarning)\n", + " (\u001b[1mwarnings.py\u001b[0m:99)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 1/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 7.96915e+42 erg / s Luminosity absorbed = 2.63370e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 9926.501965 10171.209103 0.400392 0.500372\n", + "\t5 9852.611678 10306.111379 0.211205 0.191331\n", + "\t10 9779.813302 10174.379204 0.142695 0.116864\n", + "\t15 9708.082813 9910.442275 0.104556 0.085962\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 9933.952 K -- next t_inner 11453.040 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /Users/wkerzend/python/tardis/tardis/plasma/properties/ion_population.py:59: FutureWarning: \n", + "Passing list-likes to .loc or [] with any missing label will raise\n", + "KeyError in the future, you can use .reindex() as an alternative.\n", + "\n", + "See the documentation here:\n", + "https://pandas.pydata.org/pandas-docs/stable/indexing.html#deprecate-loc-reindex-listlike\n", + " partition_function.index].dropna())\n", + " (\u001b[1mwarnings.py\u001b[0m:99)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 2/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.40398e+43 erg / s Luminosity absorbed = 4.68639e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 10171.209103 11518.516702 0.500372 0.538298\n", + "\t5 10306.111379 11554.412119 0.191331 0.217946\n", + "\t10 10174.379204 11373.574056 0.116864 0.132935\n", + "\t15 9910.442275 11040.788763 0.085962 0.099700\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11453.040 K -- next t_inner 9948.201 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 3/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 8.16814e+42 erg / s Luminosity absorbed = 2.50161e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 11518.516702 10501.129902 0.538298 0.438591\n", + "\t5 11554.412119 10869.940791 0.217946 0.160809\n", + "\t10 11373.574056 10558.269547 0.132935 0.103807\n", + "\t15 11040.788763 10185.648701 0.099700 0.079165\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 9948.201 K -- next t_inner 11328.896 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 4/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.34487e+43 erg / s Luminosity absorbed = 4.47931e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 10501.129902 11527.008679 0.438591 0.512509\n", + "\t5 10869.940791 11706.138980 0.160809 0.196458\n", + "\t10 10558.269547 11444.208532 0.103807 0.124092\n", + "\t15 10185.648701 11085.857161 0.079165 0.093694\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11328.896 K -- next t_inner 10054.300 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 5/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 8.44348e+42 erg / s Luminosity absorbed = 2.68000e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 11527.008679 10659.382763 0.512509 0.433573\n", + "\t5 11706.138980 11038.244897 0.196458 0.158494\n", + "\t10 11444.208532 10790.696726 0.124092 0.099660\n", + "\t15 11085.857161 10450.666394 0.093694 0.074550\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10054.300 K -- next t_inner 11261.489 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 6/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.32492e+43 erg / s Luminosity absorbed = 4.26229e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 10659.382763 11507.437689 0.433573 0.499441\n", + "\t5 11038.244897 11634.568776 0.158494 0.197953\n", + "\t10 10790.696726 11418.594559 0.099660 0.124085\n", + "\t15 10450.666394 10999.619473 0.074550 0.094676\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11261.489 K -- next t_inner 10069.444 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 7/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 8.49858e+42 erg / s Luminosity absorbed = 2.69247e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 11507.437689 10679.650246 0.499441 0.431088\n", + "\t5 11634.568776 11048.266431 0.197953 0.157179\n", + "\t10 11418.594559 10825.714870 0.124085 0.098608\n", + "\t15 10999.619473 10506.321595 0.094676 0.073794\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10069.444 K -- next t_inner 11241.826 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 8/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.30632e+43 erg / s Luminosity absorbed = 4.31719e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 10679.650246 11459.828312 0.431088 0.506176\n", + "\t5 11048.266431 11688.139012 0.157179 0.193468\n", + "\t10 10825.714870 11441.768967 0.098608 0.122412\n", + "\t15 10506.321595 11099.449886 0.073794 0.090915\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11241.826 K -- next t_inner 10123.177 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 9/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 8.68357e+42 erg / s Luminosity absorbed = 2.75015e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 11459.828312 10666.223660 0.506176 0.445097\n", + "\t5 11688.139012 11000.288585 0.193468 0.163424\n", + "\t10 11441.768967 10822.884326 0.122412 0.101641\n", + "\t15 11099.449886 10384.181273 0.090915 0.078432\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10123.177 K -- next t_inner 11180.783 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 10/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.28170e+43 erg / s Luminosity absorbed = 4.19511e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 10666.223660 11427.410445 0.445097 0.500788\n", + "\t5 11000.288585 11612.349822 0.163424 0.193129\n", + "\t10 10822.884326 11373.245169 0.101641 0.121622\n", + "\t15 10384.181273 11047.955461 0.078432 0.090937\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11180.783 K -- next t_inner 10164.432 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 11/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 8.79074e+42 erg / s Luminosity absorbed = 2.82804e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 11427.410445 10741.337822 0.500788 0.439938\n", + "\t5 11612.349822 11230.515356 0.193129 0.153637\n", + "\t10 11373.245169 10870.696315 0.121622 0.101050\n", + "\t15 11047.955461 10538.170159 0.090937 0.074680\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10164.432 K -- next t_inner 11157.711 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 12/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.27128e+43 erg / s Luminosity absorbed = 4.15415e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 10741.337822 11507.877578 0.439938 0.483114\n", + "\t5 11230.515356 11808.852053 0.153637 0.181826\n", + "\t10 10870.696315 11557.412757 0.101050 0.113563\n", + "\t15 10538.170159 11117.762050 0.074680 0.087418\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11157.711 K -- next t_inner 10184.966 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 13/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 8.90399e+42 erg / s Luminosity absorbed = 2.80864e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 11507.877578 10727.217531 0.483114 0.443706\n", + "\t5 11808.852053 11171.758889 0.181826 0.160824\n", + "\t10 11557.412757 10971.722637 0.113563 0.098588\n", + "\t15 11117.762050 10574.916600 0.087418 0.075266\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10184.966 K -- next t_inner 11108.923 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 14/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.25052e+43 erg / s Luminosity absorbed = 4.07335e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 10727.217531 11413.626870 0.443706 0.489526\n", + "\t5 11171.758889 11697.006992 0.160824 0.184795\n", + "\t10 10971.722637 11424.445844 0.098588 0.116722\n", + "\t15 10574.916600 11047.434163 0.075266 0.088067\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11108.923 K -- next t_inner 10224.266 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 15/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 9.00727e+42 erg / s Luminosity absorbed = 2.88724e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 11413.626870 10712.622749 0.489526 0.455660\n", + "\t5 11697.006992 11125.894032 0.184795 0.164091\n", + "\t10 11424.445844 10816.390451 0.116722 0.104037\n", + "\t15 11047.434163 10421.687097 0.088067 0.080401\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10224.266 K -- next t_inner 11087.666 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 16/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.23781e+43 erg / s Luminosity absorbed = 4.07435e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 10712.622749 11352.158138 0.455660 0.500754\n", + "\t5 11125.894032 11644.968350 0.164091 0.185289\n", + "\t10 10816.390451 11320.695930 0.104037 0.119195\n", + "\t15 10421.687097 10965.228363 0.080401 0.089940\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11087.666 K -- next t_inner 10256.946 K (\u001b[1mbase.py\u001b[0m:350)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 17/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 9.18956e+42 erg / s Luminosity absorbed = 2.86249e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 11352.158138 10738.799194 0.500754 0.452965\n", + "\t5 11644.968350 11210.269586 0.185289 0.160945\n", + "\t10 11320.695930 10911.463205 0.119195 0.103910\n", + "\t15 10965.228363 10545.065525 0.089940 0.078433\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10256.946 K -- next t_inner 11012.230 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 18/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.20741e+43 erg / s Luminosity absorbed = 3.93375e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 10738.799194 11316.665617 0.452965 0.492135\n", + "\t5 11210.269586 11599.094127 0.160945 0.183929\n", + "\t10 10911.463205 11403.508986 0.103910 0.114400\n", + "\t15 10545.065525 10958.974248 0.078433 0.087415\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11012.230 K -- next t_inner 10314.623 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 19/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 9.29848e+42 erg / s Luminosity absorbed = 3.02011e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n", + "\t t_rad next_t_rad w next_w\n", + "\tShell \n", + "\t0 11316.665617 10862.505720 0.492135 0.444495\n", + "\t5 11599.094127 11194.462074 0.183929 0.162842\n", + "\t10 11403.508986 11065.620645 0.114400 0.099372\n", + "\t15 10958.974248 10599.851144 0.087415 0.077690\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10314.623 K -- next t_inner 11009.102 K (\u001b[1mbase.py\u001b[0m:350)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 20/20 (\u001b[1mbase.py\u001b[0m:266)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.21062e+43 erg / s Luminosity absorbed = 3.88405e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Simulation finished in 20 iterations and took 23.02 s (\u001b[1mbase.py\u001b[0m:306)\n" + ] + } + ], + "source": [ + "#TARDIS now uses the data in the data repo\n", + "sim = run_tardis('tardis_example.yml')" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /Users/wkerzend/miniconda/envs/tardis3/lib/python3.6/site-packages/matplotlib/style/core.py:167: UserWarning: In /Users/wkerzend/.matplotlib/stylelib/talk_default.mplstyle: \n", + "The text.latex.unicode rcparam was deprecated in Matplotlib 2.2 and will be removed in 3.1.\n", + " styles = read_style_directory(stylelib_path)\n", + " (\u001b[1mwarnings.py\u001b[0m:99)\n", + "Populating the interactive namespace from numpy and matplotlib\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /Users/wkerzend/miniconda/envs/tardis3/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", + " AstropyDeprecationWarning)\n", + " (\u001b[1mwarnings.py\u001b[0m:99)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /Users/wkerzend/python/tardis/tardis/montecarlo/formal_integral.py:167: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.\n", + " result = pd.DataFrame(att_S_ul.as_matrix(), index=transitions.transition_line_id.values)\n", + " (\u001b[1mwarnings.py\u001b[0m:99)\n" + ] + }, + { + "data": { + "application/javascript": [ + "/* Put everything inside the global mpl namespace */\n", + "window.mpl = {};\n", + "\n", + "\n", + "mpl.get_websocket_type = function() {\n", + " if (typeof(WebSocket) !== 'undefined') {\n", + " return WebSocket;\n", + " } else if (typeof(MozWebSocket) !== 'undefined') {\n", + " return MozWebSocket;\n", + " } else {\n", + " alert('Your browser does not have WebSocket support.' +\n", + " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", + " 'Firefox 4 and 5 are also supported but you ' +\n", + " 'have to enable WebSockets in about:config.');\n", + " };\n", + "}\n", + "\n", + "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", + " this.id = figure_id;\n", + "\n", + " this.ws = websocket;\n", + "\n", + " this.supports_binary = (this.ws.binaryType != undefined);\n", + "\n", + " if (!this.supports_binary) {\n", + " var warnings = document.getElementById(\"mpl-warnings\");\n", + " if (warnings) {\n", + " warnings.style.display = 'block';\n", + " warnings.textContent = (\n", + " \"This browser does not support binary websocket messages. \" +\n", + " \"Performance may be slow.\");\n", + " }\n", + " }\n", + "\n", + " this.imageObj = new Image();\n", + "\n", + " this.context = undefined;\n", + " this.message = undefined;\n", + " this.canvas = undefined;\n", + " this.rubberband_canvas = undefined;\n", + " this.rubberband_context = undefined;\n", + " this.format_dropdown = undefined;\n", + "\n", + " this.image_mode = 'full';\n", + "\n", + " this.root = $('
');\n", + " this._root_extra_style(this.root)\n", + " this.root.attr('style', 'display: inline-block');\n", + "\n", + " $(parent_element).append(this.root);\n", + "\n", + " this._init_header(this);\n", + " this._init_canvas(this);\n", + " this._init_toolbar(this);\n", + "\n", + " var fig = this;\n", + "\n", + " this.waiting = false;\n", + "\n", + " this.ws.onopen = function () {\n", + " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", + " fig.send_message(\"send_image_mode\", {});\n", + " if (mpl.ratio != 1) {\n", + " fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n", + " }\n", + " fig.send_message(\"refresh\", {});\n", + " }\n", + "\n", + " this.imageObj.onload = function() {\n", + " if (fig.image_mode == 'full') {\n", + " // Full images could contain transparency (where diff images\n", + " // almost always do), so we need to clear the canvas so that\n", + " // there is no ghosting.\n", + " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", + " }\n", + " fig.context.drawImage(fig.imageObj, 0, 0);\n", + " };\n", + "\n", + " this.imageObj.onunload = function() {\n", + " fig.ws.close();\n", + " }\n", + "\n", + " this.ws.onmessage = this._make_on_message_function(this);\n", + "\n", + " this.ondownload = ondownload;\n", + "}\n", + "\n", + "mpl.figure.prototype._init_header = function() {\n", + " var titlebar = $(\n", + " '');\n", + " var titletext = $(\n", + " '');\n", + " titlebar.append(titletext)\n", + " this.root.append(titlebar);\n", + " this.header = titletext[0];\n", + "}\n", + "\n", + "\n", + "\n", + "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "mpl.figure.prototype._init_canvas = function() {\n", + " var fig = this;\n", + "\n", + " var canvas_div = $('');\n", + "\n", + " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", + "\n", + " function canvas_keyboard_event(event) {\n", + " return fig.key_event(event, event['data']);\n", + " }\n", + "\n", + " canvas_div.keydown('key_press', canvas_keyboard_event);\n", + " canvas_div.keyup('key_release', canvas_keyboard_event);\n", + " this.canvas_div = canvas_div\n", + " this._canvas_extra_style(canvas_div)\n", + " this.root.append(canvas_div);\n", + "\n", + " var canvas = $('');\n", + " canvas.addClass('mpl-canvas');\n", + " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", + "\n", + " this.canvas = canvas[0];\n", + " this.context = canvas[0].getContext(\"2d\");\n", + "\n", + " var backingStore = this.context.backingStorePixelRatio ||\n", + "\tthis.context.webkitBackingStorePixelRatio ||\n", + "\tthis.context.mozBackingStorePixelRatio ||\n", + "\tthis.context.msBackingStorePixelRatio ||\n", + "\tthis.context.oBackingStorePixelRatio ||\n", + "\tthis.context.backingStorePixelRatio || 1;\n", + "\n", + " mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n", + "\n", + " var rubberband = $('');\n", + " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", + "\n", + " var pass_mouse_events = true;\n", + "\n", + " canvas_div.resizable({\n", + " start: function(event, ui) {\n", + " pass_mouse_events = false;\n", + " },\n", + " resize: function(event, ui) {\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " stop: function(event, ui) {\n", + " pass_mouse_events = true;\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " });\n", + "\n", + " function mouse_event_fn(event) {\n", + " if (pass_mouse_events)\n", + " return fig.mouse_event(event, event['data']);\n", + " }\n", + "\n", + " rubberband.mousedown('button_press', mouse_event_fn);\n", + " rubberband.mouseup('button_release', mouse_event_fn);\n", + " // Throttle sequential mouse events to 1 every 20ms.\n", + " rubberband.mousemove('motion_notify', mouse_event_fn);\n", + "\n", + " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", + " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", + "\n", + " canvas_div.on(\"wheel\", function (event) {\n", + " event = event.originalEvent;\n", + " event['data'] = 'scroll'\n", + " if (event.deltaY < 0) {\n", + " event.step = 1;\n", + " } else {\n", + " event.step = -1;\n", + " }\n", + " mouse_event_fn(event);\n", + " });\n", + "\n", + " canvas_div.append(canvas);\n", + " canvas_div.append(rubberband);\n", + "\n", + " this.rubberband = rubberband;\n", + " this.rubberband_canvas = rubberband[0];\n", + " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", + " this.rubberband_context.strokeStyle = \"#000000\";\n", + "\n", + " this._resize_canvas = function(width, height) {\n", + " // Keep the size of the canvas, canvas container, and rubber band\n", + " // canvas in synch.\n", + " canvas_div.css('width', width)\n", + " canvas_div.css('height', height)\n", + "\n", + " canvas.attr('width', width * mpl.ratio);\n", + " canvas.attr('height', height * mpl.ratio);\n", + " canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n", + "\n", + " rubberband.attr('width', width);\n", + " rubberband.attr('height', height);\n", + " }\n", + "\n", + " // Set the figure to an initial 600x600px, this will subsequently be updated\n", + " // upon first draw.\n", + " this._resize_canvas(600, 600);\n", + "\n", + " // Disable right mouse context menu.\n", + " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", + " return false;\n", + " });\n", + "\n", + " function set_focus () {\n", + " canvas.focus();\n", + " canvas_div.focus();\n", + " }\n", + "\n", + " window.setTimeout(set_focus, 100);\n", + "}\n", + "\n", + "mpl.figure.prototype._init_toolbar = function() {\n", + " var fig = this;\n", + "\n", + " var nav_element = $('')\n", + " nav_element.attr('style', 'width: 100%');\n", + " this.root.append(nav_element);\n", + "\n", + " // Define a callback function for later on.\n", + " function toolbar_event(event) {\n", + " return fig.toolbar_button_onclick(event['data']);\n", + " }\n", + " function toolbar_mouse_event(event) {\n", + " return fig.toolbar_button_onmouseover(event['data']);\n", + " }\n", + "\n", + " for(var toolbar_ind in mpl.toolbar_items) {\n", + " var name = mpl.toolbar_items[toolbar_ind][0];\n", + " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", + " var image = mpl.toolbar_items[toolbar_ind][2];\n", + " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", + "\n", + " if (!name) {\n", + " // put a spacer in here.\n", + " continue;\n", + " }\n", + " var button = $('');\n", + " button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n", + " 'ui-button-icon-only');\n", + " button.attr('role', 'button');\n", + " button.attr('aria-disabled', 'false');\n", + " button.click(method_name, toolbar_event);\n", + " button.mouseover(tooltip, toolbar_mouse_event);\n", + "\n", + " var icon_img = $('');\n", + " icon_img.addClass('ui-button-icon-primary ui-icon');\n", + " icon_img.addClass(image);\n", + " icon_img.addClass('ui-corner-all');\n", + "\n", + " var tooltip_span = $('');\n", + " tooltip_span.addClass('ui-button-text');\n", + " tooltip_span.html(tooltip);\n", + "\n", + " button.append(icon_img);\n", + " button.append(tooltip_span);\n", + "\n", + " nav_element.append(button);\n", + " }\n", + "\n", + " var fmt_picker_span = $('');\n", + "\n", + " var fmt_picker = $('');\n", + " fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n", + " fmt_picker_span.append(fmt_picker);\n", + " nav_element.append(fmt_picker_span);\n", + " this.format_dropdown = fmt_picker[0];\n", + "\n", + " for (var ind in mpl.extensions) {\n", + " var fmt = mpl.extensions[ind];\n", + " var option = $(\n", + " '', {selected: fmt === mpl.default_extension}).html(fmt);\n", + " fmt_picker.append(option)\n", + " }\n", + "\n", + " // Add hover states to the ui-buttons\n", + " $( \".ui-button\" ).hover(\n", + " function() { $(this).addClass(\"ui-state-hover\");},\n", + " function() { $(this).removeClass(\"ui-state-hover\");}\n", + " );\n", + "\n", + " var status_bar = $('