shadow#

This is the API for the shadow module.

class obscurae.shadow.Disk(npix=201, thick=20)#

Disk grid.

Instantiate the stellar disk.

Parameters:
  • npix (int, optional) – Number of pixels in the stellar disk. Default is 201.

  • thick (int, optional) – Thickness of rings. Default is 20 pixels).

  • span (int, optional) – Span of velocity grid. Default is 20 km/s.

  • res (float, optional) – Resolution of velocity grid. Default is 0.25 km/s.

Grid()#

Instantiate the grid.

static grid(rad, xoff=0, yoff=0)#

Initial grid.

Parameters:
  • rad (int) – Radius in number of pixels.

  • xoff (float, optional) – Offset in x-direction. Default 0.

  • yoff (float, optional) – Offset in y-direction. Default 0.

Returns:

initial grid, velocity grid, normalized radial coordinate.

Return type:

(array, array, array)

static gridCoords(rad, xoff=0, yoff=0)#

Coordinates of the grid.

Calculate the coordinates of the grid, from -rad to +rad.

Parameters:
  • rad (int) – Radius of the grid in number of pixels.

  • xoff (float, optional) – Offset in x-direction. Default is 0.

  • yoff (float, optional) – Offset in y-direction. Default is 0.

Returns:

grid coordinates, indices of coordinates, distance from limb

Return type:

(array, array, array)

static gridRing(rad, thick, xoff=0, yoff=0)#

Initial grid in rings of \(\mu\).

Initial grid of star in rings of aprrox same \(\mu = \cos(\theta)\), where \(\theta\) is the angle between a line through the center of the star and the limb.

Useful for macroturbulence calculations.

Parameters:
  • Rs (int) – Radius in number of pixels.

  • thick (int) – Thickness of rings.

  • xoff (float, optional) – Potential offset in x-direction. Default 0.

  • yoff (float, optional) – Potential offset in y-direction. Default 0.

Returns:

pixels within stellar disk, velocity grid, radial \(\mu\) values, approx \(\mu\) in each ring

Return type:

(array, array, array, array)

class obscurae.shadow.Planet(rp=0.1, vsini=10.0, zeta=2.0, xi=1.0, cs=[0.6, 0.4], law='quad', npix=201, thick=20, span=20, res=0.25)#

Planet grid.

Instantiate the planet grid. Inherits from Star.

Parameters:
  • rp (float, optional) – Planet radius in stellar radii. Default is 0.1.

  • vsini (float, optional) – Stellar rotation velocity. Default is 10 km/s.

  • zeta (float, optional) – Macroturbulence parameter. Default is 2 km/s.

  • xi (float, optional) – Microturbulence parameter. Default is 1 km/s.

  • cs (list, float, optional) – Limb darkening coefficients. Default is [0.6,0.4].

  • law (str, optional) – Limb darkening law. Default is quadratic.

  • npix (int, optional) – Number of pixels in the stellar disk. Default is 201.

  • thick (int, optional) – Thickness of rings. Default is 20 pixels).

  • span (int, optional) – Span of velocity grid. Default is 20 km/s.

  • res (float, optional) – Resolution of velocity grid. Default is 0.25 km/s.

Occult(xx, yy)#

Transiting planet on stellar disk.

The limb-darkened stellar disk is occulted by a planet. We grab those pixels occulted by the planet and make a new (sub)grid.

Parameters:
  • xx (array, float) – x-position of planet on stellar disk.

  • yy (array, float) – y-position of planet on stellar disk.

convectiveBlueshift(Vcb)#

Convective blueshift.

Calculates the convective blueshift following . The radial component of the convective blueshift is given by \(\mu V_{ \mathrm{cb}}\), where \(V_{\mathrm{cb}}\) is the convective blueshift and \(\mu\) is the cosine of the angle between the line of sight and the local vertical direction.

Similar to Eq. (1) in , the absolute RV decrease induced is given by

\[V_{0, \mathrm{cb}} = V_{ \mathrm{cb}}\]

rac{sum_{i} mu_{i}^{2} I(mu)_{i}}{sum_{i} I(mu)_{i} mu_{i}} , ,

where \(I(\mu)\) is the intensity of the star at \(\mu\) as a result of limb-darkening.

param Vcb:

Convective blueshift parameter in km/s.

