FRUITY model handlers
Handler for FRUITY model files (from http://fruity.oa-teramo.inaf.it/).
This module provides some functions to work with the FRUITY nucleosynthesis models.
Import as:
drop_a_z(df)
Drop columns for A and Z for a dataframe.
Leaves only columns with compositions over from a FRUITY dataframe and removes columns labeled "A" and "Z". If these columns don't exist, no error will be raised.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
FRUITY dataframe with columns "A" and "Z" present. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
same dataframe with those vectors dropped. |
Source code in src/rttools/nucmod/fruity.py
get_delta_isoratio(fname, iso1, iso2, norm_self=False)
Take a FRUITY file and return delta values for one isotope ratio.
Delta will be calculated with respect to current iniabu default database. The ratio is going to be iso1/iso2. Initial and first dredge up (FDU) columns are returned as well.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fname
|
Path
|
FRUITY file name. |
required |
iso1
|
str
|
Nominator isotope, any |
required |
iso2
|
str
|
Denominator isotope, any |
required |
norm_self
|
bool
|
Norm to itself, i.e., to the initial composition instead of using standard database by |
False
|
Returns:
| Type | Description |
|---|---|
Series
|
Series with delta ratio of the two. |
Source code in src/rttools/nucmod/fruity.py
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/fruity.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/fruity.py
label_latex_mass_z_pocket(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/fruity.py
label_latex_mass_z_pocket_rot(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/fruity.py
label_parser(fname)
Label parser for FRUITY models.
Take a FRUITY filename and return various parameters as numbers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fname
|
Union[str, Path]
|
File name of the FRUITY file. |
required |
Returns:
| Type | Description |
|---|---|
Tuple[float, float, float, str]
|
Mass (M_sun), Metallicity (Z_sun), Rotation (km/s), C13 pocket (std / ext) |
Source code in src/rttools/nucmod/fruity.py
make_fruity_isoname(iso)
Pass an isotope through iniabu and then parse a FRUITY isotope name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
iso
|
str
|
Isotope, e.g., "28Si", "Si-28", "Si28" |
required |
Returns:
| Type | Description |
|---|---|
str
|
FRUITY name, e.g., "Si28" |
Source code in src/rttools/nucmod/fruity.py
plot_mod(ax, fname, xisos, yisos, norm_self=False, marker='o', color='tab:blue', label=None, linestyle='-', **kwargs)
Plot FRUITY 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 |
xisos
|
Tuple[str, str]
|
Tuple of two isotopes (nominator, denominator) for x axis. |
required |
yisos
|
Tuple[str, str]
|
Tuple of two isotopes (nominator, denominator) for y axis. |
required |
norm_self
|
bool
|
Norm to itself, i.e., to the initial composition instead of using standard database by |
False
|
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/fruity.py
reader(fname)
Read in a FRUITY file and return values as DataFrame.