From ed5e4980cd4db745ae43fc1ca26b0b9f135c2820 Mon Sep 17 00:00:00 2001 From: Nicolas Mounet Date: Tue, 3 Nov 2020 17:32:06 +0100 Subject: [PATCH] Avoid dependency of Expiration aerosols on particle_sizes order, in cara/models.py --- cara/models.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cara/models.py b/cara/models.py index b74cdcf2..95aabe08 100644 --- a/cara/models.py +++ b/cara/models.py @@ -221,11 +221,9 @@ class Expiration: def volume(diameter): return (4 * np.pi * (diameter/2)**3) / 3 total = 0 - for i, (diameter, factor) in enumerate(zip(self.particle_sizes, self.ejection_factor)): + for diameter, factor in zip(self.particle_sizes, self.ejection_factor): contribution = volume(diameter) * factor - if i >= 2: - # TODO: It is probably the case that this term comes from the - # particle diameter, rather than arbitrary position in a sequence... + if diameter >= 3e-4: contribution = contribution * (1 - mask.exhale_efficiency) total += contribution return total