Compare commits

...

272 commits

Author SHA1 Message Date
Andrejh
b2ecff86c4 Merge remote-tracking branch 'origin/feature/mc' into feature/mc 2022-02-18 22:59:54 +01:00
Andrejh
003a58c5c0 minor edits 2022-02-18 22:59:16 +01:00
Andre Henriques
cfe14d7eeb solve conflicts 2022-02-18 11:19:24 +01:00
Andre Henriques
6d6cbc36a8 add scenario 2022-02-18 11:13:35 +01:00
Andrejh
1444226080 hourly breaks data 2022-02-18 11:10:27 +01:00
Andrejh
0e0baff1a5 have fixed y axis 2022-02-18 11:10:04 +01:00
Andrejh
6ea277ac3e add hourly breaks data 2022-02-18 08:29:10 +01:00
Andrejh
b92f065a37 add new plot in figure 2 (b and c) + change hl for winter scenarios 2022-02-17 11:03:10 +01:00
Andrejh
37c5ff4eba code labelling 2022-02-17 10:56:06 +01:00
Andrejh
ba7f400a9e remove plot title 2022-02-16 23:14:02 +01:00
Andrejh
289ce821df update fig order 2022-02-16 23:12:26 +01:00
Andrejh
233a91328e fix plot size 2022-02-16 23:07:38 +01:00
Andrejh
8c5a5b18e9 update of fig order 2022-02-16 22:42:05 +01:00
Andrejh
a6b3d94f58 update of fig order 2022-02-16 22:22:26 +01:00
Andrejh
d950d5189e update of fig order 2022-02-16 19:05:32 +01:00
Andrejh
74e813aa3f add winter baseline 2022-02-16 18:52:47 +01:00
Andrejh
c11b360bda new plots 2021-08-17 11:15:13 +02:00
Andrejh
bc3db021f6 take out the 0.25 ACH inflitration ventilation for the IGH paper 2021-08-17 11:14:57 +02:00
Andrejh
916eeb1c59 take out the 0.25 ACH inflitration ventilation for the IGH paper 2021-08-06 15:46:57 +02:00
Andrejh
f18051d1c5 new csv files 2021-08-06 15:44:03 +02:00
Andrejh
7cd3f4cdd8 new plot definitions and change to virions 2021-08-06 15:43:54 +02:00
Andrejh
01bf3ac486 output file to reproduce CERN report fig 2021-08-06 15:43:38 +02:00
Andrejh
2ac20bd81d add new files for the IGH paper 2021-08-06 15:42:56 +02:00
Nicolas Mounet
f8c1658ea5 Adding 0.25 ACH to air_changes for all WindowOpening 2021-06-03 23:27:46 +02:00
markus
db457b760f add 20th and 80th percentile to qr csv 2021-04-16 12:57:41 +02:00
markus
91b27a0ef2 Merge remote-tracking branch 'origin/feature/mc' into feature/mc
# Conflicts:
#	cara/mc-output.py
2021-04-16 12:48:57 +02:00
markus
061ac4dea2 update mc-output.py with usage examples 2021-04-16 12:48:33 +02:00
markus
a30770cdec add generate_qr_csv 2021-04-16 12:48:18 +02:00
Andrejh
61a6f296f1 new run code lines 2021-04-16 12:17:46 +02:00
Andrejh
b6dfa8e9d0 new run code lines 2021-03-24 00:07:23 +01:00
Andrejh
85b260bd10 add qR quantiles print 2021-03-24 00:07:06 +01:00
Andrejh
669898be3e Merge remote-tracking branch 'origin/feature/mc' into feature/mc 2021-03-22 17:42:52 +01:00
Andrejh
d8bf270db2 print values for paper 2021-03-22 17:42:19 +01:00
Andrejh
6ff3b90ceb print values for paper 2021-03-22 17:41:51 +01:00
Andrejh
95931f6c53 added bus ride and updated graph desin 2021-03-22 17:41:16 +01:00
markus
741baa04be Merge remote-tracking branch 'origin/feature/mc' into feature/mc 2021-03-22 17:13:33 +01:00
markus
e34a31fd08 explain differences in new classes 2021-03-22 17:13:20 +01:00
Andrejh
77aae71208 add print label 2021-03-22 10:27:05 +01:00
Andrejh
9f6e500618 create present_qR_values 2021-03-19 11:31:54 +01:00
Andrejh
418305d50a updates 2021-03-19 10:45:21 +01:00
Andrejh
53d274ed9f Merge remote-tracking branch 'origin/feature/mc' into feature/mc 2021-03-19 10:37:46 +01:00
Andrejh
381e03f6d4 add new .py files for publication 2021-03-19 10:37:28 +01:00
Andre Henriques
b58840a49b Update mc-output.py 2021-03-18 16:22:01 +00:00
Andrejh
e5cbb781ee min air_exchange 0.25 ACH 2021-03-15 23:02:15 +01:00
Andrejh
ac11392bd3 update scenarios half-life 2021-03-15 23:01:54 +01:00
Andrejh
df40d70978 improve labels of plots 2021-03-15 23:00:32 +01:00
Andrejh
92ce654442 add run scripts 2021-03-07 21:47:47 +01:00
Andrejh
6264b80aef plot labels adjustment 2021-03-07 21:47:04 +01:00
Andrejh
06635f6550 add exp models for pi vs time 2021-03-05 00:32:28 +01:00
Andrejh
bb960472ea add v/hlines for pi vs time 2021-03-05 00:32:06 +01:00
Andrejh
37b58731c0 add exp models for pi vs time 2021-03-04 10:17:20 +01:00
Andrejh
30803744bb delete (%) from Pi plot lables 2021-03-03 19:26:08 +01:00
markus
d9fd316886 add normalize_y_axis 2021-03-03 16:15:08 +01:00
Andrejh
ffb0a14b75 pi vs time exp models 2021-03-03 16:02:35 +01:00
Andrejh
414ba0699b pi vs time exp models 2021-03-03 16:01:29 +01:00
markus
b379f94d8d fix pipeline 2021-03-03 13:54:45 +01:00
markus
fc5596f3fc Merge remote-tracking branch 'origin/feature/mc' into feature/mc 2021-03-03 13:51:39 +01:00
markus
6f5e66e060 update usage examples 2021-03-03 13:51:33 +01:00
markus
68c1eaee29 add plot_pi_vs_exposure_time 2021-03-03 13:49:42 +01:00
markus
9346e9c73b reduce number of samples for chorale 2021-03-03 13:49:24 +01:00
Andrejh
596c0c4d07 lables in qR viruses 2021-03-03 13:29:55 +01:00
Andrejh
0b2958dc15 adjust color of boxes 2021-03-02 17:47:44 +01:00
markus
c54767d572 use pastels for legend 2021-03-02 16:42:05 +01:00
markus
49cfc1e328 test pipeline 2021-03-02 16:36:56 +01:00
markus
7bf835c096 fix pipeline 2021-03-02 16:32:55 +01:00
markus
d4a48da49a Merge remote-tracking branch 'origin/feature/mc' into feature/mc 2021-03-02 16:22:31 +01:00
markus
c13d57972a add violin plots to compare_viruses_qr 2021-03-02 16:22:09 +01:00
Andrejh
be6d87035b minor adjustments in pi vs vl 2021-03-02 15:39:55 +01:00
Andrejh
b6db943bc2 lables pi vs vl 2021-03-02 14:52:21 +01:00
Andrejh
891d27a12a lables 2021-03-02 11:30:45 +01:00
Andrejh
a8b5e457d8 add dotted axis and fontsizes 2021-03-02 11:27:52 +01:00
Andrejh
ff8ddf873e lable update in 'present_model' 2021-03-02 10:37:11 +01:00
markus
0965f7c9e1 fix typo 2021-03-01 18:28:47 +01:00
markus
b41864fb2e Merge remote-tracking branch 'origin/feature/mc' into feature/mc
# Conflicts:
#	cara/mc-output.py
2021-03-01 18:25:13 +01:00
markus
b9e8fc1b37 add compare_viruses_qr 2021-03-01 18:24:27 +01:00
Andrejh
91c07b9e5c Merge remote-tracking branch 'origin/feature/mc' into feature/mc
# Conflicts:
#	cara/mc-output.py
#	cara/montecarlo.py
2021-03-01 15:26:49 +01:00
Andrejh
85564c2829 add ski expsoure models 2021-03-01 15:25:52 +01:00
Andrejh
dadabcbec4 lable changes 2021-03-01 15:25:35 +01:00
markus
21a9ed3072 fix typo 2021-03-01 14:49:32 +01:00
markus
bad2ba9c6a add print_qd_info 2021-03-01 14:44:52 +01:00
Andrejh
044f64ccf8 dotted axis and increase fontsize 2021-02-27 23:37:43 +01:00
Andrejh
e9621b7815 add dynamic title in compare_concentration_curves 2021-02-26 21:29:12 +01:00
Andrejh
4ad7a57477 call additional funct. 2021-02-26 21:28:23 +01:00
Andrejh
f12d657475 add sub exposure models for waiting room 2021-02-26 21:27:38 +01:00
Andrejh
fff9ad31b2 add sub exposure models for waiting room 2021-02-26 17:28:16 +01:00
Andrejh
06990099b1 increase fontsize labels and add qID line 2021-02-26 17:27:59 +01:00
Andrejh
e59d06b315 increase fontsize 2021-02-26 16:37:01 +01:00
Andrejh
762c147956 Merge remote-tracking branch 'origin/feature/mc' into feature/mc 2021-02-26 16:03:07 +01:00
markus
d7a604de1a stop accumulating qD during breaks 2021-02-26 12:31:06 +01:00
Andrejh
52d0010f70 change [] to () of units 2021-02-26 09:54:08 +01:00
Andrejh
8d037f94f8 Merge remote-tracking branch 'origin/feature/mc' into feature/mc 2021-02-25 18:01:34 +01:00
Andrejh
28d4808746 Add more scenarios 2021-02-25 18:01:02 +01:00
Andrejh
1848c68556 Add titles to C(t) plot 2021-02-25 18:00:49 +01:00
Andrejh
6af743f00b change point intersection 2021-02-25 17:39:19 +01:00
markus
27a3d661a6 enforce equal qIDs 2021-02-25 17:05:43 +01:00
markus
b90337f31d remove erroneous line 2021-02-25 12:10:32 +01:00
markus
7cf31b50df Merge remote-tracking branch 'origin/feature/mc' into feature/mc
# Conflicts:
#	cara/mc-output.py
2021-02-25 12:06:55 +01:00
markus
9e8e01993d various additions to plot 2021-02-25 12:06:21 +01:00
Andrejh
8331f592bb change single pi vs vl plot settings 2021-02-25 11:58:04 +01:00
Andrejh
05e1b100d4 additional exposure models 2021-02-25 11:57:51 +01:00
Andrejh
bb374ebaf7 additional exposure models 2021-02-25 11:46:33 +01:00
Andrejh
e966320d2a test commit 2021-02-24 17:26:11 +01:00
markus
7fee476ea6 change vl_crit to vl_95 2021-02-24 17:25:48 +01:00
Andrejh
5ab9e4f912 test commit 2021-02-24 17:20:12 +01:00
Andrejh
25b5a16668 Merge remote-tracking branch 'origin/feature/mc' into feature/mc
# Conflicts:
#	cara/mc-output.py
2021-02-24 16:28:59 +01:00
Andrejh
400548da42 cosmetics in pi vs vl plots 2021-02-24 16:26:41 +01:00
markus
f19d85ae8b scale y-axes 2021-02-24 14:53:24 +01:00
markus
fac33a5cf1 add tertiary axis and labels 2021-02-24 14:32:37 +01:00
markus
fdf4f38bbf update usage example 2021-02-24 13:19:56 +01:00
markus
646b005baa fix compare_concentration_curves 2021-02-24 13:18:20 +01:00
markus
04dfa59fce add vlcrit values 2021-02-24 10:40:14 +01:00
Andrejh
758afafbcf cosmetics in pi vs vl plot 2021-02-24 09:52:54 +01:00
markus
9decf9afd1 add (a), (b), (c) 2021-02-23 18:00:00 +01:00
markus
28a8b43c77 update x-range 2021-02-23 17:51:39 +01:00
markus
e92353eda5 add percentages 2021-02-23 17:51:25 +01:00
markus
889cc5337f update usage examples 2021-02-23 17:43:54 +01:00
markus
b5419f6f3f add composite_plot_pi_vs_viral_load 2021-02-23 17:43:27 +01:00
markus
e16c11baef change ventilation type 2021-02-23 11:59:33 +01:00
markus
53ffd6eba3 restructure files 2021-02-23 11:55:02 +01:00
markus
d2c8c28f77 create mc-output.py 2021-02-23 11:52:05 +01:00
markus
805fa173c0 move model instances to model_scenarios.py 2021-02-23 11:46:04 +01:00
markus
be6e5250dc update usage examples 2021-02-23 11:44:03 +01:00
markus
c9cd0ed5fa add classroom_model_with_hepa 2021-02-23 11:43:40 +01:00
markus
7693a0dff0 add (incomplete) compare_concentration_curves 2021-02-23 11:43:27 +01:00
markus
16f6ad3193 increase TIME_STEP 2021-02-23 11:43:08 +01:00
markus
62e0690a01 add model_scenarios.py 2021-02-23 11:42:54 +01:00
markus
267d349bb9 use ski cabin model 2021-02-22 17:11:17 +01:00
markus
4467f36a7c add time_step and fix shaded area 2021-02-22 17:10:46 +01:00
markus
5c9181d798 various improvements to concentration plot 2021-02-22 16:45:38 +01:00
markus
dea98d3c6f display histogram of given model 2021-02-22 15:56:49 +01:00
markus
386b089273 make vline positions dynamic 2021-02-22 15:56:36 +01:00
Andrejh
83eadc5280 pi vs vl plot additions 2021-02-22 11:57:08 +01:00
Andrejh
e5f4027f6a Add shaded areas in Pi vs vl 2021-02-22 00:21:30 +01:00
Andrejh
184981c400 Insert the PDF hist in the Pi vs vl plot 2021-02-21 16:08:03 +01:00
Andrejh
6481b99948 Change Pi values [0; 1] & add vl_crit lables 2021-02-21 15:27:08 +01:00
Andrejh
2d2359e356 Add scenarios as exposure models 2021-02-20 01:08:32 +01:00
markus
5a9e95e87a Merge remote-tracking branch 'origin/feature/mc' into feature/mc
# Conflicts:
#	cara/montecarlo.py
2021-02-19 19:03:22 +01:00
markus
57e07da379 add classroom_model 2021-02-19 19:01:37 +01:00
markus
c7546cec40 coarsen trapz grid 2021-02-19 19:01:29 +01:00
markus
83aaaefab9 add plot_concentration_curve 2021-02-19 19:01:20 +01:00
Andrejh
78eb8565cd further adjustments to CDF plot 2021-02-19 08:49:30 +01:00
Andrejh
5ee67f1a34 adjustments to CDF plot 2021-02-19 00:11:40 +01:00
Andrejh
df090a7952 Modify CDF plot title & colors 2021-02-18 23:38:20 +01:00
markus
17340781f5 allow for mixed expiratory activity in plotting functions 2021-02-18 15:47:15 +01:00
markus
a833cc6178 use 30% speaking, 70% breathing for large_population_baselines 2021-02-18 15:01:41 +01:00
markus
a6735b8029 update usage examples 2021-02-18 15:01:15 +01:00
markus
948cc0c1d9 add option for mixed expiratory activity 2021-02-18 15:00:57 +01:00
markus
90437cf69c make integration sampling more coarse 2021-02-18 12:30:13 +01:00
markus
8526489e96 fix quanta_exposure 2021-02-18 12:25:21 +01:00
markus
b0646619ad change legend of present_model 2021-02-17 17:34:25 +01:00
markus
60362addd1 Merge remote-tracking branch 'origin/feature/mc' into feature/mc
# Conflicts:
#	cara/montecarlo.py
2021-02-17 16:50:37 +01:00
markus
473f50d1e4 add generate_cdf_curves_vs_qr 2021-02-17 16:49:33 +01:00
Andrejh
b6e2b7ce99 add vertical lines showing the 'critical'vl values - Markus to make it more automatic 2021-02-16 22:20:58 +01:00
Andrejh
7fd295930b delete 'in sputum' 2021-02-16 22:14:18 +01:00
markus
5d675d1d1a remove english_variant variable and move qID into MCVirus class 2021-02-16 16:32:17 +01:00
markus
f6d0f4ce24 update usage example 2021-02-16 16:12:56 +01:00
markus
edcefab54e revert to qid=100 2021-02-16 16:12:45 +01:00
markus
3099294da1 add large_population_baselines 2021-02-16 16:11:58 +01:00
markus
75225e88c7 add labels to compare_infection_probabilities_vs_viral_loads 2021-02-16 14:38:39 +01:00
markus
a3dffcf1e7 change exposure_models to illustrate point 2021-02-15 17:44:11 +01:00
markus
fe00ce1b42 add compare_infection_probabilities_vs_viral_loads 2021-02-15 17:43:48 +01:00
markus
d408fbc677 change qid to 300 2021-02-15 14:02:02 +01:00
markus
e43033fecb update use examples 2021-02-15 13:13:01 +01:00
markus
313457a5f6 make qid range input parameters 2021-02-15 13:12:48 +01:00
markus
54deff7627 add baseline models with fixed viral load 2021-02-15 13:12:35 +01:00
markus
4d62cdeb05 use m as abbreviation for masked 2021-02-15 12:00:45 +01:00
markus
d9843eb941 add plot_pi_vs_qid 2021-02-15 12:00:28 +01:00
markus
e1bf3d9ef6 make superspreader label position relative 2021-02-12 12:46:59 +01:00
markus
f5c11fc2dc attempt to satisfy mypy 2021-02-12 12:39:32 +01:00
markus
5e29093d76 attempt to satisfy mypy 2021-02-12 12:35:33 +01:00
markus
f39396e7ee add packages to setup.cfg 2021-02-12 12:24:33 +01:00
markus
ef7080e4bd usage example 2021-02-11 17:15:59 +01:00
markus
a05aad27f5 change exposure_models to alternate mask-use 2021-02-11 17:15:47 +01:00
markus
3defcc63f3 allow overlayed plots 2021-02-11 17:15:07 +01:00
markus
c53da51340 use masks for exposed subjects 2021-02-11 14:15:14 +01:00
markus
2d8d03230e add customizable plot titles 2021-02-11 12:50:10 +01:00
markus
2380d1b397 fix x-range of viral load histogram 2021-02-11 12:47:22 +01:00
markus
1cc09ab4e0 call some functions 2021-02-11 12:44:40 +01:00
markus
d78a46bc0b add labels to pi_vs_viral_load plot 2021-02-11 12:44:14 +01:00
markus
35247dd8f0 expand x-axis of pi_vs_viral_load plot 2021-02-11 12:43:57 +01:00
markus
ff453805f0 add plot_pi_vs_viral_load 2021-02-10 16:11:44 +01:00
markus
d98910d823 document lognormal 2021-02-10 16:11:44 +01:00
markus
e88c4b8e99 add short description to BuonannoSpecificInfectedPopulation 2021-02-10 16:11:44 +01:00
markus
25b9bf56f0 document print_qr_info and logscale_hist 2021-02-10 16:11:44 +01:00
markus
3ac0de206b document present_model 2021-02-10 16:11:44 +01:00
markus
421f671b68 document generate_boxplot 2021-02-10 16:11:44 +01:00
markus
64eb30e370 document buonanno_exposure_model 2021-02-10 16:11:44 +01:00
markus
b2ceea9f8a document display_original_vs_english 2021-02-10 16:11:44 +01:00
Andrejh
9f23b55a81 change legend location 2021-02-10 16:11:44 +01:00
Andrejh
606cd66309 lauch present_model and add print std 2021-02-10 16:11:44 +01:00
markus
fe3ed5e07d add generate_boxplot 2021-02-10 16:11:44 +01:00
markus
4ba8510f3e rename models to avoid confusion 2021-02-10 16:11:44 +01:00
markus
3d28fc0bc5 move P(i) display into function 2021-02-10 16:11:44 +01:00
markus
f5230199cb incorporate print_qr_info in present_model 2021-02-10 16:11:44 +01:00
markus
18c24ff063 make arrow position scale with samples 2021-02-10 16:11:44 +01:00
markus
6f4bb006df refactor present_model 2021-02-10 16:11:44 +01:00
markus
a71a104524 remove baseline_model 2021-02-10 16:11:44 +01:00
Andrejh
b7a0d7f87b add superspreader annotation to qR plot 2021-02-10 16:11:44 +01:00
Andrejh
c56690bb70 add automatic labeling 2021-02-10 16:11:44 +01:00
Andrejh
0e1fec8307 change string from excercise to activity 2021-02-10 16:11:44 +01:00
Andrejh
2dcc74442c add deposition fraction f_dep 2021-02-10 16:11:44 +01:00
Andrejh
8384b4601d new deposition rate 2021-02-10 16:11:44 +01:00
Andrejh
a25e6f33e3 modifications to qR subplot style 2021-02-10 16:11:44 +01:00
markus
8ec19f8e85 add test comment 2021-02-10 16:11:44 +01:00
markus
cd3e90823e fix unit conversion 2021-02-10 16:11:44 +01:00
markus
f82ab3a6d1 implement english variant 2021-02-10 16:11:44 +01:00
markus
ee00a19940 change model parameters 2021-02-10 16:11:44 +01:00
markus
a1313b905b change presentation 2021-02-10 16:11:44 +01:00
markus
340e763bc2 use calculated Ec 2021-02-10 16:11:44 +01:00
markus
54ebff5b27 change description from RNA to q 2021-02-10 16:11:44 +01:00
markus
983517ceac import quad_vec 2021-02-10 16:11:44 +01:00
markus
a1c6a431af update concentration plot 2021-02-10 16:11:44 +01:00
markus
57839595fc rework concentration distribution calculation 2021-02-10 16:11:44 +01:00
markus
bdb2185678 change values 2021-02-10 16:11:44 +01:00
markus
4d5337377d add mask_leak_out 2021-02-10 16:11:44 +01:00
markus
0870abd663 change O-mode CMD 2021-02-10 16:11:44 +01:00
markus
ba8759412a add axis legend to fourth plot 2021-02-10 16:11:44 +01:00
markus
5a28d8602c add fourth plot to present_model 2021-02-10 16:11:44 +01:00
markus
4479cc07c0 add O-mode 2021-02-10 16:11:44 +01:00
markus
388d3c6132 move calculate_qr into emission_rate_when_present 2021-02-10 16:11:44 +01:00
markus
6ba9d0c595 add MCPopulation 2021-02-10 16:11:44 +01:00
markus
b93efd73dd add parameters from johnson et. al 2021-02-10 16:11:44 +01:00
markus
ae19a8dbd2 add present_model 2021-02-10 16:11:44 +01:00
markus
02d8442da4 remove test models 2021-02-10 16:11:44 +01:00
markus
2c1a709fd6 add breathing_category to baseline_mc_exposure_model 2021-02-10 16:11:44 +01:00
markus
ccc07cbb26 use dedicated functions for sampling 2021-02-10 16:11:44 +01:00
markus
a07b29dbc3 refactor 2021-02-10 16:11:44 +01:00
markus
bd0d3f0dd0 redo qR-calculation 2021-02-10 16:11:44 +01:00
markus
4d9aa07b49 remove misleading comment 2021-02-10 16:11:44 +01:00
markus
ee17e9f937 move buonanno model into function 2021-02-10 16:11:44 +01:00
markus
5f95c410e9 add hard-coded Ec 2021-02-10 16:11:44 +01:00
markus
e24d403a51 add specific model for buonanno comparison 2021-02-10 16:11:44 +01:00
markus
db37b58403 add specific class for buonanno comparison 2021-02-10 16:11:44 +01:00
markus
e850746c3b fix warning condition 2021-02-10 16:11:44 +01:00
markus
1ae52ffdf8 add spaces 2021-02-10 16:11:44 +01:00
markus
033e326ed8 add option for viral load distribution 2021-02-10 16:11:44 +01:00
markus
271e1c8dd8 use breathing rates 2021-02-10 16:11:44 +01:00
markus
eba70a6580 add lognormal_parameters 2021-02-10 16:11:44 +01:00
markus
1585eec6fd add type hinting to _generate_viral_loads 2021-02-10 16:11:44 +01:00
markus
8f3e279045 add lognormal method 2021-02-10 16:11:44 +01:00
markus
c8800b180d add beta_parameters 2021-02-10 16:11:44 +01:00
markus
2a1e80f8eb use new distribution for viral load 2021-02-10 16:11:44 +01:00
markus
4fe50ea22a remove viral load from MCVirus class 2021-02-10 16:11:44 +01:00
markus
3a16b683f3 add _generate_viral_loads 2021-02-10 16:11:44 +01:00
markus
487f01b0f8 remove plt.show() from logscale_hist 2021-02-10 16:11:44 +01:00
markus
34a035927a cleanup 2021-02-10 16:11:44 +01:00
markus
af9edf94ab add MCExposureModel class 2021-02-10 16:11:44 +01:00
markus
6e9f54de84 add MCConcentrationModel class 2021-02-10 16:11:44 +01:00
markus
433ee3d202 add MCInfectedPopulation class 2021-02-10 16:11:44 +01:00
markus
9532934ba0 add MCVirus class 2021-02-10 16:11:44 +01:00
markus
9beb1bcfb3 clarify scientific notation 2021-02-10 16:11:44 +01:00
markus
da718df7c5 add function for printing distribution information 2021-02-10 16:11:44 +01:00
markus
b67ffc5e2b import typing 2021-02-10 16:11:44 +01:00
markus
1c35917909 document logscale_hist 2021-02-10 16:11:44 +01:00
markus
a318cc1ecd add masked flag 2021-02-10 16:11:44 +01:00
markus
55c1a2124a use distribution for viral loads 2021-02-10 16:11:44 +01:00
markus
f4b0dd084c add masked flag 2021-02-10 16:11:44 +01:00
markus
bf3f21aef6 tweak diameters 2021-02-10 16:11:44 +01:00
markus
3308ffc872 clarify formula 2021-02-10 16:11:44 +01:00
markus
ee527631f4 remove print statement 2021-02-10 16:11:44 +01:00
markus
11561c10e8 fix time conversion factor 2021-02-10 16:11:44 +01:00
markus
b3327506fe add imports 2021-02-10 16:11:44 +01:00
markus
7cf262c98e remove unused import 2021-02-10 16:11:44 +01:00
markus
4c5305ff83 add generate_qr_values 2021-02-10 16:11:44 +01:00
markus
ecc35ee03c add unit conversions in qr-calculation 2021-02-10 16:11:44 +01:00
markus
03cad9d505 make breathing_rate optional 2021-02-10 16:11:44 +01:00
markus
06b6f9b4d7 reformat comments 2021-02-10 16:11:44 +01:00
markus
507cb7ffd9 restructure weibull_parameters 2021-02-10 16:11:44 +01:00
markus
ce453fc269 rename emission_concentration to emission 2021-02-10 16:11:44 +01:00
markus
a2eb8b07b1 add weibull parameters 2021-02-10 16:11:44 +01:00
markus
d096855bec add calculate_qr 2021-02-10 16:11:44 +01:00
markus
d01ebda19e create montecarlo.py 2021-02-10 16:11:44 +01:00
11 changed files with 4059 additions and 2 deletions

