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,27 +1,25 @@
1
1
  # from ContainerHandle.dataProcess.utils import _union_index
2
2
 
3
+ import warnings
3
4
  from datetime import datetime as dtm
5
+ from functools import partial
6
+ from multiprocessing import Pool, cpu_count
4
7
 
5
8
  import numpy as np
6
9
  from pandas import DataFrame, concat, DatetimeIndex
7
10
  # from scipy.interpolate import interp1d
8
11
  from scipy.interpolate import UnivariateSpline as unvpline, interp1d
9
12
 
10
- from multiprocessing import Pool, cpu_count
11
- from functools import partial
12
-
13
- import warnings
14
-
15
13
  warnings.filterwarnings("ignore")
16
14
 
17
15
  __all__ = ['_merge_SMPS_APS']
18
16
 
19
17
 
20
18
  def _powerlaw_fit(_coeA, _coeB, _aps, _idx, _factor):
21
- # breakpoint()
19
+ # breakpoint()
22
20
 
23
- _smps_fit_df = _coeA * (_aps.keys().values / _factor) ** _coeB
24
- return DataFrame(((_smps_fit_df.copy() - _aps.copy()) ** 2).sum(axis=1), columns=[_idx])
21
+ _smps_fit_df = _coeA * (_aps.keys().values / _factor) ** _coeB
22
+ return DataFrame(((_smps_fit_df.copy() - _aps.copy()) ** 2).sum(axis=1), columns=[_idx])
25
23
 
26
24
 
27
25
  ## Calculate S2
@@ -31,394 +29,394 @@ def _powerlaw_fit(_coeA, _coeB, _aps, _idx, _factor):
31
29
  ## return : S2
32
30
  # def _S2_calculate_dN(_smps, _aps):
33
31
  def _powerlaw_fit_dN(_smps, _aps, _alg_type):
34
- print(f"\t\t\t{dtm.now().strftime('%m/%d %X')} : \033[92moverlap range fitting : {_alg_type}\033[0m")
32
+ print(f"\t\t\t{dtm.now().strftime('%m/%d %X')} : \033[92moverlap range fitting : {_alg_type}\033[0m")
35
33
 
36
- ## overlap fitting
37
- ## parmeter
38
- _dt_indx = _smps.index
34
+ ## overlap fitting
35
+ ## parmeter
36
+ _dt_indx = _smps.index
39
37
 
40
- ## use SMPS data apply power law fitting
41
- ## y = Ax^B, A = e**coefa, B = coefb, x = logx, y = logy
42
- ## ref : http://mathworld.wolfram.com/LeastSquaresFittingPowerLaw.html
43
- ## power law fit to SMPS num conc at upper bins to log curve
38
+ ## use SMPS data apply power law fitting
39
+ ## y = Ax^B, A = e**coefa, B = coefb, x = logx, y = logy
40
+ ## ref : http://mathworld.wolfram.com/LeastSquaresFittingPowerLaw.html
41
+ ## power law fit to SMPS num conc at upper bins to log curve
44
42
 
45
- ## coefficient A, B
46
- _smps_qc_cond = ((_smps != 0) & np.isfinite(_smps))
47
- _smps_qc = _smps.where(_smps_qc_cond)
43
+ ## coefficient A, B
44
+ _smps_qc_cond = ((_smps != 0) & np.isfinite(_smps))
45
+ _smps_qc = _smps.where(_smps_qc_cond)
48
46
 
49
- _size = _smps_qc_cond.sum(axis=1)
50
- _size = _size.where(_size != 0.).copy()
47
+ _size = _smps_qc_cond.sum(axis=1)
48
+ _size = _size.where(_size != 0.).copy()
51
49
 
52
- _logx, _logy = np.log(_smps_qc.keys()._data.astype(float)), np.log(_smps_qc)
53
- _x, _y, _xy, _xx = _logx.sum(), _logy.sum(axis=1), (_logx * _logy).sum(axis=1), (_logx ** 2).sum()
50
+ _logx, _logy = np.log(_smps_qc.keys()._data.astype(float)), np.log(_smps_qc)
51
+ _x, _y, _xy, _xx = _logx.sum(), _logy.sum(axis=1), (_logx * _logy).sum(axis=1), (_logx ** 2).sum()
54
52
 
55
- _coeB = ((_size * _xy - _x * _y) / (_size * _xx - _x ** 2.))
56
- _coeA = np.exp((_y - _coeB * _x) / _size).values.reshape(-1, 1)
57
- _coeB = _coeB.values.reshape(-1, 1)
53
+ _coeB = ((_size * _xy - _x * _y) / (_size * _xx - _x ** 2.))
54
+ _coeA = np.exp((_y - _coeB * _x) / _size).values.reshape(-1, 1)
55
+ _coeB = _coeB.values.reshape(-1, 1)
58
56
 
59
- ## rebuild shift smps data by coe. A, B
60
- ## x_shift = (y_ori/A)**(1/B)
61
- _aps_shift_x = (_aps / _coeA) ** (1 / _coeB)
62
- _aps_shift_x = _aps_shift_x.where(np.isfinite(_aps_shift_x))
57
+ ## rebuild shift smps data by coe. A, B
58
+ ## x_shift = (y_ori/A)**(1/B)
59
+ _aps_shift_x = (_aps / _coeA) ** (1 / _coeB)
60
+ _aps_shift_x = _aps_shift_x.where(np.isfinite(_aps_shift_x))
63
61
 
