Find stellar rotation and activity quantities
Rotation and activity quantities (How-to)
Goal
Compute high-energy emission quantities (X-ray, EUV, Ly-Ξ±) from stellar mass, age, and rotation, optionally add variability/scatter, and (if needed) retrieve a larger set of model diagnostics via ExtendedQuantities.
Prerequisites
Install MORS and download the required stellar evolution data:
pip install fwl-mors
mors download all
Units:
Mstarin Mβ,Agein Myr,Protin days,Omegain Ξ©β. Luminosities are in erg sβ»ΒΉ and surface fluxes in erg sβ»ΒΉ cmβ»Β².
Step 1: Get the full XUV dictionary (Lxuv)
Use Omega (or OmegaEnv) or Prot to specify the surface rotation.
Using Ξ© (Ξ©β):
import mors
xuv = mors.Lxuv(Mstar=1.0, Age=5000.0, Omega=10.0)
Using rotation period (days):
import mors
xuv = mors.Lxuv(Mstar=1.0, Age=5000.0, Prot=1.0)
The returned dictionary includes luminosities, surface fluxes, and bolometric-normalized values, e.g.:
- Luminosities: Lxuv, Lx, Leuv1, Leuv2, Leuv, Lly (erg sβ»ΒΉ)
- Fluxes: Fxuv, Fx, Feuv1, ... (erg sβ»ΒΉ cmβ»Β²)
- Normalized: Rxuv, Rx, Reuv1, ... (dimensionless)
To see what keys are present:
print(sorted(xuv.keys()))
Step 2: Retrieve a single quantity directly (Lx, Leuv, Lly)
import mors
Lx = mors.Lx(Mstar=1.0, Age=5000.0, Omega=10.0)
Leu = mors.Leuv(Mstar=1.0, Age=5000.0, Omega=10.0)
Lly = mors.Lly(Mstar=1.0, Age=5000.0, Omega=10.0)
Choose an EUV sub-band with band
Leuv(..., band=...) supports:
- band=0 β 10β92 nm (total EUV)
- band=1 β 10β36 nm (EUV1)
- band=2 β 36β92 nm (EUV2)
import mors
Leuv_total = mors.Leuv(Mstar=1.0, Age=5000.0, Omega=10.0, band=0)
Leuv1 = mors.Leuv(Mstar=1.0, Age=5000.0, Omega=10.0, band=1)
Leuv2 = mors.Leuv(Mstar=1.0, Age=5000.0, Omega=10.0, band=2)
Step 3: Add variability/scatter (optional)
MORS provides random scatter terms intended to represent variability as a log-normal scatter.
X-ray scatter (XrayScatter)
You pass the mean value (e.g., Lx) and get a delta to add:
import mors
Lx = mors.Lx(Mstar=1.0, Age=5000.0, Omega=10.0)
dLx = mors.XrayScatter(Lx)
Lx_scattered = Lx + dLx
You can also pass Fx or Rx and receive dFx / dRx.
Full XUV scatter (XUVScatter)
XUVScatter takes the dictionary from Lxuv and returns a dictionary of deltas with the same keys:
import mors
xuv = mors.Lxuv(Mstar=1.0, Age=5000.0, Omega=10.0)
dxuv = mors.XUVScatter(xuv)
# Example: apply deltas to get one scattered realization
xuv_scattered = {k: xuv[k] + dxuv[k] for k in xuv}
Controlling the scatter width: the X-ray scatter width is controlled by sigmaXray in the parameters file. You can override it by passing a custom params dictionary (see the parameter how-to):
import mors
params = mors.NewParams(sigmaXray=0.3) # example value
Lx = mors.Lx(Mstar=1.0, Age=5000.0, Omega=10.0, params=params)
dLx = mors.XrayScatter(Lx, params=params) if "params" in mors.XrayScatter.__code__.co_varnames else mors.XrayScatter(Lx)
XrayScatter does not accept params directly, set sigmaXray via your model run parameters and use it consistently.)
Step 4: Get detailed diagnostics (ExtendedQuantities)
If you need additional model internals (stellar properties, wind quantities, magnetic fields, torques), call ExtendedQuantities with envelope and core rotation rates:
import mors
q = mors.ExtendedQuantities(Mstar=1.0, Age=5000.0, OmegaEnv=10.0, OmegaCore=10.0)
print(list(q))
Common pitfalls
- Donβt mix
Omega(Ξ©β) andProt(days) in the same call; pick one rotation representation. - Scatter functions are random; results differ each run unless you control the random seed in your workflow.
ExtendedQuantitiesrequires bothOmegaEnvandOmegaCore.