View file

@ -0,0 +1,44 @@
""" Title: COVID Airborne Risk Assessment
Author: <author(s) names>
Date: <date>
Code version: <code version>
Availability: <where it's located> """
from cara.montecarlo import *
from cara.model_scenarios_publication import *
# qR table:
generate_qr_csv('qR_unmasked')
generate_qr_csv('qr_masked', masked=True)
# qR values for Breathing, light activity:
print('\n<<<<<<<<<<< qR for Breathing, light activity >>>>>>>>>>>')
present_qR_values(qR_models[0].concentration_model)
# qR values for Speaking, light activity:
print('\n<<<<<<<<<<< qR for Speaking, light activity >>>>>>>>>>>')
present_qR_values(qR_models[1].concentration_model)
# qR values for Shouting, light activity:
print('\n<<<<<<<<<<< qR for Shouting / Singing, light activity >>>>>>>>>>>')
present_qR_values(qR_models[2].concentration_model)
# qR values for shouting and light activity - qID=100, 500 and 1000
print('\n<<<<<<<<<<< Shouting and light activity - qID=100 >>>>>>>>>>>')
present_qR_values(qR_models_shout_light[0].concentration_model)
print('\n<<<<<<<<<<< Shouting and light activity - qID=500 >>>>>>>>>>>')
present_qR_values(qR_models_shout_light[1].concentration_model)
print('\n<<<<<<<<<<< Shouting and light activity - qID=1000 >>>>>>>>>>>')
present_qR_values(qR_models_shout_light[2].concentration_model)
print('\n<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>')
present_model(qR_models[2].concentration_model, title='')
# qR for the S V Chorale superspreading event
print('\n<<<<<<<<<<< S V Chorale: Shouting and light activity - qID=100 >>>>>>>>>>>')
present_qR_quantiles(qR_models_shout_light[0].concentration_model, quantile=0.8)
# CDF plots of qR
generate_cdf_curves_vs_qr(masked=False,qid=100)
generate_cdf_curves_vs_qr(masked=False,qid=500)
generate_cdf_curves_vs_qr(masked=False,qid=1000)