64
- ## the least squares of diameter
65
- ## the shift factor which the closest to 1
66
- _shift_val = np.arange(0.3, 3.05, .05) ** .5
67
- # _shift_val = np.arange(0.9, 1.805, .005)**.5
62
+ ## the least squares of diameter
63
+ ## the shift factor which the closest to 1
64
+ _shift_val = np.arange(0.3, 3.05, .05) ** .5
65
+ # _shift_val = np.arange(0.9, 1.805, .005)**.5
68
66
 
69
- _shift_factor = DataFrame(columns=range(_shift_val.size), index=_aps_shift_x.index)
70
- _shift_factor.loc[:, :] = _shift_val
67
+ _shift_factor = DataFrame(columns=range(_shift_val.size), index=_aps_shift_x.index)
68
+ _shift_factor.loc[:, :] = _shift_val
71
69
 
72
- # _dropna_idx = _shift_factor.dropna(how='all').index.copy()
73
- _dropna_idx = _aps_shift_x.dropna(how='all').index.copy()
70
+ # _dropna_idx = _shift_factor.dropna(how='all').index.copy()
71
+ _dropna_idx = _aps_shift_x.dropna(how='all').index.copy()
74
72
 
75
- ## use the target function to get the similar aps and smps bin
76
- ## S2 = sum( (smps_fit_line(dia) - aps(dia*shift_factor) )**2 )
77
- ## assumption : the same diameter between smps and aps should get the same conc.
73
+ ## use the target function to get the similar aps and smps bin
74
+ ## S2 = sum( (smps_fit_line(dia) - aps(dia*shift_factor) )**2 )
75
+ ## assumption : the same diameter between smps and aps should get the same conc.
78
76
 
79
- ## be sure they art in log value
80
- _S2 = DataFrame(index=_aps_shift_x.index)
81
- _dia_table = DataFrame(np.full(_aps_shift_x.shape, _aps_shift_x.keys()),
82
- columns=_aps_shift_x.keys(), index=_aps_shift_x.index)
77
+ ## be sure they art in log value
78
+ _S2 = DataFrame(index=_aps_shift_x.index)
79
+ _dia_table = DataFrame(np.full(_aps_shift_x.shape, _aps_shift_x.keys()),
80
+ columns=_aps_shift_x.keys(), index=_aps_shift_x.index)
83
81
 
84
- pool = Pool(cpu_count())
82
+ pool = Pool(cpu_count())
85
83
 
86
- _S2 = pool.starmap(partial(_powerlaw_fit, _coeA, _coeB, _aps), list(enumerate(_shift_val)))
84
+ _S2 = pool.starmap(partial(_powerlaw_fit, _coeA, _coeB, _aps), list(enumerate(_shift_val)))
87
85
 
88
- pool.close()
89
- pool.join()
86
+ pool.close()
87
+ pool.join()
90
88
 
91
- S2 = concat(_S2, axis=1)[np.arange(_shift_val.size)]
92
- # S2 /= S2.max(axis=1).to_frame().values
89
+ S2 = concat(_S2, axis=1)[np.arange(_shift_val.size)]
90
+ # S2 /= S2.max(axis=1).to_frame().values
93
91
 
94
- shift_factor_dN = DataFrame(
95
- _shift_factor.loc[_dropna_idx].values[range(len(_dropna_idx)), S2.loc[_dropna_idx].idxmin(axis=1).values],
96
- index=_dropna_idx).reindex(_dt_indx).astype(float)
92
+ shift_factor_dN = DataFrame(
93
+ _shift_factor.loc[_dropna_idx].values[range(len(_dropna_idx)), S2.loc[_dropna_idx].idxmin(axis=1).values],
94
+ index=_dropna_idx).reindex(_dt_indx).astype(float)
97
95
 
98
- shift_factor_dN = shift_factor_dN.mask((shift_factor_dN ** 2 < 0.6) | (shift_factor_dN ** 2 > 2.6))
96
+ shift_factor_dN = shift_factor_dN.mask((shift_factor_dN ** 2 < 0.6) | (shift_factor_dN ** 2 > 2.6))
99
97
 
100
- return shift_factor_dN
98
+ return shift_factor_dN
101
99
 
102
100
 
103
101
  def _corr_fc(_aps_dia, _smps_dia, _smps_dn, _aps_dn, _smooth, _idx, _sh):
104
- ds_fc = lambda _dt: _dt * _dt.index ** 2 * np.pi
105
- dv_fc = lambda _dt: _dt * _dt.index ** 3 * np.pi / 6
102
+ ds_fc = lambda _dt: _dt * _dt.index ** 2 * np.pi
103
+ dv_fc = lambda _dt: _dt * _dt.index ** 3 * np.pi / 6
106
104
 
107
- _aps_sh = _aps_dia / _sh
108
- _aps_sh_inp = _aps_sh.where((_aps_sh >= 500) & (_aps_sh <= 1500.)).copy()
109
- _aps_sh_corr = _aps_sh.where((_aps_sh >= _smps_dia[-1]) & (_aps_sh <= 1500.)).copy()
105
+ _aps_sh = _aps_dia / _sh
106
+ _aps_sh_inp = _aps_sh.where((_aps_sh >= 500) & (_aps_sh <= 1500.)).copy()
107
+ _aps_sh_corr = _aps_sh.where((_aps_sh >= _smps_dia[-1]) & (_aps_sh <= 1500.)).copy()
110
108
 
111
- corr_x = np.append(_smps_dia, _aps_sh_corr.dropna())
109
+ corr_x = np.append(_smps_dia, _aps_sh_corr.dropna())
112
110
 
