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.

Files changed (107) hide show
  1. AeroViz/__init__.py +4 -4
  2. AeroViz/dataProcess/Chemistry/__init__.py +38 -38
  3. AeroViz/dataProcess/Chemistry/_calculate.py +15 -15
  4. AeroViz/dataProcess/Chemistry/_isoropia.py +69 -68
  5. AeroViz/dataProcess/Chemistry/_mass_volume.py +158 -158
  6. AeroViz/dataProcess/Chemistry/_ocec.py +109 -109
  7. AeroViz/dataProcess/Chemistry/_partition.py +19 -18
  8. AeroViz/dataProcess/Chemistry/_teom.py +8 -11
  9. AeroViz/dataProcess/Optical/_IMPROVE.py +40 -39
  10. AeroViz/dataProcess/Optical/__init__.py +35 -35
  11. AeroViz/dataProcess/Optical/_absorption.py +35 -35
  12. AeroViz/dataProcess/Optical/_extinction.py +25 -24
  13. AeroViz/dataProcess/Optical/_mie.py +5 -6
  14. AeroViz/dataProcess/Optical/_mie_sd.py +89 -90
  15. AeroViz/dataProcess/Optical/_scattering.py +16 -16
  16. AeroViz/dataProcess/SizeDistr/__init__.py +37 -37
  17. AeroViz/dataProcess/SizeDistr/__merge.py +159 -158
  18. AeroViz/dataProcess/SizeDistr/_merge.py +155 -154
  19. AeroViz/dataProcess/SizeDistr/_merge_v1.py +162 -161
  20. AeroViz/dataProcess/SizeDistr/_merge_v2.py +153 -152
  21. AeroViz/dataProcess/SizeDistr/_merge_v3.py +326 -326
  22. AeroViz/dataProcess/SizeDistr/_merge_v4.py +272 -274
  23. AeroViz/dataProcess/SizeDistr/_size_distr.py +51 -51
  24. AeroViz/dataProcess/VOC/__init__.py +7 -7
  25. AeroViz/dataProcess/VOC/_potential_par.py +53 -55
  26. AeroViz/dataProcess/__init__.py +4 -4
  27. AeroViz/dataProcess/core/__init__.py +59 -58
  28. AeroViz/plot/__init__.py +6 -1
  29. AeroViz/plot/bar.py +126 -0
  30. AeroViz/plot/box.py +68 -0
  31. AeroViz/plot/distribution/distribution.py +421 -427
  32. AeroViz/plot/meteorology/meteorology.py +240 -292
  33. AeroViz/plot/optical/__init__.py +0 -1
  34. AeroViz/plot/optical/optical.py +230 -230
  35. AeroViz/plot/pie.py +198 -0
  36. AeroViz/plot/regression.py +210 -0
  37. AeroViz/plot/scatter.py +99 -0
  38. AeroViz/plot/templates/__init__.py +0 -3
  39. AeroViz/plot/templates/contour.py +25 -25
  40. AeroViz/plot/templates/corr_matrix.py +86 -93
  41. AeroViz/plot/templates/diurnal_pattern.py +24 -24
  42. AeroViz/plot/templates/koschmieder.py +106 -106
  43. AeroViz/plot/templates/metal_heatmap.py +34 -34
  44. AeroViz/plot/timeseries/timeseries.py +53 -60
  45. AeroViz/plot/utils/__init__.py +2 -1
  46. AeroViz/plot/utils/_color.py +57 -57
  47. AeroViz/plot/utils/_unit.py +48 -48
  48. AeroViz/plot/utils/plt_utils.py +92 -0
  49. AeroViz/plot/utils/sklearn_utils.py +49 -0
  50. AeroViz/plot/violin.py +79 -0
  51. AeroViz/process/__init__.py +15 -15
  52. AeroViz/process/core/DataProc.py +9 -9
  53. AeroViz/process/core/SizeDist.py +81 -81
  54. AeroViz/process/method/PyMieScatt_update.py +488 -488
  55. AeroViz/process/method/mie_theory.py +231 -229
  56. AeroViz/process/method/prop.py +40 -40
  57. AeroViz/process/script/AbstractDistCalc.py +103 -103
  58. AeroViz/process/script/Chemical.py +166 -166
  59. AeroViz/process/script/IMPACT.py +40 -40
  60. AeroViz/process/script/IMPROVE.py +152 -152
  61. AeroViz/process/script/Others.py +45 -45
  62. AeroViz/process/script/PSD.py +26 -26
  63. AeroViz/process/script/PSD_dry.py +69 -70
  64. AeroViz/process/script/retrieve_RI.py +50 -51
  65. AeroViz/rawDataReader/__init__.py +57 -57
  66. AeroViz/rawDataReader/core/__init__.py +328 -326
  67. AeroViz/rawDataReader/script/AE33.py +18 -18
  68. AeroViz/rawDataReader/script/AE43.py +20 -20
  69. AeroViz/rawDataReader/script/APS_3321.py +30 -30
  70. AeroViz/rawDataReader/script/Aurora.py +23 -23
  71. AeroViz/rawDataReader/script/BC1054.py +40 -40
  72. AeroViz/rawDataReader/script/EPA_vertical.py +9 -9
  73. AeroViz/rawDataReader/script/GRIMM.py +21 -21
  74. AeroViz/rawDataReader/script/IGAC_TH.py +67 -67
  75. AeroViz/rawDataReader/script/IGAC_ZM.py +59 -59
  76. AeroViz/rawDataReader/script/MA350.py +39 -39
  77. AeroViz/rawDataReader/script/NEPH.py +74 -74
  78. AeroViz/rawDataReader/script/OCEC_LCRES.py +21 -21
  79. AeroViz/rawDataReader/script/OCEC_RES.py +16 -16
  80. AeroViz/rawDataReader/script/SMPS_TH.py +25 -25
  81. AeroViz/rawDataReader/script/SMPS_aim11.py +32 -32
  82. AeroViz/rawDataReader/script/SMPS_genr.py +31 -31
  83. AeroViz/rawDataReader/script/TEOM.py +28 -28
  84. AeroViz/rawDataReader/script/Table.py +12 -12
  85. AeroViz/rawDataReader/script/VOC_TH.py +16 -16
  86. AeroViz/rawDataReader/script/VOC_ZM.py +28 -28
  87. AeroViz/rawDataReader/script/__init__.py +20 -20
  88. AeroViz/rawDataReader/utils/config.py +161 -161
  89. AeroViz/tools/database.py +65 -65
  90. AeroViz/tools/dataclassifier.py +106 -106
  91. AeroViz/tools/dataprinter.py +51 -51
  92. AeroViz/tools/datareader.py +38 -38
  93. {AeroViz-0.1.3.dist-info → AeroViz-0.1.3b0.dist-info}/METADATA +5 -4
  94. AeroViz-0.1.3b0.dist-info/RECORD +110 -0
  95. AeroViz/config/__init__.py +0 -0
  96. AeroViz/plot/improve/__init__.py +0 -1
  97. AeroViz/plot/improve/improve.py +0 -240
  98. AeroViz/plot/optical/aethalometer.py +0 -77
  99. AeroViz/plot/templates/event_evolution.py +0 -65
  100. AeroViz/plot/templates/regression.py +0 -256
  101. AeroViz/plot/templates/scatter.py +0 -130
  102. AeroViz/plot/templates/templates.py +0 -398
  103. AeroViz/plot/utils/_decorator.py +0 -74
  104. AeroViz-0.1.3.dist-info/RECORD +0 -111
  105. {AeroViz-0.1.3.dist-info → AeroViz-0.1.3b0.dist-info}/LICENSE +0 -0
  106. {AeroViz-0.1.3.dist-info → AeroViz-0.1.3b0.dist-info}/WHEEL +0 -0
  107. {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 date_range, concat, DataFrame, to_numeric
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
- # parameter
7
- df_all = concat(df_che, axis=1)
8
- index = df_all.index.copy()
9
- df_all.columns = nam_lst
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
- df_umol = _ug2umol(df_all)
12
+ df_umol = _ug2umol(df_all)
12
13
 
13
- # calculate
14
- df_out = DataFrame(index=df_umol.index)
14
+ # calculate
15
+ df_out = DataFrame(index=df_umol.index)
15
16
 
16
- # df_out['NTR'] = df_umol['NH4+'] / (df_umol['NH4+'] + df_all['NH3'] / 22.4)
17
- df_out['NTR+'] = df_umol['NH4+'] / (df_umol['NH4+'] + df_umol['NH3'])
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
- df_out['NOR'] = df_umol['NO3-'] / (df_umol['NO3-'] + df_umol['NO2'])
20
- df_out['NOR_2'] = (df_umol['NO3-'] + df_umol['HNO3']) / (df_umol['NO3-'] + df_umol['NO2'] + df_umol['HNO3'])
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
- df_out['SOR'] = df_umol['SO42-'] / (df_umol['SO42-'] + df_umol['SO2'])
23
+ df_out['SOR'] = df_umol['SO42-'] / (df_umol['SO42-'] + df_umol['SO2'])
23
24
 
24
- df_out['epls_NO3-'] = df_umol['NO3-'] / (df_umol['NO3-'] + df_umol['HNO3'])
25
- df_out['epls_NH4+'] = df_umol['NH4+'] / (df_umol['NH4+'] + df_umol['NH3'])
26
- df_out['epls_SO42-'] = df_out['SOR']
27
- df_out['epls_Cl-'] = df_umol['Cl-'] / (df_umol['Cl-'] + df_umol['HCl'])
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
- return df_out
30
+ return df_out
@@ -1,16 +1,13 @@
1
- import numpy as np
2
-
3
-
4
1
  def _basic(_teom, _check):
5
- _teom['Volatile_Fraction'] = (_teom['PM_Total'] - _teom['PM_NV']) / _teom['PM_Total']
2
+ _teom['Volatile_Fraction'] = (_teom['PM_Total'] - _teom['PM_NV']) / _teom['PM_Total']
6
3
 
7
- _teom.loc[(_teom['Volatile_Fraction'] < 0) | (_teom['Volatile_Fraction'] > 1)] = n.nan
4
+ _teom.loc[(_teom['Volatile_Fraction'] < 0) | (_teom['Volatile_Fraction'] > 1)] = n.nan
8
5
 
9
- if _check is not None:
10
- _ratio = _teom['PM_NV'] / _check
11
- _teom['PM_Check'] = _check
6
+ if _check is not None:
7
+ _ratio = _teom['PM_NV'] / _check
8
+ _teom['PM_Check'] = _check
12
9
 
13
- _teom.loc[_teom.dropna().index, 'status'] = 'Warning'
14
- _teom.loc[(_ratio > 0) & (_ratio < 1), 'status'] = 'Normal'
10
+ _teom.loc[_teom.dropna().index, 'status'] = 'Warning'
11
+ _teom.loc[(_ratio > 0) & (_ratio < 1), 'status'] = 'Normal'
15
12
 
16
- return _teom
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
- _df_mass, _df_RH = _union_index(_df_mass, _df_RH)
11
+ _df_mass, _df_RH = _union_index(_df_mass, _df_RH)
11
12
 
12
- ## fRH
13
- with (Path(__file__).parent / 'fRH.pkl').open('rb') as f:
14
- _fRH = pkl.load(f)
15
- _fRH.loc[np.nan] = np.nan
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
- def fRH(_RH):
18
- if _RH is not None:
19
- _RH = _RH.mask(_RH > 95, 95).round(0)
20
- return _fRH.loc[_RH].values.T
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
- return 1, 1, 1, 1
23
+ return 1, 1, 1, 1
23
24
 
24
- ## different mode
25
- ## mass < 20 :
26
- ## large = mass**2/20
27
- ## small = mass-large
28
- ## mass >= 20 :
29
- ## large = mass
30
- ## small = 0
31
- _df_mode = _df_mass[['AS', 'AN', 'OM']].copy()
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
- _df_mass[['L_AS', 'L_AN', 'L_OM']] = _df_mode.mask(_df_mode < 20, _df_mode ** 2 / 20)
34
- _df_mass[['S_AS', 'S_AN', 'S_OM']] = _df_mode.values - _df_mass[['L_AS', 'L_AN', 'L_OM']]
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
- ## apply IMPROVE ccoe.
37
- def _ext_cal(_RH=None):
37
+ ## apply IMPROVE ccoe.
38
+ def _ext_cal(_RH=None):
38
39
 
39
- _frh, _frhss, _frhs, _frhl = fRH(_RH)
40
- _df = DataFrame(index=_df_mass.index)
40
+ _frh, _frhss, _frhs, _frhl = fRH(_RH)
41
+ _df = DataFrame(index=_df_mass.index)
41
42
 
42
- _df['AS'] = 2.2 * _frhs * _df_mass['S_AS'] + 4.8 * _frhl * _df_mass['L_AS']
43
- _df['AN'] = 2.4 * _frhs * _df_mass['S_AN'] + 5.1 * _frhl * _df_mass['L_AN']
44
- _df['OM'] = 2.8 * _df_mass['S_OM'] + 6.1 * _frhl * _df_mass['L_OM']
45
- _df['Soil'] = _df_mass['Soil']
46
- _df['SS'] = 1.7 * _frhss * _df_mass['SS']
47
- _df['EC'] = 10 * _df_mass['EC']
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
- _df['total'] = _df.sum(axis=1)
50
+ _df['total'] = _df.sum(axis=1)
50
51
 
51
- return _df.dropna().reindex(_df_mass.index)
52
+ return _df.dropna().reindex(_df_mass.index)
52
53
 
53
- ## calculate
54
- _out = {}
54
+ ## calculate
55
+ _out = {}
55
56
 
56
- _out['dry'] = _ext_cal()
57
+ _out['dry'] = _ext_cal()
57
58
 
58
- if _df_RH is not None:
59
- _out['wet'] = _ext_cal(_df_RH)
59
+ if _df_RH is not None:
60
+ _out['wet'] = _ext_cal(_df_RH)
60
61
 
61
- return _out
62
+ return _out
@@ -2,61 +2,61 @@ from ..core import _writter, _run_process
2
2
 
3
3
  __all__ = [
4
4
 
5
- 'Optical',
5
+ 'Optical',
6
6
 
7
7
  ]
8
8
 
9
9
 
10
10
  class Optical(_writter):
11
11
 
12
- ## scatter
13
- @_run_process('Optical - SAE', 'SAE')
14
- def SAE(self, df_sca):
15
- from ._scattering import _SAE
12
+ ## scatter
13
+ @_run_process('Optical - SAE', 'SAE')
14
+ def SAE(self, df_sca):
15
+ from ._scattering import _SAE
16
16
 
17
- out = _SAE(df_sca)
17
+ out = _SAE(df_sca)
18
18
 
19
- return self, out
19
+ return self, out
20
20
 
21
- ## absorption
22
- @_run_process('Optical - absCoe', 'absCoe')
23
- def absCoe(self, df_ae33, abs_band=[550]):
24
- from ._absorption import _absCoe
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
- out = _absCoe(df_ae33, abs_band)
26
+ out = _absCoe(df_ae33, abs_band)
27
27
 
28
- return self, out
28
+ return self, out
29
29
 
30
- @_run_process('Optical - AAE', 'AAE')
31
- def AAE(self, df_abs):
32
- from ._absorption import _AAE
30
+ @_run_process('Optical - AAE', 'AAE')
31
+ def AAE(self, df_abs):
32
+ from ._absorption import _AAE
33
33
 
34
- out = _AAE(df_abs)
34
+ out = _AAE(df_abs)
35
35
 
36
- return self, out
36
+ return self, out
37
37
 
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
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
- out = _basic(df_abs, df_sca, df_ec, df_mass, df_no2)
43
+ out = _basic(df_abs, df_sca, df_ec, df_mass, df_no2)
44
44
 
45
- return self, out
45
+ return self, out
46
46
 
47
- @_run_process('Optical - Mie', 'Mie')
48
- def Mie(self, df_psd, df_m, wave_length=550):
49
- from ._mie import _mie
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
- out = _mie(df_psd, df_m, wave_length)
51
+ out = _mie(df_psd, df_m, wave_length)
52
52
 
53
- return self, out
53
+ return self, out
54
54
 
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
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
- out = _revised(df_mass, df_RH)
60
+ out = _revised(df_mass, df_RH)
61
61
 
62
- return self, out
62
+ return self, out
@@ -1,54 +1,54 @@
1
1
  def _absCoe(df, abs_band):
2
- import numpy as n
3
- from scipy.optimize import curve_fit
2
+ import numpy as n
3
+ from scipy.optimize import curve_fit
4
4
 
5
- band = n.array([370, 470, 520, 590, 660, 880, 950])
5
+ band = n.array([370, 470, 520, 590, 660, 880, 950])
6
6
 
7
- df_out = {}
7
+ df_out = {}
8
8
 
9
- def _get_slope(__df):
10
- func = lambda _x, _sl, _int: _sl * _x + _int
11
- popt, pcov = curve_fit(func, band, __df.values)
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
- return func(n.array(abs_band), *popt)
13
+ return func(n.array(abs_band), *popt)
14
14
 
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()
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
- 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]
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
- df_out['eBC'] = df['BC6']
21
+ df_out['eBC'] = df['BC6']
22
22
 
23
- return df_out
23
+ return df_out
24
24
 
25
25
 
26
26
  def _AAE(df):
27
- import numpy as n
28
- from scipy.optimize import curve_fit
27
+ import numpy as n
28
+ from scipy.optimize import curve_fit
29
29
 
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
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
- ## 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))
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
- return popt
42
+ return popt
43
43
 
44
- ## calculate
45
- _AAE = _df.apply(_get_slope, axis=1, result_type='expand')
46
- _AAE.columns = ['slope', 'intercept']
44
+ ## calculate
45
+ _AAE = _df.apply(_get_slope, axis=1, result_type='expand')
46
+ _AAE.columns = ['slope', 'intercept']
47
47
 
48
- return _AAE
48
+ return _AAE
49
49
 
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()
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
- df_out['eBC'] = df['BC6']
54
- return df_out.reindex(df.index)
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
- 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)