AeroViz 0.1.3b0__tar.gz → 0.1.5__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.

Files changed (149) hide show
  1. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/__init__.py +5 -3
  2. {aeroviz-0.1.3b0/AeroViz/config → aeroviz-0.1.5/AeroViz/data}/DEFAULT_DATA.csv +1 -1
  3. aeroviz-0.1.5/AeroViz/dataProcess/Chemistry/__init__.py +64 -0
  4. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/Chemistry/_isoropia.py +11 -11
  5. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/Chemistry/_mass_volume.py +15 -18
  6. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/Chemistry/_ocec.py +21 -46
  7. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/Chemistry/_teom.py +2 -1
  8. aeroviz-0.1.5/AeroViz/dataProcess/Chemistry/isrpia.cnf +21 -0
  9. aeroviz-0.1.5/AeroViz/dataProcess/Chemistry/isrpia2.exe +0 -0
  10. aeroviz-0.1.5/AeroViz/dataProcess/Optical/Angstrom_exponent.py +20 -0
  11. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/Optical/_IMPROVE.py +13 -15
  12. aeroviz-0.1.5/AeroViz/dataProcess/Optical/__init__.py +47 -0
  13. aeroviz-0.1.5/AeroViz/dataProcess/Optical/_absorption.py +28 -0
  14. aeroviz-0.1.5/AeroViz/dataProcess/Optical/_extinction.py +42 -0
  15. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/Optical/_mie.py +0 -1
  16. aeroviz-0.1.5/AeroViz/dataProcess/Optical/_scattering.py +29 -0
  17. aeroviz-0.1.5/AeroViz/dataProcess/Optical/fRH.pkl +0 -0
  18. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/SizeDistr/__init__.py +7 -7
  19. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/SizeDistr/_merge.py +2 -2
  20. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/SizeDistr/_merge_v1.py +2 -2
  21. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/SizeDistr/_merge_v2.py +2 -2
  22. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/SizeDistr/_merge_v3.py +1 -1
  23. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/SizeDistr/_merge_v4.py +1 -1
  24. aeroviz-0.1.5/AeroViz/dataProcess/VOC/__init__.py +14 -0
  25. aeroviz-0.1.5/AeroViz/dataProcess/VOC/_potential_par.py +108 -0
  26. aeroviz-0.1.3b0/AeroViz/dataProcess/VOC/voc_par.json → aeroviz-0.1.5/AeroViz/dataProcess/VOC/support_voc.json +321 -339
  27. aeroviz-0.1.5/AeroViz/dataProcess/__init__.py +33 -0
  28. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/core/__init__.py +10 -17
  29. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/__init__.py +1 -1
  30. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/box.py +2 -1
  31. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/optical/optical.py +4 -4
  32. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/regression.py +25 -39
  33. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/scatter.py +68 -2
  34. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/templates/__init__.py +2 -1
  35. aeroviz-0.1.5/AeroViz/plot/templates/ammonium_rich.py +34 -0
  36. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/templates/diurnal_pattern.py +11 -9
  37. aeroviz-0.1.5/AeroViz/plot/templates/koschmieder.py +92 -0
  38. aeroviz-0.1.5/AeroViz/plot/templates/metal_heatmap.py +155 -0
  39. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/timeseries/__init__.py +1 -0
  40. aeroviz-0.1.5/AeroViz/plot/timeseries/template.py +47 -0
  41. aeroviz-0.1.5/AeroViz/plot/timeseries/timeseries.py +362 -0
  42. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/utils/plt_utils.py +2 -2
  43. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/utils/units.json +5 -0
  44. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/violin.py +9 -8
  45. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/__init__.py +2 -2
  46. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/script/AbstractDistCalc.py +1 -1
  47. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/script/Chemical.py +5 -4
  48. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/script/Others.py +1 -1
  49. aeroviz-0.1.5/AeroViz/rawDataReader/__init__.py +112 -0
  50. aeroviz-0.1.3b0/AeroViz/rawDataReader/utils/config.py → aeroviz-0.1.5/AeroViz/rawDataReader/config/supported_instruments.py +33 -54
  51. aeroviz-0.1.5/AeroViz/rawDataReader/core/__init__.py +287 -0
  52. aeroviz-0.1.5/AeroViz/rawDataReader/script/AE33.py +30 -0
  53. aeroviz-0.1.5/AeroViz/rawDataReader/script/AE43.py +31 -0
  54. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/rawDataReader/script/APS_3321.py +8 -8
  55. aeroviz-0.1.5/AeroViz/rawDataReader/script/Aurora.py +40 -0
  56. aeroviz-0.1.5/AeroViz/rawDataReader/script/BC1054.py +42 -0
  57. aeroviz-0.1.5/AeroViz/rawDataReader/script/EPA_vertical.py +46 -0
  58. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/rawDataReader/script/GRIMM.py +6 -13
  59. aeroviz-0.1.3b0/AeroViz/rawDataReader/script/IGAC_ZM.py → aeroviz-0.1.5/AeroViz/rawDataReader/script/IGAC.py +18 -18
  60. aeroviz-0.1.5/AeroViz/rawDataReader/script/MA350.py +38 -0
  61. aeroviz-0.1.5/AeroViz/rawDataReader/script/Minion.py +103 -0
  62. aeroviz-0.1.5/AeroViz/rawDataReader/script/NEPH.py +70 -0
  63. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/rawDataReader/script/SMPS_TH.py +6 -6
  64. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/rawDataReader/script/SMPS_aim11.py +8 -8
  65. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/rawDataReader/script/SMPS_genr.py +8 -8
  66. aeroviz-0.1.5/AeroViz/rawDataReader/script/Sunset_OCEC.py +66 -0
  67. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/rawDataReader/script/TEOM.py +10 -8
  68. aeroviz-0.1.5/AeroViz/rawDataReader/script/Table.py +27 -0
  69. aeroviz-0.1.5/AeroViz/rawDataReader/script/VOC.py +33 -0
  70. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/rawDataReader/script/__init__.py +10 -12
  71. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/tools/database.py +7 -9
  72. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/tools/datareader.py +3 -3
  73. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz.egg-info/PKG-INFO +1 -1
  74. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz.egg-info/SOURCES.txt +17 -13
  75. aeroviz-0.1.5/MANIFEST.in +14 -0
  76. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/PKG-INFO +1 -1
  77. aeroviz-0.1.5/requirements.txt +8 -0
  78. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/setup.py +1 -1
  79. aeroviz-0.1.3b0/AeroViz/dataProcess/Chemistry/__init__.py +0 -63
  80. aeroviz-0.1.3b0/AeroViz/dataProcess/Optical/__init__.py +0 -62
  81. aeroviz-0.1.3b0/AeroViz/dataProcess/Optical/_absorption.py +0 -54
  82. aeroviz-0.1.3b0/AeroViz/dataProcess/Optical/_extinction.py +0 -37
  83. aeroviz-0.1.3b0/AeroViz/dataProcess/Optical/_scattering.py +0 -30
  84. aeroviz-0.1.3b0/AeroViz/dataProcess/VOC/__init__.py +0 -19
  85. aeroviz-0.1.3b0/AeroViz/dataProcess/VOC/_potential_par.py +0 -74
  86. aeroviz-0.1.3b0/AeroViz/dataProcess/__init__.py +0 -11
  87. aeroviz-0.1.3b0/AeroViz/plot/templates/koschmieder.py +0 -156
  88. aeroviz-0.1.3b0/AeroViz/plot/templates/metal_heatmap.py +0 -57
  89. aeroviz-0.1.3b0/AeroViz/plot/timeseries/timeseries.py +0 -295
  90. aeroviz-0.1.3b0/AeroViz/rawDataReader/__init__.py +0 -68
  91. aeroviz-0.1.3b0/AeroViz/rawDataReader/core/__init__.py +0 -402
  92. aeroviz-0.1.3b0/AeroViz/rawDataReader/script/AE33.py +0 -31
  93. aeroviz-0.1.3b0/AeroViz/rawDataReader/script/AE43.py +0 -34
  94. aeroviz-0.1.3b0/AeroViz/rawDataReader/script/Aurora.py +0 -38
  95. aeroviz-0.1.3b0/AeroViz/rawDataReader/script/BC1054.py +0 -46
  96. aeroviz-0.1.3b0/AeroViz/rawDataReader/script/EPA_vertical.py +0 -18
  97. aeroviz-0.1.3b0/AeroViz/rawDataReader/script/IGAC_TH.py +0 -104
  98. aeroviz-0.1.3b0/AeroViz/rawDataReader/script/MA350.py +0 -45
  99. aeroviz-0.1.3b0/AeroViz/rawDataReader/script/NEPH.py +0 -80
  100. aeroviz-0.1.3b0/AeroViz/rawDataReader/script/OCEC_LCRES.py +0 -34
  101. aeroviz-0.1.3b0/AeroViz/rawDataReader/script/OCEC_RES.py +0 -28
  102. aeroviz-0.1.3b0/AeroViz/rawDataReader/script/Table.py +0 -28
  103. aeroviz-0.1.3b0/AeroViz/rawDataReader/script/VOC_TH.py +0 -30
  104. aeroviz-0.1.3b0/AeroViz/rawDataReader/script/VOC_ZM.py +0 -37
  105. aeroviz-0.1.3b0/MANIFEST.in +0 -4
  106. aeroviz-0.1.3b0/tests/test_plot.py +0 -100
  107. {aeroviz-0.1.3b0/AeroViz/config → aeroviz-0.1.5/AeroViz/data}/DEFAULT_PNSD_DATA.csv +0 -0
  108. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/Chemistry/_calculate.py +0 -0
  109. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/Chemistry/_partition.py +0 -0
  110. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/Optical/_mie_sd.py +0 -0
  111. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/SizeDistr/__merge.py +0 -0
  112. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/dataProcess/SizeDistr/_size_distr.py +0 -0
  113. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/bar.py +0 -0
  114. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/distribution/__init__.py +0 -0
  115. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/distribution/distribution.py +0 -0
  116. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/meteorology/__init__.py +0 -0
  117. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/meteorology/meteorology.py +0 -0
  118. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/optical/__init__.py +0 -0
  119. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/pie.py +0 -0
  120. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/templates/contour.py +0 -0
  121. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/templates/corr_matrix.py +0 -0
  122. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/utils/__init__.py +0 -0
  123. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/utils/_color.py +0 -0
  124. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/utils/_unit.py +0 -0
  125. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/utils/fRH.json +0 -0
  126. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/plot/utils/sklearn_utils.py +0 -0
  127. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/core/DataProc.py +0 -0
  128. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/core/SizeDist.py +0 -0
  129. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/core/__init__.py +0 -0
  130. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/method/PyMieScatt_update.py +0 -0
  131. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/method/__init__.py +0 -0
  132. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/method/mie_theory.py +0 -0
  133. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/method/prop.py +0 -0
  134. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/script/IMPACT.py +0 -0
  135. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/script/IMPROVE.py +0 -0
  136. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/script/PSD.py +0 -0
  137. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/script/PSD_dry.py +0 -0
  138. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/script/__init__.py +0 -0
  139. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/process/script/retrieve_RI.py +0 -0
  140. {aeroviz-0.1.3b0/AeroViz/rawDataReader/utils → aeroviz-0.1.5/AeroViz/rawDataReader/config}/__init__.py +0 -0
  141. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/tools/__init__.py +0 -0
  142. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/tools/dataclassifier.py +0 -0
  143. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz/tools/dataprinter.py +0 -0
  144. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz.egg-info/dependency_links.txt +0 -0
  145. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz.egg-info/requires.txt +0 -0
  146. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/AeroViz.egg-info/top_level.txt +0 -0
  147. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/LICENSE +0 -0
  148. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/README.md +0 -0
  149. {aeroviz-0.1.3b0 → aeroviz-0.1.5}/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 Optical, SizeDistr, Chemistry, VOC
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
8
  'plot',
