AeroViz 0.1.3__py3-none-any.whl → 0.1.4__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 (121) hide show
  1. AeroViz/__init__.py +7 -5
  2. AeroViz/{config → data}/DEFAULT_DATA.csv +1 -1
  3. AeroViz/dataProcess/Chemistry/__init__.py +40 -40
  4. AeroViz/dataProcess/Chemistry/_calculate.py +15 -15
  5. AeroViz/dataProcess/Chemistry/_isoropia.py +72 -68
  6. AeroViz/dataProcess/Chemistry/_mass_volume.py +158 -161
  7. AeroViz/dataProcess/Chemistry/_ocec.py +109 -109
  8. AeroViz/dataProcess/Chemistry/_partition.py +19 -18
  9. AeroViz/dataProcess/Chemistry/_teom.py +9 -11
  10. AeroViz/dataProcess/Chemistry/isrpia.cnf +21 -0
  11. AeroViz/dataProcess/Optical/Angstrom_exponent.py +20 -0
  12. AeroViz/dataProcess/Optical/_IMPROVE.py +40 -41
  13. AeroViz/dataProcess/Optical/__init__.py +29 -44
  14. AeroViz/dataProcess/Optical/_absorption.py +21 -47
  15. AeroViz/dataProcess/Optical/_extinction.py +31 -25
  16. AeroViz/dataProcess/Optical/_mie.py +5 -7
  17. AeroViz/dataProcess/Optical/_mie_sd.py +89 -90
  18. AeroViz/dataProcess/Optical/_scattering.py +19 -20
  19. AeroViz/dataProcess/SizeDistr/__init__.py +39 -39
  20. AeroViz/dataProcess/SizeDistr/__merge.py +159 -158
  21. AeroViz/dataProcess/SizeDistr/_merge.py +155 -154
  22. AeroViz/dataProcess/SizeDistr/_merge_v1.py +162 -161
  23. AeroViz/dataProcess/SizeDistr/_merge_v2.py +153 -152
  24. AeroViz/dataProcess/SizeDistr/_merge_v3.py +327 -327
  25. AeroViz/dataProcess/SizeDistr/_merge_v4.py +273 -275
  26. AeroViz/dataProcess/SizeDistr/_size_distr.py +51 -51
  27. AeroViz/dataProcess/VOC/__init__.py +9 -9
  28. AeroViz/dataProcess/VOC/_potential_par.py +53 -55
  29. AeroViz/dataProcess/__init__.py +28 -6
  30. AeroViz/dataProcess/core/__init__.py +59 -65
  31. AeroViz/plot/__init__.py +7 -2
  32. AeroViz/plot/bar.py +126 -0
  33. AeroViz/plot/box.py +69 -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 +196 -0
  40. AeroViz/plot/scatter.py +165 -0
  41. AeroViz/plot/templates/__init__.py +2 -4
  42. AeroViz/plot/templates/ammonium_rich.py +34 -0
  43. AeroViz/plot/templates/contour.py +25 -25
  44. AeroViz/plot/templates/corr_matrix.py +86 -93
  45. AeroViz/plot/templates/diurnal_pattern.py +28 -26
  46. AeroViz/plot/templates/koschmieder.py +59 -123
  47. AeroViz/plot/templates/metal_heatmap.py +135 -37
  48. AeroViz/plot/timeseries/__init__.py +1 -0
  49. AeroViz/plot/timeseries/template.py +47 -0
  50. AeroViz/plot/timeseries/timeseries.py +324 -264
  51. AeroViz/plot/utils/__init__.py +2 -1
  52. AeroViz/plot/utils/_color.py +57 -57
  53. AeroViz/plot/utils/_unit.py +48 -48
  54. AeroViz/plot/utils/plt_utils.py +92 -0
  55. AeroViz/plot/utils/sklearn_utils.py +49 -0
  56. AeroViz/plot/utils/units.json +5 -0
  57. AeroViz/plot/violin.py +80 -0
  58. AeroViz/process/__init__.py +17 -17
  59. AeroViz/process/core/DataProc.py +9 -9
  60. AeroViz/process/core/SizeDist.py +81 -81
  61. AeroViz/process/method/PyMieScatt_update.py +488 -488
  62. AeroViz/process/method/mie_theory.py +231 -229
  63. AeroViz/process/method/prop.py +40 -40
  64. AeroViz/process/script/AbstractDistCalc.py +103 -103
  65. AeroViz/process/script/Chemical.py +168 -167
  66. AeroViz/process/script/IMPACT.py +40 -40
  67. AeroViz/process/script/IMPROVE.py +152 -152
  68. AeroViz/process/script/Others.py +45 -45
  69. AeroViz/process/script/PSD.py +26 -26
  70. AeroViz/process/script/PSD_dry.py +69 -70
  71. AeroViz/process/script/retrieve_RI.py +50 -51
  72. AeroViz/rawDataReader/__init__.py +53 -58
  73. AeroViz/rawDataReader/config/supported_instruments.py +155 -0
  74. AeroViz/rawDataReader/core/__init__.py +233 -356
  75. AeroViz/rawDataReader/script/AE33.py +17 -18
  76. AeroViz/rawDataReader/script/AE43.py +18 -21
  77. AeroViz/rawDataReader/script/APS_3321.py +30 -30
  78. AeroViz/rawDataReader/script/Aurora.py +23 -24
  79. AeroViz/rawDataReader/script/BC1054.py +36 -40
  80. AeroViz/rawDataReader/script/EPA_vertical.py +37 -9
  81. AeroViz/rawDataReader/script/GRIMM.py +16 -23
  82. AeroViz/rawDataReader/script/IGAC.py +90 -0
  83. AeroViz/rawDataReader/script/MA350.py +32 -39
  84. AeroViz/rawDataReader/script/Minion.py +103 -0
  85. AeroViz/rawDataReader/script/NEPH.py +69 -74
  86. AeroViz/rawDataReader/script/SMPS_TH.py +25 -25
  87. AeroViz/rawDataReader/script/SMPS_aim11.py +32 -32
  88. AeroViz/rawDataReader/script/SMPS_genr.py +31 -31
  89. AeroViz/rawDataReader/script/Sunset_OCEC.py +60 -0
  90. AeroViz/rawDataReader/script/TEOM.py +30 -28
  91. AeroViz/rawDataReader/script/Table.py +13 -14
  92. AeroViz/rawDataReader/script/VOC.py +26 -0
  93. AeroViz/rawDataReader/script/__init__.py +18 -20
  94. AeroViz/tools/database.py +64 -66
  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.3.dist-info → AeroViz-0.1.4.dist-info}/METADATA +5 -4
  99. AeroViz-0.1.4.dist-info/RECORD +112 -0
  100. AeroViz/plot/improve/__init__.py +0 -1
  101. AeroViz/plot/improve/improve.py +0 -240
  102. AeroViz/plot/optical/aethalometer.py +0 -77
  103. AeroViz/plot/templates/event_evolution.py +0 -65
  104. AeroViz/plot/templates/regression.py +0 -256
  105. AeroViz/plot/templates/scatter.py +0 -130
  106. AeroViz/plot/templates/templates.py +0 -398
  107. AeroViz/plot/utils/_decorator.py +0 -74
  108. AeroViz/rawDataReader/script/IGAC_TH.py +0 -104
  109. AeroViz/rawDataReader/script/IGAC_ZM.py +0 -90
  110. AeroViz/rawDataReader/script/OCEC_LCRES.py +0 -34
  111. AeroViz/rawDataReader/script/OCEC_RES.py +0 -28
  112. AeroViz/rawDataReader/script/VOC_TH.py +0 -30
  113. AeroViz/rawDataReader/script/VOC_ZM.py +0 -37
  114. AeroViz/rawDataReader/utils/__init__.py +0 -0
  115. AeroViz/rawDataReader/utils/config.py +0 -169
  116. AeroViz-0.1.3.dist-info/RECORD +0 -111
  117. /AeroViz/{config → data}/DEFAULT_PNSD_DATA.csv +0 -0
  118. /AeroViz/{config → rawDataReader/config}/__init__.py +0 -0
  119. {AeroViz-0.1.3.dist-info → AeroViz-0.1.4.dist-info}/LICENSE +0 -0
  120. {AeroViz-0.1.3.dist-info → AeroViz-0.1.4.dist-info}/WHEEL +0 -0
  121. {AeroViz-0.1.3.dist-info → AeroViz-0.1.4.dist-info}/top_level.txt +0 -0
