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,16 +1,14 @@
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
+ import numpy as np
3
+ _teom['Volatile_Fraction'] = (_teom['PM_Total'] - _teom['PM_NV']) / _teom['PM_Total']
6
4
 
7
- _teom.loc[(_teom['Volatile_Fraction'] < 0) | (_teom['Volatile_Fraction'] > 1)] = n.nan
5
+ _teom.loc[(_teom['Volatile_Fraction'] < 0) | (_teom['Volatile_Fraction'] > 1)] = np.nan
8
6
 
9
- if _check is not None:
10
- _ratio = _teom['PM_NV'] / _check
11
- _teom['PM_Check'] = _check
7
+ if _check is not None:
8
+ _ratio = _teom['PM_NV'] / _check
9
+ _teom['PM_Check'] = _check
12
10
 
13
- _teom.loc[_teom.dropna().index, 'status'] = 'Warning'
14
- _teom.loc[(_ratio > 0) & (_ratio < 1), 'status'] = 'Normal'
11
+ _teom.loc[_teom.dropna().index, 'status'] = 'Warning'
12
+ _teom.loc[(_ratio > 0) & (_ratio < 1), 'status'] = 'Normal'
15
13
 
16
- return _teom
14
+ return _teom
@@ -0,0 +1,21 @@
1
+ *** [ INPUT/OUTPUT PARAMETERS ] ***
2
+ CREATE REPORT IN FILE? (.T.=yes, .F.=no, on screen)
3
+ .F.
4
+ CREATE SPREADSHEET FILE? (.T.=yes, .F.=no)
5
+ .T.
6
+
7
+ *** [ SOLUTION CONTROL ] ***
8
+ Convergence criterion (DEFAULT:1.D-6)
9
+ 1.D-6
10
+ Max iterations for bisection method (DEFAULT:100)
11
+ 100
12
+ Sweeps for activity coef. calculation (DEFAULT:4)
13
+ 4
14
+ Accuracy in activity coef. calculation (DEFAULT:5e-2)
15
+ 5e-2
16
+ Subdivisions for root tracking (DEFAULT:5)
17
+ 5
18
+ Method for binary activity coefs (0-online, 1-tables) (DEFAULT:1)
19
+ 1
20
+ Force mass conservation to machine precision? (0-no, 1-yes) (DEFAULT:0)
21
+ 0
@@ -0,0 +1,20 @@
1
+ import numpy as np
2
+ import pandas as pd
3
+ from scipy.optimize import curve_fit
4
+
5
+
6
+ def get_species_wavelength(df, specified_band):
7
+ func = lambda wavelength, _sl, _int: _sl * wavelength + _int
8
+ popt, pcov = curve_fit(func, specified_band, df.values)
9
+
10
+ return func(np.array(specified_band), *popt)
11
+
12
+
13
+ def get_Angstrom_exponent(df, band):
14
+ if (df <= 0).any():
15
+ return pd.Series([np.nan, np.nan], index=['slope', 'intercept']) # 返回包含 NaN 的 Series,保持 DataFrame 结构
16
+
17
+ func = lambda wavelength, _sl, _int: _sl * wavelength + _int
18
+ popt, _ = curve_fit(func, np.log(band), np.log(df))
19
+
20
+ return pd.Series(popt, index=['slope', 'intercept']) # 返回带有索引的 Series
@@ -1,61 +1,60 @@
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
- from AeroViz.dataProcess.core import _union_index
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
-
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
11
+ _df_mass, _df_RH = union_index(_df_mass, _df_RH)
16
12
 
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
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
21
17
 
22
- return 1, 1, 1, 1
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
23
22
 
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()
23
+ return 1, 1, 1, 1
32
24
 
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']]
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()
35
33
 
36
- ## apply IMPROVE ccoe.
37
- def _ext_cal(_RH=None):
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']]
38
36
 
39
- _frh, _frhss, _frhs, _frhl = fRH(_RH)
40
- _df = DataFrame(index=_df_mass.index)
37
+ # apply IMPROVE ccoe.
38
+ def _ext_cal(_RH=None):
41
39
 
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']
40
+ _frh, _frhss, _frhs, _frhl = fRH(_RH)
41
+ _df = DataFrame(index=_df_mass.index)
48
42
 
49
- _df['total'] = _df.sum(axis=1)
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']
50
49
 
51
- return _df.dropna().reindex(_df_mass.index)
50
+ _df['total'] = _df.sum(axis=1)
52
51
 
53
- ## calculate
54
- _out = {}
52
+ return _df.dropna().reindex(_df_mass.index)
55
53
 
56
- _out['dry'] = _ext_cal()
54
+ # calculate
55
+ _out = {'dry': _ext_cal()}
57
56
 