9
9
  'RawDataReader',
10
- 'Optical', 'SizeDistr', 'Chemistry', 'VOC',
11
- 'DataBase', 'DataReader', 'DataClassifier'
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,PM25,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
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,64 @@
1
+ from ..core import Writer, run_process
2
+
3
+ __all__ = ['Chemistry']
4
+
5
+
6
+ class Chemistry(Writer):
7
+ # Reconstruction
8
+ @run_process('Chemistry - reconstruction basic', 'reconstrc_basic')
9
+ def ReConstrc_basic(self, *df_chem, df_ref=None, df_water=None, df_density=None, nam_lst=None):
10
+ from ._mass_volume import _basic
11
+
12
+ if nam_lst is None:
13
+ nam_lst = ['NH4+', 'SO42-', 'NO3-', 'Fe', 'Na+', 'OC', 'EC']
14
+
15
+ out = _basic(df_chem, df_ref, df_water, df_density, nam_lst=nam_lst)
16
+
17
+ return self, out
18
+
19
+ # Partition
20
+ @run_process('Chemistry - Partition', 'partition')
21
+ def Partition(self, *df_chem, nam_lst=None):
22
+ from ._partition import _basic
23
+
24
+ if nam_lst is None:
25
+ nam_lst = ['NH4+', 'SO42-', 'NO3-', 'Cl-', 'NO2', 'HNO3', 'SO2', 'NH3', 'HCl', 'temp']
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, nam_lst=None):
34
+ from ._isoropia import _basic
35
+
36
+ if nam_lst is None:
37
+ nam_lst = ['Na+', 'SO42-', 'NH4+', 'NO3-', 'Cl-', 'Ca2+',
38
+ 'K+', 'Mg2+', 'NH3', 'HNO3', 'HCl', 'RH', 'temp']
39
+
40
+ if self.path_out is None:
41
+ raise ValueError('Please Input "path_out" !!')
42
+
43
+ out = _basic(df_chem, self.path_out, nam_lst=nam_lst)
44
+
45
+ return self, out
46
+
47
+ # OCEC
48
+ @run_process('Chemistry - OC/EC basic', 'ocec_basic')
49
+ def OCEC_basic(self, df_lcres, df_mass=None, ocec_ratio=None, ocec_ratio_month=1, hr_lim=200,
50
+ least_square_range=(0.1, 2.5, 0.1), WISOC_OC_range=(0.2, 0.7, 0.01), ):
51
+ from ._ocec import _basic
52
+
53
+ out = _basic(df_lcres, df_mass, ocec_ratio, ocec_ratio_month, hr_lim, least_square_range, WISOC_OC_range)
54
+
55
+ return self, out
56
+
57
+ # TEOM
58
+ @run_process('Chemistry - TEOM basic', 'teom_basic')
59
+ def TEOM_basic(self, df_teom, df_check=None):
60
+ from ._teom import _basic
61
+
62
+ out = _basic(df_teom, df_check)
63
+
64
+ return self, out
@@ -15,8 +15,8 @@ def _basic(df_che, path_out, nam_lst):
15
15
 