123
cara/mc-output.py Normal file
View file

@ -0,0 +1,123 @@
from cara.montecarlo import *
from cara.model_scenarios import *
#compare_concentration_curves([classroom_model_with_hepa[0],classroom_model_full_open_multi[0]],['xxx', 'yyy'])
#plot_concentration_curve(classroom_model[1])
#compare_concentration_curves([classroom_model, classroom_model_with_hepa], ['Just window', 'Window and HEPA'])
#print(np.mean(classroom_model[0].infection_probability()))
#print(np.mean(classroom_model[1].infection_probability()))
#print(np.mean(chorale_model.infection_probability())+np.std(chorale_model.infection_probability()))
#print(np.quantile(chorale_model[0].infection_probability(),0.8))
#print(np.quantile(chorale_model.infection_probability(),0.90))
#print(np.quantile(chorale_model.infection_probability(),0.1))
#plot_pi_vs_exposure_time(chorale_model, ['model1', 'model2'])
#print(np.mean(ski_cabin_model_baseline_20[1].infection_probability()))
#plot_pi_vs_exposure_time(ski_cabin_model_baseline_exposure_time+ski_cabin_model_baseline_exposure_time_FFP2, ['Ski cabin - surgical masks', 'Ski cabin - no masks','Ski cabin - FFP2 masks',''],
# colors=['#1f77b4','tomato', 'seagreen', 'seagreen'],
# linestyles=['solid', 'dashed', '-.', '-.'],
# points=20,
# time_in_minutes=True,
# normalize_y_axis=True)
#compare_viruses_qr(violins=True)
present_qR_values(classroom_model[1].concentration_model)
#print_qd_info(waiting_room_model_full_winter[1])
#print(np.mean(shared_office_model[1].infection_probability()))
#composite_plot_pi_vs_viral_load([shared_office_worst_model[1], shared_office_model[1], shared_office_better_model[1]],
# labels=['No mask &\nwindows closed', 'Baseline:Windows\nopen (10min/2h)', 'Windows open\n(10min/2h) +\nHEPA filter'],
# colors=['tomato', '#1f77b4', 'limegreen'],
# title='',
# plot_pi_vs_viral_load vl_points=200)
#composite_plot_pi_vs_viral_load([classroom_model_no_vent[1], classroom_model[1], classroom_model_with_hepa[1], classroom_model_full_open_multi[1], classroom_model_full_open_multi_masks[1]],
# labels=['Windows closed', 'Baseline:Windows\nopen (10min/2h)', 'Windows open\n(10min/2h) + HEPA', 'Multiple windows open', 'Multiple windows open\n+masks'],
# colors=['tomato','#1f77b4', 'dodgerblue', 'seagreen', 'limegreen'],
# title='',
# vl_points=200)
#composite_plot_pi_vs_viral_load([ski_cabin_model_60[1], ski_cabin_model_30[1], ski_cabin_model_baseline_20[1], ski_cabin_model_10[1]],
# labels=['60 min', '30 min', 'Baseline: 20 min', '10 min'],
# colors=['tomato', 'lightsalmon', '#1f77b4', 'limegreen'],
# title='',
# vl_points=200)
#
#composite_plot_pi_vs_viral_load([ski_cabin_model_baseline_20_no_mask[1], ski_cabin_model_baseline_20[1], ski_cabin_model_baseline_20_FFP2[1]],
# labels=['20min\nno masks', 'Baseline: 20 min\nsurgical mask', '20 min\nFFP2 mask'],
# colors=['tomato', '#1f77b4','seagreen'],
# title='',
# vl_points=200)
#compare_concentration_curves([classroom_model_no_vent[1], classroom_model[1], classroom_model_with_hepa[1], classroom_model_full_open_multi[1]],
# labels=['Windows closed', 'Baseline: Windows open (10min/2h)', 'Windows open (10min/2h) + HEPA', 'Multiple windows open'],
# colors=['tomato','#1f77b4', 'seagreen', 'limegreen'],
# title=''
# )
#compare_concentration_curves_virus_IGH_paper([classroom_model_no_vent[1], classroom_model[1], classroom_model_with_hepa[1], classroom_model_full_open_multi[1]],
# labels=['Windows closed', 'Baseline: Windows open (10min/2h)', 'Windows open (10min/2h) + HEPA', 'Multiple windows open'],
# colors=['tomato','#1f77b4', 'seagreen', 'limegreen'],
# title=''
# )
#
#compare_concentration_curves([waiting_room_model[1], waiting_room_model_full_summer[1],
# waiting_room_model_full_winter[1], waiting_room_model_periodic_winter[1]],
# labels=['Baseline: Windows closed', 'Windows open (summer)', 'Windows open (winter)', 'Windows open 5min/20min (winter)'],
# colors=['#1f77b4', 'darkorange', 'deepskyblue', 'lightskyblue'],
# title=''
# )
#compare_concentration_curves_virus_IGH_paper([waiting_room_model[1], waiting_room_model_full_summer[1],
# waiting_room_model_full_winter[1], waiting_room_model_periodic_winter[1]],
# labels=['Baseline: Windows closed', 'Windows open (summer)', 'Windows open (winter)', 'Windows open 5min/20min (winter)'],
# colors=['#1f77b4', 'darkorange', 'deepskyblue', 'lightskyblue'],
# title=''
# )
#plot_pi_vs_viral_load([classroom_model_no_vent[1]], labels=['Windows closed'],title='')
#plot_pi_vs_viral_load([classroom_model_no_vent[1],classroom_model_full_open_multi_masks[1]], labels=['Windows closed','Multiple windows open + Masks'],title='')
#generate_cdf_curves_vs_qr(masked=False,qid=1000)
# rs = [model.expected_new_cases() for model in large_population_baselines]
# print(f"R0 - original variant:\t{np.mean(rs[0])}")
# print(f"R0 - english variant:\t{np.mean(rs[1])}")
# print(f"Ratio between R0's:\t\t{np.mean(rs[1]) / np.mean(rs[0])}")
#
# compare_infection_probabilities_vs_viral_loads(*exposure_models)
#
#
#present_model(exposure_models[0].concentration_model, title='')
# plot_pi_vs_qid(fixed_vl_exposure_models, labels=['Viral load = $10^{' + str(i) + '}$' for i in range(6, 11)],
# qid_min=5, qid_max=2000, qid_samples=200)
#
# plot_pi_vs_qid(fixed_vl_exposure_models, labels=['Viral load = $10^{' + str(i) + '}$' for i in range(6, 11)],
# qid_min=100, qid_max=400, qid_samples=100)
#
#
# plot_pi_vs_viral_load(exposure_models, labels=['Without masks', 'With masks'])
#
# for model in exposure_models:
# present_model(model.concentration_model, title=f'Model summary - {"English" if model.concentration_model.infected.qid == 60 else "Original"} variant')
# plt.hist(model.infection_probability(), bins=200)
# plt.xlabel('Percentage probability of infection')
# plt.title(f'Probability of infection in baseline case - {"English" if model.concentration_model.infected.qid == 60 else "Original"} variant')
# plt.yticks([], [])
# plt.show()
#composite_plot_pi_vs_viral_load([classroom_model_no_vent[1],classroom_model_full_open_multi_masks[1]],
# labels=['Windows closed','Multiple windows open + Masks'],
# colors=['#1f77b4','#ff7f0e'],
# title='',
# vl_points=500)
#
#compare_concentration_curves_virus_IGH_paper([classroom_model_no_vent[1], classroom_model[1], classroom_model_with_hepa[1], classroom_model_full_open_multi[1]],
# labels=['Windows closed', 'Windows open (for 10min every 2h)', 'Windows open (for 10min every 2h) + HEPA', 'Multiple windows open (at all times)'],
# colors=['tomato','#1f77b4', 'seagreen', 'limegreen'],
# title='Mean concentration of infectious quantum and\ncumulative dose over exposure time'
# )
#generate_qr_csv('qR_unmasked')
#generate_qr_csv('qr_masked', masked=True)

