diff --git a/tardis/model/base.py b/tardis/model/base.py index 2d2d1d25b14..af0a62e8257 100644 --- a/tardis/model/base.py +++ b/tardis/model/base.py @@ -24,68 +24,6 @@ logger = logging.getLogger(__name__) -class ModelState: - """ - Store Model State Information. - - Parameters - ---------- - v_inner : astropy.units.quantity.Quantity - v_outer : astropy.units.quantity.Quantity - r_inner : astropy.units.quantity.Quantity - r_outer : astropy.units.quantity.Quantity - density : astropy.units.quantity.Quantity - time_explosion : astropy.units.quantity.Quantity - - Attributes - ---------- - geometry : pd.DataFrame - DataFrame storing `v_inner`, `v_outer`, `r_inner` and `r_outer`. - geometry_units : dict - Units of arrays stored in the `geometry` dataframe. - """ - - def __init__( - self, v_inner, v_outer, r_inner, r_outer, time_explosion, density - ): - self.time_explosion = time_explosion - self.density = density - self.geometry = pd.DataFrame( - { - "v_inner": v_inner.value, - "r_inner": r_inner.value, - "v_outer": v_outer.value, - "r_outer": r_outer.value, - } - ) - self.geometry_units = { - "v_inner": v_inner.unit, - "r_inner": r_inner.unit, - "v_outer": v_outer.unit, - "r_outer": r_outer.unit, - } - - @property - def v_inner(self): - """Inner boundary velocity.""" - return self.geometry.v_inner.values * self.geometry_units["v_inner"] - - @property - def r_inner(self): - """Inner radius of model shells.""" - return self.geometry.r_inner.values * self.geometry_units["r_inner"] - - @property - def v_outer(self): - """Outer boundary velocity.""" - return self.geometry.v_outer.values * self.geometry_units["v_outer"] - - @property - def r_outer(self): - """Outer radius of model shells.""" - return self.geometry.r_outer.values * self.geometry_units["r_outer"] - - class Radial1DGeometry: """ Holds information about model geometry for radial 1D models. @@ -96,6 +34,11 @@ class Radial1DGeometry: r_outer : astropy.units.quantity.Quantity v_inner : astropy.units.quantity.Quantity v_outer : astropy.units.quantity.Quantity + + Attributes + ---------- + volume : astropy.units.quantity.Quantity + Volume in each shell """ def __init__(self, r_inner, r_outer, v_inner, v_outer): @@ -106,6 +49,7 @@ def __init__(self, r_inner, r_outer, v_inner, v_outer): @property def volume(self): + """Volume in shell computed from r_outer and r_inner""" return (4.0 / 3) * np.pi * (self.r_outer**3 - self.r_inner**3) @@ -162,7 +106,7 @@ def elemental_number_density(self): ) -class ModelState_Experimental: +class ModelState: """ Holds information about model geometry for radial 1D models. @@ -348,7 +292,7 @@ def __init__( v_inner=v_inner, v_outer=v_outer, ) - self.model_state = ModelState_Experimental( + self.model_state = ModelState( composition=composition, geometry=geometry, time_explosion=self.time_explosion,