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.

Files changed (112) hide show
  1. AeroViz/__init__.py +4 -4
  2. AeroViz/config/DEFAULT_DATA.csv +1417 -0
  3. AeroViz/config/DEFAULT_PNSD_DATA.csv +1417 -0
  4. AeroViz/dataProcess/Chemistry/__init__.py +38 -38
  5. AeroViz/dataProcess/Chemistry/_calculate.py +15 -15
  6. AeroViz/dataProcess/Chemistry/_isoropia.py +69 -68
  7. AeroViz/dataProcess/Chemistry/_mass_volume.py +158 -158
  8. AeroViz/dataProcess/Chemistry/_ocec.py +109 -109
  9. AeroViz/dataProcess/Chemistry/_partition.py +19 -18
  10. AeroViz/dataProcess/Chemistry/_teom.py +8 -11
  11. AeroViz/dataProcess/Optical/_IMPROVE.py +40 -39
  12. AeroViz/dataProcess/Optical/__init__.py +35 -35
  13. AeroViz/dataProcess/Optical/_absorption.py +35 -35
  14. AeroViz/dataProcess/Optical/_extinction.py +25 -24
  15. AeroViz/dataProcess/Optical/_mie.py +5 -6
  16. AeroViz/dataProcess/Optical/_mie_sd.py +89 -90
  17. AeroViz/dataProcess/Optical/_scattering.py +16 -16
  18. AeroViz/dataProcess/SizeDistr/__init__.py +37 -37
  19. AeroViz/dataProcess/SizeDistr/__merge.py +159 -158
  20. AeroViz/dataProcess/SizeDistr/_merge.py +155 -154
  21. AeroViz/dataProcess/SizeDistr/_merge_v1.py +162 -161
  22. AeroViz/dataProcess/SizeDistr/_merge_v2.py +153 -152
  23. AeroViz/dataProcess/SizeDistr/_merge_v3.py +326 -326
  24. AeroViz/dataProcess/SizeDistr/_merge_v4.py +272 -274
  25. AeroViz/dataProcess/SizeDistr/_size_distr.py +51 -51
  26. AeroViz/dataProcess/VOC/__init__.py +7 -7
  27. AeroViz/dataProcess/VOC/_potential_par.py +53 -55
  28. AeroViz/dataProcess/VOC/voc_par.json +464 -0
  29. AeroViz/dataProcess/__init__.py +4 -4
  30. AeroViz/dataProcess/core/__init__.py +59 -58
  31. AeroViz/plot/__init__.py +6 -1
  32. AeroViz/plot/bar.py +126 -0
  33. AeroViz/plot/box.py +68 -0
  34. AeroViz/plot/distribution/distribution.py +421 -427
  35. AeroViz/plot/meteorology/meteorology.py +240 -292
  36. AeroViz/plot/optical/__init__.py +0 -1
  37. AeroViz/plot/optical/optical.py +230 -230
  38. AeroViz/plot/pie.py +198 -0
  39. AeroViz/plot/regression.py +210 -0
  40. AeroViz/plot/scatter.py +99 -0
  41. AeroViz/plot/templates/__init__.py +0 -3
  42. AeroViz/plot/templates/contour.py +25 -25
  43. AeroViz/plot/templates/corr_matrix.py +86 -93
  44. AeroViz/plot/templates/diurnal_pattern.py +24 -24
  45. AeroViz/plot/templates/koschmieder.py +106 -106
  46. AeroViz/plot/templates/metal_heatmap.py +34 -34
  47. AeroViz/plot/timeseries/timeseries.py +53 -60
  48. AeroViz/plot/utils/__init__.py +2 -1
  49. AeroViz/plot/utils/_color.py +57 -57
  50. AeroViz/plot/utils/_unit.py +48 -48
  51. AeroViz/plot/utils/fRH.json +390 -0
  52. AeroViz/plot/utils/plt_utils.py +92 -0
  53. AeroViz/plot/utils/sklearn_utils.py +49 -0
  54. AeroViz/plot/utils/units.json +84 -0
  55. AeroViz/plot/violin.py +79 -0
  56. AeroViz/process/__init__.py +15 -15
  57. AeroViz/process/core/DataProc.py +9 -9
  58. AeroViz/process/core/SizeDist.py +81 -81
  59. AeroViz/process/method/PyMieScatt_update.py +488 -488
  60. AeroViz/process/method/mie_theory.py +231 -229
  61. AeroViz/process/method/prop.py +40 -40
  62. AeroViz/process/script/AbstractDistCalc.py +103 -103
  63. AeroViz/process/script/Chemical.py +166 -166
  64. AeroViz/process/script/IMPACT.py +40 -40
  65. AeroViz/process/script/IMPROVE.py +152 -152
  66. AeroViz/process/script/Others.py +45 -45
  67. AeroViz/process/script/PSD.py +26 -26
  68. AeroViz/process/script/PSD_dry.py +69 -70
  69. AeroViz/process/script/retrieve_RI.py +50 -51
  70. AeroViz/rawDataReader/__init__.py +57 -57
  71. AeroViz/rawDataReader/core/__init__.py +328 -326
  72. AeroViz/rawDataReader/script/AE33.py +18 -18
  73. AeroViz/rawDataReader/script/AE43.py +20 -20
  74. AeroViz/rawDataReader/script/APS_3321.py +30 -30
  75. AeroViz/rawDataReader/script/Aurora.py +23 -23
  76. AeroViz/rawDataReader/script/BC1054.py +40 -40
  77. AeroViz/rawDataReader/script/EPA_vertical.py +9 -9
  78. AeroViz/rawDataReader/script/GRIMM.py +21 -21
  79. AeroViz/rawDataReader/script/IGAC_TH.py +67 -67
  80. AeroViz/rawDataReader/script/IGAC_ZM.py +59 -59
  81. AeroViz/rawDataReader/script/MA350.py +39 -39
  82. AeroViz/rawDataReader/script/NEPH.py +74 -74
  83. AeroViz/rawDataReader/script/OCEC_LCRES.py +21 -21
  84. AeroViz/rawDataReader/script/OCEC_RES.py +16 -16
  85. AeroViz/rawDataReader/script/SMPS_TH.py +25 -25
  86. AeroViz/rawDataReader/script/SMPS_aim11.py +32 -32
  87. AeroViz/rawDataReader/script/SMPS_genr.py +31 -31
  88. AeroViz/rawDataReader/script/TEOM.py +28 -28
  89. AeroViz/rawDataReader/script/Table.py +12 -12
  90. AeroViz/rawDataReader/script/VOC_TH.py +16 -16
  91. AeroViz/rawDataReader/script/VOC_ZM.py +28 -28
  92. AeroViz/rawDataReader/script/__init__.py +20 -20
  93. AeroViz/rawDataReader/utils/config.py +161 -161
  94. AeroViz/tools/database.py +65 -65
  95. AeroViz/tools/dataclassifier.py +106 -106
  96. AeroViz/tools/dataprinter.py +51 -51
  97. AeroViz/tools/datareader.py +38 -38
  98. {AeroViz-0.1.2.dist-info → AeroViz-0.1.3b0.dist-info}/METADATA +5 -4
  99. AeroViz-0.1.3b0.dist-info/RECORD +110 -0
  100. AeroViz/config/__init__.py +0 -0
  101. AeroViz/plot/improve/__init__.py +0 -1
  102. AeroViz/plot/improve/improve.py +0 -240
  103. AeroViz/plot/optical/aethalometer.py +0 -77
  104. AeroViz/plot/templates/event_evolution.py +0 -65
  105. AeroViz/plot/templates/regression.py +0 -256
  106. AeroViz/plot/templates/scatter.py +0 -130
  107. AeroViz/plot/templates/templates.py +0 -398
  108. AeroViz/plot/utils/_decorator.py +0 -74
  109. AeroViz-0.1.2.dist-info/RECORD +0 -106
  110. {AeroViz-0.1.2.dist-info → AeroViz-0.1.3b0.dist-info}/LICENSE +0 -0
  111. {AeroViz-0.1.2.dist-info → AeroViz-0.1.3b0.dist-info}/WHEEL +0 -0
  112. {AeroViz-0.1.2.dist-info → AeroViz-0.1.3b0.dist-info}/top_level.txt +0 -0