16
16
  df_umol = _ug2umol(df_all)
17
17
 
18
- ## output
19
- ## Na, SO4, NH3, NO3, Cl, Ca, K, Mg, RH, TEMP
18
+ # output
19
+ # Na, SO4, NH3, NO3, Cl, Ca, K, Mg, RH, TEMP
20
20
  df_input = DataFrame(index=index)
21
21
  df_out = DataFrame(index=index)
22
22
 
@@ -26,25 +26,25 @@ def _basic(df_che, path_out, nam_lst):
26
26
  pth_input.unlink(missing_ok=True)
27
27
  pth_output.unlink(missing_ok=True)
28
28
 
29
- ## header
29
+ # header
30
30
  _header = 'Input units (0=umol/m3, 1=ug/m3)\n' + '0\n\n' + \
31
31
  'Problem type (0=forward, 1=reverse); Phase state (0=solid+liquid, 1=metastable)\n' + '0, 1\n\n' + \
32
32
  'NH4-SO4 system case\n'
33
33
 
34
- ## software
34
+ # software
35
35
  path_iso = Path(__file__).parent / 'isrpia2.exe'
36
36
 
37
37
  # make input file and output temp input (without index)
38
- ## NH3
38
+ # NH3
39
39
  df_input['NH3'] = df_umol['NH4+'].fillna(0).copy() + df_umol['NH3']
