DataProcess
數據處理模組,提供氣膠數據的計算與分析功能。
模組結構
dataProcess/
├── Chemistry/ # 化學成分處理
├── Optical/ # 光學特性處理
├── SizeDistr/ # 粒徑分布處理
└── VOC/ # 揮發性有機物處理
快速開始
from pathlib import Path
from AeroViz.dataProcess import DataProcess
# 使用工廠函數建立處理器
dp = DataProcess(
method='SizeDistr', # 'Chemistry', 'Optical', 'SizeDistr', 'VOC'
path_out=Path('./output'),
csv=True,
excel=False
)
# 或直接導入類
from AeroViz.dataProcess.SizeDistr import SizeDist
from AeroViz.dataProcess.Chemistry import Chemistry
模組列表
| 模組 | 說明 | 文檔 |
|---|---|---|
| SizeDistr | 粒徑分布處理 | SizeDist 類、SMPS-APS 合併 |
| Chemistry | 化學成分處理 | 質量重建、氣粒分配、折射率 |
| Optical | 光學特性處理 | IMPROVE、Mie、折射率反演 |
| VOC | VOC 處理 | 臭氧生成潛勢 |
API 參考
AeroViz.dataProcess.DataProcess
Factory function (DEPRECATED) — use the top-level functions instead.
.. deprecated::
DataProcess(...) will be removed in a future release. Each method
on the returned Writer instance now has a direct top-level function
equivalent. Migration cheatsheet::
DataProcess('Chemistry', ...).ReConstrc_basic(df, ...)
→ from AeroViz import reconstruct_mass
reconstruct_mass(df, ...)
DataProcess('Optical', ...).IMPROVE(df_mass, df_RH, method='revised')
→ from AeroViz import improve
improve(df_mass, df_RH, method='revised')
DataProcess('Optical', ...).Mie(df_psd, df_m)
→ from AeroViz import mie
mie(df_psd, df_m)
DataProcess('SizeDistr', ...).merge_SMPS_APS_v4(df_smps, df_aps, df_pm25)
→ from AeroViz import merge_psd
merge_psd(df_smps, df_aps, df_pm25=df_pm25, version=4)
DataProcess('VOC', ...).VOC_basic(df_voc)
→ from AeroViz import voc_potentials
voc_potentials(df_voc)
Sub-namespaces (``AeroViz.chemistry``, ``AeroViz.optical``,
``AeroViz.size``, ``AeroViz.voc``) are also supported. The new
functions return DataFrames/dicts directly — pass ``df.to_csv(...)``
yourself if you want files written.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
str
|
The processing method to use. Must be one of: 'Chemistry', 'Optical', 'SizeDistr', or 'VOC'. |
required |
path_out
|
Path
|
Path where processed output files will be saved. |
required |
excel
|
bool
|
Whether to save output in Excel format. |
False
|
csv
|
bool
|
Whether to save output in CSV format. |
True
|
Returns:
| Type | Description |
|---|---|
object
|
Instance of the selected processing class initialized with the provided parameters. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the specified method name is not in the supported methods list. |
Examples: