Skip to content

Commit

Permalink
testing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlouden committed Aug 24, 2016
1 parent de81130 commit 228b5d5
Show file tree
Hide file tree
Showing 18 changed files with 198 additions and 66 deletions.
1 change: 0 additions & 1 deletion c_src/_web.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ static PyObject *web_lightcurve(PyObject *self, PyObject *args)

PyObject *t_array = PyArray_FROM_OTF(t_obj, NPY_DOUBLE, NPY_IN_ARRAY);


/* If that didn't work, throw an exception. */
if (t_array == NULL) {
Py_XDECREF(t_array);
Expand Down
4 changes: 2 additions & 2 deletions c_src/web.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ double *lightcurve(int n_layers, int n_points, double *t, double tc, double per,
double *output = malloc(sizeof(double) * n_points);

// generate the planet grid

double **planet = generate_planet(n_layers);

double *transit_coords = separation_of_centers(tc,tc,per,a,inc,ecc,omega,a_rs,r2);
Expand All @@ -50,14 +51,13 @@ double *lightcurve(int n_layers, int n_points, double *t, double tc, double per,

phase = calc_phase(t[n],tc,per);


// make correction for finite light travel speed

phase_z = old_coords[3];
phase_dz = transit_z-phase_z;
phase_dt = (phase_dz/c)/(3600.0*24.0);

double *substellar = calc_substellar(phase,coords);
double *substellar = calc_substellar(phase,old_coords);

lambda0 = substellar[0];
phi0 = substellar[1];
Expand Down
Binary file added docs/images/f1.pdf
Binary file not shown.
Binary file added docs/images/f1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/f2.pdf
Binary file not shown.
Binary file added docs/images/f2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/f3.pdf
Binary file not shown.
Binary file added docs/images/f3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/f4.pdf
Binary file not shown.
Binary file added docs/images/f4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/f5.pdf
Binary file not shown.
Binary file added docs/images/f5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Contents:

intro
installation
quickstart
ack

Release Notes
Expand Down
21 changes: 21 additions & 0 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

Quickstart
============
Making a lightcurve
---
This is likely the basic task that you need SPIDERMAN to perform, to, for example, form the basis for a likelihood function being fed into an mcmc. Here is how to return a simulated lightcurve from SPIDERMAN, the fast way.

.. figure:: images/f1.png
:width: 200px
:align: center
:height: 100px
:alt: alternate text
:figclass: align-center

figure are like images but with a caption

and whatever else youwish to add

.. code-block:: python
import image
116 changes: 87 additions & 29 deletions examples/.ipynb_checkpoints/quickstart-checkpoint.ipynb

Large diffs are not rendered by default.

109 changes: 75 additions & 34 deletions examples/quickstart.ipynb

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions spiderman/params.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
import spiderman as sp
import spiderman._web as _web
import spiderman.plot as splt

class ModelParams(object):

Expand Down Expand Up @@ -76,3 +77,13 @@ def calc_substellar(self,t):
substellar = _web.calc_substellar(self.phase,np.array(coords))
self.lambda0 = substellar[0]
self.phi0 = substellar[1]

def plot_system(self,t,ax=False,min_temp=False,max_temp=False,temp_map=False,min_bright=0):
return splt.plot_system(self,t,ax=ax,min_temp=min_temp,max_temp=max_temp,temp_map=temp_map,min_bright=min_bright)

def plot_planet(self,t,ax=False,min_temp=False,max_temp=False,temp_map=False,min_bright=0,scale_planet=1.0,planet_cen=[0.0,0.0]):
return splt.plot_planet(self,t,ax=ax,min_temp=min_temp,max_temp=max_temp,temp_map=temp_map,min_bright=min_bright,scale_planet=scale_planet,planet_cen=planet_cen)

def lightcurve(self,t):
brightness_params = self.format_bright_params()
return _web.lightcurve(self.n_layers,t,self.t0,self.per,self.a_abs,self.inc,self.ecc,self.w,self.a,self.rp,self.p_u1,self.p_u2,self.brightness_type,brightness_params)
1 change: 1 addition & 0 deletions spiderman/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def plot_system(spider_params,t,ax=False,min_temp=False,max_temp=False,temp_map=

ax.set_xlim(star_offset_pix+40*p_imrat,star_offset_pix+-40*p_imrat)
ax.set_ylim(star_offset_pix+-10*p_imrat,star_offset_pix+10*p_imrat)
return ax



Expand Down

0 comments on commit 228b5d5

Please sign in to comment.