Clock offset (exif_time_infront_real_time) is not applied to Experiment_Time[s]

クローズ 初心者向け
#173 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@kriboe90 がすでに取り組んでいます。

2026年10月29日 から。

  • #174 @kriboe90 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
data

調査の方向性

ledsa/data_extraction/init_functions.py の _calc_experiment_and_real_time から始め、その時刻計算を ledsa/core/ConfigData.py の ConfigData.get_start_time と比較してください。最初の画像の start_time が EXIF 時刻に由来する場合と、オフセットの異なる 2 台のカメラの場合について、回帰テストを追加してください。両方のケースで期待される実験共通の時間軸が生成されれば完了です。手動設定した start_time は実際の時計時刻を使うことを、設定ドキュメントに追記してください。

索引モデルが issue の本文から書いたものです。

説明

bug

Problem

The camera clock offset exif_time_infront_real_time is only applied to Time[s]. It never reaches Experiment_Time[s].

  • ConfigData.get_start_time moves start_time onto the real clock: it subtracts the offset from the EXIF time of the first image (ConfigData.py#L494).
  • _calc_experiment_and_real_time then measures the experiment time from the uncorrected EXIF time (init_functions.py#L130):
experiment_time = date_time_img - config.get_datetime()   # camera clock − real clock
...
time = date_time_img - timedelta(seconds=time_diff)        # only Time[s] is corrected

So every Experiment_Time[s] is off by exif_time_infront_real_time.

Effects

  • One camera: every time moves by the same amount. When start_time comes from the first image, that image sits at t = offset instead of 0. A temperature reduction table built on the lab clock is read that many seconds off.
  • Several cameras: the stacked analysis matches the cameras by Experiment_Time[s] (_load_time_map → read_experiment_times, StackedExtinctionCoefficients.py#L575). Their time axes stay apart by the difference of their offsets, which is the gap the clock photos were meant to remove.

Reproduction

Camera clock 30 s ahead, one image every 10 s, start_time left to be read from image 1 (EXIF times faked):

start_time = 12:00:00
#Count,Name,Time[s],Experiment_Time[s]
1,img0001.jpg,12:00:00.000,30.0
2,img0002.jpg,12:00:10.000,40.0
3,img0003.jpg,12:00:20.000,50.0

Time[s] of image 1 equals start_time, yet its experiment time is 30 s.

Suggested fix

Measure the experiment time from the corrected time, the same way start_time is computed:

     date_time_img = get_exif_datetime(img_path, tag)

-    experiment_time = date_time_img - config.get_datetime()
-    experiment_time = experiment_time.total_seconds()
     time_diff = config.getfloat(build_type, 'exif_time_infront_real_time')
     time = date_time_img - timedelta(seconds=time_diff)
+    # start_time is on the real clock, so the experiment time is measured from the corrected image time
+    experiment_time = (time - config.get_datetime()).total_seconds()
     return experiment_time, time

With this change the reproduction gives 0, 10, 20 s, and the existing unit tests (370) still pass. A regression test should cover two cases:

  1. With start_time derived from the first image, that image is at 0.
  2. Two cameras with offsets of +30 s and −5 s and the same start_time give the same experiment times.

Things to note

  • Semantics of a hand-set start_time: after the fix, start_time is read as a real-clock (lab) time, as it already is when LEDSA derives it. The config docs should say so explicitly.
  • Existing results: image_infos*.csv written before the fix, and everything built on them, are shifted by the offset. They must be regenerated, and so must any temperature reduction table that was aligned to the old axis. The demo has time_diff_to_image_time = -1, so its times move by 1 s.
  • Multi-camera, out of scope here: even after the fix, cameras share a time axis only when their start_time is the same real time. If each camera derives start_time from its own first image, the axes still differ by the gap between those first images. It may be worth a check or a warning in the stacked analysis.
主要言語
Python
スター
7
フォーク
4
平均マージ
3時間 58分
マージ済み PR(30日)
35

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

FireDynamics/LEDSmokeAnalysis のほかの issue

FireDynamics/LEDSmokeAnalysis の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。