113
- input_x = np.append(_smps_dia, _aps_sh_inp.dropna())
114
- input_y = concat([_smps_dn, _aps_dn.iloc[:, ~np.isnan(_aps_sh_inp)]], axis=1)
115
- input_y.columns = input_x
111
+ input_x = np.append(_smps_dia, _aps_sh_inp.dropna())
112
+ input_y = concat([_smps_dn, _aps_dn.iloc[:, ~np.isnan(_aps_sh_inp)]], axis=1)
113
+ input_y.columns = input_x
116
114
 
117
- input_x.sort()
118
- input_y = input_y[input_x]
119
- corr_y = input_y[corr_x]
115
+ input_x.sort()
116
+ input_y = input_y[input_x]
117
+ corr_y = input_y[corr_x]
120
118
 
121
- S2_lst = []
122
- for (_tm, _inp_y_dn), (_tm, _cor_y_dn) in zip(input_y.dropna(how='all').iterrows(),
123
- corr_y.dropna(how='all').iterrows()):
124
- ## corr(spec_data, spec_spline)
125
- _spl_dt = [unvpline(input_x, _inp_y, s=_smooth)(corr_x) for _inp_y in
126
- [_inp_y_dn, ds_fc(_inp_y_dn), dv_fc(_inp_y_dn)]]
127
- _cor_dt = [_cor_y_dn, ds_fc(_cor_y_dn), dv_fc(_cor_y_dn)]
119
+ S2_lst = []
120
+ for (_tm, _inp_y_dn), (_tm, _cor_y_dn) in zip(input_y.dropna(how='all').iterrows(),
121
+ corr_y.dropna(how='all').iterrows()):
122
+ ## corr(spec_data, spec_spline)
123
+ _spl_dt = [unvpline(input_x, _inp_y, s=_smooth)(corr_x) for _inp_y in
124
+ [_inp_y_dn, ds_fc(_inp_y_dn), dv_fc(_inp_y_dn)]]
125
+ _cor_dt = [_cor_y_dn, ds_fc(_cor_y_dn), dv_fc(_cor_y_dn)]
128
126
 
129
- _cor_all = sum([np.corrcoef(_cor, _spl)[0, 1] for _cor, _spl in zip(_cor_dt, _spl_dt)])
127
+ _cor_all = sum([np.corrcoef(_cor, _spl)[0, 1] for _cor, _spl in zip(_cor_dt, _spl_dt)])
130
128
 
131
- S2_lst.append((3 - _cor_all) / 3)
129
+ S2_lst.append((3 - _cor_all) / 3)
132
130
 
133
- return DataFrame(S2_lst, columns=[_idx])
131
+ return DataFrame(S2_lst, columns=[_idx])
134
132
 
135
133
 
136
134
  # def _S2_calculate_dSdV(_smps, _aps, _shft_dn, _S2, smps_ori, aps_ori):
137
135
  # def _S2_calculate_dSdV(_smps, _aps, smps_ori=None):
138
136
  def _corr_with_dNdSdV(_smps, _aps, _alg_type):
139
- print(f"\t\t\t{dtm.now().strftime('%m/%d %X')} : \033[92moverlap range correlation : {_alg_type}\033[0m")
137
+ print(f"\t\t\t{dtm.now().strftime('%m/%d %X')} : \033[92moverlap range correlation : {_alg_type}\033[0m")
140
138
 
141
- _smps_dia = _smps.keys().astype(float)
142
- _aps_dia = _aps.keys().astype(float)
139
+ _smps_dia = _smps.keys().astype(float)
140
+ _aps_dia = _aps.keys().astype(float)
143
141
 
144
- all_index = _smps.index.copy()
145
- qc_index = DatetimeIndex(set(_smps.dropna(how='all').index) & set(_aps.dropna(how='all').index)).sort_values()
142
+ all_index = _smps.index.copy()
143
+ qc_index = DatetimeIndex(set(_smps.dropna(how='all').index) & set(_aps.dropna(how='all').index)).sort_values()
146
144
 
147
- _smps_dn = _smps.loc[qc_index].copy()
148
- _aps_dn = _aps.loc[qc_index].copy()
145
+ _smps_dn = _smps.loc[qc_index].copy()
146
+ _aps_dn = _aps.loc[qc_index].copy()
149
147
 
150
- ds_fc = lambda _dt: _dt * _dt.index ** 2 * np.pi
151
- dv_fc = lambda _dt: _dt * _dt.index ** 3 * np.pi / 6
148
+ ds_fc = lambda _dt: _dt * _dt.index ** 2 * np.pi
149
+ dv_fc = lambda _dt: _dt * _dt.index ** 3 * np.pi / 6
152
150
 
153
- _std_bin = np.geomspace(11.8, 19810, 230)
154
- _merge_bin = _std_bin[(_std_bin >= _smps_dia[-1]) & (_std_bin < 1500)].copy()
151
+ _std_bin = np.geomspace(11.8, 19810, 230)
152
+ _merge_bin = _std_bin[(_std_bin >= _smps_dia[-1]) & (_std_bin < 1500)].copy()
155
153
 
156
- _smooth = 50
154
+ _smooth = 50
157
155
 
158
- _shift_val = np.arange(0.5, 2.605, .005) ** .5
159
- _shift_val = np.arange(0.9, 2.01, .01) ** .5
160
- _shift_val = np.arange(0.9, 2.65, .05) ** .5
156
+ _shift_val = np.arange(0.5, 2.605, .005) ** .5
157
+ _shift_val = np.arange(0.9, 2.01, .01) ** .5
158
+ _shift_val = np.arange(0.9, 2.65, .05) ** .5
161
159
 
