From a1c6a431af8b51e3b04fe1ae9435a5c176bfb22f Mon Sep 17 00:00:00 2001 From: markus Date: Thu, 4 Feb 2021 13:52:19 +0100 Subject: [PATCH] update concentration plot --- cara/montecarlo.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cara/montecarlo.py b/cara/montecarlo.py index 2af51f42..de0da6bf 100644 --- a/cara/montecarlo.py +++ b/cara/montecarlo.py @@ -410,9 +410,18 @@ def present_model(model: MCConcentrationModel, bins: int = 30) -> None: axs[0, 0].set_title('Viral load in sputum') axs[0, 0].set_xlabel('Viral load [log10(RNA copies / mL)]') - ds = np.linspace(0.1, 30, 2000) - concentrations = model.infected._concentration_distribution()(ds) - axs[0, 1].plot(ds, concentrations) + ds = np.linspace(0.1, 15, 2000) + unmasked = model.infected._concentration_distribution_without_mask()(ds) + masked = model.infected._concentration_distribution_with_mask()(ds) + if model.infected.masked: + axs[0, 1].plot(ds, masked, 'g', label="With mask") + axs[0, 1].plot(ds, unmasked, 'r--', label="Without mask") + axs[0, 1].legend(loc="upper right") + else: + axs[0, 1].plot(ds, masked, 'g--', label="With mask") + axs[0, 1].plot(ds, unmasked, 'r', label="Without mask") + axs[0, 1].legend(loc="upper right") + axs[0, 1].set_title(r'Particle concentration vs diameter') axs[0, 1].set_ylabel('Concentration [cm^-3]') axs[0, 1].set_xlabel(r'Diameter [$\mu$m]')