AeroViz 0.1.4__py3-none-any.whl → 0.1.6__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/__init__.py +21 -20
- AeroViz/dataProcess/Chemistry/_isoropia.py +9 -12
- AeroViz/dataProcess/Chemistry/_mass_volume.py +4 -3
- AeroViz/dataProcess/Chemistry/_ocec.py +20 -45
- AeroViz/dataProcess/Chemistry/isrpia2.exe +0 -0
- AeroViz/dataProcess/Optical/_IMPROVE.py +2 -3
- AeroViz/dataProcess/Optical/fRH.pkl +0 -0
- AeroViz/dataProcess/SizeDistr/__init__.py +6 -10
- AeroViz/dataProcess/VOC/__init__.py +1 -6
- AeroViz/dataProcess/VOC/_potential_par.py +71 -37
- AeroViz/dataProcess/VOC/{voc_par.json → support_voc.json} +321 -339
- AeroViz/rawDataReader/__init__.py +52 -5
- AeroViz/rawDataReader/config/supported_instruments.py +45 -53
- AeroViz/rawDataReader/core/__init__.py +113 -98
- AeroViz/rawDataReader/script/AE33.py +3 -3
- AeroViz/rawDataReader/script/AE43.py +2 -2
- AeroViz/rawDataReader/script/APS_3321.py +4 -4
- AeroViz/rawDataReader/script/Aurora.py +5 -2
- AeroViz/rawDataReader/script/BC1054.py +2 -2
- AeroViz/rawDataReader/script/EPA_vertical.py +2 -2
- AeroViz/rawDataReader/script/GRIMM.py +4 -4
- AeroViz/rawDataReader/script/IGAC.py +2 -2
- AeroViz/rawDataReader/script/MA350.py +2 -2
- AeroViz/rawDataReader/script/Minion.py +2 -2
- AeroViz/rawDataReader/script/NEPH.py +9 -14
- AeroViz/rawDataReader/script/{Sunset_OCEC.py → OCEC.py} +24 -18
- AeroViz/rawDataReader/script/SMPS.py +76 -0
- AeroViz/rawDataReader/script/TEOM.py +2 -2
- AeroViz/rawDataReader/script/Table.py +3 -3
- AeroViz/rawDataReader/script/VOC.py +16 -9
- AeroViz/rawDataReader/script/__init__.py +2 -4
- {AeroViz-0.1.4.dist-info → AeroViz-0.1.6.dist-info}/METADATA +13 -10
- {AeroViz-0.1.4.dist-info → AeroViz-0.1.6.dist-info}/RECORD +36 -36
- AeroViz/rawDataReader/script/SMPS_TH.py +0 -41
- AeroViz/rawDataReader/script/SMPS_aim11.py +0 -51
- AeroViz/rawDataReader/script/SMPS_genr.py +0 -51
- {AeroViz-0.1.4.dist-info → AeroViz-0.1.6.dist-info}/LICENSE +0 -0
- {AeroViz-0.1.4.dist-info → AeroViz-0.1.6.dist-info}/WHEEL +0 -0
- {AeroViz-0.1.4.dist-info → AeroViz-0.1.6.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import numpy as
|
|
1
|
+
import numpy as np
|
|
2
2
|
from pandas import to_datetime, read_table
|
|
3
3
|
|
|
4
4
|
from AeroViz.rawDataReader.core import AbstractReader
|
|
@@ -7,8 +7,8 @@ from AeroViz.rawDataReader.core import AbstractReader
|
|
|
7
7
|
class Reader(AbstractReader):
|
|
8
8
|
nam = 'APS_3321'
|
|
9
9
|
|
|
10
|
-
def _raw_reader(self,
|
|
11
|
-
with open(
|
|
10
|
+
def _raw_reader(self, file):
|
|
11
|
+
with open(file, 'r', encoding='utf-8', errors='ignore') as f:
|
|
12
12
|
_df = read_table(f, skiprows=6, parse_dates={'Time': ['Date', 'Start Time']}).set_index('Time')
|
|
13
13
|
_key = list(_df.keys()[3:54]) ## 542 ~ 1981
|
|
14
14
|
|
|
@@ -29,7 +29,7 @@ class Reader(AbstractReader):
|
|
|
29
29
|
# QC data
|
|
30
30
|
def _QC(self, _df):
|
|
31
31
|
# mask out the data size lower than 7
|
|
32
|
-
_df['total'] = _df.sum(axis=1, min_count=1) * (
|
|
32
|
+
_df['total'] = _df.sum(axis=1, min_count=1) * (np.diff(np.log(_df.keys().to_numpy(float)))).mean()
|
|
33
33
|
_df_size = _df['total'].dropna().resample('1h').size().resample(_df.index.freq).ffill()
|
|
34
34
|
_df = _df.mask(_df_size < 7)
|
|
35
35
|
|
|
@@ -6,8 +6,8 @@ from AeroViz.rawDataReader.core import AbstractReader
|
|
|
6
6
|
class Reader(AbstractReader):
|
|
7
7
|
nam = 'Aurora'
|
|
8
8
|
|
|
9
|
-
def _raw_reader(self,
|
|
10
|
-
with
|
|
9
|
+
def _raw_reader(self, file):
|
|
10
|
+
with file.open('r', encoding='utf-8-sig', errors='ignore') as f:
|
|
11
11
|
_df = read_csv(f, low_memory=False, index_col=0)
|
|
12
12
|
|
|
13
13
|
_df.index = to_datetime(_df.index, errors='coerce')
|
|
@@ -33,5 +33,8 @@ class Reader(AbstractReader):
|
|
|
33
33
|
# remove negative value
|
|
34
34
|
_df = _df.mask((_df <= 0) | (_df > 2000)).copy()
|
|
35
35
|
|
|
36
|
+
# total scattering is larger than back scattering
|
|
37
|
+
_df = _df[(_df['BB'] < _df['B']) & (_df['BG'] < _df['G']) & (_df['BR'] < _df['R'])]
|
|
38
|
+
|
|
36
39
|
# QC data in 1h
|
|
37
40
|
return _df.resample('1h').apply(self.basic_QC).resample(self.meta.get("freq")).mean()
|
|
@@ -6,8 +6,8 @@ from AeroViz.rawDataReader.core import AbstractReader
|
|
|
6
6
|
class Reader(AbstractReader):
|
|
7
7
|
nam = 'BC1054'
|
|
8
8
|
|
|
9
|
-
def _raw_reader(self,
|
|
10
|
-
with open(
|
|
9
|
+
def _raw_reader(self, file):
|
|
10
|
+
with open(file, 'r', encoding='utf-8', errors='ignore') as f:
|
|
11
11
|
_df = read_csv(f, parse_dates=True, index_col=0)
|
|
12
12
|
|
|
13
13
|
_df.columns = _df.columns.str.replace(' ', '')
|
|
@@ -7,8 +7,8 @@ from AeroViz.rawDataReader.core import AbstractReader
|
|
|
7
7
|
class Reader(AbstractReader):
|
|
8
8
|
nam = 'EPA_vertical'
|
|
9
9
|
|
|
10
|
-
def _raw_reader(self,
|
|
11
|
-
with
|
|
10
|
+
def _raw_reader(self, file):
|
|
11
|
+
with file.open('r', encoding='ascii', errors='ignore') as f:
|
|
12
12
|
# 有、無輸出有效值都可以
|
|
13
13
|
# read 查詢小時值(測項).csv
|
|
14
14
|
df = read_csv(f, encoding='ascii', encoding_errors='ignore', index_col=0, parse_dates=True,
|
|
@@ -6,19 +6,19 @@ from AeroViz.rawDataReader.core import AbstractReader
|
|
|
6
6
|
class Reader(AbstractReader):
|
|
7
7
|
nam = 'GRIMM'
|
|
8
8
|
|
|
9
|
-
def _raw_reader(self,
|
|
9
|
+
def _raw_reader(self, file):
|
|
10
10
|
|
|
11
|
-
_df = read_csv(
|
|
11
|
+
_df = read_csv(file, header=233, delimiter='\t', index_col=0, parse_dates=[0], encoding='ISO-8859-1',
|
|
12
12
|
dayfirst=True).rename_axis("Time")
|
|
13
13
|
_df.index = to_datetime(_df.index, format="%d/%m/%Y %H:%M:%S", dayfirst=True)
|
|
14
14
|
|
|
15
|
-
if
|
|
15
|
+
if file.name.startswith("A407ST"):
|
|
16
16
|
_df.drop(_df.columns[0:11].tolist() + _df.columns[128:].tolist(), axis=1, inplace=True)
|
|
17
17
|
else:
|
|
18
18
|
_df.drop(_df.columns[0:11].tolist() + _df.columns[-5:].tolist(), axis=1, inplace=True)
|
|
19
19
|
|
|
20
20
|
if _df.empty:
|
|
21
|
-
print(
|
|
21
|
+
print(file, "is empty")
|
|
22
22
|
return None
|
|
23
23
|
|
|
24
24
|
return _df / 0.035
|
|
@@ -10,9 +10,9 @@ from AeroViz.rawDataReader.core import AbstractReader
|
|
|
10
10
|
class Reader(AbstractReader):
|
|
11
11
|
nam = 'IGAC'
|
|
12
12
|
|
|
13
|
-
def _raw_reader(self,
|
|
13
|
+
def _raw_reader(self, file):
|
|
14
14
|
|
|
15
|
-
with
|
|
15
|
+
with file.open('r', encoding='utf-8-sig', errors='ignore') as f:
|
|
16
16
|
_df = read_csv(f, parse_dates=True, index_col=0, na_values='-').apply(to_numeric, errors='coerce')
|
|
17
17
|
|
|
18
18
|
_df.columns = _df.keys().str.strip(' ')
|
|
@@ -6,8 +6,8 @@ from AeroViz.rawDataReader.core import AbstractReader
|
|
|
6
6
|
class Reader(AbstractReader):
|
|
7
7
|
nam = 'MA350'
|
|
8
8
|
|
|
9
|
-
def _raw_reader(self,
|
|
10
|
-
_df = read_csv(
|
|
9
|
+
def _raw_reader(self, file):
|
|
10
|
+
_df = read_csv(file, parse_dates=['Date / time local'], index_col='Date / time local').rename_axis("Time")
|
|
11
11
|
|
|
12
12
|
_df = _df.rename(columns={
|
|
13
13
|
'UV BCc': 'BC1',
|
|
@@ -7,8 +7,8 @@ from AeroViz.rawDataReader.core import AbstractReader
|
|
|
7
7
|
class Reader(AbstractReader):
|
|
8
8
|
nam = 'Minion'
|
|
9
9
|
|
|
10
|
-
def _raw_reader(self,
|
|
11
|
-
with
|
|
10
|
+
def _raw_reader(self, file):
|
|
11
|
+
with file.open('r', encoding='utf-8-sig', errors='ignore') as f:
|
|
12
12
|
_df = read_csv(f, low_memory=False, index_col=0)
|
|
13
13
|
|
|
14
14
|
_df.index = to_datetime(_df.index, errors='coerce')
|
|
@@ -6,8 +6,8 @@ from AeroViz.rawDataReader.core import AbstractReader
|
|
|
6
6
|
class Reader(AbstractReader):
|
|
7
7
|
nam = 'NEPH'
|
|
8
8
|
|
|
9
|
-
def _raw_reader(self,
|
|
10
|
-
with
|
|
9
|
+
def _raw_reader(self, file):
|
|
10
|
+
with file.open('r', encoding='utf-8', errors='ignore') as f:
|
|
11
11
|
_df = read_csv(f, header=None, names=range(11))
|
|
12
12
|
|
|
13
13
|
_df_grp = _df.groupby(0)
|
|
@@ -47,23 +47,15 @@ class Reader(AbstractReader):
|
|
|
47
47
|
return _df.loc[~_df.index.duplicated() & _df.index.notna()]
|
|
48
48
|
|
|
49
49
|
except ValueError:
|
|
50
|
-
group_sizes = _df_grp.size()
|
|
51
|
-
print(group_sizes)
|
|
52
|
-
|
|
53
50
|
# Define valid groups and find invalid indices
|
|
54
|
-
|
|
55
|
-
invalid_indices = _df[~_df[0].isin(valid_groups)].index
|
|
56
|
-
|
|
57
|
-
# Print invalid indices and values
|
|
51
|
+
invalid_indices = _df[~_df[0].isin({'B', 'G', 'R', 'D', 'T', 'Y', 'Z'})].index
|
|
58
52
|
print("Invalid values and their indices:")
|
|
59
|
-
for idx in invalid_indices
|
|
60
|
-
print(f"Index: {idx}, Value: {_df.at[idx, 0]}")
|
|
53
|
+
print("\n".join([f"Index: {idx}, Value: {_df.at[idx, 0]}" for idx in invalid_indices]))
|
|
61
54
|
|
|
62
55
|
# Return an empty DataFrame with specified columns if there's a length mismatch
|
|
63
|
-
|
|
64
|
-
_df_out = DataFrame(index=_idx_tm, columns=columns)
|
|
56
|
+
_df_out = DataFrame(index=_idx_tm, columns=['B', 'G', 'R', 'BB', 'BG', 'BR', 'RH'])
|
|
65
57
|
_df_out.index.name = 'Time'
|
|
66
|
-
print(f'\n\t\t\t Length mismatch in {
|
|
58
|
+
print(f'\n\t\t\t Length mismatch in {file} data. Returning an empty DataFrame.')
|
|
67
59
|
return _df_out
|
|
68
60
|
|
|
69
61
|
# QC data
|
|
@@ -71,5 +63,8 @@ class Reader(AbstractReader):
|
|
|
71
63
|
# remove negative value
|
|
72
64
|
_df = _df.mask((_df <= 5).copy())
|
|
73
65
|
|
|
66
|
+
# total scattering is larger than back scattering
|
|
67
|
+
_df = _df[(_df['BB'] < _df['B']) & (_df['BG'] < _df['G']) & (_df['BR'] < _df['R'])]
|
|
68
|
+
|
|
74
69
|
# QC data in 1h
|
|
75
70
|
return _df.resample('1h').apply(self.basic_QC).resample(self.meta.get("freq")).mean()
|
|
@@ -4,40 +4,46 @@ from AeroViz.rawDataReader.core import AbstractReader
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class Reader(AbstractReader):
|
|
7
|
-
nam = '
|
|
7
|
+
nam = 'OCEC'
|
|
8
8
|
|
|
9
|
-
def _raw_reader(self,
|
|
10
|
-
with open(
|
|
11
|
-
_df = read_csv(f, skiprows=3)
|
|
9
|
+
def _raw_reader(self, file):
|
|
10
|
+
with open(file, 'r', encoding='utf-8', errors='ignore') as f:
|
|
11
|
+
_df = read_csv(f, skiprows=3, nrows=25)
|
|
12
12
|
|
|
13
13
|
_df['Start Date/Time'] = _df['Start Date/Time'].str.strip()
|
|
14
14
|
_df['time'] = to_datetime(_df['Start Date/Time'], format='%m/%d/%Y %I:%M:%S %p', errors='coerce')
|
|
15
15
|
_df = _df.set_index('time')
|
|
16
|
+
_df.index = _df.index.round('1h')
|
|
16
17
|
|
|
17
18
|
_df = _df.rename(columns={
|
|
18
19
|
'Thermal/Optical OC (ugC/LCm^3)': 'Thermal_OC',
|
|
19
|
-
'OC ugC/m^3 (Thermal/Optical)': 'Thermal_OC',
|
|
20
|
-
|
|
21
20
|
'Thermal/Optical EC (ugC/LCm^3)': 'Thermal_EC',
|
|
22
|
-
'EC ugC/m^3 (Thermal/Optical)': 'Thermal_EC',
|
|
23
|
-
|
|
24
21
|
'OC=TC-BC (ugC/LCm^3)': 'Optical_OC',
|
|
25
|
-
'OC by diff ugC (TC-OptEC)': 'Optical_OC',
|
|
26
|
-
|
|
27
22
|
'BC (ugC/LCm^3)': 'Optical_EC',
|
|
23
|
+
'TC (ugC/LCm^3)': 'TC',
|
|
24
|
+
|
|
25
|
+
'OC ugC/m^3 (Thermal/Optical)': 'Thermal_OC',
|
|
26
|
+
'EC ugC/m^3 (Thermal/Optical)': 'Thermal_EC',
|
|
27
|
+
'OC by diff ugC (TC-OptEC)': 'Optical_OC',
|
|
28
28
|
'OptEC ugC/m^3': 'Optical_EC',
|
|
29
|
+
'TC ugC/m^3': 'TC',
|
|
29
30
|
|
|
30
31
|
'Sample Volume Local Condition Actual m^3': 'Sample_Volume',
|
|
31
|
-
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
32
|
+
|
|
33
|
+
'OCPk1-ug C': 'OC1_raw',
|
|
34
|
+
'OCPk2-ug C': 'OC2_raw',
|
|
35
|
+
'OCPk3-ug C': 'OC3_raw',
|
|
36
|
+
'OCPk4-ug C': 'OC4_raw',
|
|
37
|
+
'ECPk1-ug C': 'EC1_raw',
|
|
38
|
+
'ECPk2-ug C': 'EC2_raw',
|
|
39
|
+
'ECPk3-ug C': 'EC3_raw',
|
|
40
|
+
'ECPk4-ug C': 'EC4_raw',
|
|
41
|
+
'ECPk5-ug C': 'EC5_raw',
|
|
38
42
|
})
|
|
39
43
|
|
|
40
|
-
_df = _df[['Thermal_OC', 'Optical_OC', 'Thermal_EC', 'Optical_EC', 'TC', '
|
|
44
|
+
_df = _df[['Thermal_OC', 'Optical_OC', 'Thermal_EC', 'Optical_EC', 'TC', 'Sample_Volume',
|
|
45
|
+
'OC1_raw', 'OC2_raw', 'OC3_raw', 'OC4_raw', 'EC1_raw', 'EC2_raw', 'EC3_raw', 'EC4_raw',
|
|
46
|
+
'EC5_raw']]
|
|
41
47
|
|
|
42
48
|
return _df.loc[~_df.index.duplicated() & _df.index.notna()]
|
|
43
49
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import csv
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
from pandas import to_datetime, to_numeric, read_csv, isna
|
|
5
|
+
|
|
6
|
+
from AeroViz.rawDataReader.core import AbstractReader
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def find_header_row(file_obj, delimiter):
|
|
10
|
+
csv_reader = csv.reader(file_obj, delimiter=delimiter)
|
|
11
|
+
for skip, row in enumerate(csv_reader):
|
|
12
|
+
if row and (row[0] in ['Sample #', 'Scan Number']):
|
|
13
|
+
return skip
|
|
14
|
+
raise ValueError("Header row not found")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def parse_date(df, date_format):
|
|
18
|
+
if 'Date' in df.columns and 'Start Time' in df.columns:
|
|
19
|
+
return to_datetime(df['Date'] + ' ' + df['Start Time'], format=date_format, errors='coerce')
|
|
20
|
+
elif 'DateTime Sample Start' in df.columns:
|
|
21
|
+
return to_datetime(df['DateTime Sample Start'], format=date_format, errors='coerce')
|
|
22
|
+
else:
|
|
23
|
+
raise ValueError("Expected date columns not found")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class Reader(AbstractReader):
|
|
27
|
+
nam = 'SMPS'
|
|
28
|
+
|
|
29
|
+
def _raw_reader(self, file):
|
|
30
|
+
with open(file, 'r', encoding='utf-8', errors='ignore') as f:
|
|
31
|
+
if file.suffix.lower() == '.txt':
|
|
32
|
+
delimiter, date_formats = '\t', ['%m/%d/%y %X', '%m/%d/%Y %X']
|
|
33
|
+
else: # csv
|
|
34
|
+
delimiter, date_formats = ',', ['%d/%m/%Y %X']
|
|
35
|
+
|
|
36
|
+
skip = find_header_row(f, delimiter)
|
|
37
|
+
f.seek(0)
|
|
38
|
+
|
|
39
|
+
_df = read_csv(f, sep=delimiter, skiprows=skip)
|
|
40
|
+
|
|
41
|
+
for date_format in date_formats:
|
|
42
|
+
_time_index = parse_date(_df, date_format)
|
|
43
|
+
if not isna(_time_index).all():
|
|
44
|
+
break
|
|
45
|
+
else:
|
|
46
|
+
raise ValueError("Unable to parse dates with given formats")
|
|
47
|
+
|
|
48
|
+
# sequence the data
|
|
49
|
+
numeric_cols = [col for col in _df.columns if col.strip().replace('.', '').isdigit()]
|
|
50
|
+
numeric_cols.sort(key=lambda x: float(x.strip()))
|
|
51
|
+
|
|
52
|
+
_df.index = _time_index
|
|
53
|
+
_df.index.name = 'time'
|
|
54
|
+
|
|
55
|
+
_df_smps = _df[numeric_cols]
|
|
56
|
+
_df_smps.columns = _df_smps.columns.astype(float)
|
|
57
|
+
|
|
58
|
+
return _df_smps.apply(to_numeric, errors='coerce')
|
|
59
|
+
|
|
60
|
+
# QC data
|
|
61
|
+
def _QC(self, _df):
|
|
62
|
+
|
|
63
|
+
# mask out the data size lower than 7
|
|
64
|
+
_df['total'] = _df.sum(axis=1, min_count=1) * (np.diff(np.log(_df.keys().to_numpy(float)))).mean()
|
|
65
|
+
_df_size = _df['total'].dropna().resample('1h').size().resample(_df.index.freq).ffill()
|
|
66
|
+
_df = _df.mask(_df_size < 7)
|
|
67
|
+
|
|
68
|
+
# remove total conc. lower than 2000
|
|
69
|
+
_df = _df.mask(_df['total'] < 2000)
|
|
70
|
+
|
|
71
|
+
# remove the bin over 400 nm which num. conc. larger than 4000
|
|
72
|
+
_df_remv_ky = _df.keys()[:-2][_df.keys()[:-2] >= 400.]
|
|
73
|
+
|
|
74
|
+
_df[_df_remv_ky] = _df[_df_remv_ky].copy().mask(_df[_df_remv_ky] > 4000.)
|
|
75
|
+
|
|
76
|
+
return _df[_df.keys()[:-1]]
|
|
@@ -6,8 +6,8 @@ from AeroViz.rawDataReader.core import AbstractReader
|
|
|
6
6
|
class Reader(AbstractReader):
|
|
7
7
|
nam = 'TEOM'
|
|
8
8
|
|
|
9
|
-
def _raw_reader(self,
|
|
10
|
-
with open(
|
|
9
|
+
def _raw_reader(self, file):
|
|
10
|
+
with open(file, 'r', encoding='utf-8', errors='ignore') as f:
|
|
11
11
|
_df = read_csv(f, skiprows=3, index_col=False)
|
|
12
12
|
|
|
13
13
|
_df = _df.rename(columns={'Time Stamp': 'time',
|
|
@@ -8,11 +8,11 @@ from AeroViz.rawDataReader.core import AbstractReader
|
|
|
8
8
|
class Reader(AbstractReader):
|
|
9
9
|
nam = 'Table'
|
|
10
10
|
|
|
11
|
-
def _raw_reader(self,
|
|
12
|
-
with
|
|
11
|
+
def _raw_reader(self, file):
|
|
12
|
+
with file.open('r', encoding='utf-8-sig', errors='ignore') as f:
|
|
13
13
|
_df = read_csv(f, low_memory=False, index_col=0)
|
|
14
14
|
|
|
15
|
-
_df.index = to_datetime(_df.index, errors='coerce'
|
|
15
|
+
_df.index = to_datetime(_df.index, errors='coerce')
|
|
16
16
|
_df.index.name = 'time'
|
|
17
17
|
|
|
18
18
|
_df.columns = _df.keys().str.strip(' ')
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
from pandas import read_csv
|
|
3
2
|
|
|
4
3
|
from AeroViz.rawDataReader.core import AbstractReader
|
|
@@ -7,20 +6,28 @@ from AeroViz.rawDataReader.core import AbstractReader
|
|
|
7
6
|
class Reader(AbstractReader):
|
|
8
7
|
nam = 'VOC'
|
|
9
8
|
|
|
10
|
-
def _raw_reader(self,
|
|
11
|
-
with
|
|
12
|
-
_df = read_csv(f, parse_dates=
|
|
9
|
+
def _raw_reader(self, file):
|
|
10
|
+
with file.open('r', encoding='utf-8-sig', errors='ignore') as f:
|
|
11
|
+
_df = read_csv(f, parse_dates=True, index_col=0, na_values=('-', 'N.D.'))
|
|
13
12
|
|
|
14
13
|
_df.columns = _df.keys().str.strip(' ')
|
|
15
14
|
_df.index.name = 'time'
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
support_voc = set(self.meta["key"])
|
|
17
|
+
|
|
18
|
+
valid_keys = [key for key in _df.keys() if key in support_voc]
|
|
19
|
+
invalid_keys = [key for key in _df.keys() if key not in support_voc]
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
if invalid_keys:
|
|
22
|
+
self.logger.warning(f'{invalid_keys} are not supported keys.')
|
|
23
|
+
print(f'\n\t{invalid_keys} are not supported keys.'
|
|
24
|
+
f'\n\tPlease check the\033[91m support_voc.md\033[0m file to use the correct name.')
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
if valid_keys:
|
|
27
|
+
return _df[valid_keys].loc[~_df.index.duplicated() & _df.index.notna()]
|
|
28
|
+
else:
|
|
29
|
+
self.logger.warning("沒有找到匹配的鍵。返回原始DataFrame並移除含NaN的行。")
|
|
30
|
+
return _df.loc[~_df.index.duplicated() & _df.index.notna()]
|
|
24
31
|
|
|
25
32
|
def _QC(self, _df):
|
|
26
33
|
return _df
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
__all__ = [
|
|
2
2
|
'NEPH',
|
|
3
3
|
'Aurora',
|
|
4
|
-
'
|
|
5
|
-
'SMPS_genr',
|
|
6
|
-
'SMPS_aim11',
|
|
4
|
+
'SMPS',
|
|
7
5
|
'APS_3321',
|
|
8
6
|
'GRIMM',
|
|
9
7
|
'AE33',
|
|
@@ -11,7 +9,7 @@ __all__ = [
|
|
|
11
9
|
'BC1054',
|
|
12
10
|
'MA350',
|
|
13
11
|
'TEOM',
|
|
14
|
-
'
|
|
12
|
+
'OCEC',
|
|
15
13
|
'IGAC',
|
|
16
14
|
'VOC',
|
|
17
15
|
'Table',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: AeroViz
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
4
4
|
Summary: Aerosol science
|
|
5
5
|
Home-page: https://github.com/Alex870521/AeroViz
|
|
6
6
|
Author: alex
|
|
@@ -11,14 +11,15 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Requires-Python: >=3.12
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Requires-Dist: pandas
|
|
15
|
-
Requires-Dist: numpy
|
|
16
|
-
Requires-Dist: matplotlib
|
|
17
|
-
Requires-Dist:
|
|
18
|
-
Requires-Dist:
|
|
19
|
-
Requires-Dist: scikit-learn
|
|
20
|
-
Requires-Dist: windrose
|
|
21
|
-
Requires-Dist: tabulate
|
|
14
|
+
Requires-Dist: pandas ==2.2.2
|
|
15
|
+
Requires-Dist: numpy ==1.26.4
|
|
16
|
+
Requires-Dist: matplotlib ==3.8.4
|
|
17
|
+
Requires-Dist: scipy ==1.14.0
|
|
18
|
+
Requires-Dist: seaborn ==0.13.2
|
|
19
|
+
Requires-Dist: scikit-learn ==1.5.1
|
|
20
|
+
Requires-Dist: windrose ==1.9.2
|
|
21
|
+
Requires-Dist: tabulate ==0.9.0
|
|
22
|
+
Requires-Dist: rich ~=13.7.1
|
|
22
23
|
|
|
23
24
|
## <div align="center">AeroViz for Aerosol Science Visualization</div>
|
|
24
25
|
|
|
@@ -52,13 +53,15 @@ Requires-Dist: tabulate
|
|
|
52
53
|
## <div align="center">Installation</div>
|
|
53
54
|
|
|
54
55
|
```bash
|
|
55
|
-
pip install AeroViz
|
|
56
|
+
pip install AeroViz
|
|
56
57
|
```
|
|
57
58
|
|
|
58
59
|
## <div align="center">Usage</div>
|
|
59
60
|
|
|
60
61
|
```python
|
|
61
62
|
import AeroViz
|
|
63
|
+
|
|
64
|
+
from AeroViz import RawDataReader, DataProcess, plot
|
|
62
65
|
```
|
|
63
66
|
|
|
64
67
|
## <div align="center">RawDataReader Supported Instruments</div>
|
|
@@ -2,23 +2,25 @@ AeroViz/__init__.py,sha256=A5W6SR71uY_eW44Sh-Yk6blJQ_G1aHrkSzeP2YTPQc4,371
|
|
|
2
2
|
AeroViz/data/DEFAULT_DATA.csv,sha256=eeeyeh8vSLKkE5tAF0TYnUNOyQIH98VA41bJaAP204Y,2248526
|
|
3
3
|
AeroViz/data/DEFAULT_PNSD_DATA.csv,sha256=imLvLA80oYwo_jzXZtlQn5hZ76d47HUIlK2jp0tZPrg,2636511
|
|
4
4
|
AeroViz/dataProcess/__init__.py,sha256=D3rTVUiGfs_daGuaotVtbijOgLAp6HaRWchj-zoEnHw,828
|
|
5
|
-
AeroViz/dataProcess/Chemistry/__init__.py,sha256=
|
|
5
|
+
AeroViz/dataProcess/Chemistry/__init__.py,sha256=fyyomjxkQcUNWDx4R5jPrHafAftN-v2liUZii9OlaiU,2058
|
|
6
6
|
AeroViz/dataProcess/Chemistry/_calculate.py,sha256=q7ojTFPok0vg8k_1PMECNdP5CPanR9NWQ4Rx5iTcHew,599
|
|
7
|
-
AeroViz/dataProcess/Chemistry/_isoropia.py,sha256=
|
|
8
|
-
AeroViz/dataProcess/Chemistry/_mass_volume.py,sha256=
|
|
9
|
-
AeroViz/dataProcess/Chemistry/_ocec.py,sha256=
|
|
7
|
+
AeroViz/dataProcess/Chemistry/_isoropia.py,sha256=3wp_FXdN230awlStMbctutwld4oot9WaAVXETGd6PSs,3255
|
|
8
|
+
AeroViz/dataProcess/Chemistry/_mass_volume.py,sha256=0joH2BAx0NUwDFzyrLgG-v7WrGl46R7zWxwbajWBV8o,5378
|
|
9
|
+
AeroViz/dataProcess/Chemistry/_ocec.py,sha256=gqDTs9rOyr0RXdN1Nrxv6Vgvh04IFgHwk4gAJUgZZGc,5437
|
|
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
|
|
13
|
+
AeroViz/dataProcess/Chemistry/isrpia2.exe,sha256=xFYPTXHSjl_-atmVcTmqqOkTZgUn1p8h-kFMcoGMIQw,1560032
|
|
13
14
|
AeroViz/dataProcess/Optical/Angstrom_exponent.py,sha256=KSGM_hf2oUPsLoLuhYSRDK5zdekwce9KgqhzRnf2Y4g,706
|
|
14
|
-
AeroViz/dataProcess/Optical/_IMPROVE.py,sha256=
|
|
15
|
+
AeroViz/dataProcess/Optical/_IMPROVE.py,sha256=n3uHUQTivckIrNlbE8rP7lPZGcMWZUAnS_qX8pXd55Q,1670
|
|
15
16
|
AeroViz/dataProcess/Optical/__init__.py,sha256=h_IYhaum0DhK7Qw6lWFvjAEv7uAqLVVPEwU0V4hJnX4,1371
|
|
16
17
|
AeroViz/dataProcess/Optical/_absorption.py,sha256=pYHIoj_R23wKvxR4acUqqU9JXKY40wgsFvZH78rETrY,1234
|
|
17
18
|
AeroViz/dataProcess/Optical/_extinction.py,sha256=anUemSXmLvJi2CSxqTYgQCgUW4pSUqgZ0q0xZ4zs0zY,1189
|
|
18
19
|
AeroViz/dataProcess/Optical/_mie.py,sha256=K_I8NqRStCdExRVxq2rX5hQdvYmfKuu9JCkNtL1OzfE,352
|
|
19
20
|
AeroViz/dataProcess/Optical/_mie_sd.py,sha256=cbWSorfG-l92csaXsZJ7005f8ij2H_VZopIhNPCwx70,4812
|
|
20
21
|
AeroViz/dataProcess/Optical/_scattering.py,sha256=w5xXXOfafV9a_dXY60YqTyzFDZppjBJeLcKl5PeCQe4,961
|
|
21
|
-
AeroViz/dataProcess/
|
|
22
|
+
AeroViz/dataProcess/Optical/fRH.pkl,sha256=PhJ-BYTaUDjl2Lp5Wz0zeiLQCzrsNdq8nP7Jd1BXyXE,4528
|
|
23
|
+
AeroViz/dataProcess/SizeDistr/__init__.py,sha256=fka1IJW4wZzYWE9HjWi8i03ab0JLFXOUdaHWYs4VHEQ,2172
|
|
22
24
|
AeroViz/dataProcess/SizeDistr/__merge.py,sha256=A-ZmduUA9a0nVM8szhG1AWhsfUPu2UhGIaqFLcmg7Lk,9422
|
|
23
25
|
AeroViz/dataProcess/SizeDistr/_merge.py,sha256=CyZwUc2M4lL-OE74e8mXq41nC6X0LJTAV8TwpO3fS2o,9176
|
|
24
26
|
AeroViz/dataProcess/SizeDistr/_merge_v1.py,sha256=6Anb8DszoatK66tc9ccA6ZApbqtL7pZRPR5TKHj-Tbs,9526
|
|
@@ -26,9 +28,9 @@ AeroViz/dataProcess/SizeDistr/_merge_v2.py,sha256=8OzUKw7hTg-yuQBipuFKgBS_7c7zbA
|
|
|
26
28
|
AeroViz/dataProcess/SizeDistr/_merge_v3.py,sha256=HN2ARFmeWOawOWRPPv_pHEGBBZNgXVbH4dDTxcN7rdY,18749
|
|
27
29
|
AeroViz/dataProcess/SizeDistr/_merge_v4.py,sha256=b8RVAievGIOLrmJHJXRsKXQ1tkMkm6rx43S7XAfeXE4,16228
|
|
28
30
|
AeroViz/dataProcess/SizeDistr/_size_distr.py,sha256=o5fTwLH7j9j5129e3uciSJrOR8AGCN3tkAyGffoPENg,3127
|
|
29
|
-
AeroViz/dataProcess/VOC/__init__.py,sha256=
|
|
30
|
-
AeroViz/dataProcess/VOC/_potential_par.py,sha256=
|
|
31
|
-
AeroViz/dataProcess/VOC/
|
|
31
|
+
AeroViz/dataProcess/VOC/__init__.py,sha256=8GNP0RMymTkJXK18pSgfLHqrKPWboN-3x1_Ke4UrI44,259
|
|
32
|
+
AeroViz/dataProcess/VOC/_potential_par.py,sha256=h3rVdvtBvC6xHa_ZG4Oq5eXezeSZtHNy6T6I40maIcM,3863
|
|
33
|
+
AeroViz/dataProcess/VOC/support_voc.json,sha256=tMYp_NERqhSriVRE2NavXh33CQ5CnsbJHtmMFlE5q_E,6804
|
|
32
34
|
AeroViz/dataProcess/core/__init__.py,sha256=FhGwqlP8ZwXZQS0LjH0YOz2g1Q2yJniUUhRZ_jDOQ6k,2707
|
|
33
35
|
AeroViz/plot/__init__.py,sha256=BxoarxAeDHNdMHizS1bCTwV8NEuUCgeDB75GbSEsNWs,394
|
|
34
36
|
AeroViz/plot/bar.py,sha256=cSPKJLWGifCzICCZVPcbZtrDrea_AStlwSli9-b-lsA,4246
|
|
@@ -77,36 +79,34 @@ AeroViz/process/script/PSD.py,sha256=unSvyHp1RqgQecY-Lab-wRFGP2u45blSO4NCNTaxcRQ
|
|
|
77
79
|
AeroViz/process/script/PSD_dry.py,sha256=P9rSQVA78jHXrY2bDiC1iQvG0w9Js8QiBNfooPOXzfY,3269
|
|
78
80
|
AeroViz/process/script/__init__.py,sha256=QExUHHK79oiwZXvk8u00P8rLwWhGOc1fpZY2Fx8Vkxg,188
|
|
79
81
|
AeroViz/process/script/retrieve_RI.py,sha256=9OQJU1w6VzVqKz00e9GdWswRAnaETe_1meAHp5N_s54,2711
|
|
80
|
-
AeroViz/rawDataReader/__init__.py,sha256=
|
|
82
|
+
AeroViz/rawDataReader/__init__.py,sha256=jXLrf0A-Hxufw-IQp0-Nyci4PszWk5YU4SnpH4ob1RE,3862
|
|
81
83
|
AeroViz/rawDataReader/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
82
|
-
AeroViz/rawDataReader/config/supported_instruments.py,sha256=
|
|
83
|
-
AeroViz/rawDataReader/core/__init__.py,sha256=
|
|
84
|
-
AeroViz/rawDataReader/script/AE33.py,sha256=
|
|
85
|
-
AeroViz/rawDataReader/script/AE43.py,sha256
|
|
86
|
-
AeroViz/rawDataReader/script/APS_3321.py,sha256=
|
|
87
|
-
AeroViz/rawDataReader/script/Aurora.py,sha256=
|
|
88
|
-
AeroViz/rawDataReader/script/BC1054.py,sha256=
|
|
89
|
-
AeroViz/rawDataReader/script/EPA_vertical.py,sha256=
|
|
90
|
-
AeroViz/rawDataReader/script/GRIMM.py,sha256=
|
|
91
|
-
AeroViz/rawDataReader/script/IGAC.py,sha256=
|
|
92
|
-
AeroViz/rawDataReader/script/MA350.py,sha256=
|
|
93
|
-
AeroViz/rawDataReader/script/Minion.py,sha256=
|
|
94
|
-
AeroViz/rawDataReader/script/NEPH.py,sha256=
|
|
95
|
-
AeroViz/rawDataReader/script/
|
|
96
|
-
AeroViz/rawDataReader/script/
|
|
97
|
-
AeroViz/rawDataReader/script/
|
|
98
|
-
AeroViz/rawDataReader/script/
|
|
99
|
-
AeroViz/rawDataReader/script/
|
|
100
|
-
AeroViz/rawDataReader/script/
|
|
101
|
-
AeroViz/rawDataReader/script/VOC.py,sha256=tl6rzqfVU5ofa2R3Ax-_1i37Lno9rUuMhlylPObYFFY,716
|
|
102
|
-
AeroViz/rawDataReader/script/__init__.py,sha256=UndjtWjvJHMma7WtArL5sF9UHiQsanx5sT2otQDqzng,270
|
|
84
|
+
AeroViz/rawDataReader/config/supported_instruments.py,sha256=iE2dqnAhXsHUeVfho5vYYcXL97fg_xt3VvvYcyxCU48,4408
|
|
85
|
+
AeroViz/rawDataReader/core/__init__.py,sha256=W_RwJZmMCTjTwWiTSxcXFhkasO3cyQWEPSdA7-ymeqU,11058
|
|
86
|
+
AeroViz/rawDataReader/script/AE33.py,sha256=Nv0u0w_V50sDjsLh17ZkNT6A75TjIo2A1O6GYc4zkJg,1107
|
|
87
|
+
AeroViz/rawDataReader/script/AE43.py,sha256=Qq9MdiBKzDuKIEFPanmn7wUbkN5VeSTG6Dopw8i0W90,1056
|
|
88
|
+
AeroViz/rawDataReader/script/APS_3321.py,sha256=x75G72Xl0vElr6Njbv8SlOcosAHNozseaJzAxVmfXyI,1697
|
|
89
|
+
AeroViz/rawDataReader/script/Aurora.py,sha256=b0XPs2gc_2UJj4HnOHwW7o255zsCPp459goaDqeAJA8,1387
|
|
90
|
+
AeroViz/rawDataReader/script/BC1054.py,sha256=QGU1SRDoE8e4yNXUX7RsdK5zh72fNd2Q0IpUy7iFzrg,1486
|
|
91
|
+
AeroViz/rawDataReader/script/EPA_vertical.py,sha256=MpcbOzbigivsuldCxzn_B6POtQMzahGQhM_sWRDVP9s,1669
|
|
92
|
+
AeroViz/rawDataReader/script/GRIMM.py,sha256=s2z3aNfpPOd_07Zl8jbHa7CxsR2EjrtoZw_HRjR5ykc,946
|
|
93
|
+
AeroViz/rawDataReader/script/IGAC.py,sha256=BDhmsNy02EvLY0sd75NM6XvLGVTEJlxyQQbprhdFQmU,2948
|
|
94
|
+
AeroViz/rawDataReader/script/MA350.py,sha256=YRY19R2V6nyHMpGMOLVZvK8_41OCCzdTcSnuZR-OJsU,1287
|
|
95
|
+
AeroViz/rawDataReader/script/Minion.py,sha256=c128ZkkxakV6wq1k9NtEq0scdi1mh9Mn0jhQFqz_uVE,3940
|
|
96
|
+
AeroViz/rawDataReader/script/NEPH.py,sha256=OSDtbJ4sujtnf3bzbENXoyJwA-RIeOkPXNCEJ6MvkPQ,2735
|
|
97
|
+
AeroViz/rawDataReader/script/OCEC.py,sha256=t3N_bs5RishlfzFqxTSfMlemZBDIco6cKZ4mU0j9_6g,2315
|
|
98
|
+
AeroViz/rawDataReader/script/SMPS.py,sha256=RnqysTWNaFautGnyPKZgMjdtPdauv9Mqu9IpuTEGpXs,2706
|
|
99
|
+
AeroViz/rawDataReader/script/TEOM.py,sha256=Hx_DDnvGSfSl9cgIVmuf4VmphaFfNCY60mqPWoLmNvw,1796
|
|
100
|
+
AeroViz/rawDataReader/script/Table.py,sha256=othBoQSFVcjfWX0_Q4y8BkjCBc5CihvC6LyrhyJWywk,800
|
|
101
|
+
AeroViz/rawDataReader/script/VOC.py,sha256=sUn3ba_iYQ8Uy8qKNI-6qb1YvHsKN4G6BosBnLLMctc,1269
|
|
102
|
+
AeroViz/rawDataReader/script/__init__.py,sha256=EXLjVwKN-wr3pMi-ILjiPH86ojwfoIif5vG2Q__DGZc,225
|
|
103
103
|
AeroViz/tools/__init__.py,sha256=tPUmCI9Fi1LgE-QSVnzan5jRdYQBIENH9PRDXB_DhTw,109
|
|
104
104
|
AeroViz/tools/database.py,sha256=05VzjJyhlRrhsZdhfFQ__7CxGm4MdFekLjz3_Is5h9U,3430
|
|
105
105
|
AeroViz/tools/dataclassifier.py,sha256=_wpv0PlZ5EGkcNqHxfFtdEsYvHP5FVE8sMZXikhm_YE,4492
|
|
106
106
|
AeroViz/tools/dataprinter.py,sha256=Jq2Yztpa9YCOeLDVTrRs7PhSdNIPhEAexVj1YSuJ7hY,2249
|
|
107
107
|
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.
|
|
108
|
+
AeroViz-0.1.6.dist-info/LICENSE,sha256=E-679GpGGkp3irmtuJXiT7R4cNUA4cmsH6Q7QUgPf5U,1069
|
|
109
|
+
AeroViz-0.1.6.dist-info/METADATA,sha256=Fp-P1AKOfLLX0c46uZms4TfEQ5ImonxFHThq5oHFs4c,5434
|
|
110
|
+
AeroViz-0.1.6.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
|
|
111
|
+
AeroViz-0.1.6.dist-info/top_level.txt,sha256=BYsmTst_o4FZOKRP1XIvIMlN6mMTTXNfnSToL2_nVbQ,8
|
|
112
|
+
AeroViz-0.1.6.dist-info/RECORD,,
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
from pandas import to_datetime, read_table
|
|
2
|
-
|
|
3
|
-
from AeroViz.rawDataReader.core import AbstractReader
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class Reader(AbstractReader):
|
|
7
|
-
nam = 'SMPS_TH'
|
|
8
|
-
|
|
9
|
-
def _raw_reader(self, _file):
|
|
10
|
-
with open(_file, 'r', encoding='utf-8', errors='ignore') as f:
|
|
11
|
-
_df = read_table(f, skiprows=18, parse_dates={'Time': ['Date', 'Start Time']}).set_index('Time')
|
|
12
|
-
_key = list(_df.keys()[6:-26])
|
|
13
|
-
|
|
14
|
-
_newkey = {}
|
|
15
|
-
for _k in _key:
|
|
16
|
-
_newkey[_k] = float(_k).__round__(4)
|
|
17
|
-
|
|
18
|
-
# _newkey['Total Conc.(#/cm)'] = 'total'
|
|
19
|
-
# _newkey['Mode(nm)'] = 'mode'
|
|
20
|
-
|
|
21
|
-
_df_idx = to_datetime(_df.index, errors='coerce')
|
|
22
|
-
return _df[_newkey.keys()].rename(_newkey, axis=1).set_index(_df_idx).loc[_df_idx.dropna()]
|
|
23
|
-
|
|
24
|
-
# QC data
|
|
25
|
-
def _QC(self, _df):
|
|
26
|
-
import numpy as n
|
|
27
|
-
|
|
28
|
-
# mask out the data size lower than 7
|
|
29
|
-
_df['total'] = _df.sum(axis=1, min_count=1) * (n.diff(n.log(_df.keys().to_numpy(float)))).mean()
|
|
30
|
-
_df_size = _df['total'].dropna().resample('1h').size().resample(_df.index.freq).ffill()
|
|
31
|
-
_df = _df.mask(_df_size < 7)
|
|
32
|
-
|
|
33
|
-
# remove total conc. lower than 2000
|
|
34
|
-
_df = _df.mask(_df['total'] < 2000)
|
|
35
|
-
|
|
36
|
-
# remove the bin over 400 nm which num. conc. larger than 4000
|
|
37
|
-
_df_remv_ky = _df.keys()[:-2][_df.keys()[:-2] >= 400.]
|
|
38
|
-
|
|
39
|
-
_df[_df_remv_ky] = _df[_df_remv_ky].copy().mask(_df[_df_remv_ky] > 4000.)
|
|
40
|
-
|
|
41
|
-
return _df[_df.keys()[:-1]]
|