40
40
 
41
- ## NO3
41
+ # NO3
42
42
  df_input['NO3'] = df_umol['HNO3'].fillna(0).copy() + df_umol['NO3-']
43
43
 
44
- ## Cl
44
+ # Cl
45
45
  df_input['Cl'] = df_umol['HCl'].fillna(0).copy() + df_umol['Cl-']
46
46
 
47
- ## temp, RH
47
+ # temp, RH
48
48
  df_input['RH'] = df_all['RH'] / 100
49
49
  df_input['TEMP'] = df_all['temp'] + 273.15
50
50
 
@@ -52,7 +52,7 @@ def _basic(df_che, path_out, nam_lst):
52
52
 
53
53
  df_input = df_input[['Na', 'SO4', 'NH3', 'NO3', 'Cl', 'Ca', 'K', 'Mg', 'RH', 'TEMP']].fillna('-').copy()
54
54
 
55
- ## output the input data
55
+ # output the input data
56
56
  df_input.to_csv(pth_input, index=False)
57
57
  with (pth_input).open('r+', encoding='utf-8', errors='ignore') as _f:
58
58
  _cont = _f.read()
@@ -68,8 +68,8 @@ def _basic(df_che, path_out, nam_lst):
68
68
  # read dat file and transform to the normal name
69
69
  cond_idx = df_all[['SO42-', 'NH4+', 'NO3-']].dropna().index
70
70
 
71
- with (pth_output).open('r', encoding='utf-8', errors='ignore') as f:
72
- df_res = read_csv(f, delimiter='\s+').apply(to_numeric, errors='coerce').set_index(index)
71
+ with pth_output.open('r', encoding='utf-8', errors='ignore') as f:
72
+ df_res = read_csv(f, delimiter=r'\s+').apply(to_numeric, errors='coerce').set_index(index)
73
73
 
74
74
  df_out['H'] = df_res['HLIQ'] / (df_res['WATER'] / 1000)
75
75
 
@@ -6,7 +6,7 @@ def _basic(df_che, df_ref, df_water, df_density, nam_lst):
6
6
  index = df_all.index.copy()
7
7
  df_all.columns = nam_lst
8
8
 
9
- ## parameter
9
+ # parameter
10
10
  mol_A, mol_S, mol_N = df_all['NH4+'] / 18, df_all['SO42-'] / 96, df_all['NO3-'] / 62
11
11
  df_all['status'] = (mol_A) / (2 * mol_S + mol_N)
12
12
 
@@ -43,7 +43,7 @@ def _basic(df_che, df_ref, df_water, df_density, nam_lst):
43
43
  'EC': 1.80 + 0.72j,
44
44
  },
45
45
 
46
- ## m + kj -> m value is same as 550 current
46
+ # m + kj -> m value is same as 550 current
47
47
  '450': {'ALWC': 1.333 + 0j,
48
48
  'AS': 1.57 + 0j,
49
49
  'AN': 1.57 + 0j,
@@ -54,21 +54,21 @@ def _basic(df_che, df_ref, df_water, df_density, nam_lst):
54
54
  },
55
55
  }
56
56
 
57
- ## mass
58
- ## NH4 Enough
57
+ # mass
58
+ # NH4 Enough
59
59
  df_mass = DataFrame()
60
60
  df_enough = df_all.where(df_all['status'] >= 1).dropna().copy()
61
61
 
62
62
  for _mass_nam, _coe in mass_coe.items():
63
63
  df_mass[_mass_nam] = df_all[convert_nam[_mass_nam]] * _coe
64
64
 
65
- ## NH4 Deficiency
65
+ # NH4 Deficiency
66
66
  defic_idx = df_all['status'] < 1
67
67
 
68
68
  if defic_idx.any():
69
69
  residual = mol_A - 2 * mol_S
70
70
 
