AeroViz 0.1.21__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- AeroViz/__init__.py +13 -0
- AeroViz/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/data/DEFAULT_DATA.csv +1417 -0
- AeroViz/data/DEFAULT_PNSD_DATA.csv +1417 -0
- AeroViz/data/hysplit_example_data.txt +101 -0
- AeroViz/dataProcess/Chemistry/__init__.py +149 -0
- AeroViz/dataProcess/Chemistry/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/dataProcess/Chemistry/_calculate.py +557 -0
- AeroViz/dataProcess/Chemistry/_isoropia.py +150 -0
- AeroViz/dataProcess/Chemistry/_mass_volume.py +487 -0
- AeroViz/dataProcess/Chemistry/_ocec.py +172 -0
- AeroViz/dataProcess/Chemistry/isrpia.cnf +21 -0
- AeroViz/dataProcess/Chemistry/isrpia2.exe +0 -0
- AeroViz/dataProcess/Optical/PyMieScatt_update.py +577 -0
- AeroViz/dataProcess/Optical/_IMPROVE.py +452 -0
- AeroViz/dataProcess/Optical/__init__.py +281 -0
- AeroViz/dataProcess/Optical/__pycache__/PyMieScatt_update.cpython-312.pyc +0 -0
- AeroViz/dataProcess/Optical/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/dataProcess/Optical/__pycache__/mie_theory.cpython-312.pyc +0 -0
- AeroViz/dataProcess/Optical/_derived.py +518 -0
- AeroViz/dataProcess/Optical/_extinction.py +123 -0
- AeroViz/dataProcess/Optical/_mie_sd.py +912 -0
- AeroViz/dataProcess/Optical/_retrieve_RI.py +243 -0
- AeroViz/dataProcess/Optical/coefficient.py +72 -0
- AeroViz/dataProcess/Optical/fRH.pkl +0 -0
- AeroViz/dataProcess/Optical/mie_theory.py +260 -0
- AeroViz/dataProcess/README.md +271 -0
- AeroViz/dataProcess/SizeDistr/__init__.py +245 -0
- AeroViz/dataProcess/SizeDistr/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/dataProcess/SizeDistr/__pycache__/_size_dist.cpython-312.pyc +0 -0
- AeroViz/dataProcess/SizeDistr/_size_dist.py +810 -0
- AeroViz/dataProcess/SizeDistr/merge/README.md +93 -0
- AeroViz/dataProcess/SizeDistr/merge/__init__.py +20 -0
- AeroViz/dataProcess/SizeDistr/merge/_merge_v0.py +251 -0
- AeroViz/dataProcess/SizeDistr/merge/_merge_v0_1.py +246 -0
- AeroViz/dataProcess/SizeDistr/merge/_merge_v1.py +255 -0
- AeroViz/dataProcess/SizeDistr/merge/_merge_v2.py +244 -0
- AeroViz/dataProcess/SizeDistr/merge/_merge_v3.py +518 -0
- AeroViz/dataProcess/SizeDistr/merge/_merge_v4.py +422 -0
- AeroViz/dataProcess/SizeDistr/prop.py +62 -0
- AeroViz/dataProcess/VOC/__init__.py +14 -0
- AeroViz/dataProcess/VOC/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/dataProcess/VOC/_potential_par.py +108 -0
- AeroViz/dataProcess/VOC/support_voc.json +446 -0
- AeroViz/dataProcess/__init__.py +66 -0
- AeroViz/dataProcess/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/dataProcess/core/__init__.py +272 -0
- AeroViz/dataProcess/core/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/mcp_server.py +352 -0
- AeroViz/plot/__init__.py +13 -0
- AeroViz/plot/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/plot/__pycache__/bar.cpython-312.pyc +0 -0
- AeroViz/plot/__pycache__/box.cpython-312.pyc +0 -0
- AeroViz/plot/__pycache__/pie.cpython-312.pyc +0 -0
- AeroViz/plot/__pycache__/radar.cpython-312.pyc +0 -0
- AeroViz/plot/__pycache__/regression.cpython-312.pyc +0 -0
- AeroViz/plot/__pycache__/scatter.cpython-312.pyc +0 -0
- AeroViz/plot/__pycache__/violin.cpython-312.pyc +0 -0
- AeroViz/plot/bar.py +126 -0
- AeroViz/plot/box.py +69 -0
- AeroViz/plot/distribution/__init__.py +1 -0
- AeroViz/plot/distribution/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/plot/distribution/__pycache__/distribution.cpython-312.pyc +0 -0
- AeroViz/plot/distribution/distribution.py +576 -0
- AeroViz/plot/meteorology/CBPF.py +295 -0
- AeroViz/plot/meteorology/__init__.py +3 -0
- AeroViz/plot/meteorology/__pycache__/CBPF.cpython-312.pyc +0 -0
- AeroViz/plot/meteorology/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/plot/meteorology/__pycache__/hysplit.cpython-312.pyc +0 -0
- AeroViz/plot/meteorology/__pycache__/wind_rose.cpython-312.pyc +0 -0
- AeroViz/plot/meteorology/hysplit.py +93 -0
- AeroViz/plot/meteorology/wind_rose.py +77 -0
- AeroViz/plot/optical/__init__.py +1 -0
- AeroViz/plot/optical/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/plot/optical/__pycache__/optical.cpython-312.pyc +0 -0
- AeroViz/plot/optical/optical.py +388 -0
- AeroViz/plot/pie.py +210 -0
- AeroViz/plot/radar.py +184 -0
- AeroViz/plot/regression.py +200 -0
- AeroViz/plot/scatter.py +174 -0
- AeroViz/plot/templates/__init__.py +6 -0
- AeroViz/plot/templates/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/plot/templates/__pycache__/ammonium_rich.cpython-312.pyc +0 -0
- AeroViz/plot/templates/__pycache__/contour.cpython-312.pyc +0 -0
- AeroViz/plot/templates/__pycache__/corr_matrix.cpython-312.pyc +0 -0
- AeroViz/plot/templates/__pycache__/diurnal_pattern.cpython-312.pyc +0 -0
- AeroViz/plot/templates/__pycache__/koschmieder.cpython-312.pyc +0 -0
- AeroViz/plot/templates/__pycache__/metal_heatmap.cpython-312.pyc +0 -0
- AeroViz/plot/templates/ammonium_rich.py +34 -0
- AeroViz/plot/templates/contour.py +47 -0
- AeroViz/plot/templates/corr_matrix.py +267 -0
- AeroViz/plot/templates/diurnal_pattern.py +61 -0
- AeroViz/plot/templates/koschmieder.py +95 -0
- AeroViz/plot/templates/metal_heatmap.py +164 -0
- AeroViz/plot/timeseries/__init__.py +2 -0
- AeroViz/plot/timeseries/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/plot/timeseries/__pycache__/template.cpython-312.pyc +0 -0
- AeroViz/plot/timeseries/__pycache__/timeseries.cpython-312.pyc +0 -0
- AeroViz/plot/timeseries/template.py +47 -0
- AeroViz/plot/timeseries/timeseries.py +446 -0
- AeroViz/plot/utils/__init__.py +4 -0
- AeroViz/plot/utils/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/plot/utils/__pycache__/_color.cpython-312.pyc +0 -0
- AeroViz/plot/utils/__pycache__/_unit.cpython-312.pyc +0 -0
- AeroViz/plot/utils/__pycache__/plt_utils.cpython-312.pyc +0 -0
- AeroViz/plot/utils/__pycache__/sklearn_utils.cpython-312.pyc +0 -0
- AeroViz/plot/utils/_color.py +71 -0
- AeroViz/plot/utils/_unit.py +55 -0
- AeroViz/plot/utils/fRH.json +390 -0
- AeroViz/plot/utils/plt_utils.py +92 -0
- AeroViz/plot/utils/sklearn_utils.py +49 -0
- AeroViz/plot/utils/units.json +89 -0
- AeroViz/plot/violin.py +80 -0
- AeroViz/rawDataReader/FLOW.md +138 -0
- AeroViz/rawDataReader/__init__.py +220 -0
- AeroViz/rawDataReader/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/config/__init__.py +0 -0
- AeroViz/rawDataReader/config/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/config/__pycache__/supported_instruments.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/config/supported_instruments.py +135 -0
- AeroViz/rawDataReader/core/__init__.py +658 -0
- AeroViz/rawDataReader/core/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/core/__pycache__/logger.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/core/__pycache__/pre_process.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/core/__pycache__/qc.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/core/__pycache__/report.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/core/logger.py +171 -0
- AeroViz/rawDataReader/core/pre_process.py +308 -0
- AeroViz/rawDataReader/core/qc.py +961 -0
- AeroViz/rawDataReader/core/report.py +579 -0
- AeroViz/rawDataReader/script/AE33.py +173 -0
- AeroViz/rawDataReader/script/AE43.py +151 -0
- AeroViz/rawDataReader/script/APS.py +339 -0
- AeroViz/rawDataReader/script/Aurora.py +191 -0
- AeroViz/rawDataReader/script/BAM1020.py +90 -0
- AeroViz/rawDataReader/script/BC1054.py +161 -0
- AeroViz/rawDataReader/script/EPA.py +79 -0
- AeroViz/rawDataReader/script/GRIMM.py +68 -0
- AeroViz/rawDataReader/script/IGAC.py +140 -0
- AeroViz/rawDataReader/script/MA350.py +179 -0
- AeroViz/rawDataReader/script/Minion.py +218 -0
- AeroViz/rawDataReader/script/NEPH.py +199 -0
- AeroViz/rawDataReader/script/OCEC.py +173 -0
- AeroViz/rawDataReader/script/Q-ACSM.py +12 -0
- AeroViz/rawDataReader/script/SMPS.py +389 -0
- AeroViz/rawDataReader/script/TEOM.py +181 -0
- AeroViz/rawDataReader/script/VOC.py +106 -0
- AeroViz/rawDataReader/script/Xact.py +244 -0
- AeroViz/rawDataReader/script/__init__.py +28 -0
- AeroViz/rawDataReader/script/__pycache__/AE33.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/AE43.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/APS.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/Aurora.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/BAM1020.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/BC1054.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/EPA.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/GRIMM.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/IGAC.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/MA350.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/Minion.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/NEPH.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/OCEC.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/Q-ACSM.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/SMPS.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/TEOM.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/VOC.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/Xact.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/tools/__init__.py +2 -0
- AeroViz/tools/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/tools/__pycache__/database.cpython-312.pyc +0 -0
- AeroViz/tools/__pycache__/dataclassifier.cpython-312.pyc +0 -0
- AeroViz/tools/database.py +95 -0
- AeroViz/tools/dataclassifier.py +117 -0
- AeroViz/tools/dataprinter.py +58 -0
- aeroviz-0.1.21.dist-info/METADATA +294 -0
- aeroviz-0.1.21.dist-info/RECORD +180 -0
- aeroviz-0.1.21.dist-info/WHEEL +5 -0
- aeroviz-0.1.21.dist-info/licenses/LICENSE +21 -0
- aeroviz-0.1.21.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
{
|
|
2
|
+
"fRH": {
|
|
3
|
+
"1": 1.0,
|
|
4
|
+
"2": 1.0,
|
|
5
|
+
"3": 1.0,
|
|
6
|
+
"4": 1.0,
|
|
7
|
+
"5": 1.0,
|
|
8
|
+
"6": 1.0,
|
|
9
|
+
"7": 1.0,
|
|
10
|
+
"8": 1.0,
|
|
11
|
+
"9": 1.0,
|
|
12
|
+
"10": 1.0,
|
|
13
|
+
"11": 1.0,
|
|
14
|
+
"12": 1.0,
|
|
15
|
+
"13": 1.0,
|
|
16
|
+
"14": 1.0,
|
|
17
|
+
"15": 1.0,
|
|
18
|
+
"16": 1.0,
|
|
19
|
+
"17": 1.0,
|
|
20
|
+
"18": 1.0,
|
|
21
|
+
"19": 1.0,
|
|
22
|
+
"20": 1.0,
|
|
23
|
+
"21": 1.0,
|
|
24
|
+
"22": 1.0,
|
|
25
|
+
"23": 1.0,
|
|
26
|
+
"24": 1.0,
|
|
27
|
+
"25": 1.0,
|
|
28
|
+
"26": 1.0,
|
|
29
|
+
"27": 1.0,
|
|
30
|
+
"28": 1.0,
|
|
31
|
+
"29": 1.0,
|
|
32
|
+
"30": 1.0,
|
|
33
|
+
"31": 1.0,
|
|
34
|
+
"32": 1.0,
|
|
35
|
+
"33": 1.0,
|
|
36
|
+
"34": 1.0,
|
|
37
|
+
"35": 1.0,
|
|
38
|
+
"36": 1.0,
|
|
39
|
+
"37": 1.02,
|
|
40
|
+
"38": 1.04,
|
|
41
|
+
"39": 1.06,
|
|
42
|
+
"40": 1.08,
|
|
43
|
+
"41": 1.1,
|
|
44
|
+
"42": 1.13,
|
|
45
|
+
"43": 1.15,
|
|
46
|
+
"44": 1.18,
|
|
47
|
+
"45": 1.2,
|
|
48
|
+
"46": 1.23,
|
|
49
|
+
"47": 1.26,
|
|
50
|
+
"48": 1.28,
|
|
51
|
+
"49": 1.31,
|
|
52
|
+
"50": 1.34,
|
|
53
|
+
"51": 1.37,
|
|
54
|
+
"52": 1.41,
|
|
55
|
+
"53": 1.44,
|
|
56
|
+
"54": 1.47,
|
|
57
|
+
"55": 1.51,
|
|
58
|
+
"56": 1.54,
|
|
59
|
+
"57": 1.58,
|
|
60
|
+
"58": 1.62,
|
|
61
|
+
"59": 1.66,
|
|
62
|
+
"60": 1.7,
|
|
63
|
+
"61": 1.74,
|
|
64
|
+
"62": 1.79,
|
|
65
|
+
"63": 1.83,
|
|
66
|
+
"64": 1.88,
|
|
67
|
+
"65": 1.93,
|
|
68
|
+
"66": 1.98,
|
|
69
|
+
"67": 2.03,
|
|
70
|
+
"68": 2.08,
|
|
71
|
+
"69": 2.14,
|
|
72
|
+
"70": 2.19,
|
|
73
|
+
"71": 2.25,
|
|
74
|
+
"72": 2.31,
|
|
75
|
+
"73": 2.37,
|
|
76
|
+
"74": 2.43,
|
|
77
|
+
"75": 2.5,
|
|
78
|
+
"76": 2.56,
|
|
79
|
+
"77": 2.63,
|
|
80
|
+
"78": 2.7,
|
|
81
|
+
"79": 2.78,
|
|
82
|
+
"80": 2.86,
|
|
83
|
+
"81": 2.94,
|
|
84
|
+
"82": 3.03,
|
|
85
|
+
"83": 3.12,
|
|
86
|
+
"84": 3.22,
|
|
87
|
+
"85": 3.33,
|
|
88
|
+
"86": 3.45,
|
|
89
|
+
"87": 3.58,
|
|
90
|
+
"88": 3.74,
|
|
91
|
+
"89": 3.93,
|
|
92
|
+
"90": 4.16,
|
|
93
|
+
"91": 4.45,
|
|
94
|
+
"92": 4.84,
|
|
95
|
+
"93": 5.37,
|
|
96
|
+
"94": 6.16,
|
|
97
|
+
"95": 7.4
|
|
98
|
+
},
|
|
99
|
+
"fRHSS": {
|
|
100
|
+
"1": 1.0,
|
|
101
|
+
"2": 1.0,
|
|
102
|
+
"3": 1.0,
|
|
103
|
+
"4": 1.0,
|
|
104
|
+
"5": 1.0,
|
|
105
|
+
"6": 1.0,
|
|
106
|
+
"7": 1.0,
|
|
107
|
+
"8": 1.0,
|
|
108
|
+
"9": 1.0,
|
|
109
|
+
"10": 1.0,
|
|
110
|
+
"11": 1.0,
|
|
111
|
+
"12": 1.0,
|
|
112
|
+
"13": 1.0,
|
|
113
|
+
"14": 1.0,
|
|
114
|
+
"15": 1.0,
|
|
115
|
+
"16": 1.0,
|
|
116
|
+
"17": 1.0,
|
|
117
|
+
"18": 1.0,
|
|
118
|
+
"19": 1.0,
|
|
119
|
+
"20": 1.0,
|
|
120
|
+
"21": 1.0,
|
|
121
|
+
"22": 1.0,
|
|
122
|
+
"23": 1.0,
|
|
123
|
+
"24": 1.0,
|
|
124
|
+
"25": 1.0,
|
|
125
|
+
"26": 1.0,
|
|
126
|
+
"27": 1.0,
|
|
127
|
+
"28": 1.0,
|
|
128
|
+
"29": 1.0,
|
|
129
|
+
"30": 1.0,
|
|
130
|
+
"31": 1.0,
|
|
131
|
+
"32": 1.0,
|
|
132
|
+
"33": 1.0,
|
|
133
|
+
"34": 1.0,
|
|
134
|
+
"35": 1.0,
|
|
135
|
+
"36": 1.0,
|
|
136
|
+
"37": 1.0,
|
|
137
|
+
"38": 1.0,
|
|
138
|
+
"39": 1.0,
|
|
139
|
+
"40": 1.0,
|
|
140
|
+
"41": 1.0,
|
|
141
|
+
"42": 1.0,
|
|
142
|
+
"43": 1.0,
|
|
143
|
+
"44": 1.0,
|
|
144
|
+
"45": 1.0,
|
|
145
|
+
"46": 1.0,
|
|
146
|
+
"47": 2.3584,
|
|
147
|
+
"48": 2.3799,
|
|
148
|
+
"49": 2.4204,
|
|
149
|
+
"50": 2.4488,
|
|
150
|
+
"51": 2.4848,
|
|
151
|
+
"52": 2.5006,
|
|
152
|
+
"53": 2.5052,
|
|
153
|
+
"54": 2.5279,
|
|
154
|
+
"55": 2.5614,
|
|
155
|
+
"56": 2.5848,
|
|
156
|
+
"57": 2.5888,
|
|
157
|
+
"58": 2.616,
|
|
158
|
+
"59": 2.6581,
|
|
159
|
+
"60": 2.6866,
|
|
160
|
+
"61": 2.7341,
|
|
161
|
+
"62": 2.7834,
|
|
162
|
+
"63": 2.8272,
|
|
163
|
+
"64": 2.8287,
|
|
164
|
+
"65": 2.8594,
|
|
165
|
+
"66": 2.8943,
|
|
166
|
+
"67": 2.9105,
|
|
167
|
+
"68": 2.9451,
|
|
168
|
+
"69": 3.0105,
|
|
169
|
+
"70": 3.0485,
|
|
170
|
+
"71": 3.1269,
|
|
171
|
+
"72": 3.1729,
|
|
172
|
+
"73": 3.2055,
|
|
173
|
+
"74": 3.2459,
|
|
174
|
+
"75": 3.2673,
|
|
175
|
+
"76": 3.3478,
|
|
176
|
+
"77": 3.4174,
|
|
177
|
+
"78": 3.5202,
|
|
178
|
+
"79": 3.5744,
|
|
179
|
+
"80": 3.6329,
|
|
180
|
+
"81": 3.6905,
|
|
181
|
+
"82": 3.808,
|
|
182
|
+
"83": 3.9505,
|
|
183
|
+
"84": 4.0398,
|
|
184
|
+
"85": 4.1127,
|
|
185
|
+
"86": 4.2824,
|
|
186
|
+
"87": 4.494,
|
|
187
|
+
"88": 4.6078,
|
|
188
|
+
"89": 4.8573,
|
|
189
|
+
"90": 5.1165,
|
|
190
|
+
"91": 5.3844,
|
|
191
|
+
"92": 5.7457,
|
|
192
|
+
"93": 6.1704,
|
|
193
|
+
"94": 6.7178,
|
|
194
|
+
"95": 7.3492
|
|
195
|
+
},
|
|
196
|
+
"fRHs": {
|
|
197
|
+
"1": 1.0,
|
|
198
|
+
"2": 1.0,
|
|
199
|
+
"3": 1.0,
|
|
200
|
+
"4": 1.0,
|
|
201
|
+
"5": 1.0,
|
|
202
|
+
"6": 1.0,
|
|
203
|
+
"7": 1.0,
|
|
204
|
+
"8": 1.0,
|
|
205
|
+
"9": 1.0,
|
|
206
|
+
"10": 1.0,
|
|
207
|
+
"11": 1.0,
|
|
208
|
+
"12": 1.0,
|
|
209
|
+
"13": 1.0,
|
|
210
|
+
"14": 1.0,
|
|
211
|
+
"15": 1.0,
|
|
212
|
+
"16": 1.0,
|
|
213
|
+
"17": 1.0,
|
|
214
|
+
"18": 1.0,
|
|
215
|
+
"19": 1.0,
|
|
216
|
+
"20": 1.0,
|
|
217
|
+
"21": 1.0,
|
|
218
|
+
"22": 1.0,
|
|
219
|
+
"23": 1.0,
|
|
220
|
+
"24": 1.0,
|
|
221
|
+
"25": 1.0,
|
|
222
|
+
"26": 1.0,
|
|
223
|
+
"27": 1.0,
|
|
224
|
+
"28": 1.0,
|
|
225
|
+
"29": 1.0,
|
|
226
|
+
"30": 1.0,
|
|
227
|
+
"31": 1.0,
|
|
228
|
+
"32": 1.0,
|
|
229
|
+
"33": 1.0,
|
|
230
|
+
"34": 1.0,
|
|
231
|
+
"35": 1.0,
|
|
232
|
+
"36": 1.0,
|
|
233
|
+
"37": 1.38,
|
|
234
|
+
"38": 1.4,
|
|
235
|
+
"39": 1.42,
|
|
236
|
+
"40": 1.44,
|
|
237
|
+
"41": 1.46,
|
|
238
|
+
"42": 1.48,
|
|
239
|
+
"43": 1.49,
|
|
240
|
+
"44": 1.51,
|
|
241
|
+
"45": 1.53,
|
|
242
|
+
"46": 1.55,
|
|
243
|
+
"47": 1.57,
|
|
244
|
+
"48": 1.59,
|
|
245
|
+
"49": 1.62,
|
|
246
|
+
"50": 1.64,
|
|
247
|
+
"51": 1.66,
|
|
248
|
+
"52": 1.68,
|
|
249
|
+
"53": 1.71,
|
|
250
|
+
"54": 1.73,
|
|
251
|
+
"55": 1.76,
|
|
252
|
+
"56": 1.78,
|
|
253
|
+
"57": 1.81,
|
|
254
|
+
"58": 1.83,
|
|
255
|
+
"59": 1.86,
|
|
256
|
+
"60": 1.89,
|
|
257
|
+
"61": 1.92,
|
|
258
|
+
"62": 1.95,
|
|
259
|
+
"63": 1.99,
|
|
260
|
+
"64": 2.02,
|
|
261
|
+
"65": 2.06,
|
|
262
|
+
"66": 2.09,
|
|
263
|
+
"67": 2.13,
|
|
264
|
+
"68": 2.17,
|
|
265
|
+
"69": 2.22,
|
|
266
|
+
"70": 2.26,
|
|
267
|
+
"71": 2.31,
|
|
268
|
+
"72": 2.36,
|
|
269
|
+
"73": 2.41,
|
|
270
|
+
"74": 2.47,
|
|
271
|
+
"75": 2.54,
|
|
272
|
+
"76": 2.6,
|
|
273
|
+
"77": 2.67,
|
|
274
|
+
"78": 2.75,
|
|
275
|
+
"79": 2.84,
|
|
276
|
+
"80": 2.93,
|
|
277
|
+
"81": 3.03,
|
|
278
|
+
"82": 3.15,
|
|
279
|
+
"83": 3.27,
|
|
280
|
+
"84": 3.42,
|
|
281
|
+
"85": 3.58,
|
|
282
|
+
"86": 3.76,
|
|
283
|
+
"87": 3.98,
|
|
284
|
+
"88": 4.23,
|
|
285
|
+
"89": 4.53,
|
|
286
|
+
"90": 4.9,
|
|
287
|
+
"91": 5.35,
|
|
288
|
+
"92": 5.93,
|
|
289
|
+
"93": 6.71,
|
|
290
|
+
"94": 7.78,
|
|
291
|
+
"95": 9.34
|
|
292
|
+
},
|
|
293
|
+
"fRHl": {
|
|
294
|
+
"1": 1.0,
|
|
295
|
+
"2": 1.0,
|
|
296
|
+
"3": 1.0,
|
|
297
|
+
"4": 1.0,
|
|
298
|
+
"5": 1.0,
|
|
299
|
+
"6": 1.0,
|
|
300
|
+
"7": 1.0,
|
|
301
|
+
"8": 1.0,
|
|
302
|
+
"9": 1.0,
|
|
303
|
+
"10": 1.0,
|
|
304
|
+
"11": 1.0,
|
|
305
|
+
"12": 1.0,
|
|
306
|
+
"13": 1.0,
|
|
307
|
+
"14": 1.0,
|
|
308
|
+
"15": 1.0,
|
|
309
|
+
"16": 1.0,
|
|
310
|
+
"17": 1.0,
|
|
311
|
+
"18": 1.0,
|
|
312
|
+
"19": 1.0,
|
|
313
|
+
"20": 1.0,
|
|
314
|
+
"21": 1.0,
|
|
315
|
+
"22": 1.0,
|
|
316
|
+
"23": 1.0,
|
|
317
|
+
"24": 1.0,
|
|
318
|
+
"25": 1.0,
|
|
319
|
+
"26": 1.0,
|
|
320
|
+
"27": 1.0,
|
|
321
|
+
"28": 1.0,
|
|
322
|
+
"29": 1.0,
|
|
323
|
+
"30": 1.0,
|
|
324
|
+
"31": 1.0,
|
|
325
|
+
"32": 1.0,
|
|
326
|
+
"33": 1.0,
|
|
327
|
+
"34": 1.0,
|
|
328
|
+
"35": 1.0,
|
|
329
|
+
"36": 1.0,
|
|
330
|
+
"37": 1.31,
|
|
331
|
+
"38": 1.32,
|
|
332
|
+
"39": 1.34,
|
|
333
|
+
"40": 1.35,
|
|
334
|
+
"41": 1.36,
|
|
335
|
+
"42": 1.38,
|
|
336
|
+
"43": 1.39,
|
|
337
|
+
"44": 1.41,
|
|
338
|
+
"45": 1.42,
|
|
339
|
+
"46": 1.44,
|
|
340
|
+
"47": 1.45,
|
|
341
|
+
"48": 1.47,
|
|
342
|
+
"49": 1.49,
|
|
343
|
+
"50": 1.5,
|
|
344
|
+
"51": 1.52,
|
|
345
|
+
"52": 1.54,
|
|
346
|
+
"53": 1.55,
|
|
347
|
+
"54": 1.57,
|
|
348
|
+
"55": 1.59,
|
|
349
|
+
"56": 1.61,
|
|
350
|
+
"57": 1.63,
|
|
351
|
+
"58": 1.65,
|
|
352
|
+
"59": 1.67,
|
|
353
|
+
"60": 1.69,
|
|
354
|
+
"61": 1.71,
|
|
355
|
+
"62": 1.73,
|
|
356
|
+
"63": 1.75,
|
|
357
|
+
"64": 1.78,
|
|
358
|
+
"65": 1.8,
|
|
359
|
+
"66": 1.83,
|
|
360
|
+
"67": 1.86,
|
|
361
|
+
"68": 1.89,
|
|
362
|
+
"69": 1.92,
|
|
363
|
+
"70": 1.95,
|
|
364
|
+
"71": 1.98,
|
|
365
|
+
"72": 2.01,
|
|
366
|
+
"73": 2.05,
|
|
367
|
+
"74": 2.09,
|
|
368
|
+
"75": 2.13,
|
|
369
|
+
"76": 2.18,
|
|
370
|
+
"77": 2.22,
|
|
371
|
+
"78": 2.27,
|
|
372
|
+
"79": 2.33,
|
|
373
|
+
"80": 2.39,
|
|
374
|
+
"81": 2.45,
|
|
375
|
+
"82": 2.52,
|
|
376
|
+
"83": 2.6,
|
|
377
|
+
"84": 2.69,
|
|
378
|
+
"85": 2.79,
|
|
379
|
+
"86": 2.9,
|
|
380
|
+
"87": 3.02,
|
|
381
|
+
"88": 3.16,
|
|
382
|
+
"89": 3.33,
|
|
383
|
+
"90": 3.53,
|
|
384
|
+
"91": 3.77,
|
|
385
|
+
"92": 4.06,
|
|
386
|
+
"93": 4.43,
|
|
387
|
+
"94": 4.92,
|
|
388
|
+
"95": 5.57
|
|
389
|
+
}
|
|
390
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
from functools import wraps
|
|
2
|
+
from typing import Literal
|
|
3
|
+
|
|
4
|
+
import matplotlib.pyplot as plt
|
|
5
|
+
from matplotlib.pyplot import Axes
|
|
6
|
+
|
|
7
|
+
__all__ = ['set_figure', 'combine_legends', 'auto_label_pct']
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def set_figure(func=None,
|
|
11
|
+
*,
|
|
12
|
+
figsize: tuple | None = None,
|
|
13
|
+
fs: int | None = None,
|
|
14
|
+
fw: str = None,
|
|
15
|
+
autolayout: bool = True):
|
|
16
|
+
# For more details please see https://matplotlib.org/stable/users/explain/customizing.html
|
|
17
|
+
def decorator(_func):
|
|
18
|
+
@wraps(_func)
|
|
19
|
+
def wrapper(*args, **kwargs):
|
|
20
|
+
print(f'\n\tPlot:\033[96m {_func.__name__}\033[0m')
|
|
21
|
+
|
|
22
|
+
plt.rcParams['mathtext.fontset'] = 'custom'
|
|
23
|
+
plt.rcParams['mathtext.rm'] = 'Times New Roman'
|
|
24
|
+
plt.rcParams['mathtext.it'] = 'Times New Roman: italic'
|
|
25
|
+
plt.rcParams['mathtext.bf'] = 'Times New Roman: bold'
|
|
26
|
+
plt.rcParams['mathtext.default'] = 'regular'
|
|
27
|
+
|
|
28
|
+
# The font properties used by `text.Text`.
|
|
29
|
+
# The text, annotate, label, title, ticks, are used to create text
|
|
30
|
+
plt.rcParams['font.family'] = 'Times New Roman'
|
|
31
|
+
plt.rcParams['font.weight'] = fw or 'normal'
|
|
32
|
+
plt.rcParams['font.size'] = fs or 8
|
|
33
|
+
|
|
34
|
+
plt.rcParams['axes.titlesize'] = 'large'
|
|
35
|
+
plt.rcParams['axes.titleweight'] = 'bold'
|
|
36
|
+
plt.rcParams['axes.labelweight'] = 'bold'
|
|
37
|
+
|
|
38
|
+
# color
|
|
39
|
+
plt.rcParams['axes.prop_cycle'] = plt.cycler(color=['b', 'g', 'r', 'c', 'm', 'y', 'k'])
|
|
40
|
+
|
|
41
|
+
plt.rcParams['xtick.labelsize'] = 'medium'
|
|
42
|
+
plt.rcParams['ytick.labelsize'] = 'medium'
|
|
43
|
+
|
|
44
|
+
# matplotlib.font_manager.FontProperties ---> matplotlib.rcParams
|
|
45
|
+
plt.rcParams['legend.loc'] = 'best'
|
|
46
|
+
plt.rcParams['legend.frameon'] = False
|
|
47
|
+
plt.rcParams['legend.fontsize'] = 'small'
|
|
48
|
+
plt.rcParams['legend.title_fontsize'] = 'medium'
|
|
49
|
+
plt.rcParams['legend.handlelength'] = 1.5
|
|
50
|
+
plt.rcParams['legend.labelspacing'] = 0.7
|
|
51
|
+
|
|
52
|
+
plt.rcParams['figure.figsize'] = figsize or (4, 4)
|
|
53
|
+
plt.rcParams['figure.dpi'] = 300
|
|
54
|
+
plt.rcParams['figure.autolayout'] = autolayout
|
|
55
|
+
|
|
56
|
+
if not autolayout:
|
|
57
|
+
plt.rcParams['figure.subplot.left'] = 0.1
|
|
58
|
+
plt.rcParams['figure.subplot.right'] = 0.875
|
|
59
|
+
plt.rcParams['figure.subplot.top'] = 0.875
|
|
60
|
+
plt.rcParams['figure.subplot.bottom'] = 0.125
|
|
61
|
+
|
|
62
|
+
# plt.rcParams['figure.constrained_layout.use'] = True
|
|
63
|
+
|
|
64
|
+
plt.rcParams['savefig.transparent'] = True
|
|
65
|
+
|
|
66
|
+
return _func(*args, **kwargs)
|
|
67
|
+
|
|
68
|
+
return wrapper
|
|
69
|
+
|
|
70
|
+
if func is None:
|
|
71
|
+
return decorator
|
|
72
|
+
|
|
73
|
+
return decorator(func)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def combine_legends(axes_list: list[Axes]) -> tuple[list, list]:
|
|
77
|
+
return (
|
|
78
|
+
[legend for axes in axes_list for legend in axes.get_legend_handles_labels()[0]],
|
|
79
|
+
[label for axes in axes_list for label in axes.get_legend_handles_labels()[1]]
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def auto_label_pct(pct,
|
|
84
|
+
symbol: bool = True,
|
|
85
|
+
include_pct: bool = False,
|
|
86
|
+
ignore: Literal["inner", "outer"] = 'inner',
|
|
87
|
+
value: float = 2):
|
|
88
|
+
if not symbol:
|
|
89
|
+
return ''
|
|
90
|
+
cond = pct <= value if ignore == 'inner' else pct > value
|
|
91
|
+
label = '' if cond else '{:.1f}'.format(pct)
|
|
92
|
+
return '' if label == '' else label + '%' if include_pct else label
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
from sklearn.linear_model import LinearRegression
|
|
3
|
+
from tabulate import tabulate
|
|
4
|
+
|
|
5
|
+
__all__ = ['linear_regression_base']
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def linear_regression_base(x_array: np.ndarray,
|
|
9
|
+
y_array: np.ndarray,
|
|
10
|
+
columns: str | list[str] | None = None,
|
|
11
|
+
positive: bool = True,
|
|
12
|
+
fit_intercept: bool = True):
|
|
13
|
+
if len(x_array.shape) > 1 and x_array.shape[1] >= 2:
|
|
14
|
+
model = LinearRegression(positive=positive, fit_intercept=fit_intercept).fit(x_array, y_array)
|
|
15
|
+
|
|
16
|
+
coefficients = model.coef_[0].round(3)
|
|
17
|
+
intercept = model.intercept_[0].round(3) if fit_intercept else 'None'
|
|
18
|
+
r_square = model.score(x_array, y_array).__round__(3)
|
|
19
|
+
y_predict = model.predict(x_array)
|
|
20
|
+
|
|
21
|
+
equation = ' + '.join([f'{coeff:.3f} * {col}' for coeff, col in zip(coefficients, columns)])
|
|
22
|
+
equation = equation.replace(' + 0.000 * Const', '') # Remove terms with coefficient 0
|
|
23
|
+
|
|
24
|
+
text = 'y = ' + str(equation) + '\n' + r'$\bf R^2 = $' + str(r_square)
|
|
25
|
+
tab = tabulate([[*coefficients, intercept, r_square]], headers=[*columns, 'intercept', 'R^2'], floatfmt=".3f",
|
|
26
|
+
tablefmt="fancy_grid")
|
|
27
|
+
print('\n' + tab)
|
|
28
|
+
|
|
29
|
+
return text, y_predict, coefficients
|
|
30
|
+
|
|
31
|
+
else:
|
|
32
|
+
x_array = x_array.reshape(-1, 1)
|
|
33
|
+
y_array = y_array.reshape(-1, 1)
|
|
34
|
+
|
|
35
|
+
model = LinearRegression(positive=positive, fit_intercept=fit_intercept).fit(x_array, y_array)
|
|
36
|
+
|
|
37
|
+
slope = model.coef_[0][0].round(3)
|
|
38
|
+
intercept = model.intercept_[0].round(3) if fit_intercept else 'None'
|
|
39
|
+
r_square = model.score(x_array, y_array).__round__(3)
|
|
40
|
+
y_predict = model.predict(x_array)
|
|
41
|
+
|
|
42
|
+
text = np.poly1d([slope, intercept])
|
|
43
|
+
text = 'y = ' + str(text).replace('\n', "") + '\n' + r'$\bf R^2 = $' + str(r_square)
|
|
44
|
+
|
|
45
|
+
tab = tabulate([[slope, intercept, r_square]], headers=['slope', 'intercept', 'R^2'], floatfmt=".3f",
|
|
46
|
+
tablefmt="fancy_grid")
|
|
47
|
+
print('\n' + tab)
|
|
48
|
+
|
|
49
|
+
return text, y_predict, slope
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ALWC": "ALWC (\u00b5g/m^3)",
|
|
3
|
+
"AN": "AN (\u00b5g/m^3)",
|
|
4
|
+
"AS": "AS (\u00b5g/m^3)",
|
|
5
|
+
"T_EC": "EC (\u00b5g/m^3)",
|
|
6
|
+
"T_OC": "OC (\u00b5g/m^3)",
|
|
7
|
+
"PM1": "PM_{1} (\u00b5g/m^3)",
|
|
8
|
+
"PM25": "PM_{2.5} (\u00b5g/m^3)",
|
|
9
|
+
"PM2.5": "PM_{2.5} (\u00b5g/m^3)",
|
|
10
|
+
"PM10": "PM_{10} (\u00b5g/m^3)",
|
|
11
|
+
"SIA": "SIA (\u00b5g/m^3)",
|
|
12
|
+
"POC": "POC (\u00b5g/m^3)",
|
|
13
|
+
"SOC": "SOC (\u00b5g/m^3)",
|
|
14
|
+
"total_mass": "Reconstructed PM_{2.5} (\u00b5g/m^3)",
|
|
15
|
+
"PM1/PM25": "PM_{1} / PM_{2.5}",
|
|
16
|
+
"OM_mass_ratio": "OM ratio (%)",
|
|
17
|
+
"EC_mass_ratio": "EC/PM_{2.5}",
|
|
18
|
+
"AS_mass_ratio": "AS ratio (%)",
|
|
19
|
+
"AN_mass_ratio": "AN ratio (%)",
|
|
20
|
+
"ALWC_mass_ratio": "ALWC/PM_{2.5}",
|
|
21
|
+
"SIA_mass_ratio": "SIA/PM_{2.5}",
|
|
22
|
+
"Babs": "Mie Amb Absorption (1/Mm)",
|
|
23
|
+
"Babs_dry": "Mie Dry Absorption (1/Mm)",
|
|
24
|
+
"Absorption": "Absorption (1/Mm)",
|
|
25
|
+
"abs": "Absorption (1/Mm)",
|
|
26
|
+
"Bext": "Mie Amb Extinction (1/Mm)",
|
|
27
|
+
"Bext_dry": "Mie Dry Extinction (1/Mm)",
|
|
28
|
+
"Extinction": "Extinction (1/Mm)",
|
|
29
|
+
"ext": "Extinction (1/Mm)",
|
|
30
|
+
"Bsca": "Mie Amb Scattering (1/Mm)",
|
|
31
|
+
"Bsca_dry": "Mie Dry Scattering (1/Mm)",
|
|
32
|
+
"Scattering": "Scattering (1/Mm)",
|
|
33
|
+
"sca": "Scattering (1/Mm)",
|
|
34
|
+
"Diurnal": "Hour",
|
|
35
|
+
"PBLH": "PBLH (m)",
|
|
36
|
+
"VC": "VC (m²/s)",
|
|
37
|
+
"MAC": "MAC (m²/g)",
|
|
38
|
+
"MAE": "MAE (m²/g)",
|
|
39
|
+
"MEE": "MEE (m²/g)",
|
|
40
|
+
"MSE": "MSE (m²/g)",
|
|
41
|
+
"SSA": "SSA",
|
|
42
|
+
"AAE": "AAE",
|
|
43
|
+
"Localized": "Reconstructed Extinction (1/Mm)",
|
|
44
|
+
"Modified": "Reconstructed Extinction (1/Mm)",
|
|
45
|
+
"Revised": "Reconstructed Extinction (1/Mm)",
|
|
46
|
+
"Measured": "Measured Extinction (1/Mm)",
|
|
47
|
+
"SOR": "SOR",
|
|
48
|
+
"NOR": "NOR",
|
|
49
|
+
"O3": "O_{3} (ppb)",
|
|
50
|
+
"NO2": "NO_{2} (ppb)",
|
|
51
|
+
"CO": "CO (ppm)",
|
|
52
|
+
"SO2": "SO_{2} (ppb)",
|
|
53
|
+
"kappa": "kappa",
|
|
54
|
+
"RH": "RH (\\%)",
|
|
55
|
+
"gRH": "g(RH)",
|
|
56
|
+
"fRH": "f(RH)",
|
|
57
|
+
"Factor": "Factor",
|
|
58
|
+
"Bext_internal": "Bext_{internal}",
|
|
59
|
+
"Bsca_internal": "Bsca_{internal}",
|
|
60
|
+
"Babs_internal": "Babs_{internal}",
|
|
61
|
+
"Bext_external": "Bext_{external}",
|
|
62
|
+
"Bsca_external": "Bsca_{external}",
|
|
63
|
+
"Babs_external": "Babs_{external}",
|
|
64
|
+
"Bext_dry_external": "Dry Bext_{external}",
|
|
65
|
+
"Bsca_dry_external": "Dry Bsca_{external}",
|
|
66
|
+
"Babs_dry_external": "Dry Babs_{external}",
|
|
67
|
+
"Bext_Fixed_PNSD": "Mie Amb Extinction (1/Mm)",
|
|
68
|
+
"Bext_Fixed_RI": "Mie Amb Extinction (1/Mm)",
|
|
69
|
+
"ABC": "ABC (%)",
|
|
70
|
+
"CPC_1": "CPC_1 ({\\#}/cm^{3})",
|
|
71
|
+
"CPC_2": "CPC_2 ({\\#}/cm^{3})",
|
|
72
|
+
"BC6": "BC6 (ng/cm^{3}) (880 nm)",
|
|
73
|
+
"IR BCc": "IR BCc (ng/cm^{3}) (880 nm)",
|
|
74
|
+
"AT": "Temp (^{\\circ}C)",
|
|
75
|
+
"WS": "WS (m/s)",
|
|
76
|
+
"WD": "WD ({\\circ})",
|
|
77
|
+
"y_actual": "y_{actual}",
|
|
78
|
+
"y_predict": "y_{predict}",
|
|
79
|
+
"PG": "Extinction (1/Mm)",
|
|
80
|
+
"Number_dist": "dN/dlogdp (nm^{-1}/cm^3)",
|
|
81
|
+
"Surface_dist": "dS/dlogdp (nm/cm^3)",
|
|
82
|
+
"Volume_dist": "dV/dlogdp (nm^2/cm^3)",
|
|
83
|
+
"Extinction_dist": "d{\\sigma}/dlogdp (1/Mm)",
|
|
84
|
+
"Vis_LPV": "Visibility (km)",
|
|
85
|
+
"Vis_LPV_1": "Visibility (km)",
|
|
86
|
+
"MA350_0171 IR BCc": "MA350-0171 IR BCc (ng/cm^{3}) (880 nm)",
|
|
87
|
+
"MA350_0176 IR BCc": "MA350-0176 IR BCc (ng/cm^{3}) (880 nm)",
|
|
88
|
+
"BC1054 IR BCc": "BC-1054 IR BCc (ng/cm^{3}) (880 nm)"
|
|
89
|
+
}
|
AeroViz/plot/violin.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import matplotlib.pyplot as plt
|
|
2
|
+
import numpy as np
|
|
3
|
+
import pandas as pd
|
|
4
|
+
import seaborn as sns
|
|
5
|
+
from matplotlib.pyplot import Figure, Axes
|
|
6
|
+
from pandas import DataFrame
|
|
7
|
+
|
|
8
|
+
from AeroViz.plot.utils import *
|
|
9
|
+
|
|
10
|
+
__all__ = ['violin']
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@set_figure(fw='bold')
|
|
14
|
+
def violin(df: DataFrame | dict,
|
|
15
|
+
unit: str,
|
|
16
|
+
ax: Axes | None = None,
|
|
17
|
+
**kwargs
|
|
18
|
+
) -> tuple[Figure, Axes]:
|
|
19
|
+
"""
|
|
20
|
+
Generate a violin plot for multiple data sets.
|
|
21
|
+
|
|
22
|
+
Parameters
|
|
23
|
+
----------
|
|
24
|
+
df : pd.DataFrame or dict
|
|
25
|
+
A mapping from category names to pandas DataFrames containing the data.
|
|
26
|
+
unit : str
|
|
27
|
+
The unit for the data being plotted.
|
|
28
|
+
ax : matplotlib.axes.Axes, optional
|
|
29
|
+
The Axes object to draw the plot onto. If not provided, a new figure will be created.
|
|
30
|
+
**kwargs : dict
|
|
31
|
+
Additional keyword arguments to be passed to the violinplot function.
|
|
32
|
+
|
|
33
|
+
Returns
|
|
34
|
+
-------
|
|
35
|
+
fig : Figure
|
|
36
|
+
The matplotlib Figure object.
|
|
37
|
+
ax : Axes
|
|
38
|
+
The matplotlib Axes object with the scatter plot.
|
|
39
|
+
|
|
40
|
+
"""
|
|
41
|
+
fig, ax = plt.subplots(**kwargs.get('fig_kws', {})) if ax is None else (ax.get_figure(), ax)
|
|
42
|
+
|
|
43
|
+
data = df.to_numpy()
|
|
44
|
+
|
|
45
|
+
data = data[~np.isnan(data).any(axis=1)]
|
|
46
|
+
|
|
47
|
+
grps = data.shape[1]
|
|
48
|
+
|
|
49
|
+
width = 0.6
|
|
50
|
+
block = width / 2
|
|
51
|
+
x_position = np.arange(grps)
|
|
52
|
+
|
|
53
|
+
plt.boxplot(data, positions=x_position, widths=0.15,
|
|
54
|
+
showfliers=False, showmeans=True, meanline=False, patch_artist=True,
|
|
55
|
+
capprops=dict(linewidth=0),
|
|
56
|
+
whiskerprops=dict(linewidth=1.5, color='k', alpha=1),
|
|
57
|
+
boxprops=dict(linewidth=1.5, color='k', facecolor='#4778D3', alpha=1),
|
|
58
|
+
meanprops=dict(marker='o', markeredgecolor='black', markerfacecolor='white', markersize=6),
|
|
59
|
+
medianprops=dict(linewidth=1.5, ls='-', color='k', alpha=1))
|
|
60
|
+
|
|
61
|
+
sns.violinplot(data=data, density_norm='area', color='#4778D3', inner=None)
|
|
62
|
+
|
|
63
|
+
for violin, alpha in zip(ax.collections[:], [0.5] * len(ax.collections[:])):
|
|
64
|
+
violin.set_alpha(alpha)
|
|
65
|
+
violin.set_edgecolor(None)
|
|
66
|
+
|
|
67
|
+
plt.scatter(x_position, data.mean(), marker='o', facecolor='white', edgecolor='k', s=10)
|
|
68
|
+
|
|
69
|
+
xlim = kwargs.get('xlim') or (x_position[0] - (width / 2 + block), x_position[-1] + (width / 2 + block))
|
|
70
|
+
ylim = kwargs.get('ylim') or (0, None)
|
|
71
|
+
xlabel = kwargs.get('xlabel') or ''
|
|
72
|
+
ylabel = kwargs.get('ylabel') or Unit(unit)
|
|
73
|
+
xticks = kwargs.get('xticks') or [x.replace('-', '\n') for x in list(df.keys())]
|
|
74
|
+
|
|
75
|
+
ax.set(xlim=xlim, ylim=ylim, xlabel=xlabel, ylabel=ylabel, title=kwargs.get('title'))
|
|
76
|
+
ax.set_xticks(x_position, xticks, fontweight='bold', fontsize=12)
|
|
77
|
+
|
|
78
|
+
plt.show()
|
|
79
|
+
|
|
80
|
+
return fig, ax
|