Stellar wind (Thomson scattering)#
Starlight scattered by the free electrons of a stellar wind (Thomson scattering).
A spherical wind of mass-loss rate Mdot and speed v has an electron density n(r) = Mdot / (4 pi r^2 v mu_e m_u). Each electron scatters sigma_T times the stellar flux L / (4 pi r^2). Integrated along the line of sight (int dz / r^4 = pi / (2 b^3)), the scattered light per solid angle, as a fraction of the star’s flux, is
contrast per steradian = K_w / theta^3, K_w = sigma_T Mdot / (32 pi v mu_e m_u d),
with theta the angle from the star (rad) and d the distance. As in wind_image.ipynb this is isotropic scattering at constant speed, with mu_e = 1. It is independent of the luminosity, the band and the wavelength: grey scattering gives a contrast valid in any band.
Each pixel holds the exact integral of K_w / theta^3 over its area, from the corners: over the quadrant beyond (x, y) >= 0, the integral of r^-3 is 2 / (x + y + r), finite everywhere but at the star. The wind starts at theta_in = r_in R_star / d; a rectangle [0, b] x [0, c] with a corner on the star holds pi / (2 theta_in) - sqrt(b^2 + c^2) / (b c).
Options (off by default): mu_e; the Thomson phase function (3/16 pi)(1 + cos^2 chi), exactly 15/16 of the isotropic result at constant speed; and a beta-law wind v(r) = v0 + (v - v0)(1 - r_in / r)^beta (line-of-sight integral done numerically).
- toycoronagraph.sources.thomson.wind_constant(mdot, v, distance, mu_e=1.0)[source]#
The wind constant K_w = sigma_T Mdot / (32 pi v mu_e m_u d).
- Parameters:
mdot (float) – mass-loss rate in M_sun/yr.
v (float) – wind speed in km/s.
distance (float) – the star’s distance in pc.
mu_e (float) – mass per electron in atomic mass units.
- Returns:
K_w, such that the contrast per steradian is K_w / theta^3 (theta in rad).
- Return type:
float
- toycoronagraph.sources.thomson.pixel_integrals(size, pixel, theta_in)[source]#
The integral of theta^-3 over every pixel of a size x size grid centred on the star.
Each pixel is split along x = 0 and y = 0 into rectangles [a, b] x [c, d] of the first quadrant (by symmetry), integrated exactly from _beyond() at their corners; a rectangle with a corner on the star holds pi / (2 theta_in) - hypot(b, d) / (b d) (exact while the disc theta < theta_in lies inside it). Exact when theta_in is below half a pixel; otherwise the pixels within theta_in of the star are integrated numerically (_numerical_near_star).
- Parameters:
size (int) – pixels on a side; the star is at pixel (size-1)/2 (between pixels if even).
pixel (float) – pixel size in rad (or any angle unit, the same as theta_in’s).
theta_in (float) – angle (rad) below which there is no wind (> 0).
- Returns:
(np.ndarray (size, size) float64 in rad^-1 (the integral of theta^-3 d^2theta, in the inverse of the unit of pixel), bool: whether the numerical fallback was used).
- Return type:
tuple
- toycoronagraph.sources.thomson.profile_factor(b, r_in, v, v0, beta, phase)[source]#
The line-of-sight integral at impact parameter b over the isotropic, constant-speed one (pi / (2 b^3)).
With b = r cos t (t the angle from the plane of the sky; z = b tan t), int dz / r^4 = b^-3 int cos^2 t dt. The density scales as 1 / v(r), so a beta law weights the integrand by v / v(r); the Thomson phase function (scattering angle chi with cos chi = sin t) by (3/4)(1 + sin^2 t) relative to isotropic. The integral is done over t in [0, pi/2] (half the line of sight, symmetric), normalised by its constant-speed isotropic value pi/4.
- Parameters:
b (float) – impact parameter, in the same unit as r_in (rad in Wind).
r_in (float) – where the wind starts (the beta law’s r_in; below it v(r) = v0).
v (float) – terminal speed (km/s; only ratios matter).
v0 (float) – speed at r_in (same unit as v).
beta (float) – exponent of the beta law; None = constant speed v.
phase (str) – “isotropic” or “thomson”.
- Returns:
the factor (1 for constant speed and isotropic scattering).
- Return type:
float
- class toycoronagraph.sources.thomson.Wind(**settings)[source]#
Bases:
SourceA spherical stellar wind seen in Thomson-scattered starlight (see the module docstring).
family “relative”: a contrast, valid in any band; requires the star’s distance (pc) and radius (R_sun, for where the wind starts).
Check and store the module’s own parameters.
- Parameters:
**settings – {param name: value}; each is converted with toycoronagraph.params.convert (units in text, “auto”, choices…); parameters not given take their default.
- Raises:
ParamError – unknown parameter names (with a suggestion) or invalid values, all listed.
- render(grid, star)[source]#
The wind’s contrast per pixel: K_w x the integral of theta^-3 over each pixel (x the profile factor with a beta law or the Thomson phase function).
- Parameters:
grid (toycoronagraph.scene.Grid) – the scene grid (size, pixel_scale in arcsec).
star (toycoronagraph.scene.Star) – distance (pc) and radius (R_sun).
- Returns:
(size, size) contrast_pixel on the scene grid (pixel_scale None), with notes for an even grid size or the numerical fallback.
- Return type: