Commit 08604cfb authored by Sören Nossek's avatar Sören Nossek
Browse files

– add tools folder: files for calibration of trigger and pickers

parent 17368079
This diff is collapsed.
%% Cell type:markdown id: tags:
## Examination of the enhanced STA/LTA Picker
Sometimes the enhanced version produces less total matches with the reference then the origignal version.
Here we want to find out why.
%% Cell type:code id: tags:
``` python
import re
import json
import sys
from obspy.core.utcdatetime import UTCDateTime
sys.path.append('../')
from lib import *
main_dir = '/home/1/dev/proj/dugseis/devel/processing/analysis/p_picker/' + \
'output/58-sourcefiles/'
rel_path_v1 = '5.5_2.0_8_180_v1/details_5.5_2.0_8_180.json'
rel_path_v2 = '5.5_2.0_8_180_v2/details_5.5_2.0_8_180.json'
with open(main_dir + rel_path_v1, 'r') as read_file:
det1 = json.load(read_file)
with open(main_dir + rel_path_v2, 'r') as read_file:
det2 = json.load(read_file)
```
%% Cell type:markdown id: tags:
Comparing matches of original and enhanced picker.
%% Cell type:code id: tags:
``` python
ok1 = set([d['ref_id'] for d in det1 if d['match'] == 'OK'])
ok2 = set([d['ref_id'] for d in det2 if d['match'] == 'OK'])
ok1.difference(ok2)
```
%% Output
{'14846'}
%% Cell type:code id: tags:
``` python
ok2.difference(ok1)
```
%% Output
set()
%% Cell type:code id: tags:
``` python
# time 540.18... = 13:33:00:0.18...
missing = [d for d in det1 if d['ref_id'] == '14846']
missing
```
%% Output
[{'i': 2347,
'ref_id': '14846',
'ref_time': 540.1833729743958,
'dug_avrg': 540.1846001148224,
'match': 'OK',
'time_diff': 0.0012271404266357422,
'picks': {'OK': 4,
'missed': [22],
'false': [19, 23, 25, 26],
'diffs': [{'ch': 16, 'ref_time': 540.1835780143738, 'diff': 8.5e-05},
{'ch': 17, 'ref_time': 540.1830880641937, 'diff': 5.5e-05},
{'ch': 18, 'ref_time': 540.1835231781006, 'diff': 9.5e-05},
{'ch': 21, 'ref_time': 540.1833930015564, 'diff': 6.5e-05}]}}]
%% Cell type:markdown id: tags:
This event is missing in the run with the enhanced Picker.
%% Cell type:code id: tags:
``` python
selection(missing)
```
%% Output
[{'i': 2347,
'ref_id': '14846',
'ref_time': 540.1833729743958,
'dug_avrg': 540.1846001148224,
'match': 'OK'}]
%% Cell type:code id: tags:
``` python
selection(det1[2346:2351])
```
%% Output
[{'i': 2346,
'ref_id': '14845',
'ref_time': 539.4590990543365,
'dug_avrg': 539.4591495990753,
'match': 'OK'},
{'i': 2347,
'ref_id': '14846',
'ref_time': 540.1833729743958,
'dug_avrg': 540.1846001148224,
'match': 'OK'},
{'i': 2348,
'ref_id': '14847',
'ref_time': 540.2479679584503,
'dug_avrg': 540.2507729530334,
'match': 'OK'},
{'i': 2349,
'ref_id': '14848',
'ref_time': 541.4315459728241,
'dug_avrg': 541.4306621551514,
'match': 'OK'},
{'i': 2350,
'ref_id': '14850',
'ref_time': 541.686708688736,
'dug_avrg': 541.686785697937,
'match': 'OK'}]
%% Cell type:code id: tags:
``` python
det2[2345:2350]
```
%% Output
[{'i': 2345,
'ref_id': '–',
'ref_time': '–',
'dug_id': 2953,
'dug_avrg': 538.5022709369659,
'match': 'false',
'time_diff': '–'},
{'i': 2346,
'ref_id': '14845',
'ref_time': 539.4590990543365,
'dug_id': 2954,
'dug_avrg': 539.4591295719147,
'match': 'OK',
'time_diff': 3.0517578125e-05,
'picks': {'OK': 10,
'missed': [],
'false': [6, 26, 27],
'diffs': [{'ch': 4, 'ref_time': 539.4628422260284, 'diff': -0.007441},
{'ch': 5, 'ref_time': 539.4631669521332, 'diff': 7.8e-05},
{'ch': 16, 'ref_time': 539.4591820240021, 'diff': 2.7e-05},
{'ch': 17, 'ref_time': 539.4587121009827, 'diff': 2.4e-05},
{'ch': 18, 'ref_time': 539.4590721130371, 'diff': 3.3e-05},
{'ch': 19, 'ref_time': 539.4596118927002, 'diff': 5.8e-05},
{'ch': 20, 'ref_time': 539.4593768119812, 'diff': 3.8e-05},