@@ -1,36 +1,37 @@
1
- from AeroViz.dataProcess.core import _union_index
2
1
  from pandas import DataFrame
3
2
 
3
+ from AeroViz.dataProcess.core import _union_index
4
+
4
5
 
5
6
  def _basic(df_abs, df_sca, df_ec, df_mass, df_no2):
6
- df_abs, df_sca, df_ec, df_mass, df_no2 = _union_index(df_abs, df_sca, df_ec, df_mass, df_no2)
7
+ df_abs, df_sca, df_ec, df_mass, df_no2 = _union_index(df_abs, df_sca, df_ec, df_mass, df_no2)
7
8
 
8
- df_out = DataFrame()
9
+ df_out = DataFrame()
9
10
 
10
- ## abs and sca coe
11
- df_out['abs'] = df_abs.copy()
12
- df_out['sca'] = df_sca.copy()
11
+ ## abs and sca coe
12
+ df_out['abs'] = df_abs.copy()
13
+ df_out['sca'] = df_sca.copy()
13
14
 
14
- ## extinction coe.
15
- df_out['ext'] = df_out['abs'] + df_out['sca']
15
+ ## extinction coe.
16
+ df_out['ext'] = df_out['abs'] + df_out['sca']
16
17
 
17
- ## SSA
18
- df_out['SSA'] = df_out['sca'] / df_out['ext']
18
+ ## SSA
19
+ df_out['SSA'] = df_out['sca'] / df_out['ext']
19
20
 
