AeroViz 0.1.6__py3-none-any.whl → 0.1.7__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/dataProcess/Chemistry/_ocec.py +20 -7
- AeroViz/plot/__init__.py +1 -0
- AeroViz/plot/meteorology/meteorology.py +2 -0
- AeroViz/plot/optical/optical.py +1 -1
- AeroViz/plot/pie.py +14 -2
- AeroViz/plot/radar.py +184 -0
- AeroViz/plot/scatter.py +16 -7
- AeroViz/plot/templates/koschmieder.py +11 -8
- AeroViz/plot/timeseries/timeseries.py +0 -1
- AeroViz/rawDataReader/__init__.py +74 -67
- AeroViz/rawDataReader/config/supported_instruments.py +52 -19
- AeroViz/rawDataReader/core/__init__.py +129 -104
- AeroViz/rawDataReader/script/AE33.py +1 -1
- AeroViz/rawDataReader/script/AE43.py +1 -1
- AeroViz/rawDataReader/script/Aurora.py +1 -1
- AeroViz/rawDataReader/script/BC1054.py +1 -1
- AeroViz/rawDataReader/script/EPA.py +39 -0
- AeroViz/rawDataReader/script/GRIMM.py +1 -1
- AeroViz/rawDataReader/script/IGAC.py +6 -23
- AeroViz/rawDataReader/script/MA350.py +1 -1
- AeroViz/rawDataReader/script/Minion.py +102 -30
- AeroViz/rawDataReader/script/NEPH.py +1 -1
- AeroViz/rawDataReader/script/OCEC.py +1 -1
- AeroViz/rawDataReader/script/SMPS.py +1 -0
- AeroViz/rawDataReader/script/TEOM.py +2 -2
- AeroViz/rawDataReader/script/XRF.py +11 -0
- AeroViz/rawDataReader/script/__init__.py +2 -2
- {AeroViz-0.1.6.dist-info → AeroViz-0.1.7.dist-info}/METADATA +46 -24
- {AeroViz-0.1.6.dist-info → AeroViz-0.1.7.dist-info}/RECORD +32 -48
- AeroViz/process/__init__.py +0 -31
- AeroViz/process/core/DataProc.py +0 -19
- AeroViz/process/core/SizeDist.py +0 -90
- AeroViz/process/core/__init__.py +0 -4
- AeroViz/process/method/PyMieScatt_update.py +0 -567
- AeroViz/process/method/__init__.py +0 -2
- AeroViz/process/method/mie_theory.py +0 -260
- AeroViz/process/method/prop.py +0 -62
- AeroViz/process/script/AbstractDistCalc.py +0 -143
- AeroViz/process/script/Chemical.py +0 -177
- AeroViz/process/script/IMPACT.py +0 -49
- AeroViz/process/script/IMPROVE.py +0 -161
- AeroViz/process/script/Others.py +0 -65
- AeroViz/process/script/PSD.py +0 -103
- AeroViz/process/script/PSD_dry.py +0 -93
- AeroViz/process/script/__init__.py +0 -5
- AeroViz/process/script/retrieve_RI.py +0 -69
- AeroViz/rawDataReader/script/EPA_vertical.py +0 -46
- AeroViz/rawDataReader/script/Table.py +0 -27
- {AeroViz-0.1.6.dist-info → AeroViz-0.1.7.dist-info}/LICENSE +0 -0
- {AeroViz-0.1.6.dist-info → AeroViz-0.1.7.dist-info}/WHEEL +0 -0
- {AeroViz-0.1.6.dist-info → AeroViz-0.1.7.dist-info}/top_level.txt +0 -0
|
@@ -1,38 +1,78 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
1
3
|
import numpy as np
|
|
2
|
-
|
|
4
|
+
import pandas
|
|
5
|
+
from pandas import read_excel, to_numeric
|
|
3
6
|
|
|
4
7
|
from AeroViz.rawDataReader.core import AbstractReader
|
|
5
8
|
|
|
9
|
+
pandas.set_option("future.no_silent_downcasting", True)
|
|
10
|
+
|
|
11
|
+
desired_order1 = ['SO2', 'NO', 'NOx', 'NO2', 'CO', 'O3', 'THC', 'NMHC',
|
|
12
|
+
'CH4', 'PM10', 'PM2.5', 'WS', 'WD', 'AT', 'RH']
|
|
13
|
+
|
|
14
|
+
desired_order2 = ['Benzene', 'Toluene', 'EthylBenzene', 'm/p-Xylene', 'o-Xylene']
|
|
15
|
+
|
|
16
|
+
desired_order3 = ['Al', 'Si', 'P', 'S', 'Cl', 'K', 'Ca', 'Ti', 'V', 'Cr', 'Mn', 'Fe',
|
|
17
|
+
'Co', 'Ni', 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Br', 'Rb', 'Sr',
|
|
18
|
+
'Y', 'Zr', 'Nb', 'Mo', 'Pd', 'Ag', 'Cd', 'In', 'Sn', 'Sb', 'Te',
|
|
19
|
+
'Cs', 'Ba', 'La', 'Ce', 'W', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi']
|
|
20
|
+
|
|
21
|
+
desired_order4 = ['NH3', 'HF', 'HCl', 'HNO2', 'HNO3', 'G-SO2',
|
|
22
|
+
'Na+', 'NH4+', 'K+', 'Mg2+', 'Ca2+',
|
|
23
|
+
'F-', 'Cl-', 'NO2-', 'NO3-', 'PO43-', 'SO42-']
|
|
24
|
+
|
|
6
25
|
|
|
7
26
|
class Reader(AbstractReader):
|
|
8
27
|
nam = 'Minion'
|
|
9
28
|
|
|
10
29
|
def _raw_reader(self, file):
|
|
11
|
-
|
|
12
|
-
|
|
30
|
+
# 讀取 Excel 文件
|
|
31
|
+
df = read_excel(file, index_col=0, parse_dates=True)
|
|
32
|
+
|
|
33
|
+
# 重命名列,去除空白
|
|
34
|
+
df = df.rename(columns=lambda x: x.strip())
|
|
35
|
+
|
|
36
|
+
# 保存單位行並給它一個名稱
|
|
37
|
+
units = df.iloc[0].copy()
|
|
13
38
|
|
|
14
|
-
|
|
15
|
-
|
|
39
|
+
# 刪除原始數據中的單位行
|
|
40
|
+
df = df.iloc[1:]
|
|
16
41
|
|
|
17
|
-
|
|
42
|
+
# 替換特定值
|
|
43
|
+
df = df.replace({'維護校正': '*', np.nan: '-', '0L': '_', 'Nodata': '-'}, inplace=False)
|
|
44
|
+
df = df.replace(to_replace=r'\d*[#]\b', value='#', regex=True)
|
|
45
|
+
df = df.replace(to_replace=r'\d*[L]\b', value='_', regex=True)
|
|
18
46
|
|
|
19
|
-
|
|
47
|
+
# 處理除了'WD'列的 0 值
|
|
48
|
+
non_wd_columns = [col for col in df.columns if col != 'WD']
|
|
49
|
+
df.loc[:, non_wd_columns] = df.loc[:, non_wd_columns].replace({0: '_'})
|
|
50
|
+
|
|
51
|
+
# 重新排序列
|
|
52
|
+
df = self.reorder_dataframe_columns(df, [desired_order1, desired_order2, desired_order3, desired_order4])
|
|
53
|
+
|
|
54
|
+
# 將單位行添加回 DataFrame
|
|
55
|
+
# df = concat([units.to_frame().T, df])
|
|
56
|
+
|
|
57
|
+
df.index.name = 'Time'
|
|
58
|
+
|
|
59
|
+
return df.loc[~df.index.duplicated() & df.index.notna()]
|
|
20
60
|
|
|
21
61
|
def _QC(self, _df):
|
|
62
|
+
# remove negative value
|
|
63
|
+
_df = _df.mask((_df < 0).copy())
|
|
64
|
+
|
|
22
65
|
# XRF QAQC
|
|
23
66
|
_df = self.XRF_QAQC(_df)
|
|
24
67
|
|
|
25
68
|
# ions balance
|
|
26
|
-
_df = self.
|
|
27
|
-
|
|
28
|
-
# remove negative value
|
|
29
|
-
_df = _df.mask((_df < 0).copy())
|
|
69
|
+
_df = self.IGAC_QAQC(_df)
|
|
30
70
|
|
|
31
71
|
# QC data in 6h
|
|
32
|
-
return _df.resample('6h').apply(self.
|
|
72
|
+
return _df.resample('6h').apply(self.n_sigma_QC).resample(self.meta.get("freq")).mean()
|
|
33
73
|
|
|
34
74
|
# base on Xact 625i Minimum Decision Limit (MDL) for XRF in ng/m3, 60 min sample time
|
|
35
|
-
def XRF_QAQC(self, df):
|
|
75
|
+
def XRF_QAQC(self, df, MDL_replace: Literal['nan', '0.5 * MDL'] = 'nan'):
|
|
36
76
|
MDL = {
|
|
37
77
|
'Al': 100, 'Si': 18, 'P': 5.2, 'S': 3.2,
|
|
38
78
|
'Cl': 1.7, 'K': 1.2, 'Ca': 0.3, 'Ti': 1.6,
|
|
@@ -40,34 +80,68 @@ class Reader(AbstractReader):
|
|
|
40
80
|
'Co': 0.14, 'Ni': 0.096, 'Cu': 0.079, 'Zn': 0.067,
|
|
41
81
|
'Ga': 0.059, 'Ge': 0.056, 'As': 0.063, 'Se': 0.081,
|
|
42
82
|
'Br': 0.1, 'Rb': 0.19, 'Sr': 0.22, 'Y': 0.28,
|
|
43
|
-
'Zr': 0.33, 'Nb': 0.41, 'Mo': 0.48, '
|
|
44
|
-
'Cd': 2.5, 'In': 3.1, 'Sn': 4.1,
|
|
45
|
-
'
|
|
46
|
-
'La': 0.36, 'Ce': 0.3, '
|
|
47
|
-
'
|
|
83
|
+
'Zr': 0.33, 'Nb': 0.41, 'Mo': 0.48, 'Pd': 2.2,
|
|
84
|
+
'Ag': 1.9, 'Cd': 2.5, 'In': 3.1, 'Sn': 4.1,
|
|
85
|
+
'Sb': 5.2, 'Te': 0.6, 'Cs': 0.37, 'Ba': 0.39,
|
|
86
|
+
'La': 0.36, 'Ce': 0.3, 'W': 0.0001, 'Pt': 0.12,
|
|
87
|
+
'Au': 0.1, 'Hg': 0.12, 'Tl': 0.12, 'Pb': 0.13,
|
|
88
|
+
'Bi': 0.13
|
|
48
89
|
}
|
|
49
|
-
# 將小於 MDL 值的數據替換為
|
|
90
|
+
# 將小於 MDL 值的數據替換為 nan or 5/6 MDL
|
|
50
91
|
for element, threshold in MDL.items():
|
|
51
92
|
if element in df.columns:
|
|
52
|
-
|
|
93
|
+
rep = np.nan if MDL_replace == 'nan' else 0.5 * threshold
|
|
94
|
+
df[element] = df[element].where(df[element] >= threshold, rep)
|
|
53
95
|
|
|
54
96
|
self.logger.info(f"{'=' * 60}")
|
|
55
97
|
self.logger.info(f"XRF QAQC summary:")
|
|
56
98
|
self.logger.info("\t\ttransform values below MDL to NaN")
|
|
57
99
|
self.logger.info(f"{'=' * 60}")
|
|
58
100
|
|
|
101
|
+
# 轉換單位 ng/m3 -> ug/m3
|
|
102
|
+
if df.Al.max() > 10 and df.Fe.max() > 10:
|
|
103
|
+
# 確保 MDL.keys() 中的所有列都存在於 _df 中
|
|
104
|
+
columns_to_convert = [col for col in MDL.keys() if col in df.columns]
|
|
105
|
+
|
|
106
|
+
df[columns_to_convert] = df[columns_to_convert].div(1000)
|
|
107
|
+
|
|
59
108
|
return df
|
|
60
109
|
|
|
61
|
-
def
|
|
110
|
+
def IGAC_QAQC(self, df, tolerance=1):
|
|
62
111
|
"""
|
|
63
112
|
Calculate the balance of ions in the system
|
|
64
113
|
"""
|
|
114
|
+
# https://www.yangyao-env.com/web/product/product_in2.jsp?pd_id=PD1640151884502
|
|
115
|
+
MDL = {
|
|
116
|
+
'HF': 0.08, 'HCl': 0.05, 'HNO2': 0.01, 'HNO3': 0.05, 'G-SO2': 0.05, 'NH3': 0.1,
|
|
117
|
+
'Na+': 0.05, 'NH4+': 0.08, 'K+': 0.08, 'Mg2+': 0.05, 'Ca2+': 0.05,
|
|
118
|
+
'F-': 0.08, 'Cl-': 0.05, 'NO2-': 0.05, 'NO3-': 0.01, 'PO43-': None, 'SO42-': 0.05,
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
MR = {
|
|
122
|
+
'HF': 200, 'HCl': 200, 'HNO2': 200, 'HNO3': 200, 'G-SO2': 200, 'NH3': 300,
|
|
123
|
+
'Na+': 300, 'NH4+': 300, 'K+': 300, 'Mg2+': 300, 'Ca2+': 300,
|
|
124
|
+
'F-': 300, 'Cl-': 300, 'NO2-': 300, 'NO3-': 300, 'PO43-': None, 'SO42-': 300,
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
_cation, _anion, _main = (['Na+', 'NH4+', 'K+', 'Mg2+', 'Ca2+'],
|
|
128
|
+
['Cl-', 'NO2-', 'NO3-', 'SO42-'],
|
|
129
|
+
['SO42-', 'NO3-', 'NH4+'])
|
|
130
|
+
# QC: replace values below MDL with 0.5 * MDL -> ions balance -> PM2.5 > main salt
|
|
131
|
+
# mass tolerance = 0.3, ions balance tolerance = 0.3
|
|
132
|
+
|
|
133
|
+
# # conc. of main salt should be present at the same time (NH4+, SO42-, NO3-)
|
|
134
|
+
# _df_salt = df.mask(df.sum(axis=1, min_count=1) > df.PM25).dropna(subset=_main).copy()
|
|
135
|
+
|
|
65
136
|
# Define the ions
|
|
66
|
-
item = ['Na+', 'NH4+', 'K+', 'Mg2+', 'Ca2+', '
|
|
137
|
+
item = ['Na+', 'NH4+', 'K+', 'Mg2+', 'Ca2+', 'Cl-', 'NO2-', 'NO3-', 'SO42-']
|
|
67
138
|
|
|
68
139
|
# Calculate the balance
|
|
69
|
-
_df = df[item].
|
|
70
|
-
|
|
140
|
+
_df = df[item].apply(lambda x: to_numeric(x, errors='coerce'))
|
|
141
|
+
|
|
142
|
+
# for (_key, _df_col) in _df.items():
|
|
143
|
+
# _df[_key] = _df_col.mask(_df_col < MDL[_key], MDL[_key] / 2)
|
|
144
|
+
|
|
71
145
|
_df['+_mole'] = _df[['Na+', 'NH4+', 'K+', 'Mg2+', 'Ca2+']].div([23, 18, 39, (24 / 2), (40 / 2)]).sum(axis=1,
|
|
72
146
|
skipna=True)
|
|
73
147
|
_df['-_mole'] = _df[['Cl-', 'NO2-', 'NO3-', 'SO42-']].div([35.5, 46, 62, (96 / 2)]).sum(axis=1, skipna=True)
|
|
@@ -79,12 +153,8 @@ class Reader(AbstractReader):
|
|
|
79
153
|
lower_bound, upper_bound = 1 - tolerance, 1 + tolerance
|
|
80
154
|
|
|
81
155
|
# 根据ratio决定是否保留原始数据
|
|
82
|
-
valid_mask = (
|
|
83
|
-
|
|
84
|
-
(_df['ratio'] >= lower_bound) &
|
|
85
|
-
~np.isnan(_df['+_mole']) &
|
|
86
|
-
~np.isnan(_df['-_mole'])
|
|
87
|
-
)
|
|
156
|
+
valid_mask = ((_df['ratio'] <= upper_bound) & (_df['ratio'] >= lower_bound) &
|
|
157
|
+
~np.isnan(_df['+_mole']) & ~np.isnan(_df['-_mole']))
|
|
88
158
|
|
|
89
159
|
# 保留数据或将不符合条件的行设为NaN
|
|
90
160
|
df.loc[~valid_mask, item] = np.nan
|
|
@@ -100,4 +170,6 @@ class Reader(AbstractReader):
|
|
|
100
170
|
if retained_percentage < 70:
|
|
101
171
|
self.logger.warning("Warning: The percentage of retained data is less than 70%")
|
|
102
172
|
|
|
173
|
+
# print(f"\tretain {retained_percentage.__round__(0)}% data within tolerance {tolerance}")
|
|
174
|
+
|
|
103
175
|
return df
|
|
@@ -67,4 +67,4 @@ class Reader(AbstractReader):
|
|
|
67
67
|
_df = _df[(_df['BB'] < _df['B']) & (_df['BG'] < _df['G']) & (_df['BR'] < _df['R'])]
|
|
68
68
|
|
|
69
69
|
# QC data in 1h
|
|
70
|
-
return _df.resample('1h').apply(self.
|
|
70
|
+
return _df.resample('1h').apply(self.n_sigma_QC).resample(self.meta.get("freq")).mean()
|
|
@@ -25,9 +25,9 @@ class Reader(AbstractReader):
|
|
|
25
25
|
|
|
26
26
|
_df = _df.set_index(to_datetime(_tm_idx, errors='coerce', format='%d - %m - %Y %X'))
|
|
27
27
|
|
|
28
|
-
_df = _df.where(_df['status'] <
|
|
28
|
+
_df = _df.where(_df['status'] < 1)
|
|
29
29
|
|
|
30
|
-
_df = _df[['PM_NV', 'PM_Total', 'noise'
|
|
30
|
+
_df = _df[['PM_NV', 'PM_Total', 'noise']]
|
|
31
31
|
|
|
32
32
|
return _df.loc[~_df.index.duplicated() & _df.index.notna()]
|
|
33
33
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: AeroViz
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: Aerosol science
|
|
5
5
|
Home-page: https://github.com/Alex870521/AeroViz
|
|
6
6
|
Author: alex
|
|
@@ -28,7 +28,7 @@ Requires-Dist: rich ~=13.7.1
|
|
|
28
28
|
<img alt="Static Badge" src="https://img.shields.io/badge/python-3.12-blue?logo=python">
|
|
29
29
|
<img alt="Static Badge" src="https://img.shields.io/badge/License-MIT-yellow">
|
|
30
30
|
<img alt="Static Badge" src="https://img.shields.io/badge/github-updating-red?logo=github">
|
|
31
|
-
<img src="https://img.shields.io/badge/testing-green?logo=Pytest&logoColor=blue">
|
|
31
|
+
<img alt="Static Badge" src="https://img.shields.io/badge/testing-green?logo=Pytest&logoColor=blue">
|
|
32
32
|
|
|
33
33
|
</p>
|
|
34
34
|
|
|
@@ -56,41 +56,63 @@ Requires-Dist: rich ~=13.7.1
|
|
|
56
56
|
pip install AeroViz
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
## <div align="center">
|
|
59
|
+
## <div align="center">Quick Start</div>
|
|
60
60
|
|
|
61
61
|
```python
|
|
62
62
|
import AeroViz
|
|
63
|
-
|
|
64
63
|
from AeroViz import RawDataReader, DataProcess, plot
|
|
64
|
+
|
|
65
|
+
# Read data from a supported instrument
|
|
66
|
+
data = RawDataReader('NEPH', '/path/to/data', start='2024-01-01', end='2024-01-31')
|
|
67
|
+
|
|
68
|
+
# Create a visualization
|
|
69
|
+
plot.timeseries(data, y='scattering_coefficient')
|
|
65
70
|
```
|
|
66
71
|
|
|
67
|
-
|
|
72
|
+
For more detailed usage instructions, please refer to our [User Guide]().
|
|
73
|
+
|
|
74
|
+
## RawDataReader
|
|
75
|
+
|
|
76
|
+
RawDataReader supports a wide range of aerosol instruments, including NEPH, SMPS, AE33, and many more. It handles
|
|
77
|
+
various file types and time resolutions, making data processing efficient and standardized.
|
|
78
|
+
|
|
79
|
+
For a detailed list of supported instruments, file types, and data columns, please refer to
|
|
80
|
+
our [RawDataReader Usage Guide](docs/RawDataReader_Usage_Guide.md) in the `docs` folder.
|
|
81
|
+
|
|
82
|
+
### Key Features:
|
|
83
|
+
|
|
84
|
+
- Supports multiple aerosol instruments
|
|
85
|
+
- Applies customizable quality control measures
|
|
86
|
+
- Offers flexible data filtering and resampling options
|
|
87
|
+
- Enables easy data export to CSV format
|
|
68
88
|
|
|
69
|
-
|
|
70
|
-
> We are continuously working to support more instruments. Please check back for updates or contribute to our project on
|
|
71
|
-
> GitHub.
|
|
89
|
+
### Supported Instruments
|
|
72
90
|
|
|
73
91
|
The AeroViz project currently supports data from the following instruments:
|
|
74
92
|
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
93
|
+
- SMPS (Scanning Mobility Particle Sizer)
|
|
94
|
+
- APS (Aerodynamic Particle Sizer)
|
|
95
|
+
- GRIMM (GRIMM Aerosol Technik)
|
|
96
|
+
- TEOM (Continuous Ambient Particulate Monitor)
|
|
97
|
+
- NEPH (Nephelometer)
|
|
98
|
+
- Aurora (Nephelometer)
|
|
99
|
+
- AE33 (Aethalometer Model 33)
|
|
100
|
+
- AE43 (Aethalometer Model 43)
|
|
101
|
+
- BC1054 (Black Carbon Monitor 1054)
|
|
102
|
+
- MA350 (MicroAeth MA350)
|
|
103
|
+
- OCEC (Organic Carbon Elemental Carbon Analyzer)
|
|
104
|
+
- IGAC (In-situ Gas and Aerosol Compositions monitor)
|
|
105
|
+
- XRF (X-ray Fluorescence Spectrometer)
|
|
106
|
+
- VOC (Volatile Organic Compounds Monitor)
|
|
107
|
+
|
|
108
|
+
> **Note:** We are continuously working to support more instruments. Please check back for updates or contribute to our
|
|
109
|
+
> project on GitHub.
|
|
88
110
|
|
|
89
111
|
## <div align="center">DataProcess Supported Method</div>
|
|
90
112
|
|
|
91
113
|
The AeroViz project currently supports the following processing methods:
|
|
92
114
|
|
|
93
|
-
- **Chemistry
|
|
115
|
+
- **Chemistry**:
|
|
94
116
|
- **Optical**
|
|
95
117
|
- **SizeDistr**
|
|
96
118
|
- **VOC**
|
|
@@ -103,7 +125,7 @@ For detailed documentation, please refer to the `docs` folder, which includes:
|
|
|
103
125
|
|
|
104
126
|
| Documentation | Description |
|
|
105
127
|
|--------------------------------------------|----------------------------|
|
|
106
|
-
| [User Guide](docs/user_guide
|
|
128
|
+
| [User Guide](docs/user_guide) | Basic usage instructions |
|
|
107
129
|
| [Developer Guide](docs/developer_guide.md) | Developer guidelines |
|
|
108
130
|
| [API Reference](docs/api_reference.md) | API documentation |
|
|
109
131
|
| [FAQ](docs/faq.md) | Frequently Asked Questions |
|
|
@@ -111,7 +133,7 @@ For detailed documentation, please refer to the `docs` folder, which includes:
|
|
|
111
133
|
|
|
112
134
|
</div>
|
|
113
135
|
|
|
114
|
-
## <div align="center">Related
|
|
136
|
+
## <div align="center">Related Source</div>
|
|
115
137
|
|
|
116
138
|
* #### [PyMieScatt](https://github.com/bsumlin/PyMieScatt.git)
|
|
117
139
|
* #### [py-smps](https://github.com/quant-aq/py-smps.git)
|
|
@@ -6,7 +6,7 @@ AeroViz/dataProcess/Chemistry/__init__.py,sha256=fyyomjxkQcUNWDx4R5jPrHafAftN-v2
|
|
|
6
6
|
AeroViz/dataProcess/Chemistry/_calculate.py,sha256=q7ojTFPok0vg8k_1PMECNdP5CPanR9NWQ4Rx5iTcHew,599
|
|
7
7
|
AeroViz/dataProcess/Chemistry/_isoropia.py,sha256=3wp_FXdN230awlStMbctutwld4oot9WaAVXETGd6PSs,3255
|
|
8
8
|
AeroViz/dataProcess/Chemistry/_mass_volume.py,sha256=0joH2BAx0NUwDFzyrLgG-v7WrGl46R7zWxwbajWBV8o,5378
|
|
9
|
-
AeroViz/dataProcess/Chemistry/_ocec.py,sha256=
|
|
9
|
+
AeroViz/dataProcess/Chemistry/_ocec.py,sha256=FKvuh6iMhz6eFne9WJZFyaeo0FyV9a1KmaZ0nm4-67I,6031
|
|
10
10
|
AeroViz/dataProcess/Chemistry/_partition.py,sha256=tKhb6BJns46UiUlEq6Zq7ahYnvUJ_whY3tWE54C3bqU,1023
|
|
11
11
|
AeroViz/dataProcess/Chemistry/_teom.py,sha256=IiM-TrifWpQLTbKllG-4k4c3mvQulfcmjswWu6muCXA,486
|
|
12
12
|
AeroViz/dataProcess/Chemistry/isrpia.cnf,sha256=iWXTqsOZFmNrJxAI9nYuilZ9h6ru1icdPFVim7YKc_k,566
|
|
@@ -32,29 +32,30 @@ AeroViz/dataProcess/VOC/__init__.py,sha256=8GNP0RMymTkJXK18pSgfLHqrKPWboN-3x1_Ke
|
|
|
32
32
|
AeroViz/dataProcess/VOC/_potential_par.py,sha256=h3rVdvtBvC6xHa_ZG4Oq5eXezeSZtHNy6T6I40maIcM,3863
|
|
33
33
|
AeroViz/dataProcess/VOC/support_voc.json,sha256=tMYp_NERqhSriVRE2NavXh33CQ5CnsbJHtmMFlE5q_E,6804
|
|
34
34
|
AeroViz/dataProcess/core/__init__.py,sha256=FhGwqlP8ZwXZQS0LjH0YOz2g1Q2yJniUUhRZ_jDOQ6k,2707
|
|
35
|
-
AeroViz/plot/__init__.py,sha256=
|
|
35
|
+
AeroViz/plot/__init__.py,sha256=Cy42d1t58zeutxLYDkm8bFbRNGE0G1T8VpqGj1li1Cw,419
|
|
36
36
|
AeroViz/plot/bar.py,sha256=cSPKJLWGifCzICCZVPcbZtrDrea_AStlwSli9-b-lsA,4246
|
|
37
37
|
AeroViz/plot/box.py,sha256=8zDd8jYndSv5f0P1lFeX0m7VWYh9okYgJTClh2Lj7Dg,2115
|
|
38
|
-
AeroViz/plot/pie.py,sha256=
|
|
38
|
+
AeroViz/plot/pie.py,sha256=POOiWcg1KbzUzn1dm4yVEL-1d2bTqUjSTkltHk5YYqU,7860
|
|
39
|
+
AeroViz/plot/radar.py,sha256=QHXkLQlAZZQDWHcqVGJBeRsGiu45GYmy3lN6gwlh6xY,6965
|
|
39
40
|
AeroViz/plot/regression.py,sha256=mTCNrCAYvH7QjIb_5WlltCR1Kqwer1anpGEsxmO2S3o,7292
|
|
40
|
-
AeroViz/plot/scatter.py,sha256=
|
|
41
|
+
AeroViz/plot/scatter.py,sha256=sxk5QxgC1Jk9PuY18q9aRgR_Ipvg5dM1RkwYQxRkn1c,6787
|
|
41
42
|
AeroViz/plot/violin.py,sha256=pU2Z2yTWocEtImmCAmbtn0WvXtUOrnCGOdDOrLxjooU,2689
|
|
42
43
|
AeroViz/plot/distribution/__init__.py,sha256=nhbIegWczkuEfWsE7-2jfF0dnpmPDzJJzjq8Fuh6q5k,28
|
|
43
44
|
AeroViz/plot/distribution/distribution.py,sha256=sAjqtqKavFwQqI8PGPFnpvZFSU-w2UKjcTTC5L91f4E,20595
|
|
44
45
|
AeroViz/plot/meteorology/__init__.py,sha256=hhGfQE3IUzS3Eaju_nO7LomPPHJnd-zAAZZweXOXs2M,27
|
|
45
|
-
AeroViz/plot/meteorology/meteorology.py,sha256=
|
|
46
|
+
AeroViz/plot/meteorology/meteorology.py,sha256=6hk-5olgQTw2SB-GhEizLN19vRVBztgiXoruh8Q6Zns,11282
|
|
46
47
|
AeroViz/plot/optical/__init__.py,sha256=5S2WPq8NouPYgc46c1XBveSL8Cxs3w8wNYN7vWIpB-s,23
|
|
47
|
-
AeroViz/plot/optical/optical.py,sha256=
|
|
48
|
+
AeroViz/plot/optical/optical.py,sha256=823dI0Y_x4_uceo9cLJvjjgl6rzFWEAYBkA4ocRVJb0,13725
|
|
48
49
|
AeroViz/plot/templates/__init__.py,sha256=VXp73SqrSF1WR9WYhHpHtbhvFcb1CR4JeV1tPQvCEEI,227
|
|
49
50
|
AeroViz/plot/templates/ammonium_rich.py,sha256=a46rfwhSZ3LIj71LxdOnklAFyy6Xe_VQ-kh1komnZ5g,1225
|
|
50
51
|
AeroViz/plot/templates/contour.py,sha256=fAM6Wn_EmENQM1IW6KJpwmLva6D9P2dEAaK6cNQBtdQ,1678
|
|
51
52
|
AeroViz/plot/templates/corr_matrix.py,sha256=VeiwBwmg_v6LYslJvhSqweiLBheR3vGfPYxrtHoqJRI,3507
|
|
52
53
|
AeroViz/plot/templates/diurnal_pattern.py,sha256=Vp8nDzSe95ppZBCDkFXnpUEh1cb-19yDS3H0qftoPaw,1434
|
|
53
|
-
AeroViz/plot/templates/koschmieder.py,sha256=
|
|
54
|
+
AeroViz/plot/templates/koschmieder.py,sha256=YMtok3T5VHlzLphnsrkchNRnw5UE3XSLYDne42Efofo,3343
|
|
54
55
|
AeroViz/plot/templates/metal_heatmap.py,sha256=ngqJFiOPCoExPKv-lHvgB1XCSr9fF_jSKmx4VwjUUXQ,4961
|
|
55
56
|
AeroViz/plot/timeseries/__init__.py,sha256=LQ_aE32pvp5ouC--BRa0NwSJ48DYO3rFaOt4AKGmn_s,50
|
|
56
57
|
AeroViz/plot/timeseries/template.py,sha256=E9dxaH_Y5QxnkIHK4VH59IVShnf4i1-TT_QE4NqVqrQ,1460
|
|
57
|
-
AeroViz/plot/timeseries/timeseries.py,sha256=
|
|
58
|
+
AeroViz/plot/timeseries/timeseries.py,sha256=9fVbhLQZUWzTX3LqFkVlo6eo-hDIjwV18CKnh_uQui0,14584
|
|
58
59
|
AeroViz/plot/utils/__init__.py,sha256=sxp3nfUnyVIIXYd-F874gEHkhQiDnMPDE1nJ_Z98270,104
|
|
59
60
|
AeroViz/plot/utils/_color.py,sha256=Vhjo-v4UWFME1JbbBR_Ro8FRj6dHB2O5Sud_9lpdu_U,2797
|
|
60
61
|
AeroViz/plot/utils/_unit.py,sha256=Abum0WDnq08DzkSoxkKvBc0mYKo8izIDmgduPo9Q27A,1671
|
|
@@ -62,51 +63,34 @@ AeroViz/plot/utils/fRH.json,sha256=t-2ux4TLOYAB-4jJ72LSM4jv1jk9XkaxKYNMDepMHIg,6
|
|
|
62
63
|
AeroViz/plot/utils/plt_utils.py,sha256=7Au3r2-7AZQmzrO2OfcyTFomJRLHgu1Npb7wxQqUvzY,3438
|
|
63
64
|
AeroViz/plot/utils/sklearn_utils.py,sha256=hKFfkVkYLRxkIDKvO9COHXwhjD_UWqQigdT3mDToni4,2098
|
|
64
65
|
AeroViz/plot/utils/units.json,sha256=JKcqvLA6dkc8REV_NhX85Jl9LA4iAZxzw9RJp6JTla0,2965
|
|
65
|
-
AeroViz/
|
|
66
|
-
AeroViz/process/core/DataProc.py,sha256=6MBDcHyQmVU16Z0oDo0GItvhU5f7fWLXFMGqUyoW1eQ,419
|
|
67
|
-
AeroViz/process/core/SizeDist.py,sha256=V6CpxTRfWjsZ8GwIEOqyKJ8_qcz7dO0ZmfHQvR6SgW4,2097
|
|
68
|
-
AeroViz/process/core/__init__.py,sha256=WmVSFDx97urX0WPA8dtRVoQF04IDaU-IgxHK979-kM8,98
|
|
69
|
-
AeroViz/process/method/PyMieScatt_update.py,sha256=g3vlzATjzYSYZd3LwmwxEmdkpo4cHJ3KY4rePY4jwZk,21065
|
|
70
|
-
AeroViz/process/method/__init__.py,sha256=_yxoNAbbI82ORhrVsi-6x8vPnWQNHavjZUXy-ioZ2wg,123
|
|
71
|
-
AeroViz/process/method/mie_theory.py,sha256=EC3SsUaq5G3SdQyPMQxcosbEokqAgJw-4Gz6moJiOsk,8666
|
|
72
|
-
AeroViz/process/method/prop.py,sha256=7f18SOkkLgDiY_g1c1We8g-3WDJJIFcxkfR4F99jUgc,1845
|
|
73
|
-
AeroViz/process/script/AbstractDistCalc.py,sha256=wXF7OA634m_i-Y79lU4THj0c0yZx5NUtLNvORH1FWZg,5351
|
|
74
|
-
AeroViz/process/script/Chemical.py,sha256=jjBIdILe0fO5Rqidb4pg3CP6qmMLqFvst-ZSz8mbb7Q,6413
|
|
75
|
-
AeroViz/process/script/IMPACT.py,sha256=Zz1GRQLJopNQGw5qUTdWl7Zxy_CBnFBsL1B-CCemaDQ,1520
|
|
76
|
-
AeroViz/process/script/IMPROVE.py,sha256=5FNl33S_785J7CsSue_CvZP58TWevpwGr2ePQM6qScw,5709
|
|
77
|
-
AeroViz/process/script/Others.py,sha256=TOtSKVZ9Z-zX1LFfE4p36H0hMjfmyyQw_Xaeq8HgMBk,2325
|
|
78
|
-
AeroViz/process/script/PSD.py,sha256=unSvyHp1RqgQecY-Lab-wRFGP2u45blSO4NCNTaxcRQ,3721
|
|
79
|
-
AeroViz/process/script/PSD_dry.py,sha256=P9rSQVA78jHXrY2bDiC1iQvG0w9Js8QiBNfooPOXzfY,3269
|
|
80
|
-
AeroViz/process/script/__init__.py,sha256=QExUHHK79oiwZXvk8u00P8rLwWhGOc1fpZY2Fx8Vkxg,188
|
|
81
|
-
AeroViz/process/script/retrieve_RI.py,sha256=9OQJU1w6VzVqKz00e9GdWswRAnaETe_1meAHp5N_s54,2711
|
|
82
|
-
AeroViz/rawDataReader/__init__.py,sha256=jXLrf0A-Hxufw-IQp0-Nyci4PszWk5YU4SnpH4ob1RE,3862
|
|
66
|
+
AeroViz/rawDataReader/__init__.py,sha256=TF8ntRdD2VWn238RO-bPMuWuW-qhnJO8GP7NmleEEWc,4824
|
|
83
67
|
AeroViz/rawDataReader/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
84
|
-
AeroViz/rawDataReader/config/supported_instruments.py,sha256=
|
|
85
|
-
AeroViz/rawDataReader/core/__init__.py,sha256=
|
|
86
|
-
AeroViz/rawDataReader/script/AE33.py,sha256=
|
|
87
|
-
AeroViz/rawDataReader/script/AE43.py,sha256=
|
|
68
|
+
AeroViz/rawDataReader/config/supported_instruments.py,sha256=CGE34wsXyq-Za8IIYu2rt3JzoANrFBgrphqvl2FYTC0,5296
|
|
69
|
+
AeroViz/rawDataReader/core/__init__.py,sha256=g_401UFSrkQcjyE89bHKLYnPoVRkMlKIKu34f1rOF6Q,12730
|
|
70
|
+
AeroViz/rawDataReader/script/AE33.py,sha256=T5HnsZpJu500dvNq8d9g2JPnGDQxM5fcwEGp_4JYhNU,1109
|
|
71
|
+
AeroViz/rawDataReader/script/AE43.py,sha256=BH1D9hkbfffpNsuEGH_c9fsjHrC8u-CnpSUnfirO2Hc,1058
|
|
88
72
|
AeroViz/rawDataReader/script/APS_3321.py,sha256=x75G72Xl0vElr6Njbv8SlOcosAHNozseaJzAxVmfXyI,1697
|
|
89
|
-
AeroViz/rawDataReader/script/Aurora.py,sha256=
|
|
90
|
-
AeroViz/rawDataReader/script/BC1054.py,sha256=
|
|
91
|
-
AeroViz/rawDataReader/script/
|
|
92
|
-
AeroViz/rawDataReader/script/GRIMM.py,sha256=
|
|
93
|
-
AeroViz/rawDataReader/script/IGAC.py,sha256=
|
|
94
|
-
AeroViz/rawDataReader/script/MA350.py,sha256=
|
|
95
|
-
AeroViz/rawDataReader/script/Minion.py,sha256=
|
|
96
|
-
AeroViz/rawDataReader/script/NEPH.py,sha256=
|
|
97
|
-
AeroViz/rawDataReader/script/OCEC.py,sha256=
|
|
98
|
-
AeroViz/rawDataReader/script/SMPS.py,sha256=
|
|
99
|
-
AeroViz/rawDataReader/script/TEOM.py,sha256=
|
|
100
|
-
AeroViz/rawDataReader/script/Table.py,sha256=othBoQSFVcjfWX0_Q4y8BkjCBc5CihvC6LyrhyJWywk,800
|
|
73
|
+
AeroViz/rawDataReader/script/Aurora.py,sha256=fcg5ij7sCWGXik34xDlhkR0ORRNiZ252mzK3rnHBK5o,1389
|
|
74
|
+
AeroViz/rawDataReader/script/BC1054.py,sha256=HCoj4ntcbdNgkWw5Ugxb2KNNKR30vRRlQW4SDcT7KkU,1488
|
|
75
|
+
AeroViz/rawDataReader/script/EPA.py,sha256=sjI6su0QeTNlVgRcxmz8_aOGh7T9B5ybHp6EQVvHQoQ,1608
|
|
76
|
+
AeroViz/rawDataReader/script/GRIMM.py,sha256=zwXhKxqEE3_kppCY1fvMdSnKjC7D_dcuVN0MsKxAlx8,948
|
|
77
|
+
AeroViz/rawDataReader/script/IGAC.py,sha256=ZdskNc65wVx2znmbjJp2J_rxVg5vuqxB1HWRoqxb7Ho,2364
|
|
78
|
+
AeroViz/rawDataReader/script/MA350.py,sha256=6brRnuqr1t93bdww5VlyK5lnKxW0aSEK0jrFmd8e3qk,1289
|
|
79
|
+
AeroViz/rawDataReader/script/Minion.py,sha256=mojPfHRZaCj6c_LHqDaSXoxCZ_IfaznKOdl-EtDy1j0,7324
|
|
80
|
+
AeroViz/rawDataReader/script/NEPH.py,sha256=QeD-42GMCXrbJayTSzrxBZtDkHYqmafwJ8D67xh8mNA,2737
|
|
81
|
+
AeroViz/rawDataReader/script/OCEC.py,sha256=Bni0B1OOCrp9lfEXSD7XY3J56ekIqmpXmCTQlL0dlOk,2338
|
|
82
|
+
AeroViz/rawDataReader/script/SMPS.py,sha256=EtXmeukOIwqfMwMJqv99_STfVg0uPdVr96r-tfD95gk,2774
|
|
83
|
+
AeroViz/rawDataReader/script/TEOM.py,sha256=_nSMv1pv2DaTAIz6csDwDnIkKdHBXsUiblMSantK_l4,1791
|
|
101
84
|
AeroViz/rawDataReader/script/VOC.py,sha256=sUn3ba_iYQ8Uy8qKNI-6qb1YvHsKN4G6BosBnLLMctc,1269
|
|
102
|
-
AeroViz/rawDataReader/script/
|
|
85
|
+
AeroViz/rawDataReader/script/XRF.py,sha256=SU1-D94GkwdkjlNXcyXbwQG1tOYCpeL6GTVkaLBHc-s,187
|
|
86
|
+
AeroViz/rawDataReader/script/__init__.py,sha256=s3c797Q8EAGcJCxVRTA-KdHie-vHLNYbMxwa5c0qz-I,214
|
|
103
87
|
AeroViz/tools/__init__.py,sha256=tPUmCI9Fi1LgE-QSVnzan5jRdYQBIENH9PRDXB_DhTw,109
|
|
104
88
|
AeroViz/tools/database.py,sha256=05VzjJyhlRrhsZdhfFQ__7CxGm4MdFekLjz3_Is5h9U,3430
|
|
105
89
|
AeroViz/tools/dataclassifier.py,sha256=_wpv0PlZ5EGkcNqHxfFtdEsYvHP5FVE8sMZXikhm_YE,4492
|
|
106
90
|
AeroViz/tools/dataprinter.py,sha256=Jq2Yztpa9YCOeLDVTrRs7PhSdNIPhEAexVj1YSuJ7hY,2249
|
|
107
91
|
AeroViz/tools/datareader.py,sha256=iTQ0U8hdNMjCdbiH7EiKW10UEoxzxXRHc4s5_1IikJo,1933
|
|
108
|
-
AeroViz-0.1.
|
|
109
|
-
AeroViz-0.1.
|
|
110
|
-
AeroViz-0.1.
|
|
111
|
-
AeroViz-0.1.
|
|
112
|
-
AeroViz-0.1.
|
|
92
|
+
AeroViz-0.1.7.dist-info/LICENSE,sha256=E-679GpGGkp3irmtuJXiT7R4cNUA4cmsH6Q7QUgPf5U,1069
|
|
93
|
+
AeroViz-0.1.7.dist-info/METADATA,sha256=l_GNd7nsHbJ9I91tBNuSEEsdguQY_CrMO21dGL2ltso,6289
|
|
94
|
+
AeroViz-0.1.7.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
|
|
95
|
+
AeroViz-0.1.7.dist-info/top_level.txt,sha256=BYsmTst_o4FZOKRP1XIvIMlN6mMTTXNfnSToL2_nVbQ,8
|
|
96
|
+
AeroViz-0.1.7.dist-info/RECORD,,
|
AeroViz/process/__init__.py
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
|
|
3
|
-
from pandas import read_csv, concat
|
|
4
|
-
|
|
5
|
-
from AeroViz.process.script import (ImpactProc, ImproveProc, ChemicalProc, ParticleSizeDistProc,
|
|
6
|
-
ExtinctionDistProc, OthersProc)
|
|
7
|
-
|
|
8
|
-
__all__ = ['DataProcessor', 'ImpactProc', 'ImproveProc', 'ChemicalProc', 'ParticleSizeDistProc', 'ExtinctionDistProc', ]
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class DataProcessor:
|
|
12
|
-
def __new__(cls, file_path, reset: bool = False, save_file: Path | str = 'All_data.csv'):
|
|
13
|
-
file_path = Path(file_path)
|
|
14
|
-
|
|
15
|
-
print(f'\t\t \033[96m --- Processing Data --- \033[0m')
|
|
16
|
-
|
|
17
|
-
if file_path.exists() and not reset:
|
|
18
|
-
return read_csv(file_path, parse_dates=['Time'], index_col='Time',
|
|
19
|
-
na_values=('-', 'E', 'F'), low_memory=False)
|
|
20
|
-
|
|
21
|
-
processor = [ImpactProc, ChemicalProc, ImproveProc, ParticleSizeDistProc, ExtinctionDistProc, OthersProc]
|
|
22
|
-
reset = [False, False, False, False, False, False]
|
|
23
|
-
save_filename = ['IMPACT.csv', 'chemical.csv', 'revised_IMPROVE.csv', 'PSD.csv', 'PESD.csv', 'Others.csv']
|
|
24
|
-
|
|
25
|
-
_df = concat([processor().process_data(reset, save_filename) for processor, reset, save_filename in
|
|
26
|
-
zip(processor, reset, save_filename)], axis=1)
|
|
27
|
-
|
|
28
|
-
# 7. save result
|
|
29
|
-
_df.to_csv(file_path)
|
|
30
|
-
|
|
31
|
-
return _df
|
AeroViz/process/core/DataProc.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
|
|
4
|
-
from pandas import DataFrame
|
|
5
|
-
|
|
6
|
-
__all__ = ['DataProc']
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class DataProc(ABC):
|
|
10
|
-
def __init__(self):
|
|
11
|
-
pass
|
|
12
|
-
|
|
13
|
-
@abstractmethod
|
|
14
|
-
def process_data(self,
|
|
15
|
-
reset: bool = False,
|
|
16
|
-
save_filename: str | Path = None
|
|
17
|
-
) -> DataFrame:
|
|
18
|
-
""" Implementation of processing data """
|
|
19
|
-
pass
|
AeroViz/process/core/SizeDist.py
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
from typing import Literal
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
from pandas import DataFrame
|
|
5
|
-
|
|
6
|
-
__all__ = ['SizeDist']
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class SizeDist:
|
|
10
|
-
"""
|
|
11
|
-
Attributes
|
|
12
|
-
----------
|
|
13
|
-
|
|
14
|
-
_data: DataFrame
|
|
15
|
-
The processed PSD data stored as a pandas DataFrame.
|
|
16
|
-
|
|
17
|
-
_dp: ndarray
|
|
18
|
-
The array of particle diameters from the PSD data.
|
|
19
|
-
|
|
20
|
-
_dlogdp: ndarray
|
|
21
|
-
The array of logarithmic particle diameter bin widths.
|
|
22
|
-
|
|
23
|
-
_index: DatetimeIndex
|
|
24
|
-
The index of the DataFrame representing time.
|
|
25
|
-
|
|
26
|
-
_state: str
|
|
27
|
-
The state of particle size distribution data.
|
|
28
|
-
|
|
29
|
-
Methods
|
|
30
|
-
-------
|
|
31
|
-
number()
|
|
32
|
-
Calculate number distribution properties.
|
|
33
|
-
|
|
34
|
-
surface(filename='PSSD_dSdlogdp.csv')
|
|
35
|
-
Calculate surface distribution properties.
|
|
36
|
-
|
|
37
|
-
volume(filename='PVSD_dVdlogdp.csv')
|
|
38
|
-
Calculate volume distribution properties.
|
|
39
|
-
|
|
40
|
-
"""
|
|
41
|
-
|
|
42
|
-
def __init__(self,
|
|
43
|
-
data: DataFrame,
|
|
44
|
-
state: Literal['dN', 'ddp', 'dlogdp'] = 'dlogdp',
|
|
45
|
-
weighting: Literal['n', 's', 'v', 'ext_in', 'ext_ex'] = 'n'
|
|
46
|
-
):
|
|
47
|
-
self._data = data
|
|
48
|
-
self._dp = np.array(self._data.columns, dtype=float)
|
|
49
|
-
self._dlogdp = np.full_like(self._dp, 0.014)
|
|
50
|
-
self._index = self._data.index.copy()
|
|
51
|
-
self._state = state
|
|
52
|
-
self._weighting = weighting
|
|
53
|
-
|
|
54
|
-
@property
|
|
55
|
-
def data(self) -> DataFrame:
|
|
56
|
-
return self._data
|
|
57
|
-
|
|
58
|
-
@property
|
|
59
|
-
def dp(self) -> np.ndarray:
|
|
60
|
-
return self._dp
|
|
61
|
-
|
|
62
|
-
@dp.setter
|
|
63
|
-
def dp(self, new_dp: np.ndarray):
|
|
64
|
-
self._dp = new_dp
|
|
65
|
-
|
|
66
|
-
@property
|
|
67
|
-
def dlogdp(self) -> np.ndarray:
|
|
68
|
-
return self._dlogdp
|
|
69
|
-
|
|
70
|
-
@dlogdp.setter
|
|
71
|
-
def dlogdp(self, new_dlogdp: np.ndarray):
|
|
72
|
-
self._dlogdp = new_dlogdp
|
|
73
|
-
|
|
74
|
-
@property
|
|
75
|
-
def index(self):
|
|
76
|
-
return self._index
|
|
77
|
-
|
|
78
|
-
@property
|
|
79
|
-
def state(self):
|
|
80
|
-
return self._state
|
|
81
|
-
|
|
82
|
-
@state.setter
|
|
83
|
-
def state(self, value):
|
|
84
|
-
if value not in ['dN', 'dlogdp', 'ddp']:
|
|
85
|
-
raise ValueError("state must be 'dlogdp' or 'ddp'")
|
|
86
|
-
self._state = value
|
|
87
|
-
|
|
88
|
-
@property
|
|
89
|
-
def weighting(self):
|
|
90
|
-
return self._weighting
|