tardis.io.model.parse_density_configuration module¶
- tardis.io.model.parse_density_configuration.calculate_density_after_time(densities: Quantity, time_0: Quantity, time_explosion: Quantity) Quantity[source]¶
 scale the density from an initial time of the model to the time of the explosion by ^-3
- Parameters:
 - densitiesastropy.units.Quantity
 densities
- time_0astropy.units.Quantity
 time of the model
- time_explosionastropy.units.Quantity
 time to be scaled to
- Returns:
 - scaled_densityastropy.units.Quantity
 in g / cm^3
- tardis.io.model.parse_density_configuration.calculate_exponential_density(velocities: Quantity, velocity_0: Quantity, rho_0: Quantity) Quantity[source]¶
 This function computes the exponential density profile. \(\rho = \rho_0 \times \exp \left( -\frac{v}{v_0} \right)\)
- Parameters:
 - velocitiesastropy.Quantity
 Array like velocity profile
- velocity_0astropy.Quantity
 reference velocity
- rho_0astropy.Quantity
 reference density
- Returns:
 - densitiesastropy.Quantity
 
- tardis.io.model.parse_density_configuration.calculate_power_law_density(velocities: Quantity, velocity_0: Quantity, rho_0: Quantity, exponent: float) Quantity[source]¶
 This function computes a descret exponential density profile. \(\rho = \rho_0 \times \left( \frac{v}{v_0} \right)^n\)
- Parameters:
 - velocitiesastropy.Quantity
 Array like velocity profile
- velocity_0astropy.Quantity
 reference velocity
- rho_0astropy.Quantity
 reference density
- exponentfloat
 exponent used in the powerlaw
- Returns:
 - densitiesastropy.Quantity
 
- tardis.io.model.parse_density_configuration.parse_density_from_csvy(csvy_model_config, csvy_model_data, time_explosion)[source]¶
 Parse the density data from a CSVY model.
- Parameters:
 - csvy_model_configobject
 The configuration data of the CSVY model.
- csvy_model_dataobject
 The data of the CSVY model.
- time_explosionfloat
 The time of the explosion.
- Returns:
 - densityobject
 The parsed density data.
- Raises:
 - None.
 
Notes
This function parses the density data from a CSVY model. If the CSVY model configuration contains a ‘density’ attribute, it uses the ‘parse_csvy_density’ function to parse the density data. Otherwise, it calculates the density data using the ‘calculate_density_after_time’ function. The parsed density data is returned.
- tardis.io.model.parse_density_configuration.parse_density_section_config(density_configuration: ConfigurationNameSpace, v_middle: Quantity, time_explosion: Quantity) Tuple[Quantity, Quantity][source]¶
 Parse the density section of the configuration file and produce a density at time_explosion.
- Parameters:
 - density_configurationtardis.io.config_reader.Configuration
 - v_middleastropy.Quantity
 middle of the velocity bins
- time_explosionastropy.Quantity
 time of the explosion
- Returns:
 - density_0astropy.Quantity
 density at time_0
- time_0astropy.Quantity
 time of the density profile
- tardis.io.model.parse_density_configuration.parse_density_section_csvy(csvy_model_config: Configuration, time_explosion: Quantity) Quantity[source]¶
 Parse the density section of the csvy file and produce a density at time_explosion.
- Parameters:
 - configtardis.io.config_reader.Configuration
 - csvy_model_configtardis.io.config_reader.Configuration
 
- Returns:
 - density: u.Quantity