20
- ## MAE, MSE, MEE
21
- if df_mass is not None:
22
- df_out['MAE'] = df_out['abs'] / df_mass
23
- df_out['MSE'] = df_out['sca'] / df_mass
24
- df_out['MEE'] = df_out['MSE'] + df_out['MAE']
21
+ ## MAE, MSE, MEE
22
+ if df_mass is not None:
23
+ df_out['MAE'] = df_out['abs'] / df_mass
24
+ df_out['MSE'] = df_out['sca'] / df_mass
25
+ df_out['MEE'] = df_out['MSE'] + df_out['MAE']
25
26
 
26
- ## gas absorbtion
27
- if df_no2 is not None:
28
- df_out['abs_gas'] = df_no2 * .33
29
- df_out['sca_gas'] = 10
30
- df_out['ext_all'] = df_out['ext'] + df_out['abs_gas'] + df_out['sca_gas']
27
+ ## gas absorbtion
28
+ if df_no2 is not None:
29
+ df_out['abs_gas'] = df_no2 * .33
30
+ df_out['sca_gas'] = 10
31
+ df_out['ext_all'] = df_out['ext'] + df_out['abs_gas'] + df_out['sca_gas']
31
32
 
32
- ## other
33
- if df_ec is not None:
34
- df_out['eBC'] = df_ec / 1e3
33
+ ## other
34
+ if df_ec is not None:
35
+ df_out['eBC'] = df_ec / 1e3
35
36
 
36
- return df_out
37
+ return df_out
@@ -2,15 +2,14 @@
2
2
  # from PyMieScatt import Mie_SD
3
3
 
4
4
  from ._mie_sd import Mie_SD
5
- from pandas import date_range, concat, DataFrame, to_numeric
6
5
 
7
6
 
8
7
  def _mie(_psd_ori, _RI_ori, _wave):
9
- _ori_idx = _psd_ori.index.copy()
10
- _cal_idx = _psd_ori.loc[_RI_ori.dropna().index].dropna(how='all').index
8
+ _ori_idx = _psd_ori.index.copy()
9
+ _cal_idx = _psd_ori.loc[_RI_ori.dropna().index].dropna(how='all').index
11
10
 
12
- _psd, _RI = _psd_ori.loc[_cal_idx], _RI_ori.loc[_cal_idx]
11
+ _psd, _RI = _psd_ori.loc[_cal_idx], _RI_ori.loc[_cal_idx]
13
12
 
14
- _out = Mie_SD(_RI.values, 550, _psd)
13
+ _out = Mie_SD(_RI.values, 550, _psd)
15
14
 
16
- return _out.reindex(_ori_idx)
15
+ return _out.reindex(_ori_idx)
@@ -1,143 +1,142 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # http://pymiescatt.readthedocs.io/en/latest/forward.html
3
3
  import numpy as np
4
+ from pandas import concat, DataFrame
4
5
  from scipy.integrate import trapezoid
5
6
  from scipy.special import jv, yv
6
- import warnings
7
- from pandas import date_range, concat, DataFrame, to_numeric, to_datetime, Series
8
7
 
9
8
 
10
9
  def coerceDType(d):
11
- if type(d) is not np.ndarray:
12
- return np.array(d)
13
- else:
14
- return d
10
+ if type(d) is not np.ndarray:
11
+ return np.array(d)
12
+ else:
13
+ return d
15
14
 
