alwaysgood commited on
Commit
ea729fc
·
verified ·
1 Parent(s): e390221

Update noise_scenarios.py

Browse files
Files changed (1) hide show
  1. noise_scenarios.py +0 -39
noise_scenarios.py CHANGED
@@ -400,45 +400,6 @@ def create_noise_comparison_plot(df_original, df_noisy, scenario_name):
400
 
401
  add_scenario_highlight(scenario_name)
402
 
403
- # 차이가 큰 구간 하이라이트 (tide_level 기준)
404
- if 'tide_level' in df_orig_slice.columns and 'tide_level' in df_noisy_reset.columns:
405
- try:
406
- # DataFrame은 이미 정렬됨
407
- orig_tide = df_orig_slice['tide_level']
408
- noisy_tide = df_noisy_reset['tide_level']
409
-
410
- # NaN이 아닌 값들만 비교
411
- valid_mask = orig_tide.notna() & noisy_tide.notna()
412
- if valid_mask.any():
413
- diff = abs(noisy_tide[valid_mask] - orig_tide[valid_mask])
414
-
415
- if len(diff) > 0 and diff.std() > 0:
416
- # 유효한 인덱스만 사용
417
- valid_indices = np.where(valid_mask)[0]
418
- significant_diff = diff > diff.std() * 1.5
419
-
420
- if significant_diff.any():
421
- # 하이라이트할 점들의 실제 인덱스
422
- sig_indices = valid_indices[significant_diff]
423
- highlight_x = sig_indices.tolist()
424
- highlight_y = [noisy_tide.iloc[i] for i in highlight_x if i < len(noisy_tide)]
425
- highlight_diffs = [diff.iloc[j] for j, i in enumerate(valid_indices) if i in sig_indices]
426
-
427
- if highlight_x and highlight_y:
428
- fig.add_trace(
429
- go.Scatter(
430
- x=highlight_x, y=highlight_y,
431
- mode='markers',
432
- name='⚠️ 큰 변화',
433
- marker=dict(color='orange', size=10, symbol='diamond', line=dict(width=2)),
434
- showlegend=True,
435
- hovertemplate='큰 변화 지점<br>차이: %{text}<extra></extra>',
436
- text=[f'{d:.1f}cm' for d in highlight_diffs]
437
- ),
438
- row=3, col=2
439
- )
440
- except Exception as e:
441
- print(f"하이라이트 처리 중 오류: {e}")
442
 
443
  # 레이아웃 개선
444
  fig.update_layout(
 
400
 
401
  add_scenario_highlight(scenario_name)
402
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
403
 
404
  # 레이아웃 개선
405
  fig.update_layout(