162
- ## spline fitting with shift aps and smps
163
- pool = Pool(cpu_count())
160
+ ## spline fitting with shift aps and smps
161
+ pool = Pool(cpu_count())
164
162
 
165
- S2_lst = pool.starmap(partial(_corr_fc, _aps_dia, _smps_dia, _smps_dn, _aps_dn, _smooth),
166
- list(enumerate(_shift_val)))
163
+ S2_lst = pool.starmap(partial(_corr_fc, _aps_dia, _smps_dia, _smps_dn, _aps_dn, _smooth),
164
+ list(enumerate(_shift_val)))
167
165
 
168
- pool.close()
169
- pool.join()
166
+ pool.close()
167
+ pool.join()
170
168
 
171
- S2_table = concat(S2_lst, axis=1).set_index(qc_index)[np.arange(_shift_val.size)].astype(float).dropna()
172
- min_shft = S2_table.idxmin(axis=1).values
169
+ S2_table = concat(S2_lst, axis=1).set_index(qc_index)[np.arange(_shift_val.size)].astype(float).dropna()
170
+ min_shft = S2_table.idxmin(axis=1).values
173
171
 
174
- return DataFrame(_shift_val[min_shft.astype(int)], index=S2_table.index).astype(float).reindex(_smps.index)
172
+ return DataFrame(_shift_val[min_shft.astype(int)], index=S2_table.index).astype(float).reindex(_smps.index)
175
173
 
176
174
 
177
175
  ## Create merge data
178
176
  ## shift all smps bin and remove the aps bin which smaller than the latest old smps bin
179
177
  ## Return : merge bins, merge data, density
180
178
  def _merge_data(_smps_ori, _aps_ori, _shift_ori, _smps_lb, _aps_hb, _shift_mode, _alg_type):
181
- print(f"\t\t\t{dtm.now().strftime('%m/%d %X')} : \033[92mcreate merge data : {_shift_mode} and {_alg_type}\033[0m")
179
+ print(f"\t\t\t{dtm.now().strftime('%m/%d %X')} : \033[92mcreate merge data : {_shift_mode} and {_alg_type}\033[0m")
182
180
 
183
- _ori_idx = _smps_ori.index.copy()
184
- # _merge_idx = _smps_ori.loc[_aps_ori.dropna(how='all').index].dropna(how='all').index
181
+ _ori_idx = _smps_ori.index.copy()
182
+ # _merge_idx = _smps_ori.loc[_aps_ori.dropna(how='all').index].dropna(how='all').index
185
183
 
186
- _corr_aps_cond = _aps_ori.keys() < 700
187
- _corr_aps_ky = _aps_ori.keys()[_corr_aps_cond]
184
+ _corr_aps_cond = _aps_ori.keys() < 700
185
+ _corr_aps_ky = _aps_ori.keys()[_corr_aps_cond]
188
186
 
189
- _merge_idx = DatetimeIndex(set(_smps_ori.dropna(how='all').index) & set(_aps_ori.dropna(how='all').index) &
190
- set(_shift_ori.dropna(how='all').index)).sort_values()
187
+ _merge_idx = DatetimeIndex(set(_smps_ori.dropna(how='all').index) & set(_aps_ori.dropna(how='all').index) &
188
+ set(_shift_ori.dropna(how='all').index)).sort_values()
191
189
 
192
- _smps, _aps, _shift = _smps_ori.loc[_merge_idx], _aps_ori.loc[_merge_idx], _shift_ori.loc[_merge_idx].values
190
+ _smps, _aps, _shift = _smps_ori.loc[_merge_idx], _aps_ori.loc[_merge_idx], _shift_ori.loc[_merge_idx].values
193
191
 
194
- ## parameter
195
- _smps_key, _aps_key = _smps.keys()._data.astype(float), _aps.keys()._data.astype(float)
192
+ ## parameter
193
+ _smps_key, _aps_key = _smps.keys()._data.astype(float), _aps.keys()._data.astype(float)
196
194
 
197
- _cntr = 1000
198
- _bin_lb = _smps_key[-1]
195
+ _cntr = 1000
196
+ _bin_lb = _smps_key[-1]
199
197
 
200
- ## make shift bins
201
- _smps_bin = np.full(_smps.shape, _smps_key)
202
- _aps_bin = np.full(_aps.shape, _aps_key)
198
+ ## make shift bins
199
+ _smps_bin = np.full(_smps.shape, _smps_key)
200
+ _aps_bin = np.full(_aps.shape, _aps_key)
203
201
 
204
- _std_bin = np.geomspace(_smps_key[0], _aps_key[-1], 230)
205
- _std_bin_merge = _std_bin[(_std_bin < _cntr) & (_std_bin > _bin_lb)]
206
- _std_bin_inte1 = _std_bin[_std_bin <= _bin_lb]
207
- _std_bin_inte2 = _std_bin[_std_bin >= _cntr]
202
+ _std_bin = np.geomspace(_smps_key[0], _aps_key[-1], 230)
203
+ _std_bin_merge = _std_bin[(_std_bin < _cntr) & (_std_bin > _bin_lb)]
204
+ _std_bin_inte1 = _std_bin[_std_bin <= _bin_lb]
205
+ _std_bin_inte2 = _std_bin[_std_bin >= _cntr]
208
206
 