16
15
 
17
16
  def Mie_ab(m, x, nmax, df_n):
18
- nu = df_n.copy() + 0.5
19
- n1 = 2 * df_n.copy() + 1
17
+ nu = df_n.copy() + 0.5
18
+ n1 = 2 * df_n.copy() + 1
20
19
 
21
- sx = np.sqrt(0.5 * np.pi * x)
22
- px = sx.reshape(-1, 1) * jv(nu, x.reshape(-1, 1))
23
- chx = -sx.reshape(-1, 1) * yv(nu, x.reshape(-1, 1))
20
+ sx = np.sqrt(0.5 * np.pi * x)
21
+ px = sx.reshape(-1, 1) * jv(nu, x.reshape(-1, 1))
22
+ chx = -sx.reshape(-1, 1) * yv(nu, x.reshape(-1, 1))
24
23
 
25
- p1x = concat([DataFrame(np.sin(x)), px.mask(df_n == nmax.reshape(-1, 1))], axis=1)
26
- p1x.columns = np.arange(len(p1x.keys()))
27
- p1x = p1x[df_n.keys()]
24
+ p1x = concat([DataFrame(np.sin(x)), px.mask(df_n == nmax.reshape(-1, 1))], axis=1)
25
+ p1x.columns = np.arange(len(p1x.keys()))
26
+ p1x = p1x[df_n.keys()]
28
27
 
29
- ch1x = concat([DataFrame(np.cos(x)), chx.mask(df_n == nmax.reshape(-1, 1))], axis=1)
30
- ch1x.columns = np.arange(len(ch1x.keys()))
31
- ch1x = ch1x[df_n.keys()]
28
+ ch1x = concat([DataFrame(np.cos(x)), chx.mask(df_n == nmax.reshape(-1, 1))], axis=1)
29
+ ch1x.columns = np.arange(len(ch1x.keys()))
30
+ ch1x = ch1x[df_n.keys()]
32
31
 
33
- gsx = px - (0 + 1j) * chx
34
- gs1x = p1x - (0 + 1j) * ch1x
32
+ gsx = px - (0 + 1j) * chx
33
+ gs1x = p1x - (0 + 1j) * ch1x
35
34
 
36
- mx = m.reshape(-1, 1) * x
37
- nmx = np.round(np.max(np.hstack([[nmax] * m.size, np.abs(mx)]).reshape(m.size, 2, -1), axis=1) + 16)
35
+ mx = m.reshape(-1, 1) * x
36
+ nmx = np.round(np.max(np.hstack([[nmax] * m.size, np.abs(mx)]).reshape(m.size, 2, -1), axis=1) + 16)
38
37
 
39
- df_qext = DataFrame(columns=m, index=df_n.index)
40
- df_qsca = DataFrame(columns=m, index=df_n.index)
38
+ df_qext = DataFrame(columns=m, index=df_n.index)
39
+ df_qsca = DataFrame(columns=m, index=df_n.index)
41
40
 
42
- df_n /= x.reshape(-1, 1)
43
- for _bin_idx, (_nmx_ary, _mx, _nmax) in enumerate(zip(nmx.T, mx.T, nmax)):
41
+ df_n /= x.reshape(-1, 1)
42
+ for _bin_idx, (_nmx_ary, _mx, _nmax) in enumerate(zip(nmx.T, mx.T, nmax)):
44
43
 
45
- df_D = DataFrame(np.nan, index=np.arange(m.size), columns=df_n.keys())
44
+ df_D = DataFrame(np.nan, index=np.arange(m.size), columns=df_n.keys())
46
45
 
47
- Dn_lst = []
48
- for _nmx, _uni_idx in DataFrame(_nmx_ary).groupby(0).groups.items():
46
+ Dn_lst = []
47
+ for _nmx, _uni_idx in DataFrame(_nmx_ary).groupby(0).groups.items():
49
48
 
50
- _inv_mx = 1 / _mx[_uni_idx]
49
+ _inv_mx = 1 / _mx[_uni_idx]
51
50
 