58
- if _df_RH is not None:
59
- _out['wet'] = _ext_cal(_df_RH)
57
+ if _df_RH is not None:
58
+ _out['wet'] = _ext_cal(_df_RH)
60
59
 
61
- return _out
60
+ return _out
@@ -1,62 +1,47 @@
1
- from ..core import _writter, _run_process
1
+ from ..core import Writer, run_process
2
2
 
3
- __all__ = [
3
+ __all__ = ['Optical']
4
4
 
5
- 'Optical',
6
5
 
7
- ]
6
+ class Optical(Writer):
8
7
 
8
+ @run_process('Optical - scaCoe', 'scaCoe')
9
+ def scaCoe(self, df_sca, instru, specified_band):
10
+ from ._scattering import _scaCoe
9
11
 
10
- class Optical(_writter):
12
+ out = _scaCoe(df_sca, instru=instru, specified_band=[550] if specified_band is None else specified_band)
11
13
 
12
- ## scatter
13
- @_run_process('Optical - SAE', 'SAE')
14
- def SAE(self, df_sca):
15
- from ._scattering import _SAE
14
+ return self, out
16
15
 
17
- out = _SAE(df_sca)
16
+ @run_process('Optical - absCoe', 'absCoe')
17
+ def absCoe(self, df_ae33, instru, specified_band):
18
+ from ._absorption import _absCoe
18
19
 
19
- return self, out
20
+ out = _absCoe(df_ae33, instru=instru, specified_band=[550] if specified_band is None else specified_band)
20
21
 
21
- ## absorption
22
- @_run_process('Optical - absCoe', 'absCoe')
23
- def absCoe(self, df_ae33, abs_band=[550]):
24
- from ._absorption import _absCoe
22
+ return self, out
25
23
 
26
- out = _absCoe(df_ae33, abs_band)
24
+ @run_process('Optical - basic', 'opt_basic')
25
+ def basic(self, df_sca, df_abs, df_mass=None, df_no2=None, df_temp=None):
26
+ from ._extinction import _basic
27
27
 
28
- return self, out
28
+ out = _basic(df_sca, df_abs, df_mass, df_no2, df_temp)
29
29
 
30
- @_run_process('Optical - AAE', 'AAE')
31
- def AAE(self, df_abs):
32
- from ._absorption import _AAE
30
+ return self, out
33
31
 
34
- out = _AAE(df_abs)
32
+ @run_process('Optical - Mie', 'Mie')
33
+ def Mie(self, df_psd, df_m, wave_length=550):
34
+ from ._mie import _mie
35
35
 
36
- return self, out
36
+ out = _mie(df_psd, df_m, wave_length)
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
+ return self, out
42
39
 
43
- out = _basic(df_abs, df_sca, df_ec, df_mass, df_no2)
40
+ @run_process('Optical - IMPROVE', 'IMPROVE')
41
+ def IMPROVE(self, df_mass, df_RH, method='revised'):
42
+ # _fc = __import__(f'_IMPROVE._{method}')
43
+ from ._IMPROVE import _revised
44
44
 
45
- return self, out
45
+ out = _revised(df_mass, df_RH)
46
46
 
47
- @_run_process('Optical - Mie', 'Mie')
48
- def Mie(self, df_psd, df_m, wave_length=550):
49
- from ._mie import _mie
50
-
51
- out = _mie(df_psd, df_m, wave_length)
52
-
53
- return self, out
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
59
-
60
- out = _revised(df_mass, df_RH)
61
-
62
- return self, out
47
+ return self, out
@@ -1,54 +1,28 @@
1
- def _absCoe(df, abs_band):
2
- import numpy as n
3
- from scipy.optimize import curve_fit
1
+ def _absCoe(df, instru, specified_band: list):
2
+ import numpy as np
3
+ from pandas import concat
4
+ from .Angstrom_exponent import get_Angstrom_exponent, get_species_wavelength
4
5
 
5
- band = n.array([370, 470, 520, 590, 660, 880, 950])
6
+ band_AE33 = np.array([370, 470, 520, 590, 660, 880, 950])
7
+ band_BC1054 = np.array([370, 430, 470, 525, 565, 590, 660, 700, 880, 950])
6
8
 
7
- df_out = {}
9
+ MAE_AE33 = np.array([18.47, 14.54, 13.14, 11.58, 10.35, 7.77, 7.19]) * 1e-3
10
+ MAE_BC1054 = np.array([18.48, 15.90, 14.55, 13.02, 12.10, 11.59, 10.36, 9.77, 7.77, 7.20]) * 1e-3
8
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
+ band = band_AE33 if instru == 'AE33' else band_BC1054
13
+ MAE = MAE_AE33 if instru == 'AE33' else MAE_BC1054
14
+ eBC = 'BC6' if instru == 'AE33' else 'BC9'
12
15
 
