tardis.io.model.readers.generic_readers module

exception tardis.io.model.readers.generic_readers.ConfigurationError[source]

Bases: Exception

tardis.io.model.readers.generic_readers.read_csv_composition(fname, delimiter='\\s+')[source]

Read composition from a simple CSV file

The CSV file can contain specific isotopes or elemental mass fractions in the different columns. The first row must contain the header in which the contents of each column is specified by the elemental symbol (for elemental mass fractions) or by the symbol plus mass number (for isotopic mass fractions).

Example: C O Fe Ni56 Co

The i-th row specifies the composition in the i-th shell

fnamestr

filename of the csv file

tardis.io.model.readers.generic_readers.read_simple_ascii_density(fname: Any) Tuple[Quantity, Quantity, Quantity][source]

Reading a density file of the following structure (example; lines starting with a hash will be ignored): The first density describes the mean density in the center of the model and is not used. 5 s #index velocity [km/s] density [g/cm^3] 0 1.1e4 1.6e8 1 1.2e4 1.7e8

Parameters:
fnamestr

filename or path with filename

Returns:
time_of_modelastropy.units.Quantity

time at which the model is valid

velocityu.Quantity

velocity

mean_density: u.Quantity

mean density

tardis.io.model.readers.generic_readers.read_simple_ascii_mass_fractions(fname)[source]

Reading a mass fraction file of the following structure (example; lines starting with hash will be ignored): The first line of mass fractions describe the mass fractions in the center of the model and are not used. #index element1, element2, …, element30 0 0.4 0.3, .. 0.2

Parameters:
fnamestr

filename or path with filename

Returns:
indexnp.ndarray

containing the indices

mass_fractionspandas.DataFrame

data frame containing index, element1 - element30 and columns according to the shells

tardis.io.model.readers.generic_readers.read_uniform_mass_fractions(mass_fractions_section, no_of_shells)[source]
Parameters:
mass_fractions_sectionconfig.model.abundances
no_of_shellsint
Returns:
mass_fractionspandas.DataFrame
isotope_mass_fractionspandas.DataFrame