209
- if _shift_mode == 'mobility':
210
- _aps_bin /= _shift
207
+ if _shift_mode == 'mobility':
208
+ _aps_bin /= _shift
211
209
 
212
- elif _shift_mode == 'aerodynamic':
213
- _smps_bin *= _shift
210
+ elif _shift_mode == 'aerodynamic':
211
+ _smps_bin *= _shift
214
212
 
215
- ## merge
216
- _merge_lst, _corr_lst = [], []
217
- for _bin_smps, _bin_aps, _dt_smps, _dt_aps, _sh in zip(_smps_bin, _aps_bin, _smps.values, _aps.values, _shift):
218
- ## keep complete smps bins and data
219
- ## remove the aps bin data lower than smps bin
220
- _condi = _bin_aps >= _bin_smps[-1]
213
+ ## merge
214
+ _merge_lst, _corr_lst = [], []
215
+ for _bin_smps, _bin_aps, _dt_smps, _dt_aps, _sh in zip(_smps_bin, _aps_bin, _smps.values, _aps.values, _shift):
216
+ ## keep complete smps bins and data
217
+ ## remove the aps bin data lower than smps bin
218
+ _condi = _bin_aps >= _bin_smps[-1]
221
219
 
222
- _merge_bin = np.hstack((_bin_smps, _bin_aps[_condi]))
223
- _merge_dt = np.hstack((_dt_smps, _dt_aps[_condi]))
220
+ _merge_bin = np.hstack((_bin_smps, _bin_aps[_condi]))
221
+ _merge_dt = np.hstack((_dt_smps, _dt_aps[_condi]))
224
222
 
225
- _merge_fit_loc = (_merge_bin < 1500) & (_merge_bin > _smps_lb)
223
+ _merge_fit_loc = (_merge_bin < 1500) & (_merge_bin > _smps_lb)
226
224
 
227
- ## coeA and coeB
228
- _unvpl_fc = unvpline(np.log(_merge_bin[_merge_fit_loc]), np.log(_merge_dt[_merge_fit_loc]), s=50)
229
- _inte_fc = interp1d(_merge_bin, _merge_dt, kind='linear', fill_value='extrapolate')
225
+ ## coeA and coeB
226
+ _unvpl_fc = unvpline(np.log(_merge_bin[_merge_fit_loc]), np.log(_merge_dt[_merge_fit_loc]), s=50)
227
+ _inte_fc = interp1d(_merge_bin, _merge_dt, kind='linear', fill_value='extrapolate')
230
228
 
231
- _merge_dt_fit = np.hstack((_inte_fc(_std_bin_inte1), np.exp(_unvpl_fc(np.log(_std_bin_merge))),
232
- _inte_fc(_std_bin_inte2)))
229
+ _merge_dt_fit = np.hstack((_inte_fc(_std_bin_inte1), np.exp(_unvpl_fc(np.log(_std_bin_merge))),
230
+ _inte_fc(_std_bin_inte2)))
233
231
 
234
- _merge_lst.append(_merge_dt_fit)
235
- _corr_lst.append(interp1d(_std_bin, _merge_dt_fit)(_bin_aps[_corr_aps_cond]))
232
+ _merge_lst.append(_merge_dt_fit)
233
+ _corr_lst.append(interp1d(_std_bin, _merge_dt_fit)(_bin_aps[_corr_aps_cond]))
236
234
 
237
- _df_merge = DataFrame(_merge_lst, columns=_std_bin, index=_merge_idx)
238
- _df_merge = _df_merge.mask(_df_merge < 0)
235
+ _df_merge = DataFrame(_merge_lst, columns=_std_bin, index=_merge_idx)
236
+ _df_merge = _df_merge.mask(_df_merge < 0)
239
237
 
240
- _df_corr = DataFrame(_corr_lst, columns=_corr_aps_ky, index=_merge_idx) / _aps_ori.loc[_merge_idx, _corr_aps_ky]
238
+ _df_corr = DataFrame(_corr_lst, columns=_corr_aps_ky, index=_merge_idx) / _aps_ori.loc[_merge_idx, _corr_aps_ky]
241
239
 
242
- ## process output df
243
- ## average, align with index
244
- def _out_df(*_df_arg, **_df_kwarg):
245
- _df = DataFrame(*_df_arg, **_df_kwarg).reindex(_ori_idx)
246
- _df.index.name = 'time'
247
- return _df
240
+ ## process output df
241
+ ## average, align with index
242
+ def _out_df(*_df_arg, **_df_kwarg):
243
+ _df = DataFrame(*_df_arg, **_df_kwarg).reindex(_ori_idx)
244
+ _df.index.name = 'time'
245
+ return _df
248
246
 
249
- return _out_df(_df_merge), _out_df(_shift_ori ** 2), _out_df(_df_corr)
247
+ return _out_df(_df_merge), _out_df(_shift_ori ** 2), _out_df(_df_corr)
250
248
 
251
249
 
252
250
  def _fitness_func(psd, rho, pm25):
253
- psd_pm25 = psd[psd.keys()[psd.keys().values <= 2500]] * np.diff(np.log10(psd.keys())).mean()
254
- rho_pm25 = pm25 / (psd_pm25 * np.pi * psd_pm25.keys().values ** 3 / 6 * 1e-9).sum(axis=1, min_count=1)
251
+ psd_pm25 = psd[psd.keys()[psd.keys().values <= 2500]] * np.diff(np.log10(psd.keys())).mean()
252
+ rho_pm25 = pm25 / (psd_pm25 * np.pi * psd_pm25.keys().values ** 3 / 6 * 1e-9).sum(axis=1, min_count=1)
255
253
 