52
- Dn = np.zeros((_uni_idx.size, int(_nmx)), dtype=complex)
53
- for _idx in range(int(_nmx) - 1, 1, -1):
54
- Dn[:, _idx - 1] = (_idx * _inv_mx) - (1 / (Dn[:, _idx] + _idx * _inv_mx))
51
+ Dn = np.zeros((_uni_idx.size, int(_nmx)), dtype=complex)
52
+ for _idx in range(int(_nmx) - 1, 1, -1):
53
+ Dn[:, _idx - 1] = (_idx * _inv_mx) - (1 / (Dn[:, _idx] + _idx * _inv_mx))
55
54
 
56
- Dn_lst.append(Dn[:, 1: int(_nmax) + 1])
57
- df_D.loc[_uni_idx, 0: int(_nmax) - 1] = Dn[:, 1: int(_nmax) + 1]
55
+ Dn_lst.append(Dn[:, 1: int(_nmax) + 1])
56
+ df_D.loc[_uni_idx, 0: int(_nmax) - 1] = Dn[:, 1: int(_nmax) + 1]
58
57
 
59
- ## other parameter
60
- _df_n, _px, _p1x, _gsx, _gs1x, _n1 = df_n.loc[_bin_idx], px.loc[_bin_idx], p1x.loc[_bin_idx], gsx.loc[_bin_idx], \
61
- gs1x.loc[_bin_idx], n1.loc[_bin_idx].values
58
+ ## other parameter
59
+ _df_n, _px, _p1x, _gsx, _gs1x, _n1 = df_n.loc[_bin_idx], px.loc[_bin_idx], p1x.loc[_bin_idx], gsx.loc[_bin_idx], \
60
+ gs1x.loc[_bin_idx], n1.loc[_bin_idx].values
62
61
 
63
- _da = df_D / m.reshape(-1, 1) + _df_n
64
- _db = df_D * m.reshape(-1, 1) + _df_n
62
+ _da = df_D / m.reshape(-1, 1) + _df_n
63
+ _db = df_D * m.reshape(-1, 1) + _df_n
65
64
 
66
- _an = (_da * _px - _p1x) / (_da * _gsx - _gs1x)
67
- _bn = (_db * _px - _p1x) / (_db * _gsx - _gs1x)
65
+ _an = (_da * _px - _p1x) / (_da * _gsx - _gs1x)
66
+ _bn = (_db * _px - _p1x) / (_db * _gsx - _gs1x)
68
67
 
69
- _real_an, _real_bn = np.real(_an), np.real(_bn)
70
- _imag_an, _imag_bn = np.imag(_an), np.imag(_bn)
68
+ _real_an, _real_bn = np.real(_an), np.real(_bn)
69
+ _imag_an, _imag_bn = np.imag(_an), np.imag(_bn)
71
70
 
72
- _pr_qext = np.nansum(_n1 * (_real_an + _real_bn), axis=1)
73
- _pr_qsca = np.nansum(_n1 * (_real_an ** 2 + _real_bn ** 2 + _imag_an ** 2 + _imag_bn ** 2), axis=1)
71
+ _pr_qext = np.nansum(_n1 * (_real_an + _real_bn), axis=1)
72
+ _pr_qsca = np.nansum(_n1 * (_real_an ** 2 + _real_bn ** 2 + _imag_an ** 2 + _imag_bn ** 2), axis=1)
74
73
 
75
- df_qext.loc[_bin_idx] = _pr_qext
76
- df_qsca.loc[_bin_idx] = _pr_qsca
74
+ df_qext.loc[_bin_idx] = _pr_qext
75
+ df_qsca.loc[_bin_idx] = _pr_qsca
77
76
 
78
- return df_qext, df_qsca
77
+ return df_qext, df_qsca
79
78
 
80
79
 
81
80
  def MieQ(m_ary, wavelength, diameter):
82
- # http://pymiescatt.readthedocs.io/en/latest/forward.html#MieQ
81
+ # http://pymiescatt.readthedocs.io/en/latest/forward.html#MieQ
83
82
 
84
- x = np.pi * diameter / wavelength
83
+ x = np.pi * diameter / wavelength
85
84
 
86
- nmax = np.round(2 + x + 4 * (x ** (1 / 3)))
85
+ nmax = np.round(2 + x + 4 * (x ** (1 / 3)))
87
86
 
88
- df_n = DataFrame([np.arange(1, nmax.max() + 1)] * nmax.size)
89
- df_n = df_n.mask(df_n > nmax.reshape(-1, 1))
87
+ df_n = DataFrame([np.arange(1, nmax.max() + 1)] * nmax.size)
88
+ df_n = df_n.mask(df_n > nmax.reshape(-1, 1))
90
89
 
