标定结果不入库

wavelength_calibration/ 是某一次实验的产物:绑定当次光路与传感器模式,

calibration.json 里还记录参考录制的本机绝对路径。改为本地生成,用

wavelength_calibration.py 重建,或 --calibration 指向别处。
This commit is contained in:
starcells committed 2026-11-14 13:52:50 +08:00
1 parent 45249b59f9
commit c405b6700d
9 files changed
+7 -3208

No files matched your search

+1
View File
@@ -5,6 +5,7 @@ recordings/
# ---- 运行产物 -----------------------------------------------------------
peak_exports/
wavelength_calibration/
*.npy
*.log
+6 -4
View File
@@ -18,7 +18,7 @@ Raspberry Pi HQ Camera(IMX477)RAW 光谱工具集:录制、回放、寻峰
| `wavelength_player.py` | 带已存标定的回放(波长轴、瀑布图) |
| `PEAK_FINDER.md` / `WAVELENGTH_PLAYER.md` | 两个工具的详细说明 |
| `test_peak_finder.py` / `test_wavelength_player.py` | 单元测试(含真实录制的端到端用例) |
| `wavelength_calibration/` | 一次汞灯标定的结果:`calibration.json` 及残差、候选、逐像素波长表 |
| `wavelength_calibration/` | 汞灯标定的输出目录(**本地生成,不入库**):`calibration.json`、残差、候选、逐像素波长表 |
`anal.py` 是 2026-10-23 的 `hq_spectrum.py` 旧副本,函数一一对应、无独有内容,属于
遗留文件,可删。
@@ -81,6 +81,8 @@ $env:PEAK_FINDER_TEST_CALIBRATION = "wavelength_calibration\calibration.json"
## 仓库里不放什么
`recordings/`(原始录制,单个约 470 MB)、`peak_exports/`(导出结果)、`__pycache__/`
都在 `.gitignore` 里。标定结果 `wavelength_calibration/` 是**放**进来的,因为它决定了
所有波长读数。
`recordings/`(原始录制,单个约 470 MB)、`peak_exports/`(导出结果)、
`wavelength_calibration/`(标定产物)、`__pycache__/` 都在 `.gitignore` 里。
标定结果不随源码走:它绑定某一次实验的光路和传感器模式,`calibration.json` 里还记录了
参考录制的本机路径。需要时用 `wavelength_calibration.py` 重新生成,或用 `--calibration` 指到别处。
-66
View File
@@ -1,66 +0,0 @@
{
"recording": "D:\\Dev\\Light\\Programs\\recordings\\hq_20261101_114417",
"frame_zero_based": 0,
"roi": [
98,
654,
848,
856
],
"pattern": "BGGR",
"raw_format": "BGGR_PISP_COMP1",
"black_adu": 4096.0,
"full_scale_adu": 65535.0,
"reduce": "mean",
"order": 1,
"coefficients_descending": [
0.2849422617422453,
349.4538237085669
],
"formula": "wavelength_nm = numpy.polyval(coefficients_descending, sensor_x_px)",
"wavelength_medium": "air",
"reference": "https://physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable2.htm",
"confirmed": [
{
"id": "B1",
"channel": "B",
"sample": 103,
"pixel": 304.0,
"signal_adu": 9736.237623762376,
"normalized": 1.0,
"wavelength_nm": 435.8328
},
{
"id": "G1",
"channel": "G",
"sample": 294,
"pixel": 686.5,
"signal_adu": 54219.9801980198,
"normalized": 1.0,
"wavelength_nm": 546.0735
},
{
"id": "G2",
"channel": "G",
"sample": 355,
"pixel": 808.5,
"signal_adu": 17836.9900990099,
"normalized": 0.3289744856760633,
"wavelength_nm": 579.0663
}
],
"residual_definition": "fitted - reference (nm)",
"residuals_nm": [
0.24347127820948344,
-1.0068136053816943,
0.7633423271722677
],
"rms_nm": 0.7428870276938522,
"max_abs_nm": 1.0068136053816943,
"residual_degrees_of_freedom": 1,
"calibrated_pixel_range": [
304.0,
808.5
],
"processing": "spatial reduction, black subtraction; no smoothing; max normalization only for detection"
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

-9
View File
@@ -1,9 +0,0 @@
id,channel,sample,pixel,signal_adu,normalized
R1,R,36,301.0,1066.666666666667,0.2308984047019312
R2,R,89,407.0,1468.606060606061,0.31790512174643165
R3,R,285,799.0,4619.636363636364,1.0
R4,R,345,919.0,1852.121212121212,0.4009235936188077
G1,G,285,798.5,61439.0,1.0
B1,B,35,298.0,8451.878787878788,0.1652635570724308
B2,B,89,406.0,51141.818181818184,1.0
B3,B,285,798.0,9526.30303030303,0.1862722791050436
1 id channel sample pixel signal_adu normalized
2 R1 R 36 301.0 1066.666666666667 0.2308984047019312
3 R2 R 89 407.0 1468.606060606061 0.31790512174643165
4 R3 R 285 799.0 4619.636363636364 1.0
5 R4 R 345 919.0 1852.121212121212 0.4009235936188077
6 G1 G 285 798.5 61439.0 1.0
7 B1 B 35 298.0 8451.878787878788 0.1652635570724308
8 B2 B 89 406.0 51141.818181818184 1.0
9 B3 B 285 798.0 9526.30303030303 0.1862722791050436
Binary file not shown.

Before

Width:  |  Height:  |  Size: 820 KiB

File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-4
View File
@@ -1,4 +0,0 @@
id,pixel,reference_nm,fitted_nm,residual_nm
B1,304.0,435.8328,436.0762712782095,0.24347127820948344
G1,686.5,546.0735,545.0666863946183,-1.0068136053816943
G2,808.5,579.0663,579.8296423271722,0.7633423271722677
1 id pixel reference_nm fitted_nm residual_nm
2 B1 304.0 435.8328 436.0762712782095 0.24347127820948344
3 G1 686.5 546.0735 545.0666863946183 -1.0068136053816943
4 G2 808.5 579.0663 579.8296423271722 0.7633423271722677