256
- return (rho['density'] - rho_pm25) ** 2
254
+ return (rho['density'] - rho_pm25) ** 2
257
255
 
258
256
 
259
257
  def merge_SMPS_APS(df_smps, df_aps, df_pm25, aps_unit='um', smps_overlap_lowbound=500, aps_fit_highbound=1000,
260
- dndsdv_alg=True, times_range=(0.8, 1.25, .05)):
261
- # merge_data, merge_data_dn, merge_data_dsdv, merge_data_cor_dn, density, density_dn, density_dsdv, density_cor_dn = [DataFrame([np.nan])] * 8
258
+ dndsdv_alg=True, times_range=(0.8, 1.25, .05)):
259
+ # merge_data, merge_data_dn, merge_data_dsdv, merge_data_cor_dn, density, density_dn, density_dsdv, density_cor_dn = [DataFrame([np.nan])] * 8
262
260
 
263
- ## set to the same units
264
- smps, aps = df_smps.copy(), df_aps.copy()
265
- smps.columns = smps.keys().to_numpy(float)
266
- aps.columns = aps.keys().to_numpy(float)
261
+ ## set to the same units
262
+ smps, aps = df_smps.copy(), df_aps.copy()
263
+ smps.columns = smps.keys().to_numpy(float)
264
+ aps.columns = aps.keys().to_numpy(float)
267
265
 
268
- if aps_unit == 'um':
269
- aps.columns = aps.keys() * 1e3
266
+ if aps_unit == 'um':
267
+ aps.columns = aps.keys() * 1e3
270
268
 
271
- fitness_typ = dict(dn=[], cor_dn=[], dndsdv=[], cor_dndsdv=[])
272
- shift_typ = dict(dn=[], cor_dn=[], dndsdv=[], cor_dndsdv=[])
273
- oth_typ = dict()
269
+ fitness_typ = dict(dn=[], cor_dn=[], dndsdv=[], cor_dndsdv=[])
270
+ shift_typ = dict(dn=[], cor_dn=[], dndsdv=[], cor_dndsdv=[])
271
+ oth_typ = dict()
274
272
 
275
- times_ary = np.arange(*times_range).round(4)
276
- # times_ary = np.arange(*(0.8, 0.9, .05)).round(4)
273
+ times_ary = np.arange(*times_range).round(4)
274
+ # times_ary = np.arange(*(0.8, 0.9, .05)).round(4)
277
275
 
278
- for times in times_ary:
276
+ for times in times_ary:
279
277
 
280
- print(f"\t\t{dtm.now().strftime('%m/%d %X')} : \033[92mSMPS times value : {times}\033[0m")
278
+ print(f"\t\t{dtm.now().strftime('%m/%d %X')} : \033[92mSMPS times value : {times}\033[0m")
281
279
 
282
- aps_input = aps.copy()
283
- aps_over = aps_input.loc[:, (aps.keys() > 700) & (aps.keys() < 1000)].copy()
280
+ aps_input = aps.copy()
281
+ aps_over = aps_input.loc[:, (aps.keys() > 700) & (aps.keys() < 1000)].copy()
284
282
 
285
- smps_input = (smps * times).copy()
286
- smps_over = smps_input[smps.keys()[smps.keys() > 500]].copy()
283
+ smps_input = (smps * times).copy()
284
+ smps_over = smps_input[smps.keys()[smps.keys() > 500]].copy()
287
285
 
288
- for _count in range(2):
286
+ for _count in range(2):
289
287
 
290
- ## shift data calculate
291
- ## original
292
- if _count == 0:
293
- alg_type = 'dn'
294
- shift = _powerlaw_fit_dN(smps_over, aps_over, alg_type)
288
+ ## shift data calculate
289
+ ## original
290
+ if _count == 0:
291
+ alg_type = 'dn'
292
+ shift = _powerlaw_fit_dN(smps_over, aps_over, alg_type)
295
293
 
296
- if dndsdv_alg:
297
- shift_dsdv = _corr_with_dNdSdV(smps_over, aps_over, 'dndsdv').mask(shift.isna())
294
+ if dndsdv_alg:
295
+ shift_dsdv = _corr_with_dNdSdV(smps_over, aps_over, 'dndsdv').mask(shift.isna())
298
296
 
299
- ## aps correct
300
- else:
301
- alg_type = 'cor_dndsdv'
302
- shift_cor = _powerlaw_fit_dN(smps_over, aps_over, 'cor_dn')
297
+ ## aps correct
298
+ else:
299
+ alg_type = 'cor_dndsdv'
300
+ shift_cor = _powerlaw_fit_dN(smps_over, aps_over, 'cor_dn')
303
301
 
304
- if dndsdv_alg:
305
- shift = _corr_with_dNdSdV(smps_over, aps_over, alg_type).mask(shift_cor.isna())
302
+ if dndsdv_alg:
303
+ shift = _corr_with_dNdSdV(smps_over, aps_over, alg_type).mask(shift_cor.isna())
306
304
 
307
- ## merge aps and smps
308
- ## 1. power law fit (dn) -> return dn data and aps correct factor
309
- ## 2. correaltion with dn, ds, dv -> return corrected dn_ds_dv data
310
- if (alg_type == 'dn') | dndsdv_alg:
311
- merge_arg = (smps_input, aps_input, shift, smps_overlap_lowbound, aps_fit_highbound)
305
+ ## merge aps and smps
306
+ ## 1. power law fit (dn) -> return dn data and aps correct factor
307
+ ## 2. correaltion with dn, ds, dv -> return corrected dn_ds_dv data
308
+ if (alg_type == 'dn') | dndsdv_alg:
309
+ merge_arg = (smps_input, aps_input, shift, smps_overlap_lowbound, aps_fit_highbound)
312
310
 