13
- return func(n.array(abs_band), *popt)
16
+ # calculate
17
+ df_abs = (df.copy().dropna() * MAE).copy()
14
18
 
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()
19
+ df_out = df_abs.apply(get_species_wavelength, axis=1, result_type='expand', args=(specified_band,))
20
+ df_out.columns = [f'abs_{_band}' for _band in specified_band]
21
+ df_out['eBC'] = df[eBC]
17
22
 
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]
23
+ df_AAE = df_abs.apply(get_Angstrom_exponent, axis=1, result_type='expand', args=(band,))
24
+ df_AAE.columns = ['AAE', 'AAE_intercept']
25
+ df_AAE = df_AAE.mask((-df_AAE['AAE'] < 0.8) | (-df_AAE['AAE'] > 2.)).copy()
20
26
 
21
- df_out['eBC'] = df['BC6']
22
-
23
- return df_out
24
-
25
-
26
- def _AAE(df):
27
- import numpy as n
28
- from scipy.optimize import curve_fit
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
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))
41
-
42
- return popt
43
-
44
- ## calculate
45
- _AAE = _df.apply(_get_slope, axis=1, result_type='expand')
46
- _AAE.columns = ['slope', 'intercept']
47
-
48
- return _AAE
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()
52
-
53
- df_out['eBC'] = df['BC6']
54
- return df_out.reindex(df.index)
27
+ _df = concat([df_out, df_AAE['AAE']], axis=1)
28
+ return _df.reindex(df.index)
@@ -1,36 +1,42 @@
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
- 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
5
 
8
- df_out = DataFrame()
6
+ def _basic(df_sca, df_abs, df_mass, df_no2, df_temp):
7
+ df_sca, df_abs, df_mass, df_no2, df_temp = union_index(df_sca, df_abs, df_mass, df_no2, df_temp)
9
8
 
10
- ## abs and sca coe
11
- df_out['abs'] = df_abs.copy()
12
- df_out['sca'] = df_sca.copy()
9
+ df_out = DataFrame()
13
10
 
14
- ## extinction coe.
15
- df_out['ext'] = df_out['abs'] + df_out['sca']
11
+ # abs and sca coe
12
+ df_out['abs'] = df_abs['abs_550'].copy()
13
+ df_out['sca'] = df_sca['sca_550'].copy()
16
14
 
17
- ## SSA
18
- df_out['SSA'] = df_out['sca'] / df_out['ext']
15
+ # extinction coe.
16
+ df_out['ext'] = df_out['abs'] + df_out['sca']
19
17
 
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']
18
+ # SSA
19
+ df_out['SSA'] = df_out['sca'] / df_out['ext']
25
20
 
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']
21
+ # SAE, AAE, eBC
22
+ df_out['SAE'] = df_sca['SAE'].copy()
23
+ df_out['AAE'] = df_abs['AAE'].copy()
24
+ df_out['eBC'] = df_abs['eBC'].copy() / 1e3
31
25
 
32
- ## other
33
- if df_ec is not None:
34
- df_out['eBC'] = df_ec / 1e3
26
+ # MAE, MSE, MEE
27
+ if df_mass is not None:
28
+ df_out['MAE'] = df_out['abs'] / df_mass
29
+ df_out['MSE'] = df_out['sca'] / df_mass
30
+ df_out['MEE'] = df_out['MSE'] + df_out['MAE']
35
31
 
36
- return df_out
32
+ # gas absorbtion
33
+ if df_no2 is not None:
34
+ df_out['abs_gas'] = df_no2 * .33
35
+
36
+ if df_temp is not None:
37
+ df_out['sca_gas'] = (11.4 * 293 / (273 + df_temp))
38
+
39
+ if df_no2 is not None and df_temp is not None:
40
+ df_out['ext_all'] = df_out['ext'] + df_out['abs_gas'] + df_out['sca_gas']
41
+
42
+ return df_out
@@ -1,16 +1,14 @@
1
1
  # from PyMieScatt import Mie_SD
2
- # from PyMieScatt import Mie_SD
3
2
 
4
3
  from ._mie_sd import Mie_SD
5
- from pandas import date_range, concat, DataFrame, to_numeric
6
4
 
7
5
 
8
6
  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
7
+ _ori_idx = _psd_ori.index.copy()
8
+ _cal_idx = _psd_ori.loc[_RI_ori.dropna().index].dropna(how='all').index
11
9
 
12
- _psd, _RI = _psd_ori.loc[_cal_idx], _RI_ori.loc[_cal_idx]
10
+ _psd, _RI = _psd_ori.loc[_cal_idx], _RI_ori.loc[_cal_idx]
13
11
 
14
- _out = Mie_SD(_RI.values, 550, _psd)
12
+ _out = Mie_SD(_RI.values, 550, _psd)
15
13
 
16
- return _out.reindex(_ori_idx)
14
+ return _out.reindex(_ori_idx)