AeroViz 0.1.2__py3-none-any.whl → 0.1.3b0__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.
Potentially problematic release.
This version of AeroViz might be problematic. Click here for more details.
- AeroViz/__init__.py +4 -4
- AeroViz/config/DEFAULT_DATA.csv +1417 -0
- AeroViz/config/DEFAULT_PNSD_DATA.csv +1417 -0
- AeroViz/dataProcess/Chemistry/__init__.py +38 -38
- AeroViz/dataProcess/Chemistry/_calculate.py +15 -15
- AeroViz/dataProcess/Chemistry/_isoropia.py +69 -68
- AeroViz/dataProcess/Chemistry/_mass_volume.py +158 -158
- AeroViz/dataProcess/Chemistry/_ocec.py +109 -109
- AeroViz/dataProcess/Chemistry/_partition.py +19 -18
- AeroViz/dataProcess/Chemistry/_teom.py +8 -11
- AeroViz/dataProcess/Optical/_IMPROVE.py +40 -39
- AeroViz/dataProcess/Optical/__init__.py +35 -35
- AeroViz/dataProcess/Optical/_absorption.py +35 -35
- AeroViz/dataProcess/Optical/_extinction.py +25 -24
- AeroViz/dataProcess/Optical/_mie.py +5 -6
- AeroViz/dataProcess/Optical/_mie_sd.py +89 -90
- AeroViz/dataProcess/Optical/_scattering.py +16 -16
- AeroViz/dataProcess/SizeDistr/__init__.py +37 -37
- AeroViz/dataProcess/SizeDistr/__merge.py +159 -158
- AeroViz/dataProcess/SizeDistr/_merge.py +155 -154
- AeroViz/dataProcess/SizeDistr/_merge_v1.py +162 -161
- AeroViz/dataProcess/SizeDistr/_merge_v2.py +153 -152
- AeroViz/dataProcess/SizeDistr/_merge_v3.py +326 -326
- AeroViz/dataProcess/SizeDistr/_merge_v4.py +272 -274
- AeroViz/dataProcess/SizeDistr/_size_distr.py +51 -51
- AeroViz/dataProcess/VOC/__init__.py +7 -7
- AeroViz/dataProcess/VOC/_potential_par.py +53 -55
- AeroViz/dataProcess/VOC/voc_par.json +464 -0
- AeroViz/dataProcess/__init__.py +4 -4
- AeroViz/dataProcess/core/__init__.py +59 -58
- AeroViz/plot/__init__.py +6 -1
- AeroViz/plot/bar.py +126 -0
- AeroViz/plot/box.py +68 -0
- AeroViz/plot/distribution/distribution.py +421 -427
- AeroViz/plot/meteorology/meteorology.py +240 -292
- AeroViz/plot/optical/__init__.py +0 -1
- AeroViz/plot/optical/optical.py +230 -230
- AeroViz/plot/pie.py +198 -0
- AeroViz/plot/regression.py +210 -0
- AeroViz/plot/scatter.py +99 -0
- AeroViz/plot/templates/__init__.py +0 -3
- AeroViz/plot/templates/contour.py +25 -25
- AeroViz/plot/templates/corr_matrix.py +86 -93
- AeroViz/plot/templates/diurnal_pattern.py +24 -24
- AeroViz/plot/templates/koschmieder.py +106 -106
- AeroViz/plot/templates/metal_heatmap.py +34 -34
- AeroViz/plot/timeseries/timeseries.py +53 -60
- AeroViz/plot/utils/__init__.py +2 -1
- AeroViz/plot/utils/_color.py +57 -57
- AeroViz/plot/utils/_unit.py +48 -48
- 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 +84 -0
- AeroViz/plot/violin.py +79 -0
- AeroViz/process/__init__.py +15 -15
- AeroViz/process/core/DataProc.py +9 -9
- AeroViz/process/core/SizeDist.py +81 -81
- AeroViz/process/method/PyMieScatt_update.py +488 -488
- AeroViz/process/method/mie_theory.py +231 -229
- AeroViz/process/method/prop.py +40 -40
- AeroViz/process/script/AbstractDistCalc.py +103 -103
- AeroViz/process/script/Chemical.py +166 -166
- AeroViz/process/script/IMPACT.py +40 -40
- AeroViz/process/script/IMPROVE.py +152 -152
- AeroViz/process/script/Others.py +45 -45
- AeroViz/process/script/PSD.py +26 -26
- AeroViz/process/script/PSD_dry.py +69 -70
- AeroViz/process/script/retrieve_RI.py +50 -51
- AeroViz/rawDataReader/__init__.py +57 -57
- AeroViz/rawDataReader/core/__init__.py +328 -326
- AeroViz/rawDataReader/script/AE33.py +18 -18
- AeroViz/rawDataReader/script/AE43.py +20 -20
- AeroViz/rawDataReader/script/APS_3321.py +30 -30
- AeroViz/rawDataReader/script/Aurora.py +23 -23
- AeroViz/rawDataReader/script/BC1054.py +40 -40
- AeroViz/rawDataReader/script/EPA_vertical.py +9 -9
- AeroViz/rawDataReader/script/GRIMM.py +21 -21
- AeroViz/rawDataReader/script/IGAC_TH.py +67 -67
- AeroViz/rawDataReader/script/IGAC_ZM.py +59 -59
- AeroViz/rawDataReader/script/MA350.py +39 -39
- AeroViz/rawDataReader/script/NEPH.py +74 -74
- AeroViz/rawDataReader/script/OCEC_LCRES.py +21 -21
- AeroViz/rawDataReader/script/OCEC_RES.py +16 -16
- AeroViz/rawDataReader/script/SMPS_TH.py +25 -25
- AeroViz/rawDataReader/script/SMPS_aim11.py +32 -32
- AeroViz/rawDataReader/script/SMPS_genr.py +31 -31
- AeroViz/rawDataReader/script/TEOM.py +28 -28
- AeroViz/rawDataReader/script/Table.py +12 -12
- AeroViz/rawDataReader/script/VOC_TH.py +16 -16
- AeroViz/rawDataReader/script/VOC_ZM.py +28 -28
- AeroViz/rawDataReader/script/__init__.py +20 -20
- AeroViz/rawDataReader/utils/config.py +161 -161
- AeroViz/tools/database.py +65 -65
- AeroViz/tools/dataclassifier.py +106 -106
- AeroViz/tools/dataprinter.py +51 -51
- AeroViz/tools/datareader.py +38 -38
- {AeroViz-0.1.2.dist-info → AeroViz-0.1.3b0.dist-info}/METADATA +5 -4
- AeroViz-0.1.3b0.dist-info/RECORD +110 -0
- AeroViz/config/__init__.py +0 -0
- AeroViz/plot/improve/__init__.py +0 -1
- AeroViz/plot/improve/improve.py +0 -240
- AeroViz/plot/optical/aethalometer.py +0 -77
- AeroViz/plot/templates/event_evolution.py +0 -65
- AeroViz/plot/templates/regression.py +0 -256
- AeroViz/plot/templates/scatter.py +0 -130
- AeroViz/plot/templates/templates.py +0 -398
- AeroViz/plot/utils/_decorator.py +0 -74
- AeroViz-0.1.2.dist-info/RECORD +0 -106
- {AeroViz-0.1.2.dist-info → AeroViz-0.1.3b0.dist-info}/LICENSE +0 -0
- {AeroViz-0.1.2.dist-info → AeroViz-0.1.3b0.dist-info}/WHEEL +0 -0
- {AeroViz-0.1.2.dist-info → AeroViz-0.1.3b0.dist-info}/top_level.txt +0 -0
|
@@ -2,79 +2,79 @@ __all__ = ['_basic']
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
def _geometric_prop(_dp, _prop):
|
|
5
|
-
|
|
5
|
+
import numpy as n
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
_prop_t = _prop.sum(axis=1)
|
|
8
|
+
_prop_t = _prop_t.where(_prop_t > 0).copy()
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
_dp = n.log(_dp)
|
|
11
|
+
_gmd = (((_prop * _dp).sum(axis=1)) / _prop_t.copy())
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
_dp_mesh, _gmd_mesh = n.meshgrid(_dp, _gmd)
|
|
14
|
+
_gsd = ((((_dp_mesh - _gmd_mesh) ** 2) * _prop).sum(axis=1) / _prop_t.copy()) ** .5
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
return _prop_t, _gmd.apply(n.exp), _gsd.apply(n.exp)
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
def _basic(df, hybrid, unit, bin_rg, input_type):
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
import numpy as n
|
|
21
|
+
from pandas import DataFrame
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
## get number conc. data and total, mode
|
|
24
|
+
dN = df
|
|
25
|
+
dN.columns = dN.keys().to_numpy(float)
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
dN_ky = dN.keys()[(dN.keys() >= bin_rg[0]) & (dN.keys() <= bin_rg[-1])]
|
|
28
|
+
dN = dN[dN_ky].copy()
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
out_dic = {}
|
|
31
|
+
## diameter
|
|
32
|
+
dp = dN.keys().to_numpy()
|
|
33
|
+
if hybrid:
|
|
34
|
+
dlog_dp = n.diff(n.log10(dp)).mean()
|
|
35
|
+
else:
|
|
36
|
+
dlog_dp = n.ones(dp.size)
|
|
37
|
+
dlog_dp[:hybrid] = n.diff(n.log10(dp[:hybrid])).mean()
|
|
38
|
+
dlog_dp[hybrid:] = n.diff(n.log10(dp[hybrid:])).mean()
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
## calculate normalize and non-normalize data
|
|
41
|
+
if input_type == 'norm':
|
|
42
|
+
out_dic['number'] = (dN * dlog_dp).copy()
|
|
43
|
+
out_dic['number_norm'] = dN.copy()
|
|
44
|
+
else:
|
|
45
|
+
out_dic['number'] = dN.copy()
|
|
46
|
+
out_dic['number_norm'] = (dN / dlog_dp).copy()
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
out_dic['surface'] = out_dic['number'] * n.pi * dp ** 2
|
|
49
|
+
out_dic['volume'] = out_dic['number'] * n.pi * (dp ** 3) / 6
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
out_dic['surface_norm'] = out_dic['number_norm'] * n.pi * dp ** 2
|
|
52
|
+
out_dic['volume_norm'] = out_dic['number_norm'] * n.pi * (dp ** 3) / 6
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
## size range mode process
|
|
55
|
+
df_oth = DataFrame(index=dN.index)
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
bound = n.array([(dp.min(), dp.max() + 1), (10, 25), (25, 100), (100, 1e3), (1e3, 2.5e3), ])
|
|
58
|
+
if unit == 'um':
|
|
59
|
+
bound[1:] /= 1e3
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
for _tp_nam, _tp_dt in zip(['num', 'surf', 'vol'], [out_dic['number'], out_dic['surface'], out_dic['volume']]):
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
for _md_nam, _range in zip(['all', 'Nucleation', 'Aitken', 'Accumulation', 'Coarse'], bound):
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
_dia = dp[(dp >= _range[0]) & (dp < _range[-1])]
|
|
66
|
+
if ~_dia.any(): continue
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
_dt = _tp_dt[_dia].copy()
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
df_oth[f'total_{_tp_nam}_{_md_nam}'], df_oth[f'GMD_{_tp_nam}_{_md_nam}'], df_oth[
|
|
71
|
+
f'GSD_{_tp_nam}_{_md_nam}'] = _geometric_prop(_dia, _dt)
|
|
72
|
+
df_oth[f'mode_{_tp_nam}_{_md_nam}'] = _dt.idxmax(axis=1)
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
## out
|
|
75
|
+
out_dic['other'] = df_oth
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
return out_dic
|
|
78
78
|
|
|
79
79
|
# old 20230113
|
|
80
80
|
|
|
@@ -2,18 +2,18 @@ from ..core import _writter, _run_process
|
|
|
2
2
|
|
|
3
3
|
__all__ = [
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
'VOC',
|
|
6
6
|
|
|
7
7
|
]
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class VOC(_writter):
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
## Reconstruction
|
|
13
|
+
@_run_process('VOC - basic', 'voc_basic')
|
|
14
|
+
def VOC_basic(self, _df_voc):
|
|
15
|
+
from ._potential_par import _basic
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
out = _basic(_df_voc)
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
return self, out
|
|
@@ -1,76 +1,74 @@
|
|
|
1
|
-
from datetime import datetime as dtm
|
|
2
|
-
from pandas import DataFrame, to_datetime, read_json
|
|
3
|
-
from pathlib import Path
|
|
4
1
|
import pickle as pkl
|
|
2
|
+
from pathlib import Path
|
|
5
3
|
|
|
6
|
-
import
|
|
4
|
+
from pandas import DataFrame, read_json
|
|
7
5
|
|
|
8
6
|
|
|
9
7
|
def _basic(_df_voc):
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
## parameter
|
|
9
|
+
_keys = _df_voc.keys()
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
with (Path(__file__).parent / 'voc_par.pkl').open('rb') as f:
|
|
12
|
+
_par = pkl.load(f)
|
|
13
|
+
_MW, _MIR, _SOAP, _KOH = _par.loc['MW', _keys], _par.loc['MIR', _keys], _par.loc['SOAP', _keys], _par.loc[
|
|
14
|
+
'KOH', _keys]
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
with (Path(__file__).parent / 'voc_par.json').open('r', encoding='utf-8', errors='ignore') as f:
|
|
17
|
+
_parr = read_json(f)
|
|
18
|
+
_MW, _MIR, _SOAP, _KOH = _par.loc['MW', _keys], _par.loc['MIR', _keys], _par.loc['SOAP', _keys], _par.loc[
|
|
19
|
+
'KOH', _keys]
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
_voc_clasfy = {
|
|
22
|
+
'alkane_total': ['Isopentane', 'n-Butane', '2-Methylhexane', 'Cyclopentane', '3-Methylpentane',
|
|
23
|
+
'2,3-Dimethylbutane',
|
|
24
|
+
'2-Methylheptane', 'n-Nonane', 'Methylcyclohexane', '2,4-Dimethylpentane', '2-Methylpentane',
|
|
25
|
+
'n-Decane',
|
|
26
|
+
'n-Heptane', 'Cyclohexane', 'n-Octane', 'Isobutane', '2,2-Dimethylbutane',
|
|
27
|
+
'Methylcyclopentane', 'n-Hexane',
|
|
28
|
+
'2,3,4-Trimethylpentane', '3-Methylhexane', 'n-Undecane', '3-Methylheptane', 'Hexane',
|
|
29
|
+
'2,2,4-Trimethylpentane', 'n-Pentane', 'Ethane', 'Propane'],
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
'alkane_total': ['Isoprene', '1-Butene', 'cis-2-Butene', 'Propene', '1.3-Butadiene',
|
|
32
|
+
't-2-Butene', 'cis-2-Pentene', 'Propylene', 'isoprene', '1-Pentene',
|
|
33
|
+
'Ethylene', 't-2-Pentene', '1-Octene'],
|
|
36
34
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
'aromatic_total': ['o-Ethyltoluene', '1,3,5-Trimethylbenzene', 'Ethylbenzene', 'm,p-Xylene', 'n-Propylbenzene',
|
|
36
|
+
'Benzene', 'Toluene', '1.2.4-TMB', 'Styrene', 'p-Ethyltoluene', 'o-Xylene',
|
|
37
|
+
'm-Diethylbenzene',
|
|
38
|
+
'1.2.3-TMB', 'Isopropylbenzene', 'm-Ethyltoluene', '2-Ethyltoluene', '1.3.5-TMB',
|
|
39
|
+
'Iso-Propylbenzene',
|
|
40
|
+
'3.4-Ethyltoluene', 'p-Diethylbenzene', '1,2,4-Trimethylbenzene', 'm.p-Xylene',
|
|
41
|
+
'1,2,3-Trimethylbenzene'],
|
|
44
42
|
|
|
45
|
-
|
|
43
|
+
'alkyne_total': ['Acetylene'],
|
|
46
44
|
|
|
47
|
-
|
|
45
|
+
'OVOC': ['Acetaldehyde', 'Ethanol', 'Acetone', 'IPA', 'Ethyl Acetate', 'Butyl Acetate'],
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
'ClVOC': ['VCM', 'TCE', 'PCE', '1.4-DCB', '1.2-DCB'],
|
|
48
|
+
}
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
_df_MW = (_df_voc * _MW).copy()
|
|
51
|
+
_df_dic = {
|
|
52
|
+
'Conc': _df_voc.copy(),
|
|
53
|
+
'OFP': _df_MW / 48 * _MIR,
|
|
54
|
+
'SOAP': _df_MW / 24.5 * _SOAP / 100 * 0.054,
|
|
55
|
+
'LOH': _df_MW / 24.5 / _MW * 0.602 * _KOH,
|
|
56
|
+
}
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
## calculate
|
|
59
|
+
_out = {}
|
|
60
|
+
for _nam, _df in _df_dic.items():
|
|
63
61
|
|
|
64
|
-
|
|
62
|
+
_df_out = DataFrame(index=_df_voc.index)
|
|
65
63
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
for _voc_nam, _voc_lst in _voc_clasfy.items():
|
|
65
|
+
_lst = list(set(_keys) & set(_voc_lst))
|
|
66
|
+
if len(_lst) == 0: continue
|
|
69
67
|
|
|
70
|
-
|
|
68
|
+
_df_out[_voc_nam] = _df[_lst].sum(axis=1, min_count=1)
|
|
71
69
|
|
|
72
|
-
|
|
70
|
+
_df_out['Total'] = _df.sum(axis=1, min_count=1)
|
|
73
71
|
|
|
74
|
-
|
|
72
|
+
_out[_nam] = _df_out
|
|
75
73
|
|
|
76
|
-
|
|
74
|
+
return _out
|