Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Astrometry + RV Joint Model Case Study #60

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/tutorials/astrometric.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@
"\n",
"def get_model(parallax=None):\n",
" with pm.Model() as model:\n",
"\n",
" if parallax is None:\n",
" # Without an actual parallax measurement, we can model the orbit in units of arcseconds\n",
" # by providing a fake_parallax and conversion constant\n",
Expand Down
2,103 changes: 2,103 additions & 0 deletions docs/tutorials/astrometry_rv_case_study.ipynb

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions docs/tutorials/eb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,7 @@
"\n",
"\n",
"def build_model(mask):\n",
"\n",
" with pm.Model() as model:\n",
"\n",
" # Systemic parameters\n",
" mean_lc = pm.Normal(\"mean_lc\", mu=0.0, sd=5.0)\n",
" mean_rv = pm.Normal(\"mean_rv\", mu=0.0, sd=50.0)\n",
Expand Down
17 changes: 12 additions & 5 deletions docs/tutorials/joint.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@
"cell_type": "code",
"execution_count": null,
"id": "8000897c",
"metadata": {},
"metadata": {
"lines_to_next_cell": 2
},
"outputs": [],
"source": [
"import pymc3 as pm\n",
Expand All @@ -330,7 +332,6 @@
" if mask is None:\n",
" mask = np.ones(len(x), dtype=bool)\n",
" with pm.Model() as model:\n",
"\n",
" # Parameters for the stellar properties\n",
" mean_flux = pm.Normal(\"mean_flux\", mu=0.0, sd=10.0)\n",
" u_star = xo.QuadLimbDark(\"u_star\")\n",
Expand Down Expand Up @@ -487,7 +488,9 @@
{
"cell_type": "markdown",
"id": "d7d02ab9",
"metadata": {},
"metadata": {
"lines_to_next_cell": 2
},
"source": [
"Now let's plot the map radial velocity model."
]
Expand All @@ -496,7 +499,9 @@
"cell_type": "code",
"execution_count": null,
"id": "b78425b5",
"metadata": {},
"metadata": {
"lines_to_next_cell": 2
},
"outputs": [],
"source": [
"def plot_rv_curve(soln):\n",
Expand Down Expand Up @@ -525,7 +530,9 @@
{
"cell_type": "markdown",
"id": "ade1ac5b",
"metadata": {},
"metadata": {
"lines_to_next_cell": 2
},
"source": [
"That looks pretty similar to what we got in {ref}`rv`.\n",
"Now let's also plot the transit model."
Expand Down
4 changes: 0 additions & 4 deletions docs/tutorials/lc-gp-transit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,10 @@
"\n",
"\n",
"def build_model(mask=None, start=None):\n",
"\n",
" if mask is None:\n",
" mask = np.ones(len(x), dtype=bool)\n",
"\n",
" with pm.Model() as model:\n",
"\n",
" # Shared parameters\n",
" mean = pm.Normal(\"mean\", mu=0, sd=1, testval=0)\n",
"\n",
Expand Down Expand Up @@ -323,7 +321,6 @@
"\n",
"\n",
"def plot_light_curve(x, y, soln, mask=None):\n",
"\n",
" if mask is None:\n",
" mask = np.ones(len(x), dtype=bool)\n",
"\n",
Expand Down Expand Up @@ -535,7 +532,6 @@
"RUN_THE_SAMPLING = 0\n",
"\n",
"if RUN_THE_SAMPLING:\n",
"\n",
" with model:\n",
" trace = pm.sample(\n",
" tune=1500,\n",
Expand Down
2 changes: 0 additions & 2 deletions docs/tutorials/lc-multi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@
"# Do several rounds of sigma clipping\n",
"for i in range(10):\n",
" with pm.Model() as model:\n",
"\n",
" # Shared orbital parameters\n",
" log_period = pm.Normal(\"log_period\", mu=np.log(lit_period), sigma=1.0)\n",
" period = pm.Deterministic(\"period\", tt.exp(log_period))\n",
Expand All @@ -197,7 +196,6 @@
" gp_preds = dict()\n",
" gp_preds_with_mean = dict()\n",
" for n, (name, (x, y, yerr, texp)) in enumerate(datasets.items()):\n",
"\n",
" # We define the per-instrument parameters in a submodel so that we\n",
" # don't have to prefix the names manually\n",
" with pm.Model(name=name, model=model):\n",
Expand Down
1 change: 0 additions & 1 deletion docs/tutorials/quick-tess.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
"\n",
"\n",
"with pm.Model() as model:\n",
"\n",
" # Stellar parameters\n",
" mean = pm.Normal(\"mean\", mu=0.0, sigma=10.0)\n",
" u = xo.QuadLimbDark(\"u\")\n",
Expand Down
1 change: 0 additions & 1 deletion docs/tutorials/rv-multi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
"t_phase = np.linspace(-0.5, 0.5, 5000)\n",
"\n",
"with pm.Model() as model:\n",
"\n",
" # Parameters describing the orbit\n",
" log_K = pm.Normal(\"log_K\", mu=np.log(300), sigma=10)\n",
" log_P = pm.Normal(\"log_P\", mu=np.log(2093.07), sigma=10)\n",
Expand Down
1 change: 0 additions & 1 deletion docs/tutorials/rv.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@
"import aesara_theano_fallback.tensor as tt\n",
"\n",
"with pm.Model() as model:\n",
"\n",
" # Gaussian priors based on transit data (from Petigura et al.)\n",
" t0 = pm.Normal(\"t0\", mu=np.array(t0s), sd=np.array(t0_errs), shape=2)\n",
" logP = pm.Normal(\n",
Expand Down
1 change: 0 additions & 1 deletion docs/tutorials/stellar-variability.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
"from celerite2.theano import terms, GaussianProcess\n",
"\n",
"with pm.Model() as model:\n",
"\n",
" # The mean flux of the time series\n",
" mean = pm.Normal(\"mean\", mu=0.0, sigma=10.0)\n",
"\n",
Expand Down
9 changes: 6 additions & 3 deletions docs/tutorials/tess.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@
"cell_type": "code",
"execution_count": null,
"id": "fbb85aad",
"metadata": {},
"metadata": {
"lines_to_next_cell": 2
},
"outputs": [],
"source": [
"import exoplanet as xo\n",
Expand All @@ -176,7 +178,6 @@
" if mask is None:\n",
" mask = np.ones(len(x), dtype=bool)\n",
" with pm.Model() as model:\n",
"\n",
" # Parameters for the stellar properties\n",
" mean = pm.Normal(\"mean\", mu=0.0, sd=10.0)\n",
" u_star = xo.QuadLimbDark(\"u_star\")\n",
Expand Down Expand Up @@ -307,7 +308,9 @@
{
"cell_type": "markdown",
"id": "82a9efd6",
"metadata": {},
"metadata": {
"lines_to_next_cell": 2
},
"source": [
"Here's how we plot the initial light curve model:"
]
Expand Down
1 change: 0 additions & 1 deletion docs/tutorials/transit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
"import pymc3_ext as pmx\n",
"\n",
"with pm.Model() as model:\n",
"\n",
" # The baseline flux\n",
" mean = pm.Normal(\"mean\", mu=0.0, sd=1.0)\n",
"\n",
Expand Down
1 change: 0 additions & 1 deletion docs/tutorials/ttv.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
"np.random.seed(9485023)\n",
"\n",
"with pm.Model() as model:\n",
"\n",
" # This part of the model is similar to the model in the `transit` tutorial\n",
" mean = pm.Normal(\"mean\", mu=0.0, sd=1.0)\n",
" u = xo.QuadLimbDark(\"u\", testval=np.array([0.3, 0.2]))\n",
Expand Down