Merge branch 'feature/virions_plot' of https://gitlab.cern.ch/cara/cara into feature/virions_plot
This commit is contained in:
commit
fe00584c89
3 changed files with 19 additions and 18 deletions
|
|
@ -29,7 +29,7 @@ yann_er = [8396.78166, 45324.55964, 400054.0827]
|
|||
######### Standard exposure models ###########
|
||||
|
||||
######### Breathing model ###########
|
||||
def breathing_exposure():
|
||||
def breathing_exposure(activity: str):
|
||||
exposure_mc = mc.ExposureModel(
|
||||
concentration_model=mc.ConcentrationModel(
|
||||
room=models.Room(volume=100, humidity=0.5),
|
||||
|
|
@ -45,21 +45,21 @@ def breathing_exposure():
|
|||
),
|
||||
presence=mc.SpecificInterval(((0, 2),)),
|
||||
mask=models.Mask.types["No mask"],
|
||||
activity=activity_distributions['Seated'],
|
||||
activity=activity_distributions[activity],
|
||||
expiration=models.Expiration.types['Breathing'],
|
||||
),
|
||||
),
|
||||
exposed=mc.Population(
|
||||
number=14,
|
||||
presence=mc.SpecificInterval(((0, 2),)),
|
||||
activity=models.Activity.types['Seated'],
|
||||
activity=models.Activity.types[activity],
|
||||
mask=models.Mask.types["No mask"],
|
||||
),
|
||||
)
|
||||
return exposure_mc
|
||||
|
||||
######### Speaking model ###########
|
||||
def speaking_exposure():
|
||||
def speaking_exposure(activity: str):
|
||||
exposure_mc = mc.ExposureModel(
|
||||
concentration_model=mc.ConcentrationModel(
|
||||
room=models.Room(volume=100, humidity=0.5),
|
||||
|
|
@ -75,21 +75,21 @@ def speaking_exposure():
|
|||
),
|
||||
presence=mc.SpecificInterval(((0, 2),)),
|
||||
mask=models.Mask.types["No mask"],
|
||||
activity=activity_distributions['Seated'],
|
||||
activity=activity_distributions[activity],
|
||||
expiration=models.Expiration.types['Talking'],
|
||||
),
|
||||
),
|
||||
exposed=mc.Population(
|
||||
number=14,
|
||||
presence=mc.SpecificInterval(((0, 2),)),
|
||||
activity=models.Activity.types['Seated'],
|
||||
activity=models.Activity.types[activity],
|
||||
mask=models.Mask.types["No mask"],
|
||||
),
|
||||
)
|
||||
return exposure_mc
|
||||
|
||||
######### Shouting model ###########
|
||||
def shouting_exposure():
|
||||
def shouting_exposure(activity: str):
|
||||
exposure_mc = mc.ExposureModel(
|
||||
concentration_model=mc.ConcentrationModel(
|
||||
room=models.Room(volume=100, humidity=0.5),
|
||||
|
|
@ -105,14 +105,14 @@ def shouting_exposure():
|
|||
),
|
||||
presence=mc.SpecificInterval(((0, 2),)),
|
||||
mask=models.Mask.types["No mask"],
|
||||
activity=activity_distributions['Seated'],
|
||||
activity=activity_distributions[activity],
|
||||
expiration=models.Expiration.types['Shouting'],
|
||||
),
|
||||
),
|
||||
exposed=mc.Population(
|
||||
number=14,
|
||||
presence=mc.SpecificInterval(((0, 2),)),
|
||||
activity=models.Activity.types['Seated'],
|
||||
activity=models.Activity.types[activity],
|
||||
mask=models.Mask.types["No mask"],
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -29,11 +29,12 @@ print('\n<<<<<<<<<<< Vlout for Breathing, seated with chosen Cn,B >>>>>>>>>>>')
|
|||
#exposure_model_from_vl_breathing_cn()
|
||||
print('\n')
|
||||
|
||||
############ Plots with viral loads and emission rates ############
|
||||
#present_vl_er_histograms()
|
||||
############ Plots with viral loads and emission rates + statistical data ############
|
||||
present_vl_er_histograms(activity='Seated')
|
||||
present_vl_er_histograms(activity='Light activity')
|
||||
|
||||
############ CDFs for comparing the QR-Values in different scenarios ############
|
||||
generate_cdf_curves()
|
||||
#generate_cdf_curves()
|
||||
|
||||
############ Used for testing ############
|
||||
#exposure_model_from_vl_talking_new_points()
|
||||
|
|
|
|||
|
|
@ -257,9 +257,9 @@ def exposure_model_from_vl_talking_cn():
|
|||
############ Statistical Data ############
|
||||
|
||||
|
||||
def get_statistical_data():
|
||||
def get_statistical_data(activity: str):
|
||||
############ Breathing model ############
|
||||
exposure_mc = breathing_exposure()
|
||||
exposure_mc = breathing_exposure(activity)
|
||||
exposure_model = exposure_mc.build_model(size=SAMPLE_SIZE)
|
||||
emission_rate = exposure_model.concentration_model.infected.emission_rate_when_present(
|
||||
cn_B=0.06, cn_L=0.2)
|
||||
|
|
@ -268,7 +268,7 @@ def get_statistical_data():
|
|||
print_er_info(emission_rate, breathing_er)
|
||||
|
||||
############ Speaking model ############
|
||||
exposure_mc = speaking_exposure()
|
||||
exposure_mc = speaking_exposure(activity)
|
||||
exposure_model = exposure_mc.build_model(size=SAMPLE_SIZE)
|
||||
emission_rate = exposure_model.concentration_model.infected.emission_rate_when_present(
|
||||
cn_B=0.06, cn_L=0.2)
|
||||
|
|
@ -277,7 +277,7 @@ def get_statistical_data():
|
|||
print_er_info(emission_rate, speaking_er)
|
||||
|
||||
############ Shouting model ############
|
||||
exposure_mc = shouting_exposure()
|
||||
exposure_mc = shouting_exposure(activity)
|
||||
exposure_model = exposure_mc.build_model(size=SAMPLE_SIZE)
|
||||
emission_rate = exposure_model.concentration_model.infected.emission_rate_when_present(
|
||||
cn_B=0.06, cn_L=0.2)
|
||||
|
|
@ -290,8 +290,8 @@ def get_statistical_data():
|
|||
return viral_load_in_sputum, breathing_er, speaking_er, shouting_er
|
||||
|
||||
|
||||
def present_vl_er_histograms():
|
||||
viral_load_in_sputum, breathing_er, speaking_er, shouting_er = get_statistical_data()
|
||||
def present_vl_er_histograms(activity: str):
|
||||
viral_load_in_sputum, breathing_er, speaking_er, shouting_er = get_statistical_data(activity)
|
||||
|
||||
fig, axs = plt.subplots(1, 2, sharex=False, sharey=False)
|
||||
fig.set_figheight(5)
|
||||
|
|
|
|||
Loading…
Reference in a new issue