232
cara/mc-output_IGH_paper.py Normal file
View file

@ -0,0 +1,232 @@
from cara.montecarlo import *
from cara.model_scenarios_IGH_paper import *
# #Fig 1c
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed[0],classroom_model_IGH_no_mask_windows_open_breaks[0],
# classroom_model_IGH_no_mask_windows_open_alltimes[0]],
# labels=['Windows closed', 'Window open during breaks', 'Window open at all times'],
# colors=['tomato', 'lightskyblue', 'limegreen', '#1f77b4', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title=''
# )
# print("\n############ Fig 1c ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_closed[0])
# print_qd_info(classroom_model_IGH_no_mask_windows_open_breaks[0])
# print_qd_info(classroom_model_IGH_no_mask_windows_open_alltimes[0])
#
# #Fig 1d
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed_winter[0],classroom_model_IGH_no_mask_windows_open_breaks_winter[0],
# classroom_model_IGH_no_mask_windows_open_alltimes_winter[0], classroom_model_IGH_no_mask_windows_fully_open_alltimes_winter[0]],
# labels=['Windows closed', 'Window fully open during breaks', 'Window slightly open at all times', 'Window fully open at all times'],
# colors=['tomato', 'lightskyblue', '#1f77b4', 'limegreen', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title=''
# )
# print("\n############ Fig 1d ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_closed_winter[0])
# print_qd_info(classroom_model_IGH_no_mask_windows_open_breaks_winter[0])
# print_qd_info(classroom_model_IGH_no_mask_windows_open_alltimes_winter[0])
# print_qd_info(classroom_model_IGH_no_mask_windows_fully_open_alltimes_winter[0])
#
# #Fig 1e
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed[0],classroom_model_IGH_no_mask_2windows_open_breaks[0],
# classroom_model_IGH_no_mask_2windows_open_alltimes[0]],
# labels=['Windows closed', '2 windows open during breaks', '2 windows open at all times'],
# colors=['tomato', 'lightskyblue', 'limegreen', '#1f77b4', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title=''
# )
# print("\n############ Fig 1e ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_closed[0])
# print_qd_info(classroom_model_IGH_no_mask_2windows_open_breaks[0])
# print_qd_info(classroom_model_IGH_no_mask_2windows_open_alltimes[0])
#
# #Fig 1f
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed_winter[0],classroom_model_IGH_no_mask_2windows_open_breaks_winter[0],
# classroom_model_IGH_no_mask_2windows_open_alltimes_winter[0], classroom_model_IGH_no_mask_2windows_fully_open_alltimes_winter[0]],
# labels=['Windows closed', '2 windows fully open during breaks', '2 windows slighty open at all times', '2 windows fully open at all times'],
# colors=['tomato', 'lightskyblue', '#1f77b4', 'limegreen', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title=''
# )
# print("\n############ Fig 1f ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_closed_winter[0])
# print_qd_info(classroom_model_IGH_no_mask_2windows_open_breaks_winter[0])
# print_qd_info(classroom_model_IGH_no_mask_2windows_open_alltimes_winter[0])
# print_qd_info(classroom_model_IGH_no_mask_2windows_fully_open_alltimes_winter[0])
#
# #Fig 1g
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed[0],classroom_model_IGH_no_mask_6windows_open_breaks[0],
# classroom_model_IGH_no_mask_6windows_open_alltimes[0]],
# labels=['Windows closed', '6 windows open during breaks', '6 windows open at all times'],
# colors=['tomato', 'lightskyblue', 'limegreen', '#1f77b4', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title=''
# )
# print("\n############ Fig 1g ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_closed[0])
# print_qd_info(classroom_model_IGH_no_mask_6windows_open_breaks[0])
# print_qd_info(classroom_model_IGH_no_mask_6windows_open_alltimes[0])
#
# #Fig 1h
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed_winter[0],classroom_model_IGH_no_mask_6windows_open_breaks_winter[0],
# classroom_model_IGH_no_mask_6windows_open_alltimes_winter[0], classroom_model_IGH_no_mask_6windows_fully_open_alltimes_winter[0]],
# labels=['Windows closed', '6 windows fully open during breaks', '6 windows slighty open at all times', '6 windows fully open at all times'],
# colors=['tomato', 'lightskyblue', '#1f77b4', 'limegreen', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title=''
# )
# print("\n############ Fig 1h ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_closed_winter[0])
# print_qd_info(classroom_model_IGH_no_mask_6windows_open_breaks_winter[0])
# print_qd_info(classroom_model_IGH_no_mask_6windows_open_alltimes_winter[0])
# print_qd_info(classroom_model_IGH_no_mask_6windows_fully_open_alltimes_winter[0])
#
# #Fig 1i
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed[0],
# classroom_model_IGH_no_mask_6windows_open_breaks_endOfClass[0]],
# labels=['Windows closed',
# '6 windows open during breaks + end of classes'],
# colors=['tomato', '#1f77b4'],
# title=''
# )
# print("\n############ Fig 1i ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_closed[0])
# print_qd_info(classroom_model_IGH_no_mask_6windows_open_breaks_endOfClass[0])
#
# #Fig 1j
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed_winter[0],
# classroom_model_IGH_no_mask_6windows_open_breaks_endOfClass_winter[0]],
# labels=['Windows closed',
# '6 windows open during breaks + end of classes'],
# colors=['tomato', '#1f77b4'],
# title=''
# )
# print("\n############ Fig 1j ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_closed_winter[0])
# print_qd_info(classroom_model_IGH_no_mask_6windows_open_breaks_endOfClass_winter[0])
#
#
#
# #Fig 2a
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed[0],classroom_model_IGH_no_mask_windows_closed_1HEPA[0],
# classroom_model_IGH_no_mask_windows_closed_2HEPA[0]],
# labels=['Windows closed', 'Windows closed + 1 HEPA filter (2.5 ACH)', 'Windows closed + 2 HEPA filter (5 ACH)'],
# colors=['tomato', 'lightskyblue', 'limegreen', '#1f77b4', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title=''
# )
# print("\n############ Fig 2a ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_closed[0])
# print_qd_info(classroom_model_IGH_no_mask_windows_closed_1HEPA[0])
# print_qd_info(classroom_model_IGH_no_mask_windows_closed_2HEPA[0])
#
# #Fig 2b
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed_winter[0],classroom_model_IGH_no_mask_windows_closed_1HEPA_winter[0],
# classroom_model_IGH_no_mask_windows_closed_2HEPA_winter[0]],
# labels=['Windows closed', 'Windows closed + 1 HEPA filter (2.5 ACH)', 'Windows closed + 2 HEPA filter (5 ACH)'],
# colors=['tomato', 'lightskyblue', 'limegreen', '#1f77b4', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title=''
# )
# print("\n############ Fig 2b ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_closed_winter[0])
# print_qd_info(classroom_model_IGH_no_mask_windows_closed_1HEPA_winter[0])
# print_qd_info(classroom_model_IGH_no_mask_windows_closed_2HEPA_winter[0])
#
# #Fig 2c
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed[0],classroom_model_IGH_with_mask_windows_closed[0]],
# labels=['Windows closed', 'Windows closed + surgical type masks'],
# colors=['tomato', 'lightskyblue', 'limegreen', '#1f77b4', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title=''
# )
# print("\n############ Fig 2c ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_closed[0])
# print_qd_info(classroom_model_IGH_with_mask_windows_closed[0])
#
# #Fig 2d
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed_winter[0],classroom_model_IGH_with_mask_windows_closed_winter[0]],
# labels=['Windows closed', 'Windows closed + surgical type masks'],
# colors=['tomato', 'lightskyblue', 'limegreen', '#1f77b4', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title=''
# )
# print("\n############ Fig 2d ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_closed_winter[0])
# print_qd_info(classroom_model_IGH_with_mask_windows_closed_winter[0])
#
#
# #Fig 3b
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed_winter[0],classroom_model_IGH_no_mask_2windows_open_alltimes_winter_bis[0],
# classroom_model_IGH_with_mask_2windows_open_alltimes_winter[0]],
# labels=['Windows closed', '2 windows open at all times', '2 windows open at all times + surgical masks'],
# colors=['tomato', 'lightskyblue', 'limegreen', '#1f77b4', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title=''
# )
# print("\n############ Fig 3b ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_closed_winter[0])
# print_qd_info(classroom_model_IGH_no_mask_2windows_open_alltimes_winter_bis[0])
# print_qd_info(classroom_model_IGH_with_mask_2windows_open_alltimes_winter[0])
#
# #Fig 3c
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed_winter[0],classroom_model_IGH_with_mask_windows_closed_1HEPA[0],
# classroom_model_IGH_with_mask_windows_closed_2HEPA[0]],
# labels=['No masks', '1 HEPA filter (2.5 ACH) + surgical masks', '2 HEPA filter (5 ACH) + surgical masks'],
# colors=['tomato', 'lightskyblue', 'limegreen', '#1f77b4', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title=''
# )
# print("\n############ Fig 3c ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_closed[0])
# print_qd_info(classroom_model_IGH_with_mask_windows_closed_1HEPA[0])
# print_qd_info(classroom_model_IGH_with_mask_windows_closed_2HEPA[0])
#
# #Fig 3d
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed_winter[0],classroom_model_IGH_with_mask_2windows_open_alltimes_winter_1HEPA[0],
# classroom_model_IGH_with_mask_2windows_open_alltimes_winter_2HEPA[0]],
# labels=['Windows closed', '2 windows open at all times + 1 HEPA filter (2.5 ACH) + surgical masks', '2 windows open at all times + 2 HEPA filter (5 ACH) + surgical masks'],
# colors=['tomato', 'lightskyblue', 'limegreen', '#1f77b4', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title=''
# )
# print("\n############ Fig 3d ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_closed_winter[0])
# print_qd_info(classroom_model_IGH_with_mask_2windows_open_alltimes_winter_1HEPA[0])
# print_qd_info(classroom_model_IGH_with_mask_2windows_open_alltimes_winter_2HEPA[0])
#
#
# #Hourly breaks
# print("\n############ Hourly breaks - summer ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_open_breaks_endOfClass[0])
# print_qd_info(classroom_model_IGH_no_mask_2windows_open_breaks_endOfClass[0])
# print_qd_info(classroom_model_IGH_no_mask_6windows_open_breaks_endOfClass[0])
#
# print("\n############ Hourly breaks - winter ###########\n")
# print_qd_info(classroom_model_IGH_no_mask_windows_open_breaks_endOfClass_winter[0])
# print_qd_info(classroom_model_IGH_no_mask_2windows_open_breaks_endOfClass_winter[0])
# print_qd_info(classroom_model_IGH_no_mask_6windows_open_breaks_endOfClass_winter[0])
#>>>>>>>>>>> Aux >>>>>>>>
#print_qd_info(classroom_model_IGH_no_mask_windows_closed[0])
#print_qd_info(classroom_model_IGH_no_mask_6windows_open_breaks_endOfClass[0])
#print_qd_info(classroom_model_IGH_no_mask_2windows_open_breaks_endOfClass_winter[0])
#print_qd_info(classroom_model_IGH_no_mask_windows_open_breaks_endOfClass_winter[0])
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed[0],classroom_model_IGH_no_mask_2windows_open_breaks_winter_bis[0],
# classroom_model_IGH_with_mask_2windows_open_breaks_winter[0]],
# labels=['Windows closed', '2 windows open during breaks', '2 windows open during breaks + surgical masks'],
# colors=['tomato', 'lightskyblue', 'limegreen', '#1f77b4', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title='Combination of measures (winter period) '
# )
# compare_concentration_curves_virus_IGH_paper([classroom_model_IGH_no_mask_windows_closed[0],classroom_model_IGH_with_mask_2windows_open_breaks_winter_1HEPA[0],
# classroom_model_IGH_with_mask_2windows_open_breaks_winter_2HEPA[0]],
# labels=['Windows closed', '2 windows open during breaks + 1 HEPA filter (2.5 ACH) + surgical masks', '2 windows open during breaks + 2 HEPA filter (5 ACH) + surgical masks'],
# colors=['tomato', 'lightskyblue', 'limegreen', '#1f77b4', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title='Combination of measures (winter period) '
# )
#compare_concentration_curves([classroom_model_IGH_no_mask_windows_closed[1],classroom_model_IGH_no_mask_2windows_open_breaks[1],classroom_model_IGH_no_mask_2windows_open_breaks_endOfClass[1],
# classroom_model_IGH_no_mask_2windows_open_alltimes[1], classroom_model_IGH_no_mask_windows_closed_1HEPA[1],
# classroom_model_IGH_no_mask_windows_closed_2HEPA[1]],
# labels=['Windows closed', '2 Windows open during breaks', '2 Windows open during breaks + end of classes',
# '2 Windows open at all times', 'Windows closed + HEPA filter (2.5 ACH)', 'Windows closed + HEPA filter (5 ACH)'],
# colors=['tomato','limegreen', '#1f77b4', 'seagreen', 'lightskyblue', 'deepskyblue'],
# title='No mask - Spring/Summer period'
# )
#present_model(classroom_model_IGH_no_mask_windows_closed[0].concentration_model, title='')