313
- merge_data, density, _corr = _merge_data(*merge_arg, 'mobility', _alg_type=alg_type)
314
- density.columns = ['density']
311
+ merge_data, density, _corr = _merge_data(*merge_arg, 'mobility', _alg_type=alg_type)
312
+ density.columns = ['density']
315
313
 
316
- fitness_typ[alg_type].append(_fitness_func(merge_data, density, df_pm25))
317
- shift_typ[alg_type].append(shift[0])
314
+ fitness_typ[alg_type].append(_fitness_func(merge_data, density, df_pm25))
315
+ shift_typ[alg_type].append(shift[0])
318
316
 
319
- ## without aps correct
320
- if _count == 0:
321
- ## merge aps and smps
322
- ## dn_ds_dv data
323
- if dndsdv_alg:
324
- alg_type = 'dndsdv'
325
- merge_arg = (smps_input, aps_input, shift_dsdv, smps_overlap_lowbound, aps_fit_highbound)
317
+ ## without aps correct
318
+ if _count == 0:
319
+ ## merge aps and smps
320
+ ## dn_ds_dv data
321
+ if dndsdv_alg:
322
+ alg_type = 'dndsdv'
323
+ merge_arg = (smps_input, aps_input, shift_dsdv, smps_overlap_lowbound, aps_fit_highbound)
326
324
 
327
- merge_data_dsdv, density_dsdv, _ = _merge_data(*merge_arg, 'mobility', _alg_type=alg_type)
328
- density_dsdv.columns = ['density']
325
+ merge_data_dsdv, density_dsdv, _ = _merge_data(*merge_arg, 'mobility', _alg_type=alg_type)
326
+ density_dsdv.columns = ['density']
329
327
 
330
- fitness_typ[alg_type].append(_fitness_func(merge_data_dsdv, density_dsdv, df_pm25))
331
- shift_typ[alg_type].append(shift_dsdv[0])
328
+ fitness_typ[alg_type].append(_fitness_func(merge_data_dsdv, density_dsdv, df_pm25))
329
+ shift_typ[alg_type].append(shift_dsdv[0])
332
330
 
333
- ## dn data
334
- merge_data_dn, density_dn = merge_data.copy(), density.copy()
331
+ ## dn data
332
+ merge_data_dn, density_dn = merge_data.copy(), density.copy()
335
333
 
336
- ## correct aps data
337
- corr = _corr.resample('1d').mean().reindex(smps.index).ffill()
338
- corr = corr.mask(corr < 1, 1)
334
+ ## correct aps data
335
+ corr = _corr.resample('1d').mean().reindex(smps.index).ffill()
336
+ corr = corr.mask(corr < 1, 1)
339
337
 
340
- aps_input.loc[:, corr.keys()] *= corr
341
- aps_over = aps_input.copy()
338
+ aps_input.loc[:, corr.keys()] *= corr
339
+ aps_over = aps_input.copy()
342
340
 
343
341
 
344
- ## with aps correct
345
- else:
346
- ## merge aps and smps
347
- ## dn data
348
- alg_type = 'cor_dn'
349
- merge_arg = (smps_input, aps_input, shift_cor, smps_overlap_lowbound, aps_fit_highbound)
342
+ ## with aps correct
343
+ else:
344
+ ## merge aps and smps
345
+ ## dn data
346
+ alg_type = 'cor_dn'
347
+ merge_arg = (smps_input, aps_input, shift_cor, smps_overlap_lowbound, aps_fit_highbound)
350
348
 
351
- merge_data_cor_dn, density_cor_dn, _ = _merge_data(*merge_arg, 'mobility', _alg_type=alg_type)
352
- density_cor_dn.columns = ['density']
349
+ merge_data_cor_dn, density_cor_dn, _ = _merge_data(*merge_arg, 'mobility', _alg_type=alg_type)
350
+ density_cor_dn.columns = ['density']
353
351
 
354
- fitness_typ[alg_type].append(_fitness_func(merge_data_cor_dn, density_cor_dn, df_pm25))
355
- shift_typ[alg_type].append(shift_cor[0])
352
+ fitness_typ[alg_type].append(_fitness_func(merge_data_cor_dn, density_cor_dn, df_pm25))
353
+ shift_typ[alg_type].append(shift_cor[0])
356
354
 
357
- ## get times value and shift value
358
- out_dic = {}
359
- for (_typ, _lst), (_typ, _shft) in zip(fitness_typ.items(), shift_typ.items()):
360
- oth_typ[_typ] = None
361
- if len(_lst) == 0: continue
355
+ ## get times value and shift value
356
+ out_dic = {}
357
+ for (_typ, _lst), (_typ, _shft) in zip(fitness_typ.items(), shift_typ.items()):
358
+ oth_typ[_typ] = None
359
+ if len(_lst) == 0: continue
362
360
 
363
- df_times_min = concat(_lst, axis=1, keys=range(len(_lst))).idxmin(axis=1).dropna().astype(int)
364
- df_shift = concat(_shft, axis=1, keys=times_ary.tolist()).loc[df_times_min.index].values[
365
- range(len(df_times_min.index)), df_times_min.values]
361
+ df_times_min = concat(_lst, axis=1, keys=range(len(_lst))).idxmin(axis=1).dropna().astype(int)
362
+ df_shift = concat(_shft, axis=1, keys=times_ary.tolist()).loc[df_times_min.index].values[
363
+ range(len(df_times_min.index)), df_times_min.values]
366
364
 
