tardis.model.density module¶
- class tardis.model.density.HomologousDensity(*args, **kwargs)[source]¶
- Bases: - tardis.io.util.HDFWriterMixin- A class that holds an initial density and time - Parameters
- density_0astropy.units.Quantity
- time_0astropy.units.Quantity
 
 - calculate_density_at_time_of_simulation(time_explosion)[source]¶
- Scale - density_0from an- time_0to the- time_explosionby ^-3- Parameters
- time_explosionastropy.units.Quantity
 
- Returns
- astropy.units.Quantity
 
 
 - classmethod from_config(config)[source]¶
- Create a new HomologousDensity instance from a Configuration object. - Parameters
- configtardis.io.config_reader.Configuration
 
- Returns
- HomologousDensity
 
 
 - classmethod from_csvy(config, csvy_model_config)[source]¶
- Create a new HomologousDensity instance from a base Configuration object and a csvy model Configuration object. - Parameters
- configtardis.io.config_reader.Configuration
- csvy_model_configtardis.io.config_reader.Configuration
 
- Returns
- HomologousDensity
 
 
 - hdf_properties = ['density_0', 'time_0']¶
 
- tardis.model.density.calculate_density_after_time(densities, time_0, time_explosion)[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_density
 
 
- tardis.model.density.calculate_exponential_density(velocities, velocity_0, rho_0)[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.model.density.calculate_power_law_density(velocities, velocity_0, rho_0, exponent)[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