|
385 | 385 | }, |
386 | 386 | { |
387 | 387 | "cell_type": "code", |
388 | | - "execution_count": 44, |
| 388 | + "execution_count": 46, |
389 | 389 | "id": "cd73f3e0", |
390 | 390 | "metadata": {}, |
391 | 391 | "outputs": [ |
392 | 392 | { |
393 | 393 | "name": "stdout", |
394 | 394 | "output_type": "stream", |
395 | 395 | "text": [ |
396 | | - "phase,time,index,confidence\n", |
397 | | - "P,2022-12-20T00:01:40.038400Z,10003,0.327\n", |
398 | | - "P,2022-12-20T00:01:41.648400Z,10164,0.789\n", |
399 | | - "P,2022-12-20T00:01:45.568400Z,10556,0.642\n", |
400 | | - "P,2022-12-20T00:01:50.978400Z,11097,0.306\n", |
401 | | - "P,2022-12-20T00:01:55.968400Z,11596,0.106\n", |
402 | | - "P,2022-12-20T00:02:06.428400Z,12642,0.342\n", |
403 | | - "P,2022-12-20T00:02:20.758400Z,14075,0.108\n", |
404 | | - "P,2022-12-20T00:02:23.068400Z,14306,0.292\n", |
405 | | - "P,2022-12-20T00:02:30.058400Z,15005,0.279\n" |
| 396 | + "phase,time,confidence\n", |
| 397 | + "P,2022-12-20T00:01:40.038400Z,0.327\n", |
| 398 | + "P,2022-12-20T00:01:41.648400Z,0.789\n", |
| 399 | + "P,2022-12-20T00:01:45.568400Z,0.642\n", |
| 400 | + "P,2022-12-20T00:01:50.978400Z,0.306\n", |
| 401 | + "P,2022-12-20T00:01:55.968400Z,0.106\n", |
| 402 | + "P,2022-12-20T00:02:06.428400Z,0.342\n", |
| 403 | + "P,2022-12-20T00:02:20.758400Z,0.108\n", |
| 404 | + "P,2022-12-20T00:02:23.068400Z,0.292\n", |
| 405 | + "P,2022-12-20T00:02:30.058400Z,0.279\n" |
406 | 406 | ] |
407 | 407 | } |
408 | 408 | ], |
|
421 | 421 | "# Write header\n", |
422 | 422 | "with open(output_file, 'w', newline='') as f:\n", |
423 | 423 | " writer = csv.writer(f)\n", |
424 | | - " writer.writerow(['phase', 'time', 'index', 'confidence'])\n", |
| 424 | + " writer.writerow(['phase', 'time', 'confidence'])\n", |
425 | 425 | "\n", |
426 | 426 | " for phase_idx, phase_label in enumerate(['P', 'S']):\n", |
427 | 427 | " probs = pred_unwrapped[phase_idx, :]\n", |
|
432 | 432 | " for peak_idx in peaks:\n", |
433 | 433 | " peak_time = starttime + peak_idx / tr.stats.sampling_rate\n", |
434 | 434 | " confidence = probs[peak_idx]\n", |
435 | | - " writer.writerow([phase_label, peak_time, peak_idx,f'{confidence:.3f}'])\n", |
| 435 | + " writer.writerow([phase_label, peak_time,f'{confidence:.3f}'])\n", |
436 | 436 | "\n", |
437 | 437 | "! head detections*" |
438 | 438 | ] |
|
0 commit comments