367
- oth_typ[_typ] = DataFrame(np.array([df_shift, times_ary[df_times_min.values]]).T,
368
- index=df_times_min.index, columns=['shift', 'times']).reindex(smps.index)
365
+ oth_typ[_typ] = DataFrame(np.array([df_shift, times_ary[df_times_min.values]]).T,
366
+ index=df_times_min.index, columns=['shift', 'times']).reindex(smps.index)
369
367
 
370
- ## re-calculate merge_data
371
- alg_type = ['dn', 'cor_dn', 'dndsdv', 'cor_dndsdv'] if dndsdv_alg else ['dn', 'cor_dn']
368
+ ## re-calculate merge_data
369
+ alg_type = ['dn', 'cor_dn', 'dndsdv', 'cor_dndsdv'] if dndsdv_alg else ['dn', 'cor_dn']
372
370
 
373
- out_dic = {}
374
- den_lst, times_lst = [], []
375
- for _typ in alg_type:
376
- print(f"\t\t{dtm.now().strftime('%m/%d %X')} : \033[92mre-caculate merge data with times: {_typ}\033[0m")
377
- typ = oth_typ[_typ]
378
- smps_input = smps.copy() * typ['times'].to_frame().values
371
+ out_dic = {}
372
+ den_lst, times_lst = [], []
373
+ for _typ in alg_type:
374
+ print(f"\t\t{dtm.now().strftime('%m/%d %X')} : \033[92mre-caculate merge data with times: {_typ}\033[0m")
375
+ typ = oth_typ[_typ]
376
+ smps_input = smps.copy() * typ['times'].to_frame().values
379
377
 
380
- corr_typ = corr if 'cor' in _typ else 1
381
- aps_input = aps.copy()
382
- aps_input.loc[:, corr.keys()] *= corr_typ
378
+ corr_typ = corr if 'cor' in _typ else 1
379
+ aps_input = aps.copy()
380
+ aps_input.loc[:, corr.keys()] *= corr_typ
383
381
 
384
- merge_arg = (smps_input, aps_input, typ['shift'].to_frame(), smps_overlap_lowbound, aps_fit_highbound)
382
+ merge_arg = (smps_input, aps_input, typ['shift'].to_frame(), smps_overlap_lowbound, aps_fit_highbound)
385
383
 
386
- merge_data, density, _corr = _merge_data(*merge_arg, 'mobility', _alg_type=_typ)
387
- density.columns = ['density']
384
+ merge_data, density, _corr = _merge_data(*merge_arg, 'mobility', _alg_type=_typ)
385
+ density.columns = ['density']
388
386
 
389
- out_dic[f'data_{_typ}'] = merge_data
387
+ out_dic[f'data_{_typ}'] = merge_data
390
388
 
391
- den_lst.append(density)
392
- times_lst.append(typ['times'])
389
+ den_lst.append(density)
390
+ times_lst.append(typ['times'])
393
391
 
394
- out_rho = concat(den_lst, axis=1)
395
- out_times = concat(times_lst, axis=1)
396
- out_rho.columns = alg_type
397
- out_times.columns = alg_type
392
+ out_rho = concat(den_lst, axis=1)
393
+ out_times = concat(times_lst, axis=1)
394
+ out_rho.columns = alg_type
395
+ out_times.columns = alg_type
398
396
 
399
- # breakpoint()
397
+ # breakpoint()
400
398
 
401
- ## out
402
- out_dic.update(dict(density=out_rho, times=out_times))
399
+ ## out
400
+ out_dic.update(dict(density=out_rho, times=out_times))
403
401
 
404
- # out_dic = {
405
- # 'data_cor_dndsdv' : merge_data,
406
- # 'data_dn' : merge_data_dn,
407
- # 'data_dndsdv' : merge_data_dsdv,
408
- # 'data_cor_dn' : merge_data_cor_dn,
402
+ # out_dic = {
403
+ # 'data_cor_dndsdv' : merge_data,
404
+ # 'data_dn' : merge_data_dn,
405
+ # 'data_dndsdv' : merge_data_dsdv,
406
+ # 'data_cor_dn' : merge_data_cor_dn,
409
407
 
410
- # 'density' : out_rho,
408
+ # 'density' : out_rho,
411
409
 
412
- # 'data_all_aer' : merge_data_aer,
410
+ # 'data_all_aer' : merge_data_aer,
413
411
 
414
- # 'density_cor_dndsdv' : density,
415
- # 'density_dn' : density_dn,
416
- # 'density_dndsdv' : density_dsdv,
417
- # 'density_cor_dn' : density_cor_dn,
418
- # }
412
+ # 'density_cor_dndsdv' : density,
413
+ # 'density_dn' : density_dn,
414
+ # 'density_dndsdv' : density_dsdv,
415
+ # 'density_cor_dn' : density_cor_dn,
416
+ # }
419
417
 
420
- ## process data
421
- for _nam, _df in out_dic.items():
422
- out_dic[_nam] = _df.reindex(smps.index).copy()
418
+ ## process data
419
+ for _nam, _df in out_dic.items():
420
+ out_dic[_nam] = _df.reindex(smps.index).copy()
423
421
 
424
- return out_dic
422
+ return out_dic