71
- ## residual > 0
71
+ # residual > 0
72
72
  _status = residual > 0
73
73
  if _status.any():
74
74
  _cond = _status & (residual <= mol_N)
@@ -77,7 +77,7 @@ def _basic(df_che, df_ref, df_water, df_density, nam_lst):
77
77
  _cond = _status & (residual > mol_N)
78
78
  df_mass.loc[_cond, 'AN'] = mol_N.loc[_cond] * 80
79
79
 
80
- ## residual < 0
80
+ # residual < 0
81
81
  _status = residual <= 0
82
82
  if _status.any():
83
83
  df_mass.loc[_status, 'AN'] = 0
@@ -94,19 +94,19 @@ def _basic(df_che, df_ref, df_water, df_density, nam_lst):
94
94
  qc_ratio = df_mass['total'] / df_ref
95
95
  qc_cond = (qc_ratio >= 0.7) & (qc_ratio <= 1.3)
96
96
 
97
- ## volume
97
+ # volume
98
98
  df_vol = DataFrame()
99
99
  for _vol_nam, _coe in vol_coe.items():
100
100
  df_vol[_vol_nam] = df_mass_cal[_vol_nam] / _coe
101
101
 
102
102
  if df_water is not None:
103
- df_vol['ALWC'] = df_water
103
+ df_vol['ALWC'] = df_water.copy()
104
104
  df_vol = df_vol.dropna()
105
105
  df_vol['total_wet'] = df_vol.sum(axis=1, min_count=6)
106
106
 
107
107
  df_vol['total_dry'] = df_vol[vol_coe.keys()].sum(axis=1, min_count=6)
108
108
 
109
- ## density
109
+ # density
110
110
  df_vol_cal = DataFrame()
111
111
  df_den_rec = df_mass['total'] / df_vol['total_dry']
112
112
  if df_density is not None:
@@ -117,10 +117,10 @@ def _basic(df_che, df_ref, df_water, df_density, nam_lst):
117
117
  df_den_all['OM'] / 1.4 + df_den_all['EC'] / 1.77
118
118
 
119
119
  df_den = df_den_all.sum(axis=1, min_count=6) / df_vol_cal
120
- # df_den = df_den_all.sum(axis=1) / df_vol_cal
121
- # df_den = df_mass['total'].loc[df_den_all.index] / df_vol_cal
120
+ else:
121
+ df_den = df_den_rec
122
122
 
123
- ## refractive index
123
+ # refractive index
124
124
  ri_dic = {}
125
125
  for _lambda, _coe in RI_coe.items():
126
126
 
@@ -138,11 +138,11 @@ def _basic(df_che, df_ref, df_water, df_density, nam_lst):
138
138
 
139
139
  ri_dic[f'RI_{_lambda}'] = df_RI[['RI_dry', 'RI_wet']]
140
140
 
141
- ## mole and equivalent
141
+ # mole and equivalent
142
142
  df_eq = concat((mol_A, mol_S, mol_N, mol_A * 1, mol_S * 2, mol_N * 1), axis=1)
143
143
  df_eq.columns = ['mol_NH4', 'mol_SO4', 'mol_NO3', 'eq_NH4', 'eq_SO4', 'eq_NO3', ]
144
144
 
