tardis.io.model.readers.snec.snec_input module

class tardis.io.model.readers.snec.snec_input.SNECIsotopeProfile(enclosed_mass: ndarray, radius: ndarray, isotope_mass_fraction: DataFrame)[source]

Bases: object

Data class representing an isotope profile from SNEC output.

Attributes:
enclosed_massnp.ndarray

Array of enclosed mass values (with astropy units).

radiusnp.ndarray

Array of radius values (with astropy units).

isotope_mass_fractionpd.DataFrame

DataFrame of isotope mass fractions, indexed by cell and columns as isotopes.

enclosed_mass: ndarray
isotope_mass_fraction: DataFrame
radius: ndarray
to_xr_array() DataArray[source]
Convert the isotope mass fractions into a 2D DataArray with dimensions:
  • cell_id

  • isotope

and attach radius and enclosed_mass as coordinates on cell_id.

Returns:
xr.DataArray

2D DataArray of isotope mass fractions with coordinates for radius and enclosed mass.

tardis.io.model.readers.snec.snec_input.read_snec_isotope_profile(file_path: str) SNECIsotopeProfile[source]

Read a SNEC isotope profile file and return a SNECIsotopeProfile object.

Parameters:
file_pathstr

Path to the SNEC isotope profile file.

Returns:
SNECIsotopeProfile

Parsed isotope profile data.