Files
WQ_GUI/src/utils/generate_pure_water_csv.py

34 lines
1.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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()