145
- ## out
145
+ # out
146
146
  out = {'mass': df_mass,
147
147
  'volume': df_vol,
148
148
  'vol_cal': df_vol_cal,
@@ -158,9 +158,6 @@ def _basic(df_che, df_ref, df_water, df_density, nam_lst):
158
158
  return out
159
159
 
160
160
 
161
- # '''
162
-
163
-
164
161
  def mass_ratio(_df):
165
162
  if _df['PM25'] >= _df['total_mass']:
166
163
  _df['others'] = _df['PM25'] - _df['total_mass']
@@ -2,7 +2,7 @@ import numpy as np
2
2
  from pandas import concat, DataFrame
3
3
  from scipy.optimize import curve_fit
4
4
 
5
- from AeroViz.dataProcess.core import _union_index
5
+ from AeroViz.dataProcess.core import union_index
6
6
 
7
7
  __all__ = [
8
8
  '_basic',
@@ -16,7 +16,7 @@ def _min_Rsq(_oc, _ec, _rng):
16
16
 
17
17
  _out_table = DataFrame(_oc_mesh - _val_mesh * _ec_mesh, index=_oc.index, columns=_rng)
18
18
 
19
- ## calculate R2
19
+ # calculate R2
20
20
  _r2_dic = {}
21
21
  _func = lambda _x, _sl, _inte: _sl * _x + _inte
22
22
  for _ocec, _out in _out_table.items():
@@ -30,28 +30,28 @@ def _min_Rsq(_oc, _ec, _rng):
30
30
 
31
31
  _r2_dic[round(_ocec, 3)] = 1. - _rss / _tss
32
32
 
33
- ## get the min R2
33
+ # get the min R2
34
34
  _ratio = DataFrame(_r2_dic, index=[0]).idxmin(axis=1).values[0]
35
35
 
36
36
  return _ratio, _out_table[_ratio]
37
37
 
38
38
 
39
39
  def _ocec_ratio_cal(_nam, _lcres_splt, _hr_lim, _range_, _wisoc_range_):
40
- ## parameter
40
+ # parameter
41
41
  _out = DataFrame(index=_lcres_splt.index)
42
42
  (_, _oc), (_, _ec) = _lcres_splt.items()
43
43
  # _oc, _ec = _lcres_splt['Thermal_OC'], _lcres_splt['Thermal_EC']
44
44
 
45
- ## real data OC/EC
45
+ # real data OC/EC
46
46
  _ocec_ratio_real = (_oc / _ec).quantile(.5)
47
47
 
48
48
  _out[f'OC/EC_real_{_nam}'] = _ocec_ratio_real
49
49
  _out[f'POC_real_{_nam}'] = _ocec_ratio_real * _ec
50
50
  _out[f'SOC_real_{_nam}'] = _oc - _out[f'POC_real_{_nam}']
51
51
 
52
- ## the least R2 method
53
- ## estimated OC/EC
54
- if (len(_lcres_splt) <= _hr_lim):
52
+ # the least R2 method
53
+ # estimated OC/EC
54
+ if len(_lcres_splt) <= _hr_lim:
55
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
56
  print('\t\tPlease Modify the Values of "hour_limit" or Input Sufficient Amount of Data !!')
57
57
 
@@ -60,13 +60,13 @@ def _ocec_ratio_cal(_nam, _lcres_splt, _hr_lim, _range_, _wisoc_range_):
60
60
 
61
61
  return _out
62
62
 
63
- if (len(_lcres_splt.dropna()) == 0):
63
+ if len(_lcres_splt.dropna()) == 0:
64
64
  _out[[f'OC/EC_{_nam}', f'POC_{_nam}', f'SOC_{_nam}', f'WISOC/OC_{_nam}', f'WSOC_{_nam}',
65
65
  f'WISOC_{_nam}']] = np.nan
66
66
 
67
67
  return _out
68
68
 
69
- ## OC/EC
69
+ # OC/EC
70
70
  _ocec_ratio = False
71
71
  _st, _ed, _stp = _range_
72
72
 
@@ -78,12 +78,12 @@ def _ocec_ratio_cal(_nam, _lcres_splt, _hr_lim, _range_, _wisoc_range_):
78
78
 
79
79
  _ocec_ratio, _soc = _min_Rsq(_oc, _ec, _ocec_rng)
80
80
 
81
- ## WISOC
81
+ # WISOC
82
82
  _st, _ed, _stp = _wisoc_range_
83
83
  _wisoc_rng = (np.arange(_st, _ed + _stp, _stp) * _ocec_ratio).round(5)
84
84
  _wisoc_ratio, _wsoc = _min_Rsq(_oc, _ec, _wisoc_rng)
85
85
 
86
- ## out
86
+ # out
87
87
  _out[f'OC/EC_{_nam}'] = _ocec_ratio
88
88
  _out[f'SOC_{_nam}'] = _soc
89
89
  _out[f'POC_{_nam}'] = _oc - _out[f'SOC_{_nam}']
@@ -95,15 +95,16 @@ def _ocec_ratio_cal(_nam, _lcres_splt, _hr_lim, _range_, _wisoc_range_):
95
95
  f'OC/EC_real_{_nam}', f'POC_real_{_nam}', f'SOC_real_{_nam}']]
96
96
 
97
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)
98
+ def _basic(_lcres, _mass, _ocec_ratio, _ocec_ratio_month, _hr_lim, _range, _wisoc_range):
99
+ _lcres, _mass = union_index(_lcres, _mass)
100
100
 
101
101
  _out = {}
102
102
 
103
- ## OC1, OC2, OC3, OC4, PC
104
- _df_bsc = _res / _lcres['Sample_Volume'].to_frame().values.copy()
103
+ # OC1, OC2, OC3, OC4, PC
104
+ _df_bsc = _lcres[['OC1_raw', 'OC2_raw', 'OC3_raw', 'OC4_raw']] / _lcres['Sample_Volume'].to_frame().values.copy()
105
+ _df_bsc.rename(columns={'OC1_raw': 'OC1', 'OC2_raw': 'OC2', 'OC3_raw': 'OC3', 'OC4_raw': 'OC4'}, inplace=True)
105
106
 
106
- ## SOC, POC, OC/EC
107
+ # SOC, POC, OC/EC
107
108
  if _ocec_ratio is not None:
108
109
  try:
109
110
  iter(_ocec_ratio)
