(1)打印读取有误的文件名;
(2)doas算法计算过程中负值置零;
This commit is contained in:
tangchao0503
2023-12-14 19:05:07 +08:00
parent 46eefb95f5
commit 0d689e745b
3 changed files with 20 additions and 6 deletions

4
.gitignore vendored
View File

@ -1,6 +1,8 @@
# 唐超添加
/.idea
/problem
/sample_data
/paper
# Byte-compiled / optimized / DLL files
__pycache__/

View File

@ -237,6 +237,10 @@ def doas(data,wl_range,band=760):
print(data.Measures[i].values)
sky_spec = data.sky[i].values
veg_spec = data.veg[i].values
veg_spec[np.where(veg_spec < 0)] = 0
sky_spec[np.where(sky_spec < 0)] = 0
_X = np.concatenate([_ref_base,(_hf/(veg_spec+0.000001111)).reshape(1,-1)]).T
_y = np.log(veg_spec+0.000001111) - np.log(sky_spec+0.00000111111)
_B = np.linalg.lstsq(_X,_y,rcond=-1)

View File

@ -123,11 +123,19 @@ def map_files(f):
'''
遍历文件
'''
dt = pd.to_datetime(f.split('\\')[-1][:-4], format='%Y_%m_%d_%H_%M_%S')
data = read_files(f)
data = data_parser(data, dt)
# par_ls.append(par)
return data # data是列表第一个是光谱数据第二个是元信息
try:
dt = pd.to_datetime(f.split('\\')[-1][:-4], format='%Y_%m_%d_%H_%M_%S')
data = read_files(f) # 每个list都是一个np数组
data = data_parser(data, dt)
except Exception as e:
print("Reading error: %s" % f)
else: # 如果打开没有出错
# par_ls.append(par)
return data # data是列表第一个是光谱数据第二个是元信息
finally:
pass
# def map_files(i):
# result = i * i