feat(step8): 新增水色指数反演模块 waterindex_inversion + CSV 公式驱动架构
This commit is contained in:
34
src/utils/generate_pure_water_csv.py
Normal file
34
src/utils/generate_pure_water_csv.py
Normal file
@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
生成纯水 IOPs(吸收与散射系数)插值表
|
||||
参考 Pope & Fry (1997) 吸收系数 + Morel & Luukko (1974) 后向散射系数
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import os
|
||||
|
||||
|
||||
def generate_csv():
|
||||
anchor_points = {
|
||||
400: [0.017, 0.0076], 440: [0.015, 0.0049], 500: [0.026, 0.0029],
|
||||
555: [0.060, 0.0019], 600: [0.245, 0.0014], 650: [0.340, 0.0010],
|
||||
709: [0.735, 0.0007], 750: [2.470, 0.0005], 800: [2.070, 0.0004]
|
||||
}
|
||||
wl_anchors = list(anchor_points.keys())
|
||||
aw_anchors = [v[0] for v in anchor_points.values()]
|
||||
bbw_anchors = [v[1] for v in anchor_points.values()]
|
||||
|
||||
wavelengths = np.arange(400, 801, 1)
|
||||
aw_interp = np.interp(wavelengths, wl_anchors, aw_anchors)
|
||||
bbw_interp = np.interp(wavelengths, wl_anchors, bbw_anchors)
|
||||
|
||||
df = pd.DataFrame({'Wavelength': wavelengths, 'aw': aw_interp, 'bbw': bbw_interp})
|
||||
save_path = os.path.join(os.path.dirname(__file__), 'pure_water_iops.csv')
|
||||
df.to_csv(save_path, index=False)
|
||||
print(f"纯水 IOPs 表已生成: {save_path}")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
generate_csv()
|
||||
Reference in New Issue
Block a user