@@ -126,7 +127,7 @@ def _basic(_lcres, _res, _mass, _ocec_ratio, _ocec_ratio_month, _hr_lim, _range,
126
127
 
127
128
  _df_bsc = concat((_df_bsc.copy(), _prcs_df), axis=1)
128
129
 
129
- ## ratio
130
+ # ratio
130
131
  _df_ratio = DataFrame(index=_df_bsc.index)
131
132
 
132
133
  for _ky, _val in _df_bsc.items():
@@ -144,41 +145,15 @@ def _basic(_lcres, _res, _mass, _ocec_ratio, _ocec_ratio_month, _hr_lim, _range,
144
145
  _df_ratio[f'Optical_OC/PM'] = _lcres['Optical_OC'] / _mass
145
146
  _df_ratio[f'Optical_EC/PM'] = _lcres['Optical_EC'] / _mass
146
147
 
147
- ## ratio status
148
+ # ratio status
148
149
  _df_bsc = concat((_lcres, _df_bsc.copy()), axis=1)
149
150
 
150
151
  for _ky, _df in _df_ratio.items():
151
152
  _df_bsc[f'{_ky}_status'] = 'Normal'
152
153
  _df_bsc[f'{_ky}_status'] = _df_bsc[f'{_ky}_status'].mask(_df > 1, 'Warning')
153
154
 
154
- ## out
155
+ # out
155
156
  _out['ratio'] = _df_ratio
156
157
  _out['basic'] = _df_bsc
157
158
 
158
159
  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
- # '''
@@ -1,7 +1,8 @@
1
1
  def _basic(_teom, _check):
2
+ import numpy as np
2
3
  _teom['Volatile_Fraction'] = (_teom['PM_Total'] - _teom['PM_NV']) / _teom['PM_Total']
3
4
 
4
- _teom.loc[(_teom['Volatile_Fraction'] < 0) | (_teom['Volatile_Fraction'] > 1)] = n.nan
5
+ _teom.loc[(_teom['Volatile_Fraction'] < 0) | (_teom['Volatile_Fraction'] > 1)] = np.nan
5
6
 
6
7
  if _check is not None:
7
8
  _ratio = _teom['PM_NV'] / _check
@@ -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
@@ -4,13 +4,13 @@ from pathlib import Path
4
4
  import numpy as np
5
5
  from pandas import DataFrame
6
6
 
7
- from AeroViz.dataProcess.core import _union_index
7
+ from AeroViz.dataProcess.core import union_index
8
8
 
9
9
 
10
10
  def _revised(_df_mass, _df_RH):
11
- _df_mass, _df_RH = _union_index(_df_mass, _df_RH)
11
+ _df_mass, _df_RH = union_index(_df_mass, _df_RH)
12
12
 
13
- ## fRH
13
+ # fRH
14
14
  with (Path(__file__).parent / 'fRH.pkl').open('rb') as f:
15
15
  _fRH = pkl.load(f)
16
16
  _fRH.loc[np.nan] = np.nan
@@ -22,19 +22,19 @@ def _revised(_df_mass, _df_RH):
22
22
 
23
23
  return 1, 1, 1, 1
24
24
 
25
- ## different mode
26
- ## mass < 20 :
27
- ## large = mass**2/20
28
- ## small = mass-large
29
- ## mass >= 20 :
30
- ## large = mass
31
- ## small = 0
25
+ # different mode
26
+ # mass < 20 :
27
+ # large = mass**2/20
28
+ # small = mass-large
29
+ # mass >= 20 :
30
+ # large = mass
31
+ # small = 0
32
32
  _df_mode = _df_mass[['AS', 'AN', 'OM']].copy()
33
33
 
34
34
  _df_mass[['L_AS', 'L_AN', 'L_OM']] = _df_mode.mask(_df_mode < 20, _df_mode ** 2 / 20)
35
35
  _df_mass[['S_AS', 'S_AN', 'S_OM']] = _df_mode.values - _df_mass[['L_AS', 'L_AN', 'L_OM']]
36
36
 
37
- ## apply IMPROVE ccoe.
37
+ # apply IMPROVE ccoe.
38
38
  def _ext_cal(_RH=None):
39
39
 
40
40
  _frh, _frhss, _frhs, _frhl = fRH(_RH)
@@ -51,10 +51,8 @@ def _revised(_df_mass, _df_RH):
51
51
 
52
52
  return _df.dropna().reindex(_df_mass.index)
53
53
 
54
- ## calculate
55
- _out = {}
56
-
57
- _out['dry'] = _ext_cal()
54
+ # calculate
55
+ _out = {'dry': _ext_cal()}
58
56
 
59
57
  if _df_RH is not None:
60
58
  _out['wet'] = _ext_cal(_df_RH)
@@ -0,0 +1,47 @@
1
+ from ..core import Writer, run_process
2
+
3
+ __all__ = ['Optical']
4
+
5
+
6
+ class Optical(Writer):
7
+
8
+ @run_process('Optical - scaCoe', 'scaCoe')
9
+ def scaCoe(self, df_sca, instru, specified_band):
10
+ from ._scattering import _scaCoe
11
+
12
+ out = _scaCoe(df_sca, instru=instru, specified_band=[550] if specified_band is None else specified_band)
13
+
14
+ return self, out
15
+
16
+ @run_process('Optical - absCoe', 'absCoe')
17
+ def absCoe(self, df_ae33, instru, specified_band):
18
+ from ._absorption import _absCoe
19
+
20
+ out = _absCoe(df_ae33, instru=instru, specified_band=[550] if specified_band is None else specified_band)
21
+
22
+ return self, out
23
+
24
+ @run_process('Optical - basic', 'opt_basic')
25
+ def basic(self, df_sca, df_abs, df_mass=None, df_no2=None, df_temp=None):
26
+ from ._extinction import _basic
27
+
28
+ out = _basic(df_sca, df_abs, df_mass, df_no2, df_temp)
29
+
30
+ return self, out
31
+
32
+ @run_process('Optical - Mie', 'Mie')
33
+ def Mie(self, df_psd, df_m, wave_length=550):
34
+ from ._mie import _mie
35
+
36
+ out = _mie(df_psd, df_m, wave_length)
37
+
38
+ return self, out
39
+
40
+ @run_process('Optical - IMPROVE', 'IMPROVE')
41
+ def IMPROVE(self, df_mass, df_RH, method='revised'):
42
+ # _fc = __import__(f'_IMPROVE._{method}')
43
+ from ._IMPROVE import _revised
44
+
45
+ out = _revised(df_mass, df_RH)
46
+
47
+ return self, out
@@ -0,0 +1,28 @@
1
+ def _absCoe(df, instru, specified_band: list):
2
+ import numpy as np
3
+ from pandas import concat
4
+ from .Angstrom_exponent import get_Angstrom_exponent, get_species_wavelength
5
+
6
+ band_AE33 = np.array([370, 470, 520, 590, 660, 880, 950])
7
+ band_BC1054 = np.array([370, 430, 470, 525, 565, 590, 660, 700, 880, 950])
8
+
9
+ MAE_AE33 = np.array([18.47, 14.54, 13.14, 11.58, 10.35, 7.77, 7.19]) * 1e-3
10
+ MAE_BC1054 = np.array([18.48, 15.90, 14.55, 13.02, 12.10, 11.59, 10.36, 9.77, 7.77, 7.20]) * 1e-3
11
+
12
+ band = band_AE33 if instru == 'AE33' else band_BC1054
13
+ MAE = MAE_AE33 if instru == 'AE33' else MAE_BC1054
14
+ eBC = 'BC6' if instru == 'AE33' else 'BC9'
15
+
16
+ # calculate
17
+ df_abs = (df.copy().dropna() * MAE).copy()
18
+
19
+ df_out = df_abs.apply(get_species_wavelength, axis=1, result_type='expand', args=(specified_band,))
20
+ df_out.columns = [f'abs_{_band}' for _band in specified_band]
21
+ df_out['eBC'] = df[eBC]
22
+
23
+ df_AAE = df_abs.apply(get_Angstrom_exponent, axis=1, result_type='expand', args=(band,))
24
+ df_AAE.columns = ['AAE', 'AAE_intercept']
25
+ df_AAE = df_AAE.mask((-df_AAE['AAE'] < 0.8) | (-df_AAE['AAE'] > 2.)).copy()
26
+
27
+ _df = concat([df_out, df_AAE['AAE']], axis=1)
28
+ return _df.reindex(df.index)
@@ -0,0 +1,42 @@
1
+ from pandas import DataFrame
2
+
3
+ from AeroViz.dataProcess.core import union_index
4
+
5
+
6
+ def _basic(df_sca, df_abs, df_mass, df_no2, df_temp):
7
+ df_sca, df_abs, df_mass, df_no2, df_temp = union_index(df_sca, df_abs, df_mass, df_no2, df_temp)
8
+
9
+ df_out = DataFrame()
10
+
11
+ # abs and sca coe
12
+ df_out['abs'] = df_abs['abs_550'].copy()
13
+ df_out['sca'] = df_sca['sca_550'].copy()
14
+
15
+ # extinction coe.
16
+ df_out['ext'] = df_out['abs'] + df_out['sca']
17
+
18
+ # SSA
19
+ df_out['SSA'] = df_out['sca'] / df_out['ext']
20
+
21
+ # SAE, AAE, eBC
22
+ df_out['SAE'] = df_sca['SAE'].copy()
23
+ df_out['AAE'] = df_abs['AAE'].copy()
24
+ df_out['eBC'] = df_abs['eBC'].copy() / 1e3
25
+
26
+ # MAE, MSE, MEE
27
+ if df_mass is not None:
28
+ df_out['MAE'] = df_out['abs'] / df_mass
29
+ df_out['MSE'] = df_out['sca'] / df_mass
30
+ df_out['MEE'] = df_out['MSE'] + df_out['MAE']
31
+
32
+ # gas absorbtion
33
+ if df_no2 is not None:
34
+ df_out['abs_gas'] = df_no2 * .33
35
+
36
+ if df_temp is not None:
37
+ df_out['sca_gas'] = (11.4 * 293 / (273 + df_temp))
38
+
39
+ if df_no2 is not None and df_temp is not None:
40
+ df_out['ext_all'] = df_out['ext'] + df_out['abs_gas'] + df_out['sca_gas']
41
+
42
+ return df_out
@@ -1,5 +1,4 @@
1
1
  # from PyMieScatt import Mie_SD
2
- # from PyMieScatt import Mie_SD
3
2
 
4
3
  from ._mie_sd import Mie_SD
5
4