Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlouden committed May 4, 2017
1 parent 183b632 commit 51b0c99
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 20 deletions.
Binary file added docs/images/phase_spectrum.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/simple_spectrum.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions docs/plotting.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
Plotting
============

Generating a simple spectrum
-----------------------------

Sometimes you don't want to bother with running a full orbital model, and just want a quick estimate of the eclipse depth of system. Spiderman has a couple of techniques to allow you to do this.

.. code-block:: python
spider_params.l1 = 1.1e-6 # The starting wavelength in meters
spider_params.l2 = 1.7e-6 # The ending wavelength in meters
This method only returns the *blocked light* relative to the stellar brightness at the specified phase, so for an example, if you were to specify a grazing transit you would not recieve the total flux of the dayside.

If you do want the total flux of the planet from a specific phase, you can instead use the "phase_brightness" method. Using this method you could calulate an emission spectrum


WRONG WRONG WRONG! "brightness_phase" should give some sort of absolute brightness measurement, not one relative to the star.
48 changes: 28 additions & 20 deletions spiderman/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,7 @@ def eclipse_depth(self,phase=0.5,stellar_grid=False):

return np.array(out)

def phase_brightness(self,phase,stellar_grid=False):

brightness_params = self.format_bright_params()
def phase_brightness(self,phases,stellar_grid=False):

if self.thermal == True:
if stellar_grid == False:
Expand All @@ -473,30 +471,40 @@ def phase_brightness(self,phase,stellar_grid=False):
teffs = []
totals = []

t = 0.0 + np.array([phase])
if type(phases) is not list: phases = [phases]

if(self.inc == None):
self.inc = 90.0
brightness_params = self.format_bright_params()

if(self.p_u1 == None):
self.p_u1 = 0.0
out_list = []
for phase in phases:

if(self.p_u2 == None):
self.p_u2 = 0.0
t = 0.0 + np.array([phase])

if(self.a == None):
self.a = 4.0
if(self.inc == None):
self.inc = 90.0

if(self.w == None):
self.w = 0.0
if(self.p_u1 == None):
self.p_u1 = 0.0

if(self.ecc == None):
self.ecc = 0.0
if(self.p_u2 == None):
self.p_u2 = 0.0

if(self.a == None):
self.a = 4.0

if(self.a_abs == None):
self.a_abs = 1.0
if(self.w == None):
self.w = 0.0

if(self.ecc == None):
self.ecc = 0.0


if(self.a_abs == None):
self.a_abs = 1.0

out = _web.lightcurve(self.n_layers,t,0.0,1.0,self.a_abs,self.inc,0.0,0.0,self.a,self.rp,self.p_u1,self.p_u2,self.brightness_type,brightness_params,teffs,totals,len(totals),0)[0] - 1.0
out = _web.lightcurve(self.n_layers,t,0.0,1.0,self.a_abs,self.inc,0.0,0.0,self.a,self.rp,self.p_u1,self.p_u2,self.brightness_type,brightness_params,teffs,totals,len(totals),0)[0] - 1.0
out_list += [out]
if len(out_list) == 1:
return out_list[0]

return np.array(out)
return out_list

0 comments on commit 51b0c99

Please sign in to comment.