AeroViz 0.1.3__tar.gz → 0.1.4__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.3 → aeroviz-0.1.4}/AeroViz/__init__.py +7 -5
- {aeroviz-0.1.3/AeroViz/config → aeroviz-0.1.4/AeroViz/data}/DEFAULT_DATA.csv +1 -1
- aeroviz-0.1.4/AeroViz/dataProcess/Chemistry/__init__.py +63 -0
- aeroviz-0.1.4/AeroViz/dataProcess/Chemistry/_calculate.py +27 -0
- aeroviz-0.1.4/AeroViz/dataProcess/Chemistry/_isoropia.py +103 -0
- aeroviz-0.1.4/AeroViz/dataProcess/Chemistry/_mass_volume.py +172 -0
- aeroviz-0.1.4/AeroViz/dataProcess/Chemistry/_ocec.py +184 -0
- aeroviz-0.1.4/AeroViz/dataProcess/Chemistry/_partition.py +30 -0
- aeroviz-0.1.4/AeroViz/dataProcess/Chemistry/_teom.py +14 -0
- aeroviz-0.1.4/AeroViz/dataProcess/Chemistry/isrpia.cnf +21 -0
- aeroviz-0.1.4/AeroViz/dataProcess/Optical/Angstrom_exponent.py +20 -0
- aeroviz-0.1.4/AeroViz/dataProcess/Optical/_IMPROVE.py +60 -0
- aeroviz-0.1.4/AeroViz/dataProcess/Optical/__init__.py +47 -0
- aeroviz-0.1.4/AeroViz/dataProcess/Optical/_absorption.py +28 -0
- aeroviz-0.1.4/AeroViz/dataProcess/Optical/_extinction.py +42 -0
- aeroviz-0.1.4/AeroViz/dataProcess/Optical/_mie.py +14 -0
- aeroviz-0.1.4/AeroViz/dataProcess/Optical/_mie_sd.py +142 -0
- aeroviz-0.1.4/AeroViz/dataProcess/Optical/_scattering.py +29 -0
- aeroviz-0.1.4/AeroViz/dataProcess/SizeDistr/__init__.py +61 -0
- aeroviz-0.1.4/AeroViz/dataProcess/SizeDistr/__merge.py +251 -0
- aeroviz-0.1.4/AeroViz/dataProcess/SizeDistr/_merge.py +246 -0
- aeroviz-0.1.4/AeroViz/dataProcess/SizeDistr/_merge_v1.py +255 -0
- aeroviz-0.1.4/AeroViz/dataProcess/SizeDistr/_merge_v2.py +244 -0
- aeroviz-0.1.4/AeroViz/dataProcess/SizeDistr/_merge_v3.py +518 -0
- aeroviz-0.1.4/AeroViz/dataProcess/SizeDistr/_merge_v4.py +422 -0
- aeroviz-0.1.4/AeroViz/dataProcess/SizeDistr/_size_distr.py +93 -0
- aeroviz-0.1.4/AeroViz/dataProcess/VOC/__init__.py +19 -0
- aeroviz-0.1.4/AeroViz/dataProcess/VOC/_potential_par.py +74 -0
- aeroviz-0.1.4/AeroViz/dataProcess/__init__.py +33 -0
- aeroviz-0.1.4/AeroViz/dataProcess/core/__init__.py +86 -0
- aeroviz-0.1.4/AeroViz/plot/__init__.py +12 -0
- aeroviz-0.1.4/AeroViz/plot/bar.py +126 -0
- aeroviz-0.1.4/AeroViz/plot/box.py +69 -0
- aeroviz-0.1.4/AeroViz/plot/distribution/distribution.py +576 -0
- aeroviz-0.1.4/AeroViz/plot/meteorology/meteorology.py +265 -0
- aeroviz-0.1.4/AeroViz/plot/optical/__init__.py +1 -0
- aeroviz-0.1.4/AeroViz/plot/optical/optical.py +388 -0
- aeroviz-0.1.4/AeroViz/plot/pie.py +198 -0
- aeroviz-0.1.4/AeroViz/plot/regression.py +196 -0
- aeroviz-0.1.4/AeroViz/plot/scatter.py +165 -0
- aeroviz-0.1.4/AeroViz/plot/templates/__init__.py +6 -0
- aeroviz-0.1.4/AeroViz/plot/templates/ammonium_rich.py +34 -0
- aeroviz-0.1.4/AeroViz/plot/templates/contour.py +47 -0
- aeroviz-0.1.4/AeroViz/plot/templates/corr_matrix.py +101 -0
- aeroviz-0.1.4/AeroViz/plot/templates/diurnal_pattern.py +44 -0
- aeroviz-0.1.4/AeroViz/plot/templates/koschmieder.py +92 -0
- aeroviz-0.1.4/AeroViz/plot/templates/metal_heatmap.py +155 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz/plot/timeseries/__init__.py +1 -0
- aeroviz-0.1.4/AeroViz/plot/timeseries/template.py +47 -0
- aeroviz-0.1.4/AeroViz/plot/timeseries/timeseries.py +362 -0
- aeroviz-0.1.4/AeroViz/plot/utils/__init__.py +4 -0
- aeroviz-0.1.4/AeroViz/plot/utils/_color.py +71 -0
- aeroviz-0.1.4/AeroViz/plot/utils/_unit.py +55 -0
- aeroviz-0.1.4/AeroViz/plot/utils/plt_utils.py +92 -0
- aeroviz-0.1.4/AeroViz/plot/utils/sklearn_utils.py +49 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz/plot/utils/units.json +5 -0
- aeroviz-0.1.4/AeroViz/plot/violin.py +80 -0
- aeroviz-0.1.4/AeroViz/process/__init__.py +31 -0
- aeroviz-0.1.4/AeroViz/process/core/DataProc.py +19 -0
- aeroviz-0.1.4/AeroViz/process/core/SizeDist.py +90 -0
- aeroviz-0.1.4/AeroViz/process/method/PyMieScatt_update.py +567 -0
- aeroviz-0.1.4/AeroViz/process/method/mie_theory.py +260 -0
- aeroviz-0.1.4/AeroViz/process/method/prop.py +62 -0
- aeroviz-0.1.4/AeroViz/process/script/AbstractDistCalc.py +143 -0
- aeroviz-0.1.4/AeroViz/process/script/Chemical.py +177 -0
- aeroviz-0.1.4/AeroViz/process/script/IMPACT.py +49 -0
- aeroviz-0.1.4/AeroViz/process/script/IMPROVE.py +161 -0
- aeroviz-0.1.4/AeroViz/process/script/Others.py +65 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz/process/script/PSD.py +26 -26
- aeroviz-0.1.4/AeroViz/process/script/PSD_dry.py +93 -0
- aeroviz-0.1.4/AeroViz/process/script/retrieve_RI.py +69 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/__init__.py +63 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/config/supported_instruments.py +155 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/core/__init__.py +277 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/AE33.py +30 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/AE43.py +31 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/APS_3321.py +47 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/Aurora.py +37 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/BC1054.py +42 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/EPA_vertical.py +46 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/GRIMM.py +28 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/IGAC.py +90 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/MA350.py +38 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/Minion.py +103 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/NEPH.py +75 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/SMPS_TH.py +41 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/SMPS_aim11.py +51 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/SMPS_genr.py +51 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/Sunset_OCEC.py +60 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/TEOM.py +48 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/Table.py +27 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/VOC.py +26 -0
- aeroviz-0.1.4/AeroViz/rawDataReader/script/__init__.py +20 -0
- aeroviz-0.1.4/AeroViz/tools/database.py +95 -0
- aeroviz-0.1.4/AeroViz/tools/dataclassifier.py +117 -0
- aeroviz-0.1.4/AeroViz/tools/dataprinter.py +58 -0
- aeroviz-0.1.4/AeroViz/tools/datareader.py +66 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz.egg-info/PKG-INFO +5 -4
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz.egg-info/SOURCES.txt +22 -21
- aeroviz-0.1.4/MANIFEST.in +10 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/PKG-INFO +5 -4
- {aeroviz-0.1.3 → aeroviz-0.1.4}/README.md +4 -3
- aeroviz-0.1.4/requirements.txt +8 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/setup.py +1 -1
- aeroviz-0.1.3/AeroViz/dataProcess/Chemistry/__init__.py +0 -63
- aeroviz-0.1.3/AeroViz/dataProcess/Chemistry/_calculate.py +0 -27
- aeroviz-0.1.3/AeroViz/dataProcess/Chemistry/_isoropia.py +0 -99
- aeroviz-0.1.3/AeroViz/dataProcess/Chemistry/_mass_volume.py +0 -175
- aeroviz-0.1.3/AeroViz/dataProcess/Chemistry/_ocec.py +0 -184
- aeroviz-0.1.3/AeroViz/dataProcess/Chemistry/_partition.py +0 -29
- aeroviz-0.1.3/AeroViz/dataProcess/Chemistry/_teom.py +0 -16
- aeroviz-0.1.3/AeroViz/dataProcess/Optical/_IMPROVE.py +0 -61
- aeroviz-0.1.3/AeroViz/dataProcess/Optical/__init__.py +0 -62
- aeroviz-0.1.3/AeroViz/dataProcess/Optical/_absorption.py +0 -54
- aeroviz-0.1.3/AeroViz/dataProcess/Optical/_extinction.py +0 -36
- aeroviz-0.1.3/AeroViz/dataProcess/Optical/_mie.py +0 -16
- aeroviz-0.1.3/AeroViz/dataProcess/Optical/_mie_sd.py +0 -143
- aeroviz-0.1.3/AeroViz/dataProcess/Optical/_scattering.py +0 -30
- aeroviz-0.1.3/AeroViz/dataProcess/SizeDistr/__init__.py +0 -61
- aeroviz-0.1.3/AeroViz/dataProcess/SizeDistr/__merge.py +0 -250
- aeroviz-0.1.3/AeroViz/dataProcess/SizeDistr/_merge.py +0 -245
- aeroviz-0.1.3/AeroViz/dataProcess/SizeDistr/_merge_v1.py +0 -254
- aeroviz-0.1.3/AeroViz/dataProcess/SizeDistr/_merge_v2.py +0 -243
- aeroviz-0.1.3/AeroViz/dataProcess/SizeDistr/_merge_v3.py +0 -518
- aeroviz-0.1.3/AeroViz/dataProcess/SizeDistr/_merge_v4.py +0 -424
- aeroviz-0.1.3/AeroViz/dataProcess/SizeDistr/_size_distr.py +0 -93
- aeroviz-0.1.3/AeroViz/dataProcess/VOC/__init__.py +0 -19
- aeroviz-0.1.3/AeroViz/dataProcess/VOC/_potential_par.py +0 -76
- aeroviz-0.1.3/AeroViz/dataProcess/__init__.py +0 -11
- aeroviz-0.1.3/AeroViz/dataProcess/core/__init__.py +0 -92
- aeroviz-0.1.3/AeroViz/plot/__init__.py +0 -7
- aeroviz-0.1.3/AeroViz/plot/distribution/distribution.py +0 -582
- aeroviz-0.1.3/AeroViz/plot/improve/__init__.py +0 -1
- aeroviz-0.1.3/AeroViz/plot/improve/improve.py +0 -240
- aeroviz-0.1.3/AeroViz/plot/meteorology/meteorology.py +0 -317
- aeroviz-0.1.3/AeroViz/plot/optical/__init__.py +0 -2
- aeroviz-0.1.3/AeroViz/plot/optical/aethalometer.py +0 -77
- aeroviz-0.1.3/AeroViz/plot/optical/optical.py +0 -388
- aeroviz-0.1.3/AeroViz/plot/templates/__init__.py +0 -8
- aeroviz-0.1.3/AeroViz/plot/templates/contour.py +0 -47
- aeroviz-0.1.3/AeroViz/plot/templates/corr_matrix.py +0 -108
- aeroviz-0.1.3/AeroViz/plot/templates/diurnal_pattern.py +0 -42
- aeroviz-0.1.3/AeroViz/plot/templates/event_evolution.py +0 -65
- aeroviz-0.1.3/AeroViz/plot/templates/koschmieder.py +0 -156
- aeroviz-0.1.3/AeroViz/plot/templates/metal_heatmap.py +0 -57
- aeroviz-0.1.3/AeroViz/plot/templates/regression.py +0 -256
- aeroviz-0.1.3/AeroViz/plot/templates/scatter.py +0 -130
- aeroviz-0.1.3/AeroViz/plot/templates/templates.py +0 -398
- aeroviz-0.1.3/AeroViz/plot/timeseries/timeseries.py +0 -302
- aeroviz-0.1.3/AeroViz/plot/utils/__init__.py +0 -3
- aeroviz-0.1.3/AeroViz/plot/utils/_color.py +0 -71
- aeroviz-0.1.3/AeroViz/plot/utils/_decorator.py +0 -74
- aeroviz-0.1.3/AeroViz/plot/utils/_unit.py +0 -55
- aeroviz-0.1.3/AeroViz/process/__init__.py +0 -31
- aeroviz-0.1.3/AeroViz/process/core/DataProc.py +0 -19
- aeroviz-0.1.3/AeroViz/process/core/SizeDist.py +0 -90
- aeroviz-0.1.3/AeroViz/process/method/PyMieScatt_update.py +0 -567
- aeroviz-0.1.3/AeroViz/process/method/mie_theory.py +0 -258
- aeroviz-0.1.3/AeroViz/process/method/prop.py +0 -62
- aeroviz-0.1.3/AeroViz/process/script/AbstractDistCalc.py +0 -143
- aeroviz-0.1.3/AeroViz/process/script/Chemical.py +0 -176
- aeroviz-0.1.3/AeroViz/process/script/IMPACT.py +0 -49
- aeroviz-0.1.3/AeroViz/process/script/IMPROVE.py +0 -161
- aeroviz-0.1.3/AeroViz/process/script/Others.py +0 -65
- aeroviz-0.1.3/AeroViz/process/script/PSD_dry.py +0 -94
- aeroviz-0.1.3/AeroViz/process/script/retrieve_RI.py +0 -70
- aeroviz-0.1.3/AeroViz/rawDataReader/__init__.py +0 -68
- aeroviz-0.1.3/AeroViz/rawDataReader/core/__init__.py +0 -400
- aeroviz-0.1.3/AeroViz/rawDataReader/script/AE33.py +0 -31
- aeroviz-0.1.3/AeroViz/rawDataReader/script/AE43.py +0 -34
- aeroviz-0.1.3/AeroViz/rawDataReader/script/APS_3321.py +0 -47
- aeroviz-0.1.3/AeroViz/rawDataReader/script/Aurora.py +0 -38
- aeroviz-0.1.3/AeroViz/rawDataReader/script/BC1054.py +0 -46
- aeroviz-0.1.3/AeroViz/rawDataReader/script/EPA_vertical.py +0 -18
- aeroviz-0.1.3/AeroViz/rawDataReader/script/GRIMM.py +0 -35
- aeroviz-0.1.3/AeroViz/rawDataReader/script/IGAC_TH.py +0 -104
- aeroviz-0.1.3/AeroViz/rawDataReader/script/IGAC_ZM.py +0 -90
- aeroviz-0.1.3/AeroViz/rawDataReader/script/MA350.py +0 -45
- aeroviz-0.1.3/AeroViz/rawDataReader/script/NEPH.py +0 -80
- aeroviz-0.1.3/AeroViz/rawDataReader/script/OCEC_LCRES.py +0 -34
- aeroviz-0.1.3/AeroViz/rawDataReader/script/OCEC_RES.py +0 -28
- aeroviz-0.1.3/AeroViz/rawDataReader/script/SMPS_TH.py +0 -41
- aeroviz-0.1.3/AeroViz/rawDataReader/script/SMPS_aim11.py +0 -51
- aeroviz-0.1.3/AeroViz/rawDataReader/script/SMPS_genr.py +0 -51
- aeroviz-0.1.3/AeroViz/rawDataReader/script/TEOM.py +0 -46
- aeroviz-0.1.3/AeroViz/rawDataReader/script/Table.py +0 -28
- aeroviz-0.1.3/AeroViz/rawDataReader/script/VOC_TH.py +0 -30
- aeroviz-0.1.3/AeroViz/rawDataReader/script/VOC_ZM.py +0 -37
- aeroviz-0.1.3/AeroViz/rawDataReader/script/__init__.py +0 -22
- aeroviz-0.1.3/AeroViz/rawDataReader/utils/__init__.py +0 -0
- aeroviz-0.1.3/AeroViz/rawDataReader/utils/config.py +0 -169
- aeroviz-0.1.3/AeroViz/tools/database.py +0 -97
- aeroviz-0.1.3/AeroViz/tools/dataclassifier.py +0 -117
- aeroviz-0.1.3/AeroViz/tools/dataprinter.py +0 -58
- aeroviz-0.1.3/AeroViz/tools/datareader.py +0 -66
- aeroviz-0.1.3/MANIFEST.in +0 -4
- aeroviz-0.1.3/tests/test_plot.py +0 -100
- {aeroviz-0.1.3/AeroViz/config → aeroviz-0.1.4/AeroViz/data}/DEFAULT_PNSD_DATA.csv +0 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz/dataProcess/VOC/voc_par.json +0 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz/plot/distribution/__init__.py +0 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz/plot/meteorology/__init__.py +0 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz/plot/utils/fRH.json +0 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz/process/core/__init__.py +0 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz/process/method/__init__.py +0 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz/process/script/__init__.py +0 -0
- {aeroviz-0.1.3/AeroViz → aeroviz-0.1.4/AeroViz/rawDataReader}/config/__init__.py +0 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz/tools/__init__.py +0 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz.egg-info/dependency_links.txt +0 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz.egg-info/requires.txt +0 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/AeroViz.egg-info/top_level.txt +0 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/LICENSE +0 -0
- {aeroviz-0.1.3 → aeroviz-0.1.4}/setup.cfg +0 -0
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# This file is used to import all the modules in the AeroViz package
|
|
2
2
|
from AeroViz import plot
|
|
3
|
-
from AeroViz.dataProcess import
|
|
3
|
+
from AeroViz.dataProcess import DataProcess
|
|
4
4
|
from AeroViz.rawDataReader import RawDataReader
|
|
5
5
|
from AeroViz.tools import DataBase, DataReader, DataClassifier
|
|
6
6
|
|
|
7
7
|
__all__ = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
'plot',
|
|
9
|
+
'RawDataReader',
|
|
10
|
+
'DataProcess',
|
|
11
|
+
'DataBase',
|
|
12
|
+
'DataReader',
|
|
13
|
+
'DataClassifier'
|
|
12
14
|
]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Time,SO2,NO,NOx,NO2,CO,O3,THC,CH4,NMHC,PM10,
|
|
1
|
+
Time,SO2,NO,NOx,NO2,CO,O3,THC,CH4,NMHC,PM10,PM2.5,WS,WD,AT,RH,RT,Benzene,Toluene,EthylBenzene,m/p-Xylene,o-Xylene,Si,Ti,V,Cr,Mn,Fe,Co,Ni,Cu,Zn,Ga,As,Se,Br,Sr,Ag,Cd,Sn,Sb,Ba,Hg,Tl,Pb,NH3,HF,HCl,HNO2,HNO3,G-SO2,Na+,NH4+,K+,Mg2+,Ca2+,F-,Cl-,NO2-,NO3-,PO43-,SO42-,Extinction,Scattering,Absorption,MEE,MSE,MAE,SSA,SAE450700,AAE370880,Vis_Naked,Vis_LPV,BC,VC,PBLH,T_OC,T_EC,O_OC,O_EC,POC,SOC,NOR,SOR,PM1,ALWC,pH,NH4_status,AS,AN,OM,Soil,SS,EC,SIA,total_mass,unknown_mass,AS_ratio,AN_ratio,OM_ratio,Soil_ratio,SS_ratio,EC_ratio,SIA_ratio,unknown_mass_ratio,AS_volume,AN_volume,OM_volume,Soil_volume,SS_volume,EC_volume,total_volume,AS_volume_ratio,AN_volume_ratio,OM_volume_ratio,Soil_volume_ratio,SS_volume_ratio,EC_volume_ratio,density,ALWC_volume_ratio,gRH,k_amb,k_dry,kappa_chem,kappa_vam,n_amb,n_dry,AS_ext_dry,AN_ext_dry,OM_ext_dry,Soil_ext_dry,SS_ext_dry,EC_ext_dry,total_ext_dry,AS_ext,AN_ext,OM_ext,Soil_ext,SS_ext,EC_ext,total_ext,ALWC_AS_ext,ALWC_AN_ext,ALWC_SS_ext,ALWC_ext,fRH_IMPR,ScatteringByGas,AbsorptionByGas,ExtinctionByGas,Number,GMDn,GSDn,mode_n,ultra_n,accum_n,coarse_n,Surface,GMDs,GSDs,mode_s,ultra_s,accum_s,coarse_s,Volume,GMDv,GSDv,mode_v,ultra_v,accum_v,coarse_v,Bext_internal,GMDext_in,GSDext_in,mode_ext_in,ultra_ext_in,accum_ext_in,coarse_ext_in,Bsca_internal,Babs_internal,Bext_external,GMDext_ex,GSDext_ex,mode_ext_ex,ultra_ext_ex,accum_ext_ex,coarse_ext_ex,Bsca_external,Babs_external,Bext_Fixed_PNSD,Bext_Fixed_RI,PG,MAC,Ox,N2O5_tracer,Vis_cal,OCEC_ratio,PM1/PM25,MEE_PNSD
|
|
2
2
|
2021-02-01 00:00:00,2.5,10.4,53.0,42.6,1.3,14.6,2.2,2.0,0.2,84.0,56.0,1.3,306.0,20.5,76.8,24.4,0.99,2.67,0.19,0.68,0.21,,,,,,,,,,,,,,,,,,,,,,,,12.5774,,0.5693,0.4759,,0.0714,0.4765,11.6625,0.0743,0.2798,0.2885,,0.1486,0.5551,6.4869,,2.9681,179.879,129.306,50.573,3.212125969,2.309035714,0.903090254,0.718849677,1.624,1.356,,2.4,3593.466667,48.54,37.339,0.540278143,0.169467395,,,7.108993122,2.413756878,0.056,0.229,35.56,15.537361,3.88663594,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,11.3805792163543,14.058,25.4385792163544,65073.8724853036,26.1370756001682,2.27387008559594,11.8,0.9,0.1,0.0,1056999978.60697,202.561522810954,2.46787275826095,175.1255164,0.17,0.8,0.03,51861790000.2695,421.511551165032,2.3298013391531,378.4899973,0.03,0.8,0.16,,,,,,,,,,,,,,,,,,,,,205.317579216354,298.423186359831,57.2,621.96,6.09298472862313,,0.635,
|
|
3
3
|
2021-02-01 01:00:00,2.1,1.8,36.7,34.8,0.9,21.1,2.2,2.1,0.1,73.0,49.0,1.2,291.0,19.7,80.5,24.4,1.14,1.84,0.12,0.43,0.11,,,,,,,,,,,,,,,,,,,,,,,,12.0403,,0.5965,0.3095,,0.0355,0.4456,11.057,0.0568,0.284,0.2534,,0.1092,0.2621,5.8583,,2.8003,162.183,120.322,41.861,3.309852291,2.45555102,0.854301271,0.741891421,1.668,1.285,10.0,2.4,3008.316667,50.13,41.775,0.466460746,0.148629793,,,6.036647232,1.923627768,0.061,0.25,32.2,18.378917,3.919787846,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,11.4116843184148,11.484,22.8956843184148,42275.3347651561,32.3417554250119,2.43890896537368,11.8,0.85,0.15,0.0,979132241.788556,213.495369564376,2.34216600590469,192.8357499,0.16,0.81,0.03,49066097131.0516,420.683242663998,2.27756054854188,378.4899973,0.03,0.81,0.15,,,,,,,,,,,,,,,,,,,,,185.078684318415,281.646089623498,55.9,734.28,6.75779828958646,,0.657142857142857,
|
|
4
4
|
2021-02-01 02:00:00,2.9,9.8,61.0,51.1,0.99,10.7,2.4,2.1,0.3,94.0,70.0,1.3,299.0,19.4,82.8,24.4,1.08,1.98,0.14,0.14,0.12,0.479322,0.013841,0.001037,0.002118,0.026962,0.49815,,,0.039141,0.140642,,0.008099,0.003098,0.023387,,,,0.018278,0.011566,0.005437,,,0.009238,12.0026,,0.3118,0.2484,,0.0514,0.424,12.8777,0.0656,0.2885,0.2404,,0.1137,0.4371,8.3928,,2.7932,208.59,158.844,49.746,2.979859428,2.2692,0.710659428,0.761512432,1.75,1.31,,2.55,3570.75,58.135,44.719,0.624357056,0.20177276,,,7.06735645,2.12126855,0.06,0.194,34.93,24.048226,3.879511152,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,11.4233926128591,16.863,28.2863926128591,62303.8712944327,30.3238605222433,2.49086526854534,11.8,0.85,0.15,0.0,1391459557.50536,211.541054105552,2.30001297386085,186.741787,0.15,0.82,0.02,67916033048.9499,402.359688194295,2.22606883392695,366.5290201,0.03,0.84,0.13,,,,,,,,,,,,,,,,,,,,,236.876392612859,246.544677289442,61.8,546.77,5.25432666954312,,0.499,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from ..core import Writer, run_process
|
|
2
|
+
|
|
3
|
+
__all__ = [
|
|
4
|
+
|
|
5
|
+
'Chemistry',
|
|
6
|
+
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Chemistry(Writer):
|
|
11
|
+
|
|
12
|
+
## Reconstruction
|
|
13
|
+
@run_process('Chemistry - reconstruction basic', 'reconstrc_basic')
|
|
14
|
+
def ReConstrc_basic(self, *df_chem, df_ref=None, df_water=None, df_density=None,
|
|
15
|
+
nam_lst=['NH4+', 'SO42-', 'NO3-', 'Fe', 'Na+', 'OC', 'EC']):
|
|
16
|
+
from ._mass_volume import _basic
|
|
17
|
+
|
|
18
|
+
out = _basic(df_chem, df_ref, df_water, df_density, nam_lst=nam_lst)
|
|
19
|
+
|
|
20
|
+
return self, out
|
|
21
|
+
|
|
22
|
+
## Partition
|
|
23
|
+
@run_process('Chemistry - Partition', 'partition')
|
|
24
|
+
def Partition(self, *df_chem, nam_lst=['NH4+', 'SO42-', 'NO3-', 'Cl-', 'NO2', 'HNO3', 'SO2', 'NH3', 'HCl', 'temp']):
|
|
25
|
+
from ._partition import _basic
|
|
26
|
+
|
|
27
|
+
out = _basic(df_chem, nam_lst=nam_lst)
|
|
28
|
+
|
|
29
|
+
return self, out
|
|
30
|
+
|
|
31
|
+
## ISOROPIA
|
|
32
|
+
@run_process('Chemistry - ISOROPIA', 'isoropia')
|
|
33
|
+
def ISOROPIA(self, *df_chem,
|
|
34
|
+
nam_lst=['Na+', 'SO42-', 'NH4+', 'NO3-', 'Cl-', 'Ca2+', 'K+', 'Mg2+', 'NH3', 'HNO3', 'HCl', 'RH',
|
|
35
|
+
'temp']):
|
|
36
|
+
from ._isoropia import _basic
|
|
37
|
+
|
|
38
|
+
if self.path_out is None:
|
|
39
|
+
raise ValueError('Please Input "path_out" !!')
|
|
40
|
+
|
|
41
|
+
out = _basic(df_chem, self.path_out, nam_lst=nam_lst)
|
|
42
|
+
|
|
43
|
+
return self, out
|
|
44
|
+
|
|
45
|
+
## OCEC
|
|
46
|
+
@run_process('Chemistry - OC/EC basic', 'ocec_basic')
|
|
47
|
+
def OCEC_basic(self, df_lcres, df_res, df_mass=None, ocec_ratio=None, ocec_ratio_month=1, hr_lim=200,
|
|
48
|
+
least_square_range=(0.1, 2.5, 0.1), WISOC_OC_range=(0.2, 0.7, 0.01), ):
|
|
49
|
+
from ._ocec import _basic
|
|
50
|
+
|
|
51
|
+
out = _basic(df_lcres, df_res, df_mass, ocec_ratio, ocec_ratio_month, hr_lim, least_square_range,
|
|
52
|
+
WISOC_OC_range)
|
|
53
|
+
|
|
54
|
+
return self, out
|
|
55
|
+
|
|
56
|
+
## TEOM
|
|
57
|
+
@run_process('Chemistry - TEOM basic', 'teom_basic')
|
|
58
|
+
def TEOM_basic(self, df_teom, df_check=None):
|
|
59
|
+
from ._teom import _basic
|
|
60
|
+
|
|
61
|
+
out = _basic(df_teom, df_check)
|
|
62
|
+
|
|
63
|
+
return self, out
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from pandas import concat
|
|
2
|
+
|
|
3
|
+
# parameter
|
|
4
|
+
_mol_wg = {
|
|
5
|
+
'SO42-': 96.06,
|
|
6
|
+
'NO3-': 62.00,
|
|
7
|
+
'Cl-': 35.4,
|
|
8
|
+
|
|
9
|
+
'Ca2+': 40.078,
|
|
10
|
+
'K+': 39.098,
|
|
11
|
+
'Mg2+': 24.305,
|
|
12
|
+
'Na+': 22.99,
|
|
13
|
+
'NH4+': 18.04,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# ug -> umol
|
|
18
|
+
def _ug2umol(_df):
|
|
19
|
+
_pt_ky = list(set(_df.keys()) & set(_mol_wg.keys()))
|
|
20
|
+
_gas_ky = list(set(_df.keys()) - set(_mol_wg.keys()) - set(['temp', 'RH']))
|
|
21
|
+
|
|
22
|
+
_par = (_df['temp'].to_frame() + 273.15) * .082
|
|
23
|
+
|
|
24
|
+
_df_pt = concat([(_df[_ky] / _mol_wg[_ky]).copy() for _ky in _pt_ky], axis=1)
|
|
25
|
+
_df_gas = _df[_gas_ky] / _par.values
|
|
26
|
+
|
|
27
|
+
return concat([_df_pt, _df_gas], axis=1)
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
from subprocess import Popen, PIPE
|
|
3
|
+
|
|
4
|
+
import numpy as np
|
|
5
|
+
from pandas import concat, DataFrame, to_numeric, read_csv
|
|
6
|
+
|
|
7
|
+
from ._calculate import _ug2umol
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# TODO: fix isoropia2.exe can not run
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _basic(df_che, path_out, nam_lst):
|
|
14
|
+
# parameter
|
|
15
|
+
df_all = concat(df_che, axis=1)
|
|
16
|
+
index = df_all.index.copy()
|
|
17
|
+
df_all.columns = nam_lst
|
|
18
|
+
|
|
19
|
+
df_umol = _ug2umol(df_all)
|
|
20
|
+
|
|
21
|
+
## output
|
|
22
|
+
## Na, SO4, NH3, NO3, Cl, Ca, K, Mg, RH, TEMP
|
|
23
|
+
df_input = DataFrame(index=index)
|
|
24
|
+
df_out = DataFrame(index=index)
|
|
25
|
+
|
|
26
|
+
pth_input = path_out / '_temp_input.txt'
|
|
27
|
+
pth_output = path_out / '_temp_input.dat'
|
|
28
|
+
|
|
29
|
+
pth_input.unlink(missing_ok=True)
|
|
30
|
+
pth_output.unlink(missing_ok=True)
|
|
31
|
+
|
|
32
|
+
## header
|
|
33
|
+
_header = 'Input units (0=umol/m3, 1=ug/m3)\n' + '0\n\n' + \
|
|
34
|
+
'Problem type (0=forward, 1=reverse); Phase state (0=solid+liquid, 1=metastable)\n' + '0, 1\n\n' + \
|
|
35
|
+
'NH4-SO4 system case\n'
|
|
36
|
+
|
|
37
|
+
## software
|
|
38
|
+
path_iso = Path(__file__).parent / 'isrpia2.exe'
|
|
39
|
+
|
|
40
|
+
# make input file and output temp input (without index)
|
|
41
|
+
## NH3
|
|
42
|
+
df_input['NH3'] = df_umol['NH4+'].fillna(0).copy() + df_umol['NH3']
|
|
43
|
+
|
|
44
|
+
## NO3
|
|
45
|
+
df_input['NO3'] = df_umol['HNO3'].fillna(0).copy() + df_umol['NO3-']
|
|
46
|
+
|
|
47
|
+
## Cl
|
|
48
|
+
df_input['Cl'] = df_umol['HCl'].fillna(0).copy() + df_umol['Cl-']
|
|
49
|
+
|
|
50
|
+
## temp, RH
|
|
51
|
+
df_input['RH'] = df_all['RH'] / 100
|
|
52
|
+
df_input['TEMP'] = df_all['temp'] + 273.15
|
|
53
|
+
|
|
54
|
+
df_input[['Na', 'SO4', 'Ca', 'K', 'Mg']] = df_umol[['Na+', 'SO42-', 'Ca2+', 'K+', 'Mg2+']].copy()
|
|
55
|
+
|
|
56
|
+
df_input = df_input[['Na', 'SO4', 'NH3', 'NO3', 'Cl', 'Ca', 'K', 'Mg', 'RH', 'TEMP']].fillna('-').copy()
|
|
57
|
+
|
|
58
|
+
## output the input data
|
|
59
|
+
df_input.to_csv(pth_input, index=False)
|
|
60
|
+
with (pth_input).open('r+', encoding='utf-8', errors='ignore') as _f:
|
|
61
|
+
_cont = _f.read()
|
|
62
|
+
_f.seek(0)
|
|
63
|
+
|
|
64
|
+
_f.write(_header)
|
|
65
|
+
_f.write(_cont)
|
|
66
|
+
|
|
67
|
+
# use ISOROPIA2
|
|
68
|
+
run = Popen([path_iso], stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
|
69
|
+
scrn_res, run_res = run.communicate(input=str(pth_input.resolve()).encode())
|
|
70
|
+
|
|
71
|
+
# read dat file and transform to the normal name
|
|
72
|
+
cond_idx = df_all[['SO42-', 'NH4+', 'NO3-']].dropna().index
|
|
73
|
+
|
|
74
|
+
with pth_output.open('r', encoding='utf-8', errors='ignore') as f:
|
|
75
|
+
df_res = read_csv(f, delimiter=r'\s+').apply(to_numeric, errors='coerce').set_index(index)
|
|
76
|
+
|
|
77
|
+
df_out['H'] = df_res['HLIQ'] / (df_res['WATER'] / 1000)
|
|
78
|
+
|
|
79
|
+
df_out.loc[cond_idx, 'pH'] = -np.log10(df_out['H'].loc[cond_idx])
|
|
80
|
+
df_out['pH'] = df_out['pH'].where((df_all['RH'] <= 95) & (df_all['RH'] >= 20))
|
|
81
|
+
|
|
82
|
+
cond_idx = df_out['pH'].dropna().index
|
|
83
|
+
df_out.loc[cond_idx, 'ALWC'] = df_res['WATER'].loc[cond_idx]
|
|
84
|
+
|
|
85
|
+
df_out[['NH3', 'HNO3', 'HCl', 'NH4+', 'NO3-', 'Cl-']] = df_res[
|
|
86
|
+
['GNH3', 'GHNO3', 'GHCL', 'NH4AER', 'NO3AER', 'CLAER']]
|
|
87
|
+
|
|
88
|
+
# calculate partition
|
|
89
|
+
# df_out['epls_NO3-'] = df_umol['NO3-'] / (df_umol['NO3-'] + df_umol['HNO3'])
|
|
90
|
+
# df_out['epls_NH4+'] = df_umol['NH4+'] / (df_umol['NH4+'] + df_umol['NH3'])
|
|
91
|
+
# df_out['epls_Cl-'] = df_umol['Cl-'] / (df_umol['Cl-'] + df_umol['HCl'])
|
|
92
|
+
|
|
93
|
+
# remove _temp file (input and output)
|
|
94
|
+
pth_input.unlink(missing_ok=True)
|
|
95
|
+
pth_output.unlink(missing_ok=True)
|
|
96
|
+
|
|
97
|
+
# output input and output
|
|
98
|
+
out = {
|
|
99
|
+
'input': df_input,
|
|
100
|
+
'output': df_out,
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return out
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
from pandas import concat, DataFrame
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def _basic(df_che, df_ref, df_water, df_density, nam_lst):
|
|
5
|
+
df_all = concat(df_che, axis=1)
|
|
6
|
+
index = df_all.index.copy()
|
|
7
|
+
df_all.columns = nam_lst
|
|
8
|
+
|
|
9
|
+
# parameter
|
|
10
|
+
mol_A, mol_S, mol_N = df_all['NH4+'] / 18, df_all['SO42-'] / 96, df_all['NO3-'] / 62
|
|
11
|
+
df_all['status'] = (mol_A) / (2 * mol_S + mol_N)
|
|
12
|
+
|
|
13
|
+
convert_nam = {'AS': 'SO42-',
|
|
14
|
+
'AN': 'NO3-',
|
|
15
|
+
'OM': 'OC',
|
|
16
|
+
'Soil': 'Fe',
|
|
17
|
+
'SS': 'Na+',
|
|
18
|
+
'EC': 'EC',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
mass_coe = {'AS': 1.375,
|
|
22
|
+
'AN': 1.29,
|
|
23
|
+
'OM': 1.8,
|
|
24
|
+
'Soil': 28.57,
|
|
25
|
+
'SS': 2.54,
|
|
26
|
+
'EC': 1,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
vol_coe = {'AS': 1.76,
|
|
30
|
+
'AN': 1.73,
|
|
31
|
+
'OM': 1.4,
|
|
32
|
+
'Soil': 2.6,
|
|
33
|
+
'SS': 2.16,
|
|
34
|
+
'EC': 1.5,
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
RI_coe = {'550': {'ALWC': 1.333 + 0j,
|
|
38
|
+
'AS': 1.53 + 0j,
|
|
39
|
+
'AN': 1.55 + 0j,
|
|
40
|
+
'OM': 1.55 + 0.0163j,
|
|
41
|
+
'Soil': 1.56 + 0.006j,
|
|
42
|
+
'SS': 1.54 + 0j,
|
|
43
|
+
'EC': 1.80 + 0.72j,
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
# m + kj -> m value is same as 550 current
|
|
47
|
+
'450': {'ALWC': 1.333 + 0j,
|
|
48
|
+
'AS': 1.57 + 0j,
|
|
49
|
+
'AN': 1.57 + 0j,
|
|
50
|
+
'OM': 1.58 + 0.056,
|
|
51
|
+
'Soil': 1.56 + 0.009j,
|
|
52
|
+
'SS': 1.54 + 0j,
|
|
53
|
+
'EC': 1.80 + 0.79j,
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
# mass
|
|
58
|
+
# NH4 Enough
|
|
59
|
+
df_mass = DataFrame()
|
|
60
|
+
df_enough = df_all.where(df_all['status'] >= 1).dropna().copy()
|
|
61
|
+
|
|
62
|
+
for _mass_nam, _coe in mass_coe.items():
|
|
63
|
+
df_mass[_mass_nam] = df_all[convert_nam[_mass_nam]] * _coe
|
|
64
|
+
|
|
65
|
+
# NH4 Deficiency
|
|
66
|
+
defic_idx = df_all['status'] < 1
|
|
67
|
+
|
|
68
|
+
if defic_idx.any():
|
|
69
|
+
residual = mol_A - 2 * mol_S
|
|
70
|
+
|
|
71
|
+
# residual > 0
|
|
72
|
+
_status = residual > 0
|
|
73
|
+
if _status.any():
|
|
74
|
+
_cond = _status & (residual <= mol_N)
|
|
75
|
+
df_mass.loc[_cond, 'AN'] = residual.loc[_cond] * 80
|
|
76
|
+
|
|
77
|
+
_cond = _status & (residual > mol_N)
|
|
78
|
+
df_mass.loc[_cond, 'AN'] = mol_N.loc[_cond] * 80
|
|
79
|
+
|
|
80
|
+
# residual < 0
|
|
81
|
+
_status = residual <= 0
|
|
82
|
+
if _status.any():
|
|
83
|
+
df_mass.loc[_status, 'AN'] = 0
|
|
84
|
+
|
|
85
|
+
_cond = _status & (mol_A <= 2 * mol_S)
|
|
86
|
+
df_mass.loc[_cond, 'AS'] = mol_A.loc[_cond] / 2 * 132
|
|
87
|
+
|
|
88
|
+
_cond = _status & (mol_A > 2 * mol_S)
|
|
89
|
+
df_mass.loc[_cond, 'AS'] = mol_S.loc[_cond] * 132
|
|
90
|
+
|
|
91
|
+
df_mass_cal = df_mass.dropna().copy()
|
|
92
|
+
df_mass['total'] = df_mass.sum(axis=1, min_count=6)
|
|
93
|
+
|
|
94
|
+
qc_ratio = df_mass['total'] / df_ref
|
|
95
|
+
qc_cond = (qc_ratio >= 0.7) & (qc_ratio <= 1.3)
|
|
96
|
+
|
|
97
|
+
# volume
|
|
98
|
+
df_vol = DataFrame()
|
|
99
|
+
for _vol_nam, _coe in vol_coe.items():
|
|
100
|
+
df_vol[_vol_nam] = df_mass_cal[_vol_nam] / _coe
|
|
101
|
+
|
|
102
|
+
if df_water is not None:
|
|
103
|
+
df_vol['ALWC'] = df_water.copy()
|
|
104
|
+
df_vol = df_vol.dropna()
|
|
105
|
+
df_vol['total_wet'] = df_vol.sum(axis=1, min_count=6)
|
|
106
|
+
|
|
107
|
+
df_vol['total_dry'] = df_vol[vol_coe.keys()].sum(axis=1, min_count=6)
|
|
108
|
+
|
|
109
|
+
# density
|
|
110
|
+
df_vol_cal = DataFrame()
|
|
111
|
+
df_den_rec = df_mass['total'] / df_vol['total_dry']
|
|
112
|
+
if df_density is not None:
|
|
113
|
+
df_den_all = concat([df_all[['SO42-', 'NO3-', 'NH4+', 'EC']], df_density, df_mass['OM']], axis=1).dropna()
|
|
114
|
+
|
|
115
|
+
df_vol_cal = (df_den_all[['SO42-', 'NO3-', 'NH4+']].sum(axis=1) / 1.75) + \
|
|
116
|
+
df_den_all['Cl-'] / 1.52 + \
|
|
117
|
+
df_den_all['OM'] / 1.4 + df_den_all['EC'] / 1.77
|
|
118
|
+
|
|
119
|
+
df_den = df_den_all.sum(axis=1, min_count=6) / df_vol_cal
|
|
120
|
+
else:
|
|
121
|
+
df_den = df_den_rec
|
|
122
|
+
|
|
123
|
+
# refractive index
|
|
124
|
+
ri_dic = {}
|
|
125
|
+
for _lambda, _coe in RI_coe.items():
|
|
126
|
+
|
|
127
|
+
df_RI = DataFrame()
|
|
128
|
+
|
|
129
|
+
for _ky, _df in df_vol.items():
|
|
130
|
+
if 'total' in _ky: continue
|
|
131
|
+
df_RI[_ky] = (_df * _coe[_ky])
|
|
132
|
+
|
|
133
|
+
df_RI['RI_wet'] = None
|
|
134
|
+
if df_water is not None:
|
|
135
|
+
df_RI['RI_wet'] = (df_RI / df_vol['total_wet'].to_frame().values).sum(axis=1)
|
|
136
|
+
|
|
137
|
+
df_RI['RI_dry'] = (df_RI[vol_coe.keys()] / df_vol['total_dry'].to_frame().values).sum(axis=1)
|
|
138
|
+
|
|
139
|
+
ri_dic[f'RI_{_lambda}'] = df_RI[['RI_dry', 'RI_wet']]
|
|
140
|
+
|
|
141
|
+
# mole and equivalent
|
|
142
|
+
df_eq = concat((mol_A, mol_S, mol_N, mol_A * 1, mol_S * 2, mol_N * 1), axis=1)
|
|
143
|
+
df_eq.columns = ['mol_NH4', 'mol_SO4', 'mol_NO3', 'eq_NH4', 'eq_SO4', 'eq_NO3', ]
|
|
144
|
+
|
|
145
|
+
# out
|
|
146
|
+
out = {'mass': df_mass,
|
|
147
|
+
'volume': df_vol,
|
|
148
|
+
'vol_cal': df_vol_cal,
|
|
149
|
+
'eq': df_eq,
|
|
150
|
+
'density_mat': df_den,
|
|
151
|
+
'density_rec': df_den_rec,
|
|
152
|
+
}
|
|
153
|
+
out.update(ri_dic)
|
|
154
|
+
|
|
155
|
+
for _ky, _df in out.items():
|
|
156
|
+
out[_ky] = _df.reindex(index).where(qc_cond)
|
|
157
|
+
|
|
158
|
+
return out
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
def mass_ratio(_df):
|
|
162
|
+
if _df['PM25'] >= _df['total_mass']:
|
|
163
|
+
_df['others'] = _df['PM25'] - _df['total_mass']
|
|
164
|
+
for _val, _species in zip(_df.values, _df.index):
|
|
165
|
+
_df[f'{_species}_ratio'] = _val / _df['PM25'].__round__(3)
|
|
166
|
+
|
|
167
|
+
if _df['PM25'] < _df['total_mass']:
|
|
168
|
+
_df['others'] = 0
|
|
169
|
+
for _val, _species in zip(_df.values, _df.index):
|
|
170
|
+
_df[f'{_species}_ratio'] = _val / _df['PM25'].__round__(3)
|
|
171
|
+
|
|
172
|
+
return _df['others':].drop(labels=['PM25_ratio', 'total_mass_ratio'])
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
from pandas import concat, DataFrame
|
|
3
|
+
from scipy.optimize import curve_fit
|
|
4
|
+
|
|
5
|
+
from AeroViz.dataProcess.core import union_index
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
'_basic',
|
|
9
|
+
# '_ocec_ratio_cal',
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _min_Rsq(_oc, _ec, _rng):
|
|
14
|
+
_val_mesh, _oc_mesh = np.meshgrid(_rng, _oc)
|
|
15
|
+
_val_mesh, _ec_mesh = np.meshgrid(_rng, _ec)
|
|
16
|
+
|
|
17
|
+
_out_table = DataFrame(_oc_mesh - _val_mesh * _ec_mesh, index=_oc.index, columns=_rng)
|
|
18
|
+
|
|
19
|
+
## calculate R2
|
|
20
|
+
_r2_dic = {}
|
|
21
|
+
_func = lambda _x, _sl, _inte: _sl * _x + _inte
|
|
22
|
+
for _ocec, _out in _out_table.items():
|
|
23
|
+
_df = DataFrame([_out.values, _ec.values]).T.dropna()
|
|
24
|
+
|
|
25
|
+
_x, _y = _df[0], _df[1]
|
|
26
|
+
_opt, _ = curve_fit(_func, _x, _y)
|
|
27
|
+
|
|
28
|
+
_tss = np.sum((_y - _y.mean()) ** 2.)
|
|
29
|
+
_rss = np.sum((_y - _func(_x, *_opt)) ** 2.)
|
|
30
|
+
|
|
31
|
+
_r2_dic[round(_ocec, 3)] = 1. - _rss / _tss
|
|
32
|
+
|
|
33
|
+
## get the min R2
|
|
34
|
+
_ratio = DataFrame(_r2_dic, index=[0]).idxmin(axis=1).values[0]
|
|
35
|
+
|
|
36
|
+
return _ratio, _out_table[_ratio]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _ocec_ratio_cal(_nam, _lcres_splt, _hr_lim, _range_, _wisoc_range_):
|
|
40
|
+
## parameter
|
|
41
|
+
_out = DataFrame(index=_lcres_splt.index)
|
|
42
|
+
(_, _oc), (_, _ec) = _lcres_splt.items()
|
|
43
|
+
# _oc, _ec = _lcres_splt['Thermal_OC'], _lcres_splt['Thermal_EC']
|
|
44
|
+
|
|
45
|
+
## real data OC/EC
|
|
46
|
+
_ocec_ratio_real = (_oc / _ec).quantile(.5)
|
|
47
|
+
|
|
48
|
+
_out[f'OC/EC_real_{_nam}'] = _ocec_ratio_real
|
|
49
|
+
_out[f'POC_real_{_nam}'] = _ocec_ratio_real * _ec
|
|
50
|
+
_out[f'SOC_real_{_nam}'] = _oc - _out[f'POC_real_{_nam}']
|
|
51
|
+
|
|
52
|
+
## the least R2 method
|
|
53
|
+
## estimated OC/EC
|
|
54
|
+
if (len(_lcres_splt) <= _hr_lim):
|
|
55
|
+
print(f"\t\t{_lcres_splt.index[0].strftime('%Y-%m-%d %X')} to {_lcres_splt.index[-1].strftime('%Y-%m-%d %X')}")
|
|
56
|
+
print('\t\tPlease Modify the Values of "hour_limit" or Input Sufficient Amount of Data !!')
|
|
57
|
+
|
|
58
|
+
_out[[f'OC/EC_{_nam}', f'POC_{_nam}', f'SOC_{_nam}', f'WISOC/OC_{_nam}', f'WSOC_{_nam}',
|
|
59
|
+
f'WISOC_{_nam}']] = np.nan
|
|
60
|
+
|
|
61
|
+
return _out
|
|
62
|
+
|
|
63
|
+
if (len(_lcres_splt.dropna()) == 0):
|
|
64
|
+
_out[[f'OC/EC_{_nam}', f'POC_{_nam}', f'SOC_{_nam}', f'WISOC/OC_{_nam}', f'WSOC_{_nam}',
|
|
65
|
+
f'WISOC_{_nam}']] = np.nan
|
|
66
|
+
|
|
67
|
+
return _out
|
|
68
|
+
|
|
69
|
+
## OC/EC
|
|
70
|
+
_ocec_ratio = False
|
|
71
|
+
_st, _ed, _stp = _range_
|
|
72
|
+
|
|
73
|
+
for _ in range(2):
|
|
74
|
+
if _ocec_ratio:
|
|
75
|
+
_ocec_rng = np.arange(_ocec_ratio - _stp / 2, _ocec_ratio + _stp / 2, .01).round(3)
|
|
76
|
+
else:
|
|
77
|
+
_ocec_rng = np.arange(_st, _ed + _stp, _stp).round(3)
|
|
78
|
+
|
|
79
|
+
_ocec_ratio, _soc = _min_Rsq(_oc, _ec, _ocec_rng)
|
|
80
|
+
|
|
81
|
+
## WISOC
|
|
82
|
+
_st, _ed, _stp = _wisoc_range_
|
|
83
|
+
_wisoc_rng = (np.arange(_st, _ed + _stp, _stp) * _ocec_ratio).round(5)
|
|
84
|
+
_wisoc_ratio, _wsoc = _min_Rsq(_oc, _ec, _wisoc_rng)
|
|
85
|
+
|
|
86
|
+
## out
|
|
87
|
+
_out[f'OC/EC_{_nam}'] = _ocec_ratio
|
|
88
|
+
_out[f'SOC_{_nam}'] = _soc
|
|
89
|
+
_out[f'POC_{_nam}'] = _oc - _out[f'SOC_{_nam}']
|
|
90
|
+
_out[f'WISOC/OC_{_nam}'] = _wisoc_ratio
|
|
91
|
+
_out[f'WSOC_{_nam}'] = _wsoc
|
|
92
|
+
_out[f'WISOC_{_nam}'] = _oc - _out[f'WSOC_{_nam}']
|
|
93
|
+
|
|
94
|
+
return _out[[f'OC/EC_{_nam}', f'POC_{_nam}', f'SOC_{_nam}', f'WISOC/OC_{_nam}', f'WSOC_{_nam}', f'WISOC_{_nam}',
|
|
95
|
+
f'OC/EC_real_{_nam}', f'POC_real_{_nam}', f'SOC_real_{_nam}']]
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def _basic(_lcres, _res, _mass, _ocec_ratio, _ocec_ratio_month, _hr_lim, _range, _wisoc_range):
|
|
99
|
+
_lcres, _res, _mass = union_index(_lcres, _res, _mass)
|
|
100
|
+
|
|
101
|
+
_out = {}
|
|
102
|
+
|
|
103
|
+
## OC1, OC2, OC3, OC4, PC
|
|
104
|
+
_df_bsc = _res / _lcres['Sample_Volume'].to_frame().values.copy()
|
|
105
|
+
|
|
106
|
+
## SOC, POC, OC/EC
|
|
107
|
+
if _ocec_ratio is not None:
|
|
108
|
+
try:
|
|
109
|
+
iter(_ocec_ratio)
|
|
110
|
+
except TypeError:
|
|
111
|
+
raise TypeError('"ocec_ratio" Only Accept a Single Value !!')
|
|
112
|
+
|
|
113
|
+
_prcs_df = DataFrame(index=_df_bsc.index)
|
|
114
|
+
_prcs_df['OC/EC'] = _ocec_ratio
|
|
115
|
+
_prcs_df['POC'] = _ocec_ratio * _lcres['Thermal_EC']
|
|
116
|
+
_prcs_df['SOC'] = _lcres['Thermal_OC'] - _prcs_df['POC']
|
|
117
|
+
|
|
118
|
+
else:
|
|
119
|
+
_df_lst = []
|
|
120
|
+
for _, _df in _lcres.resample(f'{_ocec_ratio_month}MS', closed='left'):
|
|
121
|
+
_thm_cal = _ocec_ratio_cal('thm', _df[['Thermal_OC', 'Thermal_EC']], _hr_lim, _range, _wisoc_range)
|
|
122
|
+
_opt_cal = _ocec_ratio_cal('opt', _df[['Optical_OC', 'Optical_EC']], _hr_lim, _range, _wisoc_range)
|
|
123
|
+
_df_lst.append(concat([_thm_cal, _opt_cal], axis=1))
|
|
124
|
+
|
|
125
|
+
_prcs_df = concat(_df_lst)
|
|
126
|
+
|
|
127
|
+
_df_bsc = concat((_df_bsc.copy(), _prcs_df), axis=1)
|
|
128
|
+
|
|
129
|
+
## ratio
|
|
130
|
+
_df_ratio = DataFrame(index=_df_bsc.index)
|
|
131
|
+
|
|
132
|
+
for _ky, _val in _df_bsc.items():
|
|
133
|
+
if 'OC/EC' in _ky: continue
|
|
134
|
+
_df_ratio[f'{_ky}/Thermal_OC'] = _val / _lcres['Thermal_OC']
|
|
135
|
+
_df_ratio[f'{_ky}/Optical_OC'] = _val / _lcres['Optical_OC']
|
|
136
|
+
|
|
137
|
+
if _mass is not None:
|
|
138
|
+
for _ky, _val in _df_bsc.items():
|
|
139
|
+
_df_ratio[f'{_ky}/PM'] = _val / _mass
|
|
140
|
+
|
|
141
|
+
_df_ratio[f'Thermal_OC/PM'] = _lcres['Thermal_OC'] / _mass
|
|
142
|
+
_df_ratio[f'Thermal_EC/PM'] = _lcres['Thermal_EC'] / _mass
|
|
143
|
+
|
|
144
|
+
_df_ratio[f'Optical_OC/PM'] = _lcres['Optical_OC'] / _mass
|
|
145
|
+
_df_ratio[f'Optical_EC/PM'] = _lcres['Optical_EC'] / _mass
|
|
146
|
+
|
|
147
|
+
## ratio status
|
|
148
|
+
_df_bsc = concat((_lcres, _df_bsc.copy()), axis=1)
|
|
149
|
+
|
|
150
|
+
for _ky, _df in _df_ratio.items():
|
|
151
|
+
_df_bsc[f'{_ky}_status'] = 'Normal'
|
|
152
|
+
_df_bsc[f'{_ky}_status'] = _df_bsc[f'{_ky}_status'].mask(_df > 1, 'Warning')
|
|
153
|
+
|
|
154
|
+
## out
|
|
155
|
+
_out['ratio'] = _df_ratio
|
|
156
|
+
_out['basic'] = _df_bsc
|
|
157
|
+
|
|
158
|
+
return _out
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
'''
|
|
162
|
+
_ocec_mesh, _oc_mesh = n.meshgrid(_ocec_rng, _oc)
|
|
163
|
+
_ocec_mesh, _ec_mesh = n.meshgrid(_ocec_rng, _ec)
|
|
164
|
+
|
|
165
|
+
_soc_table = DataFrame(_oc_mesh-_ocec_mesh*_ec_mesh, index=_oc.index, columns=_ocec_rng)
|
|
166
|
+
|
|
167
|
+
## calculate R2
|
|
168
|
+
_r2_dic = {}
|
|
169
|
+
_func = lambda _x, _sl, _inte : _sl*_x+_inte
|
|
170
|
+
for _ocec, _soc in _soc_table.items():
|
|
171
|
+
|
|
172
|
+
_df = DataFrame([_soc.values, _ec.values]).T.dropna()
|
|
173
|
+
_x, _y = _df[0], _df[1]
|
|
174
|
+
|
|
175
|
+
_opt, _ = curve_fit(_func, _x, _y)
|
|
176
|
+
|
|
177
|
+
_tss = n.sum((_y - _y.mean())**2.)
|
|
178
|
+
_rss = n.sum((_y - _func(_x, *_opt))**2.)
|
|
179
|
+
|
|
180
|
+
_r2_dic[round(_ocec,2)] = 1. - _rss / _tss
|
|
181
|
+
|
|
182
|
+
## get the min R2
|
|
183
|
+
_ocec_ratio = DataFrame(_r2_dic, index=[0]).idxmin(axis=1).values[0]
|
|
184
|
+
# '''
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from pandas import concat, DataFrame
|
|
2
|
+
|
|
3
|
+
from ._calculate import _ug2umol
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def _basic(df_che, nam_lst):
|
|
7
|
+
# parameter
|
|
8
|
+
df_all = concat(df_che, axis=1)
|
|
9
|
+
index = df_all.index.copy()
|
|
10
|
+
df_all.columns = nam_lst
|
|
11
|
+
|
|
12
|
+
df_umol = _ug2umol(df_all)
|
|
13
|
+
|
|
14
|
+
# calculate
|
|
15
|
+
df_out = DataFrame(index=df_umol.index)
|
|
16
|
+
|
|
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'])
|
|
19
|
+
|
|
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'])
|
|
22
|
+
|
|
23
|
+
df_out['SOR'] = df_umol['SO42-'] / (df_umol['SO42-'] + df_umol['SO2'])
|
|
24
|
+
|
|
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'])
|
|
29
|
+
|
|
30
|
+
return df_out
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
def _basic(_teom, _check):
|
|
2
|
+
import numpy as np
|
|
3
|
+
_teom['Volatile_Fraction'] = (_teom['PM_Total'] - _teom['PM_NV']) / _teom['PM_Total']
|
|
4
|
+
|
|
5
|
+
_teom.loc[(_teom['Volatile_Fraction'] < 0) | (_teom['Volatile_Fraction'] > 1)] = np.nan
|
|
6
|
+
|
|
7
|
+
if _check is not None:
|
|
8
|
+
_ratio = _teom['PM_NV'] / _check
|
|
9
|
+
_teom['PM_Check'] = _check
|
|
10
|
+
|
|
11
|
+
_teom.loc[_teom.dropna().index, 'status'] = 'Warning'
|
|
12
|
+
_teom.loc[(_ratio > 0) & (_ratio < 1), 'status'] = 'Normal'
|
|
13
|
+
|
|
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
|