947
cara/model_scenarios.py Normal file
View file

@ -0,0 +1,947 @@
from cara import models
from cara.montecarlo import *
fixed_vl_exposure_models = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=45),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=10),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (283,)),
window_height=1.6, opening_length=0.6,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 4), (5, 9))),
masked=True,
virus=MCVirus(halflife=1.1, qID=100),
expiratory_activity=1,
samples=2000000,
breathing_category=1,
viral_load=float(vl)
)
),
exposed=models.Population(
number=2,
presence=models.SpecificInterval(((0, 4), (5, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['Type I']
)
) for vl in range(6, 11)]
large_population_baselines = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=800),
ventilation=models.HVACMechanical(
active=models.PeriodicInterval(period=120, duration=120),
q_air_mech=2000.
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 4), (5, 9))),
masked=False,
virus=MCVirus(halflife=1.1, qID=qid),
expiratory_activity=1,
samples=200000,
breathing_category=2,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=60,
presence=models.SpecificInterval(((0, 4), (5, 9))),
activity=models.Activity.types['Standing'],
mask=models.Mask.types['No mask']
)
) for qid in (100, 60)]
######### Standard exposure models ###########
exposure_models = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=45),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=120),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (283,)),
window_height=1.6, opening_length=0.2,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 4), (5, 9))),
masked=False,
virus=MCVirus(halflife=1.1, qID=qid),
expiratory_activity=3,
samples=2000000,
breathing_category=3,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=2,
presence=models.SpecificInterval(((0, 4), (5, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['Type I']
)
) for qid in (100, 60)]
exposure_models_2 = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=33),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=120),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (283,)),
window_height=1.6, opening_length=0.6,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 4), (5, 9))),
masked=True,
virus=MCVirus(halflife=1.1, qID=qid),
expiratory_activity=4,
samples=2000000,
breathing_category=1,
expiratory_activity_weights=(0.7, 0.1, 0)
)
),
exposed=models.Population(
number=2,
presence=models.SpecificInterval(((0, 4), (5, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['Type I']
)
) for qid in (100, 60)]
######## Classroom exposure models ###########
classroom_model = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=160),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=10),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (283,)),
window_height=1.6, opening_length=0.6,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
masked=False,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=3,
)
),
exposed=models.Population(
number=19,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]
classroom_model_full_open = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=160),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=120),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (283,)),
window_height=1.6, opening_length=0.6,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
masked=False,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=3,
)
),
exposed=models.Population(
number=19,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]
classroom_model_summer = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=160),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=10),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (291,)),
window_height=1.6, opening_length=0.6,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
masked=False,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=3,
)
),
exposed=models.Population(
number=19,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]
classroom_model_full_open_summer = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=160),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=120),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (291,)),
window_height=1.6, opening_length=0.6,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
masked=False,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=3,
)
),
exposed=models.Population(
number=19,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]
classroom_model_no_vent = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=160),
ventilation=models.AirChange(
active=models.PeriodicInterval(period=120, duration=120),
air_exch=0.25,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
masked=False,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=3,
)
),
exposed=models.Population(
number=19,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]
classroom_model_teacher_mask_full_open = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=160),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=120),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (291,)),
window_height=1.6, opening_length=4*0.6,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
masked=True,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=3,
)
),
exposed=models.Population(
number=19,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]
classroom_model_with_hepa = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=160),
ventilation=models.MultipleVentilation(
ventilations=(
models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=10),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (283,)),
window_height=1.6, opening_length=0.6,
),
models.HEPAFilter(active=models.PeriodicInterval(period=120, duration=120),
q_air_mech=800)
)
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
masked=False,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=3,
)
),
exposed=models.Population(
number=19,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]
classroom_model_full_open_multi = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=160),
ventilation=models.MultipleVentilation(
ventilations=(
models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=120),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (283,)),
window_height=1.6, opening_length=4*0.6,
),
models.HEPAFilter(active=models.PeriodicInterval(period=120, duration=120),
q_air_mech=0)
)
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
masked=False,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=3,
)
),
exposed=models.Population(
number=19,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]
classroom_model_full_open_multi_masks = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=160),
ventilation=models.MultipleVentilation(
ventilations=(
models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=120),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (283,)),
window_height=1.6, opening_length=4*0.6,
),
models.HEPAFilter(active=models.PeriodicInterval(period=120, duration=120),
q_air_mech=0)
)
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
masked=True,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=3,
)
),
exposed=models.Population(
number=19,
presence=models.SpecificInterval(((0, 2), (2.5, 4), (5, 7), (7.5, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['Type I']
)
)for qid in (100, 60)]
######### Shared office exposure models ###########
shared_office_model = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=50),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=10),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (283,)),
window_height=1.6, opening_length=0.6,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2), (2.1, 4), (5, 7), (7.1, 9))),
masked=True,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=4,
samples=200000,
breathing_category=1,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=3,
presence=models.SpecificInterval(((0, 2), (2.1, 4), (5, 7), (7.1, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['Type I']
)
) for qid in (100, 60)]
shared_office_model_no_mask = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=50),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=10),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (283,)),
window_height=1.6, opening_length=0.6,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2), (2.1, 4), (5, 7), (7.1, 9))),
masked=False,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=4,
samples=200000,
breathing_category=1,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=3,
presence=models.SpecificInterval(((0, 2), (2.1, 4), (5, 7), (7.1, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['No mask']
)
) for qid in (100, 60)]
shared_office_worst_model = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=50),
ventilation=models.AirChange(
active=models.PeriodicInterval(period=120, duration=120),
air_exch=0.25,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2), (2.1, 4), (5, 7), (7.1, 9))),
masked=False,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=4,
samples=200000,
breathing_category=1,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=3,
presence=models.SpecificInterval(((0, 2), (2.1, 4), (5, 7), (7.1, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['No mask']
)
) for qid in (100, 60)]
shared_office_better_model = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=50),
ventilation=models.MultipleVentilation(
ventilations=(
models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=10),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (283,)),
window_height=1.6, opening_length=0.6,
),
models.AirChange(active=models.PeriodicInterval(period=120, duration=120),
air_exch=5.)
)
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2), (2.1, 4), (5, 7), (7.1, 9))),
masked=True,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=4,
samples=200000,
breathing_category=1,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=3,
presence=models.SpecificInterval(((0, 2), (2.1, 4), (5, 7), (7.1, 9))),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['Type I']
)
) for qid in (100, 60)]
######### Ski cabine exposure models ###########
ski_cabin_model_10 = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=10),
ventilation=models.HVACMechanical(
active=models.PeriodicInterval(period=120, duration=120),
q_air_mech=0.,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 10/60),)),
masked=True,
virus=MCVirus(halflife=1.1, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=4,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=3,
presence=models.SpecificInterval(((0, 10/60),)),
activity=models.Activity.types['Moderate activity'],
mask=models.Mask.types['Type I']
)
)for qid in (100, 60)]
ski_cabin_model_baseline_20 = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=10),
ventilation=models.HVACMechanical(
active=models.PeriodicInterval(period=120, duration=120),
q_air_mech=0.,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 20/60),)),
masked=True,
virus=MCVirus(halflife=1.1, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=4,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=3,
presence=models.SpecificInterval(((0, 20/60),)),
activity=models.Activity.types['Moderate activity'],
mask=models.Mask.types['Type I']
)
)for qid in (100, 60)]
ski_cabin_model_baseline_20_FFP2 = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=10),
ventilation=models.HVACMechanical(
active=models.PeriodicInterval(period=120, duration=120),
q_air_mech=0.,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 20/60),)),
masked=True,
virus=MCVirus(halflife=1.1, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=4,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=3,
presence=models.SpecificInterval(((0, 20/60),)),
activity=models.Activity.types['Moderate activity'],
mask=models.Mask.types['FFP2']
)
)for qid in (100, 60)]
ski_cabin_model_baseline_20_no_mask = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=10),
ventilation=models.HVACMechanical(
active=models.PeriodicInterval(period=120, duration=120),
q_air_mech=0.,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 20/60),)),
masked=False,
virus=MCVirus(halflife=1.1, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=4,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=3,
presence=models.SpecificInterval(((0, 20/60),)),
activity=models.Activity.types['Moderate activity'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]
ski_cabin_model_25 = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=10),
ventilation=models.HVACMechanical(
active=models.PeriodicInterval(period=120, duration=120),
q_air_mech=0.,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 25/60),)),
masked=True,
virus=MCVirus(halflife=1.1, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=4,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=3,
presence=models.SpecificInterval(((0, 25/60),)),
activity=models.Activity.types['Moderate activity'],
mask=models.Mask.types['Type I']
)
)for qid in (100, 60)]
ski_cabin_model_30 = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=10),
ventilation=models.HVACMechanical(
active=models.PeriodicInterval(period=120, duration=120),
q_air_mech=0.,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 30/60),)),
masked=True,
virus=MCVirus(halflife=1.1, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=4,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=3,
presence=models.SpecificInterval(((0, 30/60),)),
activity=models.Activity.types['Moderate activity'],
mask=models.Mask.types['Type I']
)
)for qid in (100, 60)]
ski_cabin_model_60 = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=10),
ventilation=models.HVACMechanical(
active=models.PeriodicInterval(period=120, duration=120),
q_air_mech=0.,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 1),)),
masked=True,
virus=MCVirus(halflife=1.1, qID=qid),
expiratory_activity=2,
samples=200000,
breathing_category=4,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=3,
presence=models.SpecificInterval(((0, 1),)),
activity=models.Activity.types['Moderate activity'],
mask=models.Mask.types['Type I']
)
)for qid in (100, 60)]
ski_cabin_model_baseline_exposure_time = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=10),
ventilation=models.HVACMechanical(
active=models.PeriodicInterval(period=120, duration=120),
q_air_mech=0.,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 60/60),)),
masked=mi,
virus=MCVirus(halflife=1.1, qID=60),
expiratory_activity=2,
samples=200000,
breathing_category=4,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=3,
presence=models.SpecificInterval(((0, 60/60),)),
activity=models.Activity.types['Moderate activity'],
mask=models.Mask.types[me]
)
)for mi, me in zip((True, False), ('Type I', 'No mask', 'FFP2'))]
ski_cabin_model_baseline_exposure_time_FFP2 = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=10),
ventilation=models.HVACMechanical(
active=models.PeriodicInterval(period=120, duration=120),
q_air_mech=0.,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 60/60),)),
masked=True,
virus=MCVirus(halflife=1.1, qID=60),
expiratory_activity=2,
samples=200000,
breathing_category=4,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=3,
presence=models.SpecificInterval(((0, 60/60),)),
activity=models.Activity.types['Moderate activity'],
mask=models.Mask.types['FFP2']
)
)for mi in (True, False)]
######### Gym exposure models ###########
gym_model = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=300),
ventilation=models.AirChange(
active=models.PeriodicInterval(period=120, duration=120),
air_exch=6.,
),
infected=MCInfectedPopulation(
number=2,
presence=models.SpecificInterval(((0, 1),)),
masked=False,
virus=MCVirus(halflife=1.1, qID=qid),
expiratory_activity=1,
samples=200000,
breathing_category=5,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=28,
presence=models.SpecificInterval(((0, 1),)),
activity=models.Activity.types['Heavy exercise'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]
gym_model_exposure_time = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=300),
ventilation=models.AirChange(
active=models.PeriodicInterval(period=120, duration=120),
air_exch=6.,
),
infected=MCInfectedPopulation(
number=2,
presence=models.SpecificInterval(((0, 1),)),
masked=mi,
virus=MCVirus(halflife=1.1, qID=60),
expiratory_activity=1,
samples=200000,
breathing_category=5,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=28,
presence=models.SpecificInterval(((0, 1),)),
activity=models.Activity.types['Heavy exercise'],
mask=models.Mask.types[me]
)
)for mi, me in zip((True, False), ('Type I', 'No mask'))]
######### Waiting room exposure models ###########
waiting_room_model = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=100),
ventilation=models.AirChange(
active=models.PeriodicInterval(period=120, duration=120),
air_exch=0.25,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2),)),
masked=False,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=4,
samples=200000,
breathing_category=1,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=14,
presence=models.SpecificInterval(((0, 2),)),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]
waiting_room_model_full_winter = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=100),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=120),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (283,)),
window_height=1.6, opening_length=0.6,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2),)),
masked=False,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=4,
samples=200000,
breathing_category=1,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=14,
presence=models.SpecificInterval(((0, 2),)),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]
waiting_room_model_full_summer = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=100),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=120),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (291,)),
window_height=1.6, opening_length=0.6,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2),)),
masked=False,
virus=MCVirus(halflife=1.1, qID=qid),
expiratory_activity=4,
samples=200000,
breathing_category=1,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=14,
presence=models.SpecificInterval(((0, 2),)),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]
waiting_room_model_periodic_winter = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=100),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=20, duration=5),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (283,)),
window_height=1.6, opening_length=0.6,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2),)),
masked=False,
virus=MCVirus(halflife=3.8, qID=qid),
expiratory_activity=4,
samples=200000,
breathing_category=1,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=14,
presence=models.SpecificInterval(((0, 2),)),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]
waiting_room_model_periodic_summer = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=100),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=60, duration=10),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (291,)),
window_height=1.6, opening_length=0.6,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2),)),
masked=False,
virus=MCVirus(halflife=1.1, qID=qid),
expiratory_activity=4,
samples=200000,
breathing_category=1,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=14,
presence=models.SpecificInterval(((0, 2),)),
activity=models.Activity.types['Seated'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]
######### S V Chorale exposure models ###########
chorale_model = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=810),
ventilation=models.AirChange(
active=models.PeriodicInterval(period=120, duration=120),
air_exch=0.7,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 2.5),)),
masked=False,
virus=MCVirus(halflife=1.1, qID=qid),
expiratory_activity=3,
samples=20000,
breathing_category=3,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=60,
presence=models.SpecificInterval(((0, 2.5),)),
activity=models.Activity.types['Moderate activity'],
mask=models.Mask.types['No mask']
)
)for qid in (100, 60)]

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,59 @@
from cara import models
from cara.montecarlo import *
######### Standard exposure models ###########
qR_models = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=45),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=120),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (283,)),
window_height=1.6, opening_length=0.2,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 4), (5, 9))),
masked=False,
virus=MCVirus(halflife=1.1, qID=100),
expiratory_activity=a,
samples=2000000,
breathing_category=3,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=2,
presence=models.SpecificInterval(((0, 4), (5, 9))),
activity=models.Activity.types['Light activity'],
mask=models.Mask.types['No mask']
)
) for a in (1, 2, 3)]
qR_models_shout_light = [MCExposureModel(
concentration_model=MCConcentrationModel(
room=models.Room(volume=45),
ventilation=models.SlidingWindow(
active=models.PeriodicInterval(period=120, duration=120),
inside_temp=models.PiecewiseConstant((0, 24), (293,)),
outside_temp=models.PiecewiseConstant((0, 24), (283,)),
window_height=1.6, opening_length=0.2,
),
infected=MCInfectedPopulation(
number=1,
presence=models.SpecificInterval(((0, 4), (5, 9))),
masked=False,
virus=MCVirus(halflife=1.1, qID=qid),
expiratory_activity=3,
samples=2000000,
breathing_category=3,
expiratory_activity_weights=(0.7, 0.3, 0)
)
),
exposed=models.Population(
number=2,
presence=models.SpecificInterval(((0, 4), (5, 9))),
activity=models.Activity.types['Light activity'],
mask=models.Mask.types['No mask']
)
) for qid in (100, 500, 1000)]