91
- n1 = 2 * df_n + 1
92
- n2 = df_n * (df_n + 2) / (df_n + 1)
93
- n3 = n1 / (df_n * (df_n + 1))
94
- x2 = x ** 2
90
+ n1 = 2 * df_n + 1
91
+ n2 = df_n * (df_n + 2) / (df_n + 1)
92
+ n3 = n1 / (df_n * (df_n + 1))
93
+ x2 = x ** 2
95
94
 
96
- _qext, _qsca = Mie_ab(m_ary, x, nmax, df_n)
95
+ _qext, _qsca = Mie_ab(m_ary, x, nmax, df_n)
97
96
 
98
- qext = (2 / x2).reshape(-1, 1) * _qext
99
- qsca = (2 / x2).reshape(-1, 1) * _qsca
97
+ qext = (2 / x2).reshape(-1, 1) * _qext
98
+ qsca = (2 / x2).reshape(-1, 1) * _qsca
100
99
 
101
- # return qext.astype(float).values.T, qsca.astype(float).values.T,
102
- return qext.values.T.astype(float), qsca.values.T.astype(float)
100
+ # return qext.astype(float).values.T, qsca.astype(float).values.T,
101
+ return qext.values.T.astype(float), qsca.values.T.astype(float)
103
102
 
104
103
 
105
104
  def Mie_SD(m_ary, wavelength, psd, multp_m_in1psd=False, dt_chunk_size=10, q_table=False):
106
- m_ary = coerceDType(m_ary)
107
- if type(psd) is not DataFrame:
108
- psd = DataFrame(psd).T
105
+ m_ary = coerceDType(m_ary)
106
+ if type(psd) is not DataFrame:
107
+ psd = DataFrame(psd).T
109
108
 
110
- if (len(m_ary) != len(psd)) & ~multp_m_in1psd:
111
- raise ValueError('"m array" size should be same as "psd" size')
109
+ if (len(m_ary) != len(psd)) & ~multp_m_in1psd:
110
+ raise ValueError('"m array" size should be same as "psd" size')
112
111
 
113
- dp = psd.keys().values
114
- ndp = psd.values
115
- aSDn = np.pi * ((dp / 2) ** 2) * ndp * 1e-6
112
+ dp = psd.keys().values
113
+ ndp = psd.values
114
+ aSDn = np.pi * ((dp / 2) ** 2) * ndp * 1e-6
116
115
 
117
- if q_table:
118
- qext, qsca = q_table
119
- else:
120
- qext, qsca = MieQ(m_ary, wavelength, dp)
116
+ if q_table:
117
+ qext, qsca = q_table
118
+ else:
119
+ qext, qsca = MieQ(m_ary, wavelength, dp)
121
120
 
122
- if multp_m_in1psd:
123
- # print('\tcalculate ext')
121
+ if multp_m_in1psd:
122
+ # print('\tcalculate ext')
124
123
 
125
- aSDn_all = np.repeat(aSDn, m_ary.size, axis=0).reshape(len(aSDn), m_ary.size, -1)
124
+ aSDn_all = np.repeat(aSDn, m_ary.size, axis=0).reshape(len(aSDn), m_ary.size, -1)
126
125
 
127
- qext_all = np.repeat(qext[np.newaxis, :, :], len(aSDn), axis=0).reshape(*aSDn_all.shape)
128
- qsca_all = np.repeat(qsca[np.newaxis, :, :], len(aSDn), axis=0).reshape(*aSDn_all.shape)
126
+ qext_all = np.repeat(qext[np.newaxis, :, :], len(aSDn), axis=0).reshape(*aSDn_all.shape)
127
+ qsca_all = np.repeat(qsca[np.newaxis, :, :], len(aSDn), axis=0).reshape(*aSDn_all.shape)
129
128
 
130
- df_ext = DataFrame(trapezoid(aSDn_all * qext_all), columns=m_ary, index=psd.index).astype(float)
131
- df_sca = DataFrame(trapezoid(aSDn_all * qsca_all), columns=m_ary, index=psd.index).astype(float)
132
- df_abs = df_ext - df_sca
133
- # print('\tdone')
129
+ df_ext = DataFrame(trapezoid(aSDn_all * qext_all), columns=m_ary, index=psd.index).astype(float)
130
+ df_sca = DataFrame(trapezoid(aSDn_all * qsca_all), columns=m_ary, index=psd.index).astype(float)
131
+ df_abs = df_ext - df_sca
132
+ # print('\tdone')
134
133
 
