From d1c2ecb4e6f41bc8cba93751ca30c9b973a45a2b Mon Sep 17 00:00:00 2001 From: yanitski Date: Tue, 30 Jul 2024 15:03:20 +0200 Subject: [PATCH] fix error in volume-filling factor * should be working now --- kosmatau3d/models/voxel.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/kosmatau3d/models/voxel.py b/kosmatau3d/models/voxel.py index 3e1d370..2e3366c 100644 --- a/kosmatau3d/models/voxel.py +++ b/kosmatau3d/models/voxel.py @@ -513,13 +513,23 @@ def set_properties( / 100**3 for ens in range(len(constants.clump_mass_number)) ] - self.__volume_factor = volume_factor - if isinstance(ensemble_density, (list, tuple, np.ndarray)): - self.__ensemble_density = ensemble_density else: - self.__ensemble_density = [ensemble_density] * len( - constants.clump_mass_number - ) + if isinstance(ensemble_density, (list, tuple, np.ndarray)): + self.__ensemble_density = ensemble_density + else: + self.__ensemble_density = [ensemble_density] * len( + constants.clump_mass_number + ) + self.__volume_factor = [ + self.__ensemble_mass[ens] + * constants.mass_solar + / self.__ensemble_density[ens] + / constants.mass_h + / constants.voxel_size**3 + / constants.pc**3 + / 100**3 + for ens in range(len(constants.clump_mass_number)) + ] if isinstance(fuv, (list, tuple, np.ndarray)): self.__fuv = fuv