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 abundances 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 abundances) or by the symbol plus mass number (for isotopic abundances).

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_abundances(fname)[source]

Reading an abundance file of the following structure (example; lines starting with hash will be ignored): The first line of abundances describe the abundances 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

abundancespandas.DataFrame

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

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_uniform_abundances(abundances_section, no_of_shells)[source]
Parameters
abundances_sectionconfig.model.abundances
no_of_shellsint
Returns
abundancepandas.DataFrame
isotope_abundancepandas.DataFrame