Skip to content

Commit

Permalink
Merge pull request #146 from sblunt/rv_changes
Browse files Browse the repository at this point in the history
Rv changes
  • Loading branch information
sblunt authored Mar 6, 2020
2 parents 3e6ea05 + 81c8e94 commit 3d6334b
Show file tree
Hide file tree
Showing 22 changed files with 1,485 additions and 475 deletions.
1 change: 1 addition & 0 deletions docs/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ us if you are still confused).
.. toctree::
:maxdepth: 1

tutorials/Orbitize_RV_Tutorial.ipynb
tutorials/Modifying_Priors.ipynb
tutorials/Plotting_tutorial.ipynb
tutorials/MCMC_vs_OFTI.ipynb
Expand Down
38 changes: 32 additions & 6 deletions docs/tutorials/MCMC_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,39 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"WARNING: KEPLER: Unable to import C-based Kepler's equation solver. Falling back to the slower NumPy implementation.\n"
"ename": "Exception",
"evalue": "Invalid value of input_data for Driver",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m~/orbitize/orbitize/read_input.py\u001b[0m in \u001b[0;36mread_file\u001b[0;34m(filename)\u001b[0m\n\u001b[1;32m 88\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 89\u001b[0;31m \u001b[0minput_table\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mread\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 90\u001b[0m \u001b[0;32mexcept\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda3/lib/python3.7/site-packages/astropy/io/ascii/ui.py\u001b[0m in \u001b[0;36mread\u001b[0;34m(table, guess, **kwargs)\u001b[0m\n\u001b[1;32m 286\u001b[0m \u001b[0;31m# more useful traceback.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 287\u001b[0;31m \u001b[0mdat\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_guess\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtable\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnew_kwargs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mformat\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfast_reader\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 288\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mdat\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda3/lib/python3.7/site-packages/astropy/io/ascii/ui.py\u001b[0m in \u001b[0;36m_guess\u001b[0;34m(table, read_kwargs, format, fast_reader)\u001b[0m\n\u001b[1;32m 445\u001b[0m \u001b[0mreader\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mguessing\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 446\u001b[0;31m \u001b[0mdat\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mreader\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtable\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 447\u001b[0m _read_trace.append({'kwargs': copy.deepcopy(guess_kwargs),\n",
"\u001b[0;32m~/anaconda3/lib/python3.7/site-packages/astropy/io/ascii/core.py\u001b[0m in \u001b[0;36mread\u001b[0;34m(self, table)\u001b[0m\n\u001b[1;32m 1163\u001b[0m \u001b[0;31m# Get a list of the lines (rows) in the table\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1164\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlines\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minputter\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_lines\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtable\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1165\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda3/lib/python3.7/site-packages/astropy/io/ascii/core.py\u001b[0m in \u001b[0;36mget_lines\u001b[0;34m(self, table)\u001b[0m\n\u001b[1;32m 304\u001b[0m with get_readable_fileobj(table,\n\u001b[0;32m--> 305\u001b[0;31m encoding=self.encoding) as fileobj:\n\u001b[0m\u001b[1;32m 306\u001b[0m \u001b[0mtable\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfileobj\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda3/lib/python3.7/contextlib.py\u001b[0m in \u001b[0;36m__enter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 111\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 112\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mnext\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgen\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 113\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mStopIteration\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda3/lib/python3.7/site-packages/astropy/utils/data.py\u001b[0m in \u001b[0;36mget_readable_fileobj\u001b[0;34m(name_or_obj, encoding, cache, show_progress, remote_timeout)\u001b[0m\n\u001b[1;32m 192\u001b[0m timeout=remote_timeout)\n\u001b[0;32m--> 193\u001b[0;31m \u001b[0mfileobj\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mio\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mFileIO\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname_or_obj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 194\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mis_url\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mcache\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/home/sda/rtejada/anaconda3/orbitize_example_data/GJ504.csv'",
"\nDuring handling of the above exception, another exception occurred:\n",
"\u001b[0;31mException\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m~/orbitize/orbitize/driver.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, input_data, sampler_str, num_secondary_bodies, system_mass, plx, mass_err, plx_err, lnlike, system_kwargs, mcmc_kwargs)\u001b[0m\n\u001b[1;32m 43\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 44\u001b[0;31m \u001b[0mdata_table\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0morbitize\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread_input\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread_file\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minput_data\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 45\u001b[0m \u001b[0;32mexcept\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/orbitize/orbitize/read_input.py\u001b[0m in \u001b[0;36mread_file\u001b[0;34m(filename)\u001b[0m\n\u001b[1;32m 91\u001b[0m raise Exception(\n\u001b[0;32m---> 92\u001b[0;31m 'Unable to read file: {}. \\n Please check file path and format.'.format(filename))\n\u001b[0m\u001b[1;32m 93\u001b[0m \u001b[0mnum_measurements\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minput_table\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mException\u001b[0m: Unable to read file: /home/sda/rtejada/anaconda3/orbitize_example_data/GJ504.csv. \n Please check file path and format.",
"\nDuring handling of the above exception, another exception occurred:\n",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m~/orbitize/orbitize/driver.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, input_data, sampler_str, num_secondary_bodies, system_mass, plx, mass_err, plx_err, lnlike, system_kwargs, mcmc_kwargs)\u001b[0m\n\u001b[1;32m 47\u001b[0m \u001b[0;31m# Check if input might be an orbitize style astropy.table.Table\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 48\u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0;34m'quant_type'\u001b[0m \u001b[0;32min\u001b[0m \u001b[0minput_data\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 49\u001b[0m \u001b[0mdata_table\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0minput_data\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mAttributeError\u001b[0m: 'str' object has no attribute 'columns'",
"\nDuring handling of the above exception, another exception occurred:\n",
"\u001b[0;31mException\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-1-ad96f1c099e2>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 22\u001b[0m my_driver = driver.Driver(\n\u001b[1;32m 23\u001b[0m \u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'MCMC'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnum_secondary_bodies\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msystem_mass\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mplx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmass_err\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmass_err\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mplx_err\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mplx_err\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 24\u001b[0;31m \u001b[0mmcmc_kwargs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0;34m'num_temps'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mnum_temps\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'num_walkers'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mnum_walkers\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'num_threads'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mnum_threads\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 25\u001b[0m )\n",
"\u001b[0;32m~/orbitize/orbitize/driver.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, input_data, sampler_str, num_secondary_bodies, system_mass, plx, mass_err, plx_err, lnlike, system_kwargs, mcmc_kwargs)\u001b[0m\n\u001b[1;32m 49\u001b[0m \u001b[0mdata_table\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0minput_data\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 50\u001b[0m \u001b[0;32mexcept\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 51\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mException\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Invalid value of input_data for Driver'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 52\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 53\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0msystem_kwargs\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mException\u001b[0m: Invalid value of input_data for Driver"
]
}
],
Expand Down Expand Up @@ -448,7 +474,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.9"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/Modifying_MCMC_initial_positions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.9"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/Modifying_Priors.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.9"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 3d6334b

Please sign in to comment.