Lugaro nucleosynthesis models
Model reader for Maria Lugaro's AGB star files.
Import as:
label_latex_mass(fname, prec=1)
Create a LaTeX label for only mass.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fname
|
str
|
Filename of data file. |
required |
prec
|
int
|
Precision of return value (at most). |
1
|
Returns:
| Type | Description |
|---|---|
str
|
LaTeX label. |
Source code in src/rttools/nucmod/lugaro.py
label_latex_mass_z(fname, prec=2)
Create a LaTeX label for mass and metallicity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fname
|
str
|
Filename of data file. |
required |
prec
|
int
|
Precision of return value (at most). |
2
|
Returns:
| Type | Description |
|---|---|
str
|
LaTeX label. |
Source code in src/rttools/nucmod/lugaro.py
label_latex_mass_z_pmz(fname, prec=2)
Create a LaTeX label for mass, metallicity, and PMZ.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fname
|
str
|
Filename of data file. |
required |
prec
|
int
|
Precision of return value (at most). |
2
|
Returns:
| Type | Description |
|---|---|
str
|
LaTeX label. |
Source code in src/rttools/nucmod/lugaro.py
label_parser(fname)
Parse a filename and return properties of star.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fname
|
str
|
File name (with or without ".dat") |
required |
Returns:
| Type | Description |
|---|---|
Tuple[float, float, float, bool]
|
Mass (M_sun), Metallicity (Z_sun), PMZ, st-case |
Source code in src/rttools/nucmod/lugaro.py
plot_mod(ax, fname, xdat_col, ydat_col, co_ratio_col=0, marker='o', color='tab:blue', label=None, linestyle='-', **kwargs)
Plot Lugaro Model curve onto a plot.
Note that **kwargs are passed along to both plotting routines. For C/O < 1, the marker is set to 'None'.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ax
|
Axes
|
Matplotlib axis to plot on. |
required |
fname
|
Path
|
Filename of model data file |
required |
xdat_col
|
int
|
Number of column to plot on x-axis |
required |
ydat_col
|
int
|
Number of column to plot on y-axis |
required |
co_ratio_col
|
int
|
Number of column for CO ratio (defaults to 0) |
0
|
marker
|
str
|
Marker of the plot, defaults to 'o' |
'o'
|
color
|
str
|
Color of the plot, defaults to 'tab:blue' |
'tab:blue'
|
linestyle
|
str
|
Linestyle of the plot, defaults to '-' |
'-'
|
Returns:
| Type | Description |
|---|---|
None
|
Nothing |
Source code in src/rttools/nucmod/lugaro.py
reader(fname, cols=None)
Read a Lugaro ABG star file and return it.
In these files, the first column is generally the model number. Subsequent columns are labeled with integers, starting at zero. In my experience, column 0 is generally the C/O ratio. Subsequent columns are delta-values of specific isotope ratios.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fname
|
Path
|
Filename of file to read |
required |
cols
|
List[str]
|
Optional, headers for the columns starting with integers. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Data Frame of the whole file, with columns as headers if given. |