@@ -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
@@ -1,30 +1,29 @@
1
1
  import numpy as np
2
- from scipy.optimize import curve_fit
2
+ from pandas import concat
3
3
 
4
- __all__ = [
5
- '_SAE',
6
- ]
4
+ __all__ = ['_scaCoe']
7
5
 
8
6
 
9
- def _SAE(df):
10
- def _SAEcalc(_df):
11
- ## parameter
12
- band = np.array([450, 550, 700]) * 1e-3
7
+ def _scaCoe(df, instru, specified_band: list):
8
+ from .Angstrom_exponent import get_Angstrom_exponent, get_species_wavelength
9
+ band_Neph = np.array([450, 550, 700])
10
+ band_Aurora = np.array([450, 525, 635])
13
11
 
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))
12
+ band = band_Neph if instru == 'Neph' else band_Aurora
19
13
 
20
- return popt
14
+ df_sca = df.copy().dropna()
21
15
 
22
- ## calculate
23
- _SAE = _df.apply(_get_slope, axis=1, result_type='expand')
24
- _SAE.columns = ['slope', 'intercept']
16
+ if instru == 'Neph':
17
+ df_out = df_sca[['B']].copy()
18
+ df_out.columns = [f'sca_{_band}' for _band in specified_band]
19
+ else:
20
+ df_out = df_sca.apply(get_species_wavelength, axis=1, result_type='expand', args=(specified_band,))
21
+ df_out.columns = [f'sca_{_band}' for _band in specified_band]
25
22
 
26
- return _SAE
23
+ # calculate
24
+ df_SAE = df[['B', 'G', 'R']].dropna().apply(get_Angstrom_exponent, axis=1, result_type='expand', args=(band,))
25
+ df_SAE.columns = ['SAE', 'SAE_intercept']
27
26
 
28
- df_out = _SAEcalc(df[['B', 'G', 'R']].dropna())
27
+ _df = concat([df_out, df_SAE['SAE']], axis=1)
29
28
 
30
- return df_out.reindex(df.index)
29
+ return _df.reindex(df.index)
@@ -1,61 +1,61 @@
1
- from ..core import _writter, _run_process
1
+ from ..core import Writer, run_process
2
2
 
3
3
  __all__ = [
4
4
 
5
- 'SizeDistr',
5
+ 'SizeDistr',
6
6
 
7
7
  ]
8
8
 
9
9
 
10
- class SizeDistr(_writter):
10
+ class SizeDistr(Writer):
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