Package ivs :: Package roche :: Module local
[hide private]
[frames] | no frames]

Module local

source code

Derive local quantities such as effective temperature and surface gravity for Roche potentials.

Functions [hide private]
 
surface_normals(r, phi, theta, grid, gtype='spher')
Numerically compute surface normals of a grid (in absence of analytical alternative).
source code
    Gridding functions
 
get_grid(*args, **kwargs)
Construct a coordinate grid
source code
 
stitch_grid(theta, phi, *quant, **kwargs)
Stitch a grid together that was originally defined on 1 quadrant.
source code
    Derivation of local quantities
 
surface_elements((r, mygrid), (surfnormal_x, surfnormal_y, surfnormal_z), gtype='spher')
Compute surface area of elements in a grid.
source code
 
temperature(surface_gravity, g_pole, T_pole, beta=1.)
Calculate local temperature.
source code
 
intensity(teff, grav, mu=None, photband='OPEN.BOL')
Calculate local intensity.
source code
 
projected_intensity(teff, gravity, areas, line_of_sight, photband='OPEN.BOL')
Compute projected intensity in the line of sight.
source code
 
project(star, view_long=(0,0,0), view_lat=(pi/2,0,0), photband='OPEN.BOL', only_visible=False, plot_sort=False, scale_factor=1.)
Project and transform coordinates and vectors to align with the line-of-sight.
source code
Function Details [hide private]

get_grid(*args, **kwargs)

source code 

Construct a coordinate grid

If you give two resolutions, the first is for theta, the second for phi

Parameters:
  • args (integer) - one or two integers indicating number of grid points in theta and phi direction
  • gtype (str) - grid type ('spher' or 'delaunay')
Returns:
theta,phi(,grid)

stitch_grid(theta, phi, *quant, **kwargs)

source code 

Stitch a grid together that was originally defined on 1 quadrant.

We add the three other quandrants.

surface_normals(r, phi, theta, grid, gtype='spher')

source code 

Numerically compute surface normals of a grid (in absence of analytical alternative).

Also computes the surface elements, making surface_elements obsolete.

surface_elements((r, mygrid), (surfnormal_x, surfnormal_y, surfnormal_z), gtype='spher')

source code 

Compute surface area of elements in a grid.

theta,phi must be generated like mgrid(theta_range,phi_range)

usually, the surfnormals are acquired via differentiation of a gravity potential, and is then equal to the *negative* of the local surface gravity.

temperature(surface_gravity, g_pole, T_pole, beta=1.)

source code 

Calculate local temperature.

beta is gravity darkening parameter.

intensity(teff, grav, mu=None, photband='OPEN.BOL')

source code 

Calculate local intensity.

beta is gravity darkening parameter.

projected_intensity(teff, gravity, areas, line_of_sight, photband='OPEN.BOL')

source code 

Compute projected intensity in the line of sight.

gravity is vector directed inwards in the star line of sight is vector.

project(star, view_long=(0,0,0), view_lat=(pi/2,0,0), photband='OPEN.BOL', only_visible=False, plot_sort=False, scale_factor=1.)

source code 

Project and transform coordinates and vectors to align with the line-of-sight.

Parameter star should be a record array containing fields 'teff','gravx', 'gravy','gravz','areas','vx','vy','vz'

and either you suply ('r','theta','phi') or ('x','y','z')

The XY direction is then the line-of-sight, and the YZ plane is the plane of the sky.

An extra column 'projflux' and 'eyeflux' will be added. Projected flux takes care of limb darkening, and projected surface area. Eye flux only takes care of limbdarkening, and should only be used for plotting reasons.

view_long[0] of 0 means looking in the XY line, pi means looking in the YX line. view_lat[0] of pi/2 means edge on, 0 or pi is pole-on.

This function updates all Cartesian coordinates present in the star, but not the polar coordinates! The projected fluxes are added as a field 'projflux' to the returned record array.

If you set 'only_visible' to True, only the information on the visible parts of the star will be contained.

If you set 'plot_sort' to True, the arrays will be returned in a sorted order, where the areas at the back come first. This is especially handy for plotting.

Parameters:
  • view_long (tuple floats (radians,x,y)) - longitude viewing angle (radians) and coordinate zeropoint
  • view_lat (tuple floats (radians,x,z)) - inclination viewing angle (radians) and coordinate zeropoint
  • photband (string) - photometric passband
  • only_visible (boolean) - flag to return only information on visible surface elements
  • plot_sort (boolean) - flag to sort the surface elements from back to front
  • star (numpy record array)