135
- return dict(ext=df_ext, sca=df_sca, abs=df_abs)
134
+ return dict(ext=df_ext, sca=df_sca, abs=df_abs)
136
135
 
137
- else:
138
- df_out = DataFrame(index=psd.index)
139
- df_out['ext'] = trapezoid(qext * aSDn).astype(float)
140
- df_out['sca'] = trapezoid(qsca * aSDn).astype(float)
141
- df_out['abs'] = df_out['ext'] - df_out['sca']
136
+ else:
137
+ df_out = DataFrame(index=psd.index)
138
+ df_out['ext'] = trapezoid(qext * aSDn).astype(float)
139
+ df_out['sca'] = trapezoid(qsca * aSDn).astype(float)
140
+ df_out['abs'] = df_out['ext'] - df_out['sca']
142
141
 
143
- return df_out
142
+ return df_out
@@ -2,29 +2,29 @@ import numpy as np
2
2
  from scipy.optimize import curve_fit
3
3
 
4
4
  __all__ = [
5
- '_SAE',
5
+ '_SAE',
6
6
  ]
7
7
 
8
8
 
9
9
  def _SAE(df):
10
- def _SAEcalc(_df):
11
- ## parameter
12
- band = np.array([450, 550, 700]) * 1e-3
10
+ def _SAEcalc(_df):
11
+ ## parameter
12
+ band = np.array([450, 550, 700]) * 1e-3
13
13
 
14
- ## 3 pts fitting
15
- ## function
16
- def _get_slope(__df):
17
- func = lambda _x, _sl, _int: _sl * _x + _int
18
- popt, pcov = curve_fit(func, np.log(band), np.log(__df))
14
+ ## 3 pts fitting
15
+ ## function
16
+ def _get_slope(__df):
17
+ func = lambda _x, _sl, _int: _sl * _x + _int
18
+ popt, pcov = curve_fit(func, np.log(band), np.log(__df))
19
19
 
20
- return popt
20
+ return popt
21
21
 
22
- ## calculate
23
- _SAE = _df.apply(_get_slope, axis=1, result_type='expand')
24
- _SAE.columns = ['slope', 'intercept']
22
+ ## calculate
23
+ _SAE = _df.apply(_get_slope, axis=1, result_type='expand')
24
+ _SAE.columns = ['slope', 'intercept']
25
25
 
26
- return _SAE
26
+ return _SAE
27
27
 
28
- df_out = _SAEcalc(df[['B', 'G', 'R']].dropna())
28
+ df_out = _SAEcalc(df[['B', 'G', 'R']].dropna())
29
29
 
30
- return df_out.reindex(df.index)
30
+ return df_out.reindex(df.index)
@@ -2,60 +2,60 @@ from ..core import _writter, _run_process
2
2
 
3
3
  __all__ = [
4
4
 
5
- 'SizeDistr',
5
+ 'SizeDistr',
6
6
 
7
7
  ]
8
8
 
9
9
 
10
10
  class SizeDistr(_writter):
11
11
 
12
- ## basic
13
- @_run_process('SizeDistr - basic', 'distr_basic')
14
- def basic(self, df, hybrid_bin_start_loc=None, unit='nm', bin_range=(0, 20000), input_type='norm'):
15
- from ._size_distr import _basic
12
+ ## basic
13
+ @_run_process('SizeDistr - basic', 'distr_basic')
14
+ def basic(self, df, hybrid_bin_start_loc=None, unit='nm', bin_range=(0, 20000), input_type='norm'):
15
+ from ._size_distr import _basic
16
16
 
17
- out = _basic(df, hybrid_bin_start_loc, unit, bin_range, input_type)
17
+ out = _basic(df, hybrid_bin_start_loc, unit, bin_range, input_type)
18
18
 
19
- return self, out
19
+ return self, out
20
20
 
