AeroViz 0.1.8__tar.gz → 0.1.9.1__tar.gz
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-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Chemistry/_ocec.py +5 -5
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/hysplit/hysplit.py +5 -2
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/core/__init__.py +7 -5
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/OCEC.py +4 -2
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz.egg-info/PKG-INFO +2 -1
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz.egg-info/SOURCES.txt +1 -2
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz.egg-info/requires.txt +1 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/PKG-INFO +2 -1
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/requirements.txt +1 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/setup.py +1 -1
- aeroviz-0.1.8/test/test_plot.py +0 -132
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/data/240228_00.txt +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/data/DEFAULT_DATA.csv +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/data/DEFAULT_PNSD_DATA.csv +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Chemistry/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Chemistry/_calculate.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Chemistry/_isoropia.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Chemistry/_mass_volume.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Chemistry/_partition.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Chemistry/_teom.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Chemistry/isrpia.cnf +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Chemistry/isrpia2.exe +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Optical/Angstrom_exponent.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Optical/_IMPROVE.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Optical/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Optical/_absorption.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Optical/_extinction.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Optical/_mie.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Optical/_mie_sd.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Optical/_scattering.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/Optical/fRH.pkl +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/SizeDistr/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/SizeDistr/__merge.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/SizeDistr/_merge.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/SizeDistr/_merge_v1.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/SizeDistr/_merge_v2.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/SizeDistr/_merge_v3.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/SizeDistr/_merge_v4.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/SizeDistr/_size_distr.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/VOC/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/VOC/_potential_par.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/VOC/support_voc.json +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/dataProcess/core/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/bar.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/box.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/distribution/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/distribution/distribution.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/hysplit/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/meteorology/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/meteorology/meteorology.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/optical/PyMieScatt_update.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/optical/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/optical/mie_theory.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/optical/optical.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/pie.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/radar.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/regression.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/scatter.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/templates/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/templates/ammonium_rich.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/templates/contour.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/templates/corr_matrix.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/templates/diurnal_pattern.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/templates/koschmieder.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/templates/metal_heatmap.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/timeseries/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/timeseries/template.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/timeseries/timeseries.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/utils/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/utils/_color.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/utils/_unit.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/utils/fRH.json +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/utils/plt_utils.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/utils/sklearn_utils.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/utils/units.json +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/plot/violin.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/config/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/config/supported_instruments.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/AE33.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/AE43.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/APS_3321.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/Aurora.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/BC1054.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/EPA.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/GRIMM.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/IGAC.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/MA350.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/Minion.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/NEPH.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/SMPS.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/TEOM.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/VOC.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/XRF.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/rawDataReader/script/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/tools/__init__.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/tools/database.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/tools/dataclassifier.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/tools/dataprinter.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz/tools/datareader.py +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz.egg-info/dependency_links.txt +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/AeroViz.egg-info/top_level.txt +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/LICENSE +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/MANIFEST.in +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/README.md +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/setup.cfg +0 -0
- {aeroviz-0.1.8 → aeroviz-0.1.9.1}/test/test_aeroviz_imports.py +0 -0
|
@@ -114,8 +114,7 @@ def _basic(_lcres, _mass, _ocec_ratio, _ocec_ratio_month, _hr_lim, _range, _wiso
|
|
|
114
114
|
_out = {}
|
|
115
115
|
|
|
116
116
|
# OC1, OC2, OC3, OC4, PC
|
|
117
|
-
_df_bsc = _lcres[['
|
|
118
|
-
_df_bsc.rename(columns={'OC1_raw': 'OC1', 'OC2_raw': 'OC2', 'OC3_raw': 'OC3', 'OC4_raw': 'OC4'}, inplace=True)
|
|
117
|
+
_df_bsc = _lcres[['OC1', 'OC2', 'OC3', 'OC4', 'PC']].copy()
|
|
119
118
|
|
|
120
119
|
# SOC, POC, OC/EC
|
|
121
120
|
if _ocec_ratio is not None:
|
|
@@ -144,7 +143,8 @@ def _basic(_lcres, _mass, _ocec_ratio, _ocec_ratio_month, _hr_lim, _range, _wiso
|
|
|
144
143
|
_df_ratio = DataFrame(index=_df_bsc.index)
|
|
145
144
|
|
|
146
145
|
for _ky, _val in _df_bsc.items():
|
|
147
|
-
if 'OC/EC' in _ky:
|
|
146
|
+
if 'OC/EC' in _ky:
|
|
147
|
+
continue
|
|
148
148
|
_df_ratio[f'{_ky}/Thermal_OC'] = _val / _lcres['Thermal_OC']
|
|
149
149
|
_df_ratio[f'{_ky}/Optical_OC'] = _val / _lcres['Optical_OC']
|
|
150
150
|
|
|
@@ -159,14 +159,14 @@ def _basic(_lcres, _mass, _ocec_ratio, _ocec_ratio_month, _hr_lim, _range, _wiso
|
|
|
159
159
|
_df_ratio[f'Optical_EC/PM'] = _lcres['Optical_EC'] / _mass
|
|
160
160
|
|
|
161
161
|
# ratio status
|
|
162
|
-
_df_bsc = concat((_lcres, _df_bsc.copy()), axis=1)
|
|
162
|
+
_df_bsc = concat((_lcres.loc[:, :'Sample_Volume'], _df_bsc.copy()), axis=1)
|
|
163
163
|
|
|
164
164
|
for _ky, _df in _df_ratio.items():
|
|
165
165
|
_df_bsc[f'{_ky}_status'] = 'Normal'
|
|
166
166
|
_df_bsc[f'{_ky}_status'] = _df_bsc[f'{_ky}_status'].mask(_df > 1, 'Warning')
|
|
167
167
|
|
|
168
168
|
# out
|
|
169
|
-
_out['ratio'] = _df_ratio
|
|
170
169
|
_out['basic'] = _df_bsc
|
|
170
|
+
_out['ratio'] = _df_ratio
|
|
171
171
|
|
|
172
172
|
return _out
|
|
@@ -12,6 +12,9 @@ from AeroViz.plot.utils import set_figure
|
|
|
12
12
|
|
|
13
13
|
__all__ = ['hysplit']
|
|
14
14
|
|
|
15
|
+
# 設置默認文件路徑
|
|
16
|
+
DEFAULT_FILE = Path(__file__).parent.parent.parent / 'data' / '240228_00.txt'
|
|
17
|
+
|
|
15
18
|
|
|
16
19
|
def read_hysplit_data(file: Path):
|
|
17
20
|
data = pd.read_csv(file, skiprows=8, sep=r'\s+', names=range(0, 12), engine='python')
|
|
@@ -23,7 +26,7 @@ def read_hysplit_data(file: Path):
|
|
|
23
26
|
|
|
24
27
|
|
|
25
28
|
@set_figure
|
|
26
|
-
def hysplit(file: Path):
|
|
29
|
+
def hysplit(file: Path = DEFAULT_FILE):
|
|
27
30
|
data = read_hysplit_data(file)
|
|
28
31
|
|
|
29
32
|
# 創建地圖
|
|
@@ -76,4 +79,4 @@ def hysplit(file: Path):
|
|
|
76
79
|
|
|
77
80
|
|
|
78
81
|
if __name__ == "__main__":
|
|
79
|
-
hysplit(
|
|
82
|
+
hysplit() # 請替換為您的實際檔案路徑
|
|
@@ -101,11 +101,13 @@ class AbstractReader(ABC):
|
|
|
101
101
|
|
|
102
102
|
# validate rate calculation
|
|
103
103
|
if period_size < sample_size or sample_size < qc_size or period_size == 0 or sample_size == 0:
|
|
104
|
-
|
|
104
|
+
_acq_rate, _yid_rate, _OEE_rate = 0, 0, 0
|
|
105
|
+
# raise ValueError(f"Invalid sample sizes: period={period_size}, sample={sample_size}, QC={qc_size}")
|
|
105
106
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
else:
|
|
108
|
+
_acq_rate = round((sample_size / period_size) * 100, 1)
|
|
109
|
+
_yid_rate = round((qc_size / sample_size) * 100, 1)
|
|
110
|
+
_OEE_rate = round((qc_size / period_size) * 100, 1)
|
|
109
111
|
|
|
110
112
|
self.logger.info(f'{_nam}:')
|
|
111
113
|
self.logger.info(f"\tAcquisition rate: {_acq_rate}%")
|
|
@@ -114,7 +116,7 @@ class AbstractReader(ABC):
|
|
|
114
116
|
self.logger.info(f"{'=' * 60}")
|
|
115
117
|
|
|
116
118
|
print(f'\n\t{_nam} : ')
|
|
117
|
-
print(f'\t\tacquisition rate | yield rate
|
|
119
|
+
print(f'\t\tacquisition rate | yield rate -> OEE rate :'
|
|
118
120
|
f' \033[91m{_acq_rate}% | {_yid_rate}% -> {_OEE_rate}%\033[0m')
|
|
119
121
|
|
|
120
122
|
if self.meta['deter_key'] is not None:
|
|
@@ -9,7 +9,7 @@ class Reader(AbstractReader):
|
|
|
9
9
|
|
|
10
10
|
def _raw_reader(self, file):
|
|
11
11
|
with open(file, 'r', encoding='utf-8', errors='ignore') as f:
|
|
12
|
-
_df = read_csv(f, skiprows=3)
|
|
12
|
+
_df = read_csv(f, skiprows=3)
|
|
13
13
|
|
|
14
14
|
_df['Start Date/Time'] = _df['Start Date/Time'].str.strip()
|
|
15
15
|
_df['time'] = to_datetime(_df['Start Date/Time'], format='%m/%d/%Y %I:%M:%S %p', errors='coerce')
|
|
@@ -51,6 +51,8 @@ class Reader(AbstractReader):
|
|
|
51
51
|
'ECPk5-ug C': 'EC5_raw',
|
|
52
52
|
})
|
|
53
53
|
|
|
54
|
+
_df = _df.apply(to_numeric, errors='coerce')
|
|
55
|
+
|
|
54
56
|
_df['OC1'] = _df['OC1_raw'] / _df['Sample_Volume']
|
|
55
57
|
_df['OC2'] = _df['OC2_raw'] / _df['Sample_Volume']
|
|
56
58
|
_df['OC3'] = _df['OC3_raw'] / _df['Sample_Volume']
|
|
@@ -64,7 +66,7 @@ class Reader(AbstractReader):
|
|
|
64
66
|
# _df['EC4'] = _df['EC4_raw'] / _df['Sample_Volume']
|
|
65
67
|
# _df['EC5'] = _df['EC5_raw'] / _df['Sample_Volume']
|
|
66
68
|
|
|
67
|
-
_df = _df[['Thermal_OC', '
|
|
69
|
+
_df = _df[['Thermal_OC', 'Thermal_EC', 'Optical_OC', 'Optical_EC', 'TC', 'Sample_Volume',
|
|
68
70
|
'OC1', 'OC2', 'OC3', 'OC4', 'PC']]
|
|
69
71
|
|
|
70
72
|
return _df.loc[~_df.index.duplicated() & _df.index.notna()]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: AeroViz
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9.1
|
|
4
4
|
Summary: Aerosol science
|
|
5
5
|
Home-page: https://github.com/Alex870521/AeroViz
|
|
6
6
|
Author: alex
|
|
@@ -18,6 +18,7 @@ Requires-Dist: scipy==1.14.0
|
|
|
18
18
|
Requires-Dist: seaborn==0.13.2
|
|
19
19
|
Requires-Dist: scikit-learn==1.5.1
|
|
20
20
|
Requires-Dist: windrose==1.9.2
|
|
21
|
+
Requires-Dist: cartopy==0.24.1
|
|
21
22
|
Requires-Dist: tabulate==0.9.0
|
|
22
23
|
Requires-Dist: rich~=13.7.1
|
|
23
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: AeroViz
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9.1
|
|
4
4
|
Summary: Aerosol science
|
|
5
5
|
Home-page: https://github.com/Alex870521/AeroViz
|
|
6
6
|
Author: alex
|
|
@@ -18,6 +18,7 @@ Requires-Dist: scipy==1.14.0
|
|
|
18
18
|
Requires-Dist: seaborn==0.13.2
|
|
19
19
|
Requires-Dist: scikit-learn==1.5.1
|
|
20
20
|
Requires-Dist: windrose==1.9.2
|
|
21
|
+
Requires-Dist: cartopy==0.24.1
|
|
21
22
|
Requires-Dist: tabulate==0.9.0
|
|
22
23
|
Requires-Dist: rich~=13.7.1
|
|
23
24
|
|
aeroviz-0.1.8/test/test_plot.py
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
from AeroViz import plot, DataBase, DataClassifier
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def use_scatter():
|
|
6
|
-
# example of using plot.scatter
|
|
7
|
-
df = DataBase(load_data=True)
|
|
8
|
-
|
|
9
|
-
df = df[['Vis_LPV', 'PM2.5', 'RH', 'VC', 'Extinction', 'Scattering']].dropna()
|
|
10
|
-
# plot.scatter(df, x='PM2.5', y='Extinction', c='VC', s='RH', cmap='YlGnBu', diagonal=True)
|
|
11
|
-
plot.scatter(df, x='Scattering', y='Extinction', color='r', regression=True, regression_line_color='darkred',
|
|
12
|
-
diagonal=True)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def use_regression():
|
|
16
|
-
# example of using plot.linear_regression
|
|
17
|
-
df = DataBase(load_data=True)
|
|
18
|
-
|
|
19
|
-
plot.linear_regression(df, x='PM2.5', y='Extinction')
|
|
20
|
-
plot.linear_regression(df, x='PM2.5', y=['Extinction', 'Scattering', 'Absorption'], xlim=[0, None], ylim=[0, None])
|
|
21
|
-
# plot.multiple_linear_regression(df, x=['AS', 'AN', 'OM', 'EC', 'SS', 'Soil'], y=['Extinction'])
|
|
22
|
-
# plot.multiple_linear_regression(df, x=['NO', 'NO2', 'CO', 'PM1'], y=['PM25'])
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def use_pie():
|
|
26
|
-
pass
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def use_bar():
|
|
30
|
-
pass
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def use_CBPF_windrose():
|
|
34
|
-
# example of using plot.meteorology
|
|
35
|
-
df = DataBase(load_data=True)
|
|
36
|
-
|
|
37
|
-
# plot.meteorology.wind_rose(df, 'WS', 'WD', typ='bar')
|
|
38
|
-
# plot.meteorology.wind_rose(df, 'WS', 'WD', 'PM25', typ='scatter')
|
|
39
|
-
|
|
40
|
-
# plot.meteorology.CBPF(df, 'WS', 'WD', 'PM25')
|
|
41
|
-
# plot.meteorology.CBPF(df, 'WS', 'WD', 'PM25', percentile=[0, 25])
|
|
42
|
-
# plot.meteorology.CBPF(df, 'WS', 'WD', 'PM25', percentile=[25, 50])
|
|
43
|
-
# plot.meteorology.CBPF(df, 'WS', 'WD', 'PM25', percentile=[50, 75])
|
|
44
|
-
plot.meteorology.CBPF(df, 'WS', 'WD', 'PM2.5', percentile=[75, 100], resolution=50)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def use_SMPS():
|
|
48
|
-
# example of using plot.distribution
|
|
49
|
-
PNSD = DataBase(load_PSD=True)
|
|
50
|
-
|
|
51
|
-
plot.distribution.heatmap(PNSD, unit='Number')
|
|
52
|
-
plot.distribution.heatmap_tms(PNSD, unit='Number', freq='60d')
|
|
53
|
-
|
|
54
|
-
# Classify the data
|
|
55
|
-
# PNSD_state_class, _ = DataClassifier(df=PNSD, by='State', statistic='Table')
|
|
56
|
-
# plot.distribution.plot_dist(PNSD_state_class, _, unit='Number', additional='error')
|
|
57
|
-
|
|
58
|
-
# PNSE_ext_class, _ = DataClassifier(df=PNSD, by='Extinction', statistic='Table', qcut=20)
|
|
59
|
-
# plot.distribution.three_dimension(PNSE_ext_class, unit='Number')
|
|
60
|
-
|
|
61
|
-
# plot.distribution.curve_fitting(np.array(PNSE_ext_class.columns, dtype=float), PNSE_ext_class.iloc[0, :], mode=3, unit='Number')
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
def use_linear_regression_and_scatter_to_verify():
|
|
65
|
-
# example of using plot.linear_regression and plot.scatter
|
|
66
|
-
df = DataBase(load_data=True)
|
|
67
|
-
|
|
68
|
-
plot.linear_regression(df, x='Extinction', y=['Bext_internal', 'Bext_external'], xlim=[0, 300], ylim=[0, 600])
|
|
69
|
-
plot.linear_regression(df, x='Scattering', y=['Bsca_internal', 'Bsca_external'], xlim=[0, 300], ylim=[0, 600])
|
|
70
|
-
plot.linear_regression(df, x='Absorption', y=['Babs_internal', 'Babs_external'], xlim=[0, 100], ylim=[0, 200])
|
|
71
|
-
|
|
72
|
-
plot.scatter(df, x='Extinction', y='Bext_Fixed_PNSD', xlim=[0, 600], ylim=[0, 600], title='Fixed PNSD',
|
|
73
|
-
regression=True, diagonal=True)
|
|
74
|
-
plot.scatter(df, x='Extinction', y='Bext_Fixed_RI', xlim=[0, 600], ylim=[0, 600], title='Fixed RI',
|
|
75
|
-
regression=True, diagonal=True)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
def use_extinction_by_particle_gas():
|
|
79
|
-
# example of using plot.bar and plot.pie
|
|
80
|
-
df = DataBase(load_data=True)
|
|
81
|
-
|
|
82
|
-
ser_grp_sta, ser_grp_sta_std = DataClassifier(df, by='State', df_support=df)
|
|
83
|
-
ext_particle_gas = ser_grp_sta.loc[:, ['Scattering', 'Absorption', 'ScatteringByGas', 'AbsorptionByGas']]
|
|
84
|
-
|
|
85
|
-
# plot.bar(data_set=ext_particle_gas, data_std=None,
|
|
86
|
-
# labels=[rf'$b_{{sp}}$', rf'$b_{{ap}}$', rf'$b_{{sg}}$', rf'$b_{{ag}}$'],
|
|
87
|
-
# unit='Extinction',
|
|
88
|
-
# style="stacked",
|
|
89
|
-
# colors=plot.Color.paired)
|
|
90
|
-
|
|
91
|
-
plot.pie(data_set=ext_particle_gas,
|
|
92
|
-
labels=[rf'$b_{{sp}}$', rf'$b_{{ap}}$', rf'$b_{{sg}}$', rf'$b_{{ag}}$'],
|
|
93
|
-
unit='Extinction',
|
|
94
|
-
style='donut',
|
|
95
|
-
colors=plot.Color.paired,
|
|
96
|
-
title=['', '', '', ''])
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
def use_timeseries():
|
|
100
|
-
# example of using plot.timeseries
|
|
101
|
-
df = DataBase(load_data=True)
|
|
102
|
-
|
|
103
|
-
# plot.timeseries(df['2021-02-01':'2021-03-31'],
|
|
104
|
-
# y=['Extinction', 'Scattering'], color=None, style=['line', 'line'],
|
|
105
|
-
# ylim=[0, None], ylim2=[0, None], rolling=50,
|
|
106
|
-
# inset_kws2=dict(bbox_to_anchor=(1.12, 0, 1.2, 1)))
|
|
107
|
-
|
|
108
|
-
plot.timeseries(df['2021-02-01':'2021-02-11'],
|
|
109
|
-
y='WS', color='WD', style='scatter',
|
|
110
|
-
scatter_kws=dict(cmap='hsv'), cbar_kws=dict(ticks=[0, 90, 180, 270, 360]),
|
|
111
|
-
ylim=[0, None])
|
|
112
|
-
|
|
113
|
-
# plot.timeseries_template(df.loc['2021-02-01':'2021-03-31'])
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
def use_diurnal_pattern():
|
|
117
|
-
df = DataBase(load_data=True)
|
|
118
|
-
plot.diurnal_pattern(df, 'PM2.5')
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
def use_hysplit():
|
|
122
|
-
plot.hysplit(Path("/AeroViz/data/240228_00.txt"))
|
|
123
|
-
|
|
124
|
-
if __name__ == '__main__':
|
|
125
|
-
# use_SMPS()
|
|
126
|
-
# use_scatter()
|
|
127
|
-
# use_regression()
|
|
128
|
-
# use_CBPF_windrose()
|
|
129
|
-
# use_extinction_by_particle_gas()
|
|
130
|
-
# use_timeseries()
|
|
131
|
-
# use_diurnal_pattern()
|
|
132
|
-
use_hysplit()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|