View file

@ -236,7 +236,7 @@ class WindowOpening(Ventilation):
def air_exchange(self, room: Room, time: float) -> float:
# If the window is shut, no air is being exchanged.
if not self.active.triggered(time):
return 0.
return 0.25
# Reminder, no dependence on time in the resulting calculation.
inside_temp = self.inside_temp.value(time)
@ -384,7 +384,7 @@ class Virus:
Virus.types = {
'SARS_CoV_2': Virus(
halflife=1.1,
viral_load_in_sputum=10e8,
viral_load_in_sputum=1e9,
# No data on coefficient for SARS-CoV-2 yet.
# It is somewhere between 0.001 and 0.01 to have a 50% chance
# to cause infection. i.e. 1000 or 100 SARS-CoV viruses to cause infection.

1449
cara/montecarlo.py Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,9 @@
,,Breathing,,,Speaking,,,Shouting,
Percentiles,Seated,Light,Heavy,Seated,Light,Heavy,Seated,Light,Heavy
1st,4.37e-06,1.08e-05,2.75e-05,3.32e-04,8.11e-04,2.08e-03,1.66e-03,4.08e-03,1.05e-02
5th,1.86e-05,4.61e-05,1.18e-04,1.41e-03,3.47e-03,8.83e-03,7.06e-03,1.73e-02,4.44e-02
20th,6.62e-04,1.65e-03,4.23e-03,5.04e-02,1.24e-01,3.23e-01,2.53e-01,6.21e-01,1.62e+00
50th,4.59e-02,1.13e-01,2.96e-01,3.48e+00,8.62e+00,2.25e+01,1.75e+01,4.29e+01,1.13e+02
80th,1.16e+00,2.84e+00,7.34e+00,8.77e+01,2.16e+02,5.59e+02,4.37e+02,1.08e+03,2.80e+03
95th,7.90e+00,1.94e+01,5.10e+01,6.00e+02,1.48e+03,3.88e+03,3.00e+03,7.34e+03,1.94e+04
99th,2.42e+01,5.91e+01,1.57e+02,1.83e+03,4.50e+03,1.19e+04,9.20e+03,2.24e+04,5.95e+04
1 Breathing Speaking Shouting
2 Percentiles Seated Light Heavy Seated Light Heavy Seated Light Heavy
3 1st 4.37e-06 1.08e-05 2.75e-05 3.32e-04 8.11e-04 2.08e-03 1.66e-03 4.08e-03 1.05e-02
4 5th 1.86e-05 4.61e-05 1.18e-04 1.41e-03 3.47e-03 8.83e-03 7.06e-03 1.73e-02 4.44e-02
5 20th 6.62e-04 1.65e-03 4.23e-03 5.04e-02 1.24e-01 3.23e-01 2.53e-01 6.21e-01 1.62e+00
6 50th 4.59e-02 1.13e-01 2.96e-01 3.48e+00 8.62e+00 2.25e+01 1.75e+01 4.29e+01 1.13e+02
7 80th 1.16e+00 2.84e+00 7.34e+00 8.77e+01 2.16e+02 5.59e+02 4.37e+02 1.08e+03 2.80e+03
8 95th 7.90e+00 1.94e+01 5.10e+01 6.00e+02 1.48e+03 3.88e+03 3.00e+03 7.34e+03 1.94e+04
9 99th 2.42e+01 5.91e+01 1.57e+02 1.83e+03 4.50e+03 1.19e+04 9.20e+03 2.24e+04 5.95e+04

View file

@ -0,0 +1,9 @@
,,Breathing,,,Speaking,,,Shouting,
Percentiles,Seated,Light,Heavy,Seated,Light,Heavy,Seated,Light,Heavy
1st,8.32e-07,2.05e-06,5.25e-06,6.06e-05,1.51e-04,3.84e-04,3.06e-04,7.50e-04,1.91e-03
5th,3.54e-06,8.77e-06,2.24e-05,2.58e-04,6.37e-04,1.62e-03,1.30e-03,3.20e-03,8.14e-03
20th,1.26e-04,3.15e-04,8.04e-04,9.36e-03,2.30e-02,5.91e-02,4.66e-02,1.15e-01,2.95e-01
50th,8.80e-03,2.17e-02,5.64e-02,6.40e-01,1.58e+00,4.11e+00,3.23e+00,7.92e+00,2.07e+01
80th,2.21e-01,5.42e-01,1.40e+00,1.61e+01,3.95e+01,1.03e+02,8.08e+01,1.99e+02,5.12e+02
95th,1.51e+00,3.71e+00,9.77e+00,1.10e+02,2.71e+02,7.11e+02,5.52e+02,1.35e+03,3.57e+03
99th,4.62e+00,1.13e+01,3.02e+01,3.35e+02,8.30e+02,2.20e+03,1.68e+03,4.13e+03,1.10e+04
1 Breathing Speaking Shouting
2 Percentiles Seated Light Heavy Seated Light Heavy Seated Light Heavy
3 1st 8.32e-07 2.05e-06 5.25e-06 6.06e-05 1.51e-04 3.84e-04 3.06e-04 7.50e-04 1.91e-03
4 5th 3.54e-06 8.77e-06 2.24e-05 2.58e-04 6.37e-04 1.62e-03 1.30e-03 3.20e-03 8.14e-03
5 20th 1.26e-04 3.15e-04 8.04e-04 9.36e-03 2.30e-02 5.91e-02 4.66e-02 1.15e-01 2.95e-01
6 50th 8.80e-03 2.17e-02 5.64e-02 6.40e-01 1.58e+00 4.11e+00 3.23e+00 7.92e+00 2.07e+01
7 80th 2.21e-01 5.42e-01 1.40e+00 1.61e+01 3.95e+01 1.03e+02 8.08e+01 1.99e+02 5.12e+02
8 95th 1.51e+00 3.71e+00 9.77e+00 1.10e+02 2.71e+02 7.11e+02 5.52e+02 1.35e+03 3.57e+03
9 99th 4.62e+00 1.13e+01 3.02e+01 3.35e+02 8.30e+02 2.20e+03 1.68e+03 4.13e+03 1.10e+04

View file

@ -16,3 +16,12 @@ ignore_missing_imports = True
[mypy-mistune.*]
ignore_missing_imports = True
[mypy-tqdm.*]
ignore_missing_imports = True
[mypy-scipy.*]
ignore_missing_imports = True
[mypy-sklearn.*]
ignore_missing_imports = True