Stellar models#
- class mascaret.StellarModel(logs_dir=None, num_profile=None, filename=None, interpolation=None, preserve_original_datapoints=True, kind='linear', remove_atmosphere=False, add_kappa_rad=False, add_micro_viscosity=False, rot_solar_rate=0, vanishing_rotation=False, convective_neutral=True, add_centre=True)#
Class containing profiles and information read and computed from an input MESA model.
- __init__(logs_dir=None, num_profile=None, filename=None, interpolation=None, preserve_original_datapoints=True, kind='linear', remove_atmosphere=False, add_kappa_rad=False, add_micro_viscosity=False, rot_solar_rate=0, vanishing_rotation=False, convective_neutral=True, add_centre=True)#
Initialise a
StellarModelobject, including necessary quantities to compute mode eigenfunctions. Eitherfilenameshould be provided, or bothlogs_dirandnum_profile. The MESA computed profiles should include the following quantities:R,Rho,mass,g,brunt_N2,T,P,csound. Ifadd_micro_viscosityis set toTrue,x_mass_fraction_Hshould also be included. Ifadd_kappa_radis set toTrue,cpandopacityshould also be included.- Parameters:
logs_dir (str or Path) – Directory with MESA logs. Optional, default
None.num_profile (int) – Profile index in
logs_dir. Optional, defaultNone.filename (str or Path object) – Filename of the profile. Will be used instead of
logs_dirandnum_profileif provided. Optional, defaultNone.interpolation (int) – Number of points on which to interpolate the profiles. Optional, default
None.kind (str) – Type of interpolation. Optional, default
linear.preserve_original_datapoints (bool) – If
Trueandinterpolationis notNone, the original data points of the radial profile will be conserved together with the interpolated points.remove_atmosphere (bool) – If
True, the region with positive Brunt-Vaisala frequency above the convective envelope will be removed. Optional, defaultFalse.add_kappa_rad (bool) – If
True, the thermal radiativity coefficientkappa_radwill be computed among other profiles. Optional, defaultFalse.add_kappa_rad – If
True, the microscopic viscosity will be computed among other profiles. Optional, defaultFalse.rot_solar_rate (float or ndarray) – Stellar rotation frequency, in solar rotation units. It can be an array with the same number of elements as the stellar profile. Optional, default
0.vanishing_rotation (bool) – If
True, the rotation profile vanishes following an exponential decay close to the centre. Optional, defaultTrue.convective_neutral (bool) – If
True, the square of the Brunt-Väisälä frequency will be set to zero where N2<0 (neutral stratification), otherwise the input value of the model will be conserved. Optional, defaultTrue.add_centre (bool) – If
True, add ax=0central point to the model. Optional, defaultTrue.
- compute_adimensioned_quantities(omega=None, omega_ad=None, add_centre=True)#
Add adimensioned quantities to model. Note that some of the quantities are computed with respect to a characteristic frequency (provided through
omegaoromega_ad) which can be e.g. the frequency of an eigenmode.- Parameters:
omega (float) – Characteristic frequency, in rad.s-1. Optional, default
None.omega_ad (float) – Adimensioned characteristic frequency. Optional, default
None. Will be considered rather thanomegaif provided.add_centre (bool) – If
True, add a central pointx=0to the stellar profiles. Optional, defaultTrue.
- compute_model_properties(add_kappa_rad=False, add_micro_viscosity=False, interpolation=None, preserve_original_datapoints=True, remove_atmosphere=False, convective_neutral=True, kind='linear', rot_solar_rate=0, vanishing_rotation=False, add_centre=True)#
Compute model base properties after profile quantities have been loaded.
- compute_omega_critic(rot_solar_rate=0, l=1)#
Compute critical frequency for mode damping.
- compute_rotation_profile(rot_solar_rate=0, vanishing_rotation=False, x0=0.0001, a=1)#
Compute stellar rotation profile and the corresponding zeta profile (2*Omega + r*dOmega/dr), as well as their adimensioned counterparts.
- Parameters:
rot_solar_rate (float or ndarray) – Stellar rotation frequency, in solar rotation units. It can be an array with the same number of elements as the stellar profile. Optional, default
0.x0 (float) – Characteristic radius where the rotation profile starts to decay (this is done to enforce the regularisation condition at
x=0).vanishing_rotation (bool) – If
True, the rotation profile vanishes following an exponential decay close to the centre.a (float) – Exponent controlling the decay rate of the rotation profile.
- Returns:
The computed rotation profile and the zeta profile, followed by their adimensioned counterparts.
- Return type:
tuple of ndarray
- load_mesa_model(logs_dir=None, num_profile=None, filename=None, add_kappa_rad=False, add_micro_viscosity=False)#
Load MESA model.
- make_interpolation(interpolation, preserve_original_datapoints=True, kind='linear')#
Interpolate quantities with a radial dependence.
- truncate_model(x_span)#
Truncate model according to a new
x_span.
- mascaret.load_example_profile(interpolation=None, remove_atmosphere=False, convective_neutral=False, add_kappa_rad=False, add_micro_viscosity=False, rot_solar_rate=0, add_centre=True, vanishing_rotation=True)#
Load example profile that is included with the module (1 solar mass star at metallicity Z = 0.02124).
- class mascaret.MESAModel(logs_dir=None, num_profile=None, filename=None, interpolation=None, preserve_original_datapoints=True, kind='linear', remove_atmosphere=False, add_kappa_rad=False, add_micro_viscosity=False, rot_solar_rate=0, vanishing_rotation=False, convective_neutral=True, add_centre=True)#
An alias name for the
StellaModelclass.
- class mascaret.SolarModel(interpolation=None, preserve_original_datapoints=True, kind='linear', remove_atmosphere=False, add_kappa_rad=False, add_micro_viscosity=False, rot_solar_rate=0, vanishing_rotation=False, convective_neutral=True, add_centre=True)#
Class containing standard solar model (S model) structure informations.
More information about the S model can be found at: https://users-phys.au.dk/jcd/solar_models.
- __init__(interpolation=None, preserve_original_datapoints=True, kind='linear', remove_atmosphere=False, add_kappa_rad=False, add_micro_viscosity=False, rot_solar_rate=0, vanishing_rotation=False, convective_neutral=True, add_centre=True)#
Initialise a
SolarModelobject from a standard solar model, including necessary quantities to compute mode eigenfunctions.- Parameters:
interpolation (int) – Number of points on which to interpolate the profiles. Optional, default
None.kind (str) – Type of interpolation. Optional, default
linear.preserve_original_datapoints (bool) – If
Trueandinterpolationis notNone, the original data points of the radial profile will be conserved together with the interpolated points.remove_atmosphere (bool) – If
True, the region with positive Brunt-Vaisala frequency above the convective envelope will be removed. Optional, defaultFalse.add_kappa_rad (bool) – If
True, the thermal radiativity coefficientkappa_radwill be computed among other profiles. Optional, defaultFalse.add_kappa_rad – If
True, the microscopic viscosity will be computed among other profiles. Optional, defaultFalse.rot_solar_rate (float or ndarray) – Stellar rotation frequency, in solar rotation units. It can be an array with the same number of elements as the stellar profile. Optional, default
0.vanishing_rotation (bool) – If
True, the rotation profile vanishes following an exponential decay close to the centre. Optional, defaultTrue.convective_neutral (bool) – If
True, the square of the Brunt-Väisälä frequency will be set to zero where N2<0 (neutral stratification), otherwise the input value of the model will be conserved. Optional, defaultTrue.add_centre (bool) – If
True, add ax=0central point to the model. Optional, defaultTrue.
- load_standard_solar_model()#
Load standard solar model (S model) structure informations.
- class mascaret.CustomModel(profiles, interpolation=None, preserve_original_datapoints=True, kind='linear', remove_atmosphere=False, add_kappa_rad=False, add_micro_viscosity=False, rot_solar_rate=0, vanishing_rotation=True, convective_neutral=False, add_centre=True)#
Class allowing the user to create and manipulate a custom structure model.
- __init__(profiles, interpolation=None, preserve_original_datapoints=True, kind='linear', remove_atmosphere=False, add_kappa_rad=False, add_micro_viscosity=False, rot_solar_rate=0, vanishing_rotation=True, convective_neutral=False, add_centre=True)#
Initialise a
CustomModelobject from a dictionary of profiles provided by the user.- Parameters:
profiles (dict) – A dictionary with the structure profiles and additional attributes of the model. Mandatory entries for the model are:
r(radius in cm),rho(density ing/cm**3),Mr(internal mass at given radius, in g),g(gravity acceleration incm/s**2),N2(square of the Brunt-Väisälä frequency in(rad/s)**2),T(temperature inK),P(pressure inBa),cs(sound speed incm/s). Ifadd_kappa_radis set toTrue, providingopacityandcpis also mandatory. Ifadd_micro_viscosity, providingx_H(hydrogen mass fraction) is also mandatory.interpolation (int) – Number of points on which to interpolate the profiles. Optional, default
None.kind (str) – Type of interpolation. Optional, default
linear.preserve_original_datapoints (bool) – If
Trueandinterpolationis notNone, the original data points of the radial profile will be conserved together with the interpolated points.remove_atmosphere (bool) – If
True, the region with positive Brunt-Vaisala frequency above the convective envelope will be removed. Optional, defaultFalse.add_kappa_rad (bool) – If
True, the thermal radiativity coefficientkappa_radwill be computed among other profiles. Optional, defaultFalse.add_kappa_rad – If
True, the microscopic viscosity will be computed among other profiles. Optional, defaultFalse.rot_solar_rate (float or ndarray) – Stellar rotation frequency, in solar rotation units. It can be an array with the same number of elements as the stellar profile. Optional, default
0.vanishing_rotation (bool) – If
True, the rotation profile vanishes following an exponential decay close to the centre. Optional, defaultTrue.convective_neutral (bool) – If
True, the square of the Brunt-Väisälä frequency will be set to zero where N2<0 (neutral stratification), otherwise the input value of the model will be conserved. Optional, defaultTrue.add_centre (bool) – If
True, add ax=0central point to the model. Optional, defaultTrue.