type Vcb:

float

createShadow(per, t0, times, cmap='gray_r', font=14, zmin=None, zmax=None)#

Doppler shadow.

Creates the shadow of the planet traversing the stellar disk.

class obscurae.shadow.Spot(Tspot=2500, Teff=5777, Rspot=0.1, rp=0.0, vsini=10.0, zeta=2.0, xi=1.0, cs=[0.6, 0.4], law='quad', npix=100)#

Spot grid.

Instantiate the spot grid. Inherits from Star.

Parameters:
  • Tspot (float, optional) – Spot temperature in K. Default is 2500 K.

  • Teff (float, optional) – Stellar effective temperature in K. Default is 5777 K.

  • Rspot (float, optional) – Spot radius in stellar radii. Default is 0.1.

  • vsini (float, optional) – Stellar rotation velocity. Default is 10 km/s.

  • zeta (float, optional) – Macroturbulence parameter. Default is 2 km/s.

  • xi (float, optional) – Microturbulence parameter. Default is 1 km/s.

  • cs (list, float, optional) – Limb darkening coefficients. Default is [0.6,0.4].

  • law (str, optional) – Limb darkening law. Default is quadratic.

  • npix (int, optional) – Number of pixels in the stellar disk. Default is 201.

  • thick (int, optional) – Thickness of rings. Default is 20 pixels).

  • span (int, optional) – Span of velocity grid. Default is 20 km/s.

  • res (float, optional) – Resolution of velocity grid. Default is 0.25 km/s.

Cross(xx, yy, xp=[], yp=[])#

Spot crossing stellar disk.

Similar to Planet.Occult() but for spots with fractional intensity.

Parameters:
  • xx (array, float) – x-position of spot on stellar disk.

  • yy (array, float) – y-position of spot on stellar disk.

fromAngularRadius(delta)#

Angular radius.

Calculates and sets the radius of the spot-to-star radius from the angular radius as

\[\tan \delta = \frac{R_{spot}}{R_{star}} \, ,\]
Parameters:

delta (floats) – Angular radius in radians.

Returns:

Angular radius in radians.

Return type:

float

class obscurae.shadow.Star(vsini=10.0, zeta=2.0, xi=1.0, cs=(0.6, 0.4), law='quad', npix=101)#

Stellar grid.

Instantiate the stellar grid. Inherits from Disk.

Parameters:
  • vsini (float, optional) – Stellar rotation velocity. Default is 10 km/s.

  • zeta (float, optional) – Macroturbulence parameter. Default is 2 km/s.

  • xi (float, optional) – Microturbulence parameter. Default is 1 km/s.

  • cs (list, float, optional) – Limb darkening coefficients. Default is (0.6,0.4).

  • law (str, optional) – Limb darkening law. Default is quadratic.

  • npix (int, optional) – Number of pixels in the stellar disk. Default is 201.

  • thick (int, optional) – Thickness of rings. Default is 20 pixels).

  • span – Span of velocity grid. Default is 20 km/s.

  • res (float, optional) – Resolution of velocity grid. Default is 0.25 km/s.

Line()#

Stellar line profile.

The stellar line profile is calculated by convolving the rotating, limb-darkened star grid with the macroturbulence and microturbulence.

convolve()#

Convolve the stellar grid.

Convolves the stellar grid with the macroturbulence and microturbulence following the approaches in Hirano et al. (2011) and Gray (2005).

limbDarkening(cs=(0.3, 0.2), law='quad')#

Limb darkening.

Calculates the limb darkening of the star based on \(\mu\) and the limb darkening law.

Parameters:
  • cs (tuple, float) – Limb darkening coefficients. Default is [0.3,0.2].

  • law (str, optional) – Limb darkening law. Default is quadratic.

Note

The ‘nonlinear’ law needs four coefficients, while the ‘quad’ only need two. ‘uni’ naturally does not need any.

macroturbulence(zeta)#

Macroturbulence.

Calculates the macroturbulence of the star in rings at a given \(\mu\) for a given \(\zeta\) using the radial-tangential profile.

Parameters:

zeta (float) – Macroturbulence parameter.

microturbulence(xi)#

Microturbulence.

Convolves the rotation profile with a gaussian to take microturbulence for a given \(\xi\) into account.

Parameters:

xi (float) – Microturbulence parameter.