21
- ## merge
22
- @_run_process('SizeDistr - merge_SMPS_APS_v4', 'distr_merge')
23
- def merge_SMPS_APS_v4(self, df_smps, df_aps, df_pm25, aps_unit='um',
24
- smps_overlap_lowbound=500, aps_fit_highbound=1000, dndsdv_alg=True,
25
- times_range=(0.8, 1.25, .05)):
26
- from ._merge_v4 import merge_SMPS_APS
21
+ ## merge
22
+ @_run_process('SizeDistr - merge_SMPS_APS_v4', 'distr_merge')
23
+ def merge_SMPS_APS_v4(self, df_smps, df_aps, df_pm25, aps_unit='um',
24
+ smps_overlap_lowbound=500, aps_fit_highbound=1000, dndsdv_alg=True,
25
+ times_range=(0.8, 1.25, .05)):
26
+ from ._merge_v4 import merge_SMPS_APS
27
27
 
28
- out = merge_SMPS_APS(df_smps, df_aps, df_pm25, aps_unit, smps_overlap_lowbound, aps_fit_highbound, dndsdv_alg,
29
- times_range)
28
+ out = merge_SMPS_APS(df_smps, df_aps, df_pm25, aps_unit, smps_overlap_lowbound, aps_fit_highbound, dndsdv_alg,
29
+ times_range)
30
30
 
31
- return self, out
31
+ return self, out
32
32
 
33
- ## merge
34
- @_run_process('SizeDistr - merge_SMPS_APS_v3', 'distr_merge')
35
- def merge_SMPS_APS_v3(self, df_smps, df_aps, aps_unit='um',
36
- smps_overlap_lowbound=500, aps_fit_highbound=1000, dndsdv_alg=True):
37
- from ._merge_v3 import merge_SMPS_APS
33
+ ## merge
34
+ @_run_process('SizeDistr - merge_SMPS_APS_v3', 'distr_merge')
35
+ def merge_SMPS_APS_v3(self, df_smps, df_aps, aps_unit='um',
36
+ smps_overlap_lowbound=500, aps_fit_highbound=1000, dndsdv_alg=True):
37
+ from ._merge_v3 import merge_SMPS_APS
38
38
 
39
- out = merge_SMPS_APS(df_smps, df_aps, aps_unit, smps_overlap_lowbound, aps_fit_highbound, dndsdv_alg)
39
+ out = merge_SMPS_APS(df_smps, df_aps, aps_unit, smps_overlap_lowbound, aps_fit_highbound, dndsdv_alg)
40
40
 
41
- return self, out
41
+ return self, out
42
42
 
43
- ## merge
44
- @_run_process('SizeDistr - merge_SMPS_APS_v2', 'distr_merge')
45
- def merge_SMPS_APS_v2(self, df_smps, df_aps, aps_unit='um',
46
- smps_overlap_lowbound=500, aps_fit_highbound=1000):
47
- from ._merge_v2 import merge_SMPS_APS
43
+ ## merge
44
+ @_run_process('SizeDistr - merge_SMPS_APS_v2', 'distr_merge')
45
+ def merge_SMPS_APS_v2(self, df_smps, df_aps, aps_unit='um',
46
+ smps_overlap_lowbound=500, aps_fit_highbound=1000):
47
+ from ._merge_v2 import merge_SMPS_APS
48
48
 
49
- out = merge_SMPS_APS(df_smps, df_aps, aps_unit, smps_overlap_lowbound, aps_fit_highbound)
49
+ out = merge_SMPS_APS(df_smps, df_aps, aps_unit, smps_overlap_lowbound, aps_fit_highbound)
50
50
 
51
- return self, out
51
+ return self, out
52
52
 
53
- ## merge
54
- @_run_process('SizeDistr - merge_SMPS_APS_v1', 'distr_merge')
55
- def merge_SMPS_APS(self, df_smps, df_aps, aps_unit='um', shift_mode='mobility',
56
- smps_overlap_lowbound=523, aps_fit_highbound=800):
57
- from ._merge_v1 import _merge_SMPS_APS
53
+ ## merge
54
+ @_run_process('SizeDistr - merge_SMPS_APS_v1', 'distr_merge')
55
+ def merge_SMPS_APS(self, df_smps, df_aps, aps_unit='um', shift_mode='mobility',
56
+ smps_overlap_lowbound=523, aps_fit_highbound=800):
57
+ from ._merge_v1 import _merge_SMPS_APS
58
58
 
59
- out = _merge_SMPS_APS(df_smps, df_aps, aps_unit, shift_mode, smps_overlap_lowbound, aps_fit_highbound)
59
+ out = _merge_SMPS_APS(df_smps, df_aps, aps_unit, shift_mode, smps_overlap_lowbound, aps_fit_highbound)
60
60
 
61
- return self, out
61
+ return self, out