AeroViz 0.1.3__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/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/__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/plt_utils.py +92 -0
- AeroViz/plot/utils/sklearn_utils.py +49 -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.3.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.3.dist-info/RECORD +0 -111
- {AeroViz-0.1.3.dist-info → AeroViz-0.1.3b0.dist-info}/LICENSE +0 -0
- {AeroViz-0.1.3.dist-info → AeroViz-0.1.3b0.dist-info}/WHEEL +0 -0
- {AeroViz-0.1.3.dist-info → AeroViz-0.1.3b0.dist-info}/top_level.txt +0 -0
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
from pandas import
|
|
1
|
+
from pandas import concat, DataFrame
|
|
2
|
+
|
|
2
3
|
from ._calculate import _ug2umol
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
def _basic(df_che, nam_lst):
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
# parameter
|
|
8
|
+
df_all = concat(df_che, axis=1)
|
|
9
|
+
index = df_all.index.copy()
|
|
10
|
+
df_all.columns = nam_lst
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
df_umol = _ug2umol(df_all)
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
# calculate
|
|
15
|
+
df_out = DataFrame(index=df_umol.index)
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
# df_out['NTR'] = df_umol['NH4+'] / (df_umol['NH4+'] + df_all['NH3'] / 22.4)
|
|
18
|
+
df_out['NTR+'] = df_umol['NH4+'] / (df_umol['NH4+'] + df_umol['NH3'])
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
df_out['NOR'] = df_umol['NO3-'] / (df_umol['NO3-'] + df_umol['NO2'])
|
|
21
|
+
df_out['NOR_2'] = (df_umol['NO3-'] + df_umol['HNO3']) / (df_umol['NO3-'] + df_umol['NO2'] + df_umol['HNO3'])
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
df_out['SOR'] = df_umol['SO42-'] / (df_umol['SO42-'] + df_umol['SO2'])
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
df_out['epls_NO3-'] = df_umol['NO3-'] / (df_umol['NO3-'] + df_umol['HNO3'])
|
|
26
|
+
df_out['epls_NH4+'] = df_umol['NH4+'] / (df_umol['NH4+'] + df_umol['NH3'])
|
|
27
|
+
df_out['epls_SO42-'] = df_out['SOR']
|
|
28
|
+
df_out['epls_Cl-'] = df_umol['Cl-'] / (df_umol['Cl-'] + df_umol['HCl'])
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
return df_out
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import numpy as np
|
|
2
|
-
|
|
3
|
-
|
|
4
1
|
def _basic(_teom, _check):
|
|
5
|
-
|
|
2
|
+
_teom['Volatile_Fraction'] = (_teom['PM_Total'] - _teom['PM_NV']) / _teom['PM_Total']
|
|
6
3
|
|
|
7
|
-
|
|
4
|
+
_teom.loc[(_teom['Volatile_Fraction'] < 0) | (_teom['Volatile_Fraction'] > 1)] = n.nan
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
if _check is not None:
|
|
7
|
+
_ratio = _teom['PM_NV'] / _check
|
|
8
|
+
_teom['PM_Check'] = _check
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
_teom.loc[_teom.dropna().index, 'status'] = 'Warning'
|
|
11
|
+
_teom.loc[(_ratio > 0) & (_ratio < 1), 'status'] = 'Normal'
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
return _teom
|
|
@@ -1,61 +1,62 @@
|
|
|
1
1
|
import pickle as pkl
|
|
2
2
|
from pathlib import Path
|
|
3
|
+
|
|
3
4
|
import numpy as np
|
|
5
|
+
from pandas import DataFrame
|
|
4
6
|
|
|
5
|
-
from pandas import date_range, concat, DataFrame, to_numeric
|
|
6
7
|
from AeroViz.dataProcess.core import _union_index
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
def _revised(_df_mass, _df_RH):
|
|
10
|
-
|
|
11
|
+
_df_mass, _df_RH = _union_index(_df_mass, _df_RH)
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
## fRH
|
|
14
|
+
with (Path(__file__).parent / 'fRH.pkl').open('rb') as f:
|
|
15
|
+
_fRH = pkl.load(f)
|
|
16
|
+
_fRH.loc[np.nan] = np.nan
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
def fRH(_RH):
|
|
19
|
+
if _RH is not None:
|
|
20
|
+
_RH = _RH.mask(_RH > 95, 95).round(0)
|
|
21
|
+
return _fRH.loc[_RH].values.T
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
return 1, 1, 1, 1
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
## different mode
|
|
26
|
+
## mass < 20 :
|
|
27
|
+
## large = mass**2/20
|
|
28
|
+
## small = mass-large
|
|
29
|
+
## mass >= 20 :
|
|
30
|
+
## large = mass
|
|
31
|
+
## small = 0
|
|
32
|
+
_df_mode = _df_mass[['AS', 'AN', 'OM']].copy()
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
_df_mass[['L_AS', 'L_AN', 'L_OM']] = _df_mode.mask(_df_mode < 20, _df_mode ** 2 / 20)
|
|
35
|
+
_df_mass[['S_AS', 'S_AN', 'S_OM']] = _df_mode.values - _df_mass[['L_AS', 'L_AN', 'L_OM']]
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
## apply IMPROVE ccoe.
|
|
38
|
+
def _ext_cal(_RH=None):
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
_frh, _frhss, _frhs, _frhl = fRH(_RH)
|
|
41
|
+
_df = DataFrame(index=_df_mass.index)
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
_df['AS'] = 2.2 * _frhs * _df_mass['S_AS'] + 4.8 * _frhl * _df_mass['L_AS']
|
|
44
|
+
_df['AN'] = 2.4 * _frhs * _df_mass['S_AN'] + 5.1 * _frhl * _df_mass['L_AN']
|
|
45
|
+
_df['OM'] = 2.8 * _df_mass['S_OM'] + 6.1 * _frhl * _df_mass['L_OM']
|
|
46
|
+
_df['Soil'] = _df_mass['Soil']
|
|
47
|
+
_df['SS'] = 1.7 * _frhss * _df_mass['SS']
|
|
48
|
+
_df['EC'] = 10 * _df_mass['EC']
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
_df['total'] = _df.sum(axis=1)
|
|
50
51
|
|
|
51
|
-
|
|
52
|
+
return _df.dropna().reindex(_df_mass.index)
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
## calculate
|
|
55
|
+
_out = {}
|
|
55
56
|
|
|
56
|
-
|
|
57
|
+
_out['dry'] = _ext_cal()
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
if _df_RH is not None:
|
|
60
|
+
_out['wet'] = _ext_cal(_df_RH)
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
return _out
|
|
@@ -2,61 +2,61 @@ from ..core import _writter, _run_process
|
|
|
2
2
|
|
|
3
3
|
__all__ = [
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
'Optical',
|
|
6
6
|
|
|
7
7
|
]
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class Optical(_writter):
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
## scatter
|
|
13
|
+
@_run_process('Optical - SAE', 'SAE')
|
|
14
|
+
def SAE(self, df_sca):
|
|
15
|
+
from ._scattering import _SAE
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
out = _SAE(df_sca)
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
return self, out
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
## absorption
|
|
22
|
+
@_run_process('Optical - absCoe', 'absCoe')
|
|
23
|
+
def absCoe(self, df_ae33, abs_band=[550]):
|
|
24
|
+
from ._absorption import _absCoe
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
out = _absCoe(df_ae33, abs_band)
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
return self, out
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
@_run_process('Optical - AAE', 'AAE')
|
|
31
|
+
def AAE(self, df_abs):
|
|
32
|
+
from ._absorption import _AAE
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
out = _AAE(df_abs)
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
return self, out
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
## extinction
|
|
39
|
+
@_run_process('Optical - basic', 'opt_basic')
|
|
40
|
+
def basic(self, df_abs, df_sca, df_ec=None, df_mass=None, df_no2=None):
|
|
41
|
+
from ._extinction import _basic
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
out = _basic(df_abs, df_sca, df_ec, df_mass, df_no2)
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
return self, out
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
@_run_process('Optical - Mie', 'Mie')
|
|
48
|
+
def Mie(self, df_psd, df_m, wave_length=550):
|
|
49
|
+
from ._mie import _mie
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
out = _mie(df_psd, df_m, wave_length)
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
return self, out
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
@_run_process('Optical - IMPROVE', 'IMPROVE')
|
|
56
|
+
def IMPROVE(self, df_mass, df_RH, method='revised'):
|
|
57
|
+
# _fc = __import__(f'_IMPROVE._{method}')
|
|
58
|
+
from ._IMPROVE import _revised
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
out = _revised(df_mass, df_RH)
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
return self, out
|
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
def _absCoe(df, abs_band):
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import numpy as n
|
|
3
|
+
from scipy.optimize import curve_fit
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
band = n.array([370, 470, 520, 590, 660, 880, 950])
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
df_out = {}
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
def _get_slope(__df):
|
|
10
|
+
func = lambda _x, _sl, _int: _sl * _x + _int
|
|
11
|
+
popt, pcov = curve_fit(func, band, __df.values)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
return func(n.array(abs_band), *popt)
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
MAE = n.array([18.47, 14.54, 13.14, 11.58, 10.35, 7.77, 7.19]) * 1e-3
|
|
16
|
+
df_abs = (df.copy() * MAE).dropna().copy()
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
df_out = df_abs.apply(_get_slope, axis=1, result_type='expand').reindex(df.index)
|
|
19
|
+
df_out.columns = [f'abs_{_band}' for _band in abs_band]
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
df_out['eBC'] = df['BC6']
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
return df_out
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
def _AAE(df):
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
import numpy as n
|
|
28
|
+
from scipy.optimize import curve_fit
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
def _AAEcalc(_df):
|
|
31
|
+
## parameter
|
|
32
|
+
MAE = n.array([18.47, 14.54, 13.14, 11.58, 10.35, 7.77, 7.19]) * 1e-3
|
|
33
|
+
band = n.array([370, 470, 520, 590, 660, 880, 950])
|
|
34
|
+
_df *= MAE
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
## 7 pts fitting
|
|
37
|
+
## function
|
|
38
|
+
def _get_slope(__df):
|
|
39
|
+
func = lambda _x, _sl, _int: _sl * _x + _int
|
|
40
|
+
popt, pcov = curve_fit(func, n.log(band), n.log(__df))
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
return popt
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
## calculate
|
|
45
|
+
_AAE = _df.apply(_get_slope, axis=1, result_type='expand')
|
|
46
|
+
_AAE.columns = ['slope', 'intercept']
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
return _AAE
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
df_out = _AAEcalc(df[['BC1', 'BC2', 'BC3', 'BC4', 'BC5', 'BC6', 'BC7']].dropna())
|
|
51
|
+
df_out = df_out.mask((-df_out.slope < 0.8) | (-df_out.slope > 2.)).copy()
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
df_out['eBC'] = df['BC6']
|
|
54
|
+
return df_out.reindex(df.index)
|
|
@@ -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
|
-
|
|
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
|
-
|
|
9
|
+
df_out = DataFrame()
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
## abs and sca coe
|
|
12
|
+
df_out['abs'] = df_abs.copy()
|
|
13
|
+
df_out['sca'] = df_sca.copy()
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
## extinction coe.
|
|
16
|
+
df_out['ext'] = df_out['abs'] + df_out['sca']
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
## SSA
|
|
19
|
+
df_out['SSA'] = df_out['sca'] / df_out['ext']
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
## other
|
|
34
|
+
if df_ec is not None:
|
|
35
|
+
df_out['eBC'] = df_ec / 1e3
|
|
35
36
|
|
|
36
|
-
|
|
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
|
-
|
|
10
|
-
|
|
8
|
+
_ori_idx = _psd_ori.index.copy()
|
|
9
|
+
_cal_idx = _psd_ori.loc[_RI_ori.dropna().index].dropna(how='all').index
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
_psd, _RI = _psd_ori.loc[_cal_idx], _RI_ori.loc[_cal_idx]
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
_out = Mie_SD(_RI.values, 550, _psd)
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
return _out.reindex(_ori_idx)
|