Derivative class for stellar quantities which are interpolated age, mass and [Fe/H]. More...
#include <InterpolatedDerivatives.h>
Public Member Functions | |
InterpolatedDerivatives (double mass, double feh, std::vector< const FunctionDerivatives *> *derivatives, const alglib::real_1d_array &interp_masses, const alglib::real_1d_array &interp_feh, double age=NaN, bool log_quantity=false, bool delete_derivatives=false) | |
Create an object that interpolates derivatives from evolution tracks. More... | |
~InterpolatedDerivatives () | |
Deletes the interpolation data if so specified on creation. More... | |
Public Member Functions inherited from StellarEvolution::LogDerivatives | |
LogDerivatives (double x=NaN, bool log_y=false) | |
Create a derivative for possibly log(functions) of possibly log(arg). More... | |
double | order (unsigned deriv_order=1) const |
Returns the deriv_order-th derivative of the quantity. More... | |
Public Member Functions inherited from Core::FunctionDerivatives | |
virtual | ~FunctionDerivatives () |
Clean up. More... | |
Protected Member Functions | |
double | calc_deriv (unsigned deriv_order) const |
Returns the deriv_order-th derivative of the quantity. More... | |
Private Attributes | |
double | __stellar_mass |
The mass to interpolate to in \(M_\odot\). More... | |
double | __stellar_feh |
The [Fe/H] to interpolate to. More... | |
std::vector< const FunctionDerivatives * > * | __interp_deriv |
The age derivatives for each stellar model. More... | |
const alglib::real_1d_array & | __interp_masses |
The masses of the stelar models in \(M_\odot\). More... | |
const alglib::real_1d_array & | __interp_feh |
The [Fe/H] of the stellar models. More... | |
bool | __delete_derivatives |
Whether to delete the derivatives it was created with. More... | |
Derivative class for stellar quantities which are interpolated age, mass and [Fe/H].
Definition at line 16 of file InterpolatedDerivatives.h.
StellarEvolution::InterpolatedDerivatives::InterpolatedDerivatives | ( | double | mass, |
double | feh, | ||
std::vector< const FunctionDerivatives *> * | derivatives, | ||
const alglib::real_1d_array & | interp_masses, | ||
const alglib::real_1d_array & | interp_feh, | ||
double | age = NaN , |
||
bool | log_quantity = false , |
||
bool | delete_derivatives = false |
||
) |
Create an object that interpolates derivatives from evolution tracks.
The input grid of derivatives may be of quantity of log(quantity) vs. age or log(age). The returned derivatives are always of quantity vs age (no log of anything).
mass | The stellar mass at which to evaluate the interpolated derivatives. |
feh | The stellar [Fe/H] at which to evaluate the interpolated derivatives. |
derivatives | The derivatives at each grid intersection. |
interp_masses | The masses of the grid intersections. |
interp_feh | The sorted [Fe/H] of the grid intersections. |
age | If not NaN, derivatives are assumed to calculate derivatives w.r.t. ln(age), whereas this object always returns derivatives w.r.t. age. |
log_quantity | Are derivatives of log(quantity) instead of quantity? |
delete_derivatives | Should derivatives be deleted when this object is destroyed? |
Definition at line 22 of file InterpolatedDerivatives.cpp.
|
inline |
Deletes the interpolation data if so specified on creation.
Definition at line 80 of file InterpolatedDerivatives.h.
|
protectedvirtual |
Returns the deriv_order-th derivative of the quantity.
Implements StellarEvolution::LogDerivatives.
Definition at line 6 of file InterpolatedDerivatives.cpp.
|
private |
Whether to delete the derivatives it was created with.
Definition at line 37 of file InterpolatedDerivatives.h.
|
private |
The age derivatives for each stellar model.
Definition at line 26 of file InterpolatedDerivatives.h.
|
private |
The [Fe/H] of the stellar models.
Definition at line 31 of file InterpolatedDerivatives.h.
|
private |
The masses of the stelar models in \(M_\odot\).
Definition at line 31 of file InterpolatedDerivatives.h.
|
private |
The [Fe/H] to interpolate to.
Definition at line 20 of file InterpolatedDerivatives.h.
|
private |
The mass to interpolate to in \(M_\odot\).
Definition at line 20 of file InterpolatedDerivatives.h.