2053 Commits

Author SHA1 Message Date
Darius Arnold
cfe59cc264 Merge remote-tracking branch 'origin/develop' into darius 2017-09-07 17:03:18 +02:00
9d540fdd9b Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-09-07 16:57:34 +02:00
91340b66e9 [minor] add window title to pickDlg 2017-09-07 16:57:10 +02:00
Darius Arnold
8a600e1bfa Merge remote-tracking branch 'origin/develop' into develop 2017-09-07 16:43:21 +02:00
Darius Arnold
11fb9bfa52 Merge remote-tracking branch 'origin/develop' into darius 2017-09-07 13:00:47 +02:00
bf36e5e6a5 [bugfix] shift traces on wfPG plot 2017-09-05 15:31:02 +02:00
88bf4c8f67 [bugfix] delete picks after jk/wadati not working 2017-09-05 15:03:03 +02:00
c6105330e0 [add] Ctrl+S to save fig (has to be clicked firsts) 2017-09-04 15:03:30 +02:00
16997ff49b Merge branch 'update_waveformwidget' into develop 2017-09-01 15:47:17 +02:00
39b450b005 [add] panZoom implemented 2017-09-01 15:44:42 +02:00
Darius Arnold
f06d11ab07 Merge remote-tracking branch 'origin/develop' into darius 2017-08-31 22:49:44 +02:00
Darius Arnold
e6d5dccb74 [bugfix] add default values when wadaticheck fails
Else plotting crashes due to unset variables
2017-08-31 21:58:13 +02:00
9a61a7f27d [change] fix legend locations to prevent them from bouncing on zoom 2017-08-31 15:41:59 +02:00
8e59845558 Merge branch 'develop' into update_waveformwidget 2017-08-31 15:28:07 +02:00
699575f9d5 Merge branch 'compare_events' into develop 2017-08-31 15:02:27 +02:00
33bc4e060f [minor] change layout and add groupbox 2017-08-31 15:01:48 +02:00
9eea1e9b14 Merge remote-tracking branch 'origin/develop' into develop 2017-08-31 14:32:12 +02:00
79cbaf3397 [update] working version to compare several events 2017-08-31 14:31:33 +02:00
eaa7a993af [add] compare widget for multiple events added 2017-08-31 11:16:38 +02:00
Darius Arnold
591743240c Merge branch 'develop' into darius 2017-08-31 10:57:23 +02:00
ba001fb53d [change] restructured comparison widget 2017-08-31 09:49:09 +02:00
Darius Arnold
9e1af65af7 [bugfix] AIC-CF was smoothed using wrong parameter
aictsmooth was unused in pylot, instead the tsmoothP parameter was used two times. 
aictsmooth should smooth the AIC-CF during the determination of the preliminary onset. tsmoothP is used to smooth the HOS-CF during pragmatic picking.
2017-08-31 00:07:38 +02:00
f4fc067f16 Merge branch 'develop' into compare_events 2017-08-30 14:54:24 +02:00
ca5167cb04 [bugfix] check type(picks) in dict/Attribdict 2017-08-30 14:45:20 +02:00
aea58b3c11 [update] made autopickwidget concept more flexible 2017-08-30 14:44:39 +02:00
f21fc7bb37 [fixes #244] parameters passed to pickDlg explicit 2017-08-30 10:51:20 +02:00
34ae5dddd2 [update] phaseText refreshing working (maybe slow)
if replotting slows down user interaction too much, change replot to pan-release instead of -move action, or add refresh timer
2017-08-29 16:32:42 +02:00
e2b69d043c Merge branch 'develop' into update_waveformwidget 2017-08-29 15:57:04 +02:00
21f02bf675 [minor] add absolute time to WfWidgetPG 2017-08-29 15:55:36 +02:00
881cc39e0e [bugfix] add default value to jackfactor
if not done, autoPyLoT will raise an error on old pylot.in files (or projects with old parameter obj.)
2017-08-29 15:23:25 +02:00
89dc390125 [minor] readd taupy tooltip 2017-08-29 15:08:28 +02:00
Darius Arnold
1ceb347602 [bugfix] avoid indexing an empty array when there are no NaNs at start of CF 2017-08-29 15:05:34 +02:00
Darius Arnold
bac6d6f5ec [add] jackknife safety factor no longer hardcoded, GUI parameter added 2017-08-29 15:05:10 +02:00
Darius Arnold
71973a5348 [bugfix] Earllate-Picker would use wrong timearray for plotting
signal-timearray gets doubled if not enough zero crossings are found to calculate valid signal period. Plotting would then use the old "single" timearray.
2017-08-29 14:58:20 +02:00
Darius Arnold
b232a2a194 [bugfix] check4rotated unable to access metadata in TuneAutopicker 2017-08-29 14:40:26 +02:00
Darius Arnold
5648fc1870 [change] replace NaN's in HOScf by first NaN value instead of zero 2017-08-29 14:40:05 +02:00
Darius Arnold
0852bf0f80 [bugfix] handle to short zero crossings window 2017-08-29 14:39:30 +02:00
Darius Arnold
afd03da178 [change] more readable indexing during slope determination 2017-08-29 14:39:09 +02:00
Darius Arnold
8ce9e40d49 [bugfix] catch empty index array during slope determination 2017-08-29 14:38:57 +02:00
Darius Arnold
19566715a7 [add] tune autopicker displays picked onset time and error in seconds 2017-08-29 14:38:36 +02:00
8e4fa5edca [cherrypick] from darius: rotate and taupy tooltip 2017-08-29 14:37:05 +02:00
Darius Arnold
f65b5efe41 [bugfix] for #240, tune autopicker not showing plots for some stations
this is probably just a workaround. Why was the program trying to access picks that were removed from the pick-dictionary?
2017-08-27 17:51:04 +02:00
Darius Arnold
bb54f2843e [experimental] enable tight layout option on tune autopicker
Seems to work if autopicker is called from the GUI. No further testing done
2017-08-27 16:52:21 +02:00
Darius Arnold
8293d63d28 [change] show more stations in stationbox of tune autopicker dialog 2017-08-27 16:34:00 +02:00
Darius Arnold
85e1e45552 [change] wadaticheck and jackknife print excluded stations 2017-08-26 19:41:26 +02:00
Darius Arnold
66d091197a [minor] change axis label for comparison dialog 2017-08-26 19:30:46 +02:00
Darius Arnold
6de5ebfe52 [minor] only show a single point in legends of wadati-/jacknife-plot 2017-08-26 19:20:43 +02:00
Darius Arnold
2b7ff9fd3a [change] include safetygap in check for other maxima in front of first one
And some changes to improve readability/understandability
2017-08-26 19:19:55 +02:00
Darius Arnold
01dc489569 [bugfix] avoid indexing an empty array when there are no NaNs at start of CF 2017-08-26 17:26:35 +02:00
Darius Arnold
efd2621db9 [add] jackknife safety factor no longer hardcoded, GUI parameter added 2017-08-26 17:22:28 +02:00
Darius Arnold
fde3f251fb [bugfix] Earllate-Picker would use wrong timearray for plotting
signal-timearray gets doubled if not enough zero crossings are found to calculate valid signal period. Plotting would then use the old "single" timearray.
2017-08-26 12:14:44 +02:00
Darius Arnold
2db6fde709 [add] check second maximum of HOS/AR-CF
Use the second maximum if it is larger than first maximum * minfactor. This helps when two onsets are close together (eg. S and SKS at 90°) and the second onset is stronger.
2017-08-26 02:12:31 +02:00
Darius Arnold
cd83c99034 [bugfix] wdfit2 referenced before set if wadaticheck had < 3 good picks 2017-08-26 01:55:16 +02:00
Darius Arnold
c760ea394c [add] remove picks with weight > 3 from pickdictionary after autopicking 2017-08-26 01:53:38 +02:00
Darius Arnold
1afc6bdcf1 readd imports of check4rotated that got lost during merge 2017-08-26 01:49:18 +02:00
Darius Arnold
63293c6f93 gitignore file update 2017-08-26 01:43:21 +02:00
Darius Arnold
1dab754811 Merge branch 'develop' into darius 2017-08-26 01:42:18 +02:00
Darius Arnold
17da0b9ddb [bugfix] check4rotated unable to access metadata in TuneAutopicker 2017-08-26 01:10:17 +02:00
726544bf3b [update] canvas finally working again 2017-08-24 17:16:21 +02:00
Darius Arnold
2a2c4d7a37 [change] replace NaN's in HOScf by first NaN value instead of zero 2017-08-24 15:42:12 +02:00
c83671f140 [update] canvas used for tune-fig, not yet pan 2017-08-24 11:35:53 +02:00
070c32e007 [change] disable multicursor by default 2017-08-23 15:18:24 +02:00
2ce609a19c [bugfix] tuneAutopicker not working cause of wadatijack 2017-08-23 14:46:30 +02:00
1bbb686778 [updates] first usage of PylotCanvas for other fig 2017-08-23 14:45:46 +02:00
3cfd2371fc [change] scroll zoom now part of WFwidget 2017-08-23 12:17:51 +02:00
47a79c7660 [add] wadaticheck added to widget (problem:
picking weights showing wadati/jk check
will be lost on saving/loading XML)
2017-08-23 11:51:59 +02:00
0e650dfb75 [update] working version of autopickwidget 2017-08-23 10:25:46 +02:00
9a5196c33f [minor] cosmetics 2017-08-23 09:20:59 +02:00
62610cd592 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-22 16:43:57 +02:00
c6c13f85bc [new] first working version of jackknife plots for multiple events (WIP) 2017-08-22 16:43:09 +02:00
d818e6aef9 [new] widget for picking interactive inside GUI 2017-08-22 13:21:06 +02:00
0f2660e20b [change] number of picks regards pick quality 2017-08-22 11:53:19 +02:00
Ludger Küperkoch
f7cada6d09 [Bugfix] Some typo. 2017-08-22 10:34:58 +02:00
a5097e1da6 [add] updates to jackknife from GUI (WIP, experimental) 2017-08-21 17:19:08 +02:00
Ludger Küperkoch
6722024749 Take renaming of existing function into account. 2017-08-21 16:16:09 +02:00
Ludger Küperkoch
dabd7f463c Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-08-21 16:11:41 +02:00
Ludger Küperkoch
75d206b9b1 Revised function using already existing functions. 2017-08-21 16:11:10 +02:00
ed994e987f [change] ComparisonDlg -> ComparisonWidget 2017-08-21 16:07:57 +02:00
b185ce72b1 [add] exclude quality class 4 from comparison 2017-08-21 15:33:19 +02:00
b30ab69ad2 [bugfix] teach comparison to cope without pick 2017-08-21 15:33:00 +02:00
50e7b83812 [new] new function to exclude picks by quality 2017-08-21 15:11:07 +02:00
2b0aa38b37 [change] restructure identifyPhase functions 2017-08-21 14:59:28 +02:00
55a54ae154 [rename] getQualityFromUncertainty 2017-08-21 14:50:18 +02:00
e9dd34eca7 [change] py3 histogram changes merged to develop 2017-08-21 14:11:41 +02:00
a75c16b2cd Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-21 13:56:40 +02:00
b9bdaa391b [change] use timedelta if (epick or lpick)=mpick 2017-08-21 13:51:54 +02:00
bdcb0ba649 [change] islope calculation with 2 samples 2017-08-21 13:38:50 +02:00
Ludger Küperkoch
f6225f8176 [Bugfix] Strange bug, happened only in multiple-event processing, key error. 2017-08-21 13:20:15 +02:00
Darius Arnold
9dfb4f37a5 [change] calculate slope from two or more samples 2017-08-21 13:20:05 +02:00
Darius Arnold
c454640619 [bugfix] handle to short zero crossings window 2017-08-21 13:19:22 +02:00
Darius Arnold
6223c4b5e1 [change] more readable indexing during slope determination 2017-08-21 13:18:31 +02:00
Darius Arnold
2e094fb0b5 [bugfix] catch empty index array during slope determination 2017-08-21 13:17:33 +02:00
Darius Arnold
f6ae77d4d2 [add] tune autopicker displays picked onset time and error in seconds 2017-08-21 13:16:22 +02:00
Darius Arnold
08ce54e890 [add] enabled jackknife function fpr P onsets 2017-08-21 13:15:38 +02:00
Darius Arnold
f2a6228e83 [bugfix] error in if check during load of eventliste.csv file 2017-08-21 13:14:10 +02:00
Darius Arnold
3e3b00b304 [add] function to rotate back traces if metadata is available 2017-08-21 13:13:03 +02:00
Darius Arnold
f1b64bb314 [add] possible models displayed in taupy tooltip 2017-08-21 13:09:54 +02:00
Darius Arnold
09374f8242 [bugfix] compare now shows histogram for all stations 2017-08-21 12:19:23 +02:00
e0e0be48c7 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-21 10:30:10 +02:00
a9f05d3572 [fixes #238] missing parenthesis in if statement 2017-08-21 10:28:47 +02:00
Ludger Küperkoch
2cbecfd54e [Bugfix] "locflag" was overwritten within event loop. 2017-08-18 16:52:39 +02:00
Ludger Küperkoch
6ba7fd8874 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-08-18 15:40:30 +02:00
Ludger Küperkoch
6729256087 [Bugfix] changed name of keys in loops, which might overwrite equal named input argument, reversed double fix of bug. 2017-08-18 15:38:01 +02:00
8fb6a4ea19 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-18 14:54:02 +02:00
9c12dde741 [change] simplified toolbars, disabled dragging 2017-08-18 14:53:35 +02:00
Ludger Küperkoch
13f7976e53 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-08-18 14:05:11 +02:00
Ludger Küperkoch
2460d3e9d6 [Bugfix] "savepath" remained the same within multiple event processing, even if set to None (set savepath automatically to event path).
station looses its attribute 'all'.
2017-08-18 14:03:25 +02:00
4faf007e0b [change] try set ncores flag explicitly (WIP) 2017-08-18 13:18:21 +02:00
8a024b66e0 [bugfix] checked identity of 'None' in autoPyLoT 2017-08-18 11:44:55 +02:00
53aa02669c [bugfix] savepath overwritten after first occurrence in for loop 2017-08-18 11:36:58 +02:00
4c859eae1b [cosmetics] added/changed some icons 2017-08-18 11:32:45 +02:00
4b01c7a28b Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-17 15:50:18 +02:00
2b942338b0 [bugfix] merge_picks not checking for method_id
[cleanup] removed unnecessary Data()
2017-08-17 15:47:42 +02:00
Ludger Küperkoch
641a3a09e9 [Bugfix] Attribute path got lost during export in loop over output formats, fixed! 2017-08-17 15:38:13 +02:00
Ludger Küperkoch
3369fb6382 [Bugfix] Attribute path got lost during xml-check. 2017-08-17 15:21:39 +02:00
Ludger Küperkoch
76144252ea Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-08-17 12:32:54 +02:00
Ludger Küperkoch
24ded1cf2b Reversed changes made in previous commit, initialize ObsPy-event object including path. 2017-08-17 12:31:42 +02:00
d067d4787e [bugfix] doubled picks saving XML files 2017-08-17 11:54:01 +02:00
ea7b609091 [change] restructure setupUi and init map/inventory 2017-08-17 10:46:06 +02:00
Ludger Küperkoch
5920c64ec5 Reversed some changes of former commit accidently made. 2017-08-16 16:49:47 +02:00
Ludger Küperkoch
b64009e525 [Bugfix] It might happen, that Lc is negative and/or pstop smaller than pstart! 2017-08-16 16:48:04 +02:00
Ludger Küperkoch
9f48b23d88 Use writephases for exporting to VELEST-input file, as VELEST can handle only 4-string station IDs which is already implemented in source code. 2017-08-16 16:24:35 +02:00
Ludger Küperkoch
db628a5228 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-08-16 15:33:16 +02:00
Ludger Küperkoch
606dc6a596 Enable compare button only if automatic as well as manual picks are available for same stations. 2017-08-16 15:32:25 +02:00
17f94228ab Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-16 15:14:15 +02:00
879282657a [change] get comparison working with alparray/py3 2017-08-16 15:13:55 +02:00
8e6237a08d [add]function to check for doubled channels in stream 2017-08-16 15:13:28 +02:00
ec095c572d [bugfix] if no cuttimes are set for h-comp skip S 2017-08-16 13:23:40 +02:00
Ludger Küperkoch
5d076511ec [Bugfix] Input are already picks, no more event object. 2017-08-16 12:12:04 +02:00
4b6b3de547 [change] check for real bool 2017-08-16 11:19:25 +02:00
Ludger Küperkoch
8d36393e36 [Bugfix] Enable compare button only, if manual as well as automatic picks are available. 2017-08-16 10:52:46 +02:00
Ludger Küperkoch
e3f758fa63 [Bugfix] get_evt_data().path no more existent. 2017-08-16 10:43:05 +02:00
c6fa6d8ff8 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-16 10:04:23 +02:00
256f3b6838 [closes #232] load autopicks automatically 2017-08-16 10:03:10 +02:00
2c054161c1 [refs #229] same issue found in islope calculation 2017-08-16 09:56:41 +02:00
Ludger Küperkoch
95a2f21675 Removed hard coded station name introduced for bug fixing. 2017-08-15 17:02:50 +02:00
Ludger Küperkoch
cc25a8e6cf Rearranged changes accidently got lost by former commit. 2017-08-15 17:01:27 +02:00
Ludger Küperkoch
fe8128a61a Use mean for noise level determination instead of max. 2017-08-15 16:57:52 +02:00
Ludger Küperkoch
4d8dc912ac Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-08-15 16:56:17 +02:00
Ludger Küperkoch
1dacc08b26 Leave picking parameters for onsets with small residuum unchanged. 2017-08-15 16:55:20 +02:00
ff6f2ed2d9 [minor] rearrange menu items 2017-08-15 16:36:14 +02:00
92e083770e [bugfix] accidently swapped pick menus 2017-08-15 16:32:02 +02:00
81f3758414 [change] rearranged menu (pick para, preferences) 2017-08-15 16:28:38 +02:00
9bfba65aee [bugfix] station names in pgplot 2017-08-15 16:15:49 +02:00
8f1943b48f Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-15 15:49:22 +02:00
15e76e4932 [refs #229] use last item in t instead of len(t) 2017-08-15 15:47:59 +02:00
Ludger Küperkoch
43cf9c4e3d Remove possible underscores in station names. 2017-08-15 15:22:10 +02:00
Ludger Küperkoch
b211294b94 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-08-15 15:10:58 +02:00
Ludger Küperkoch
2e24c406ac Use abs instead of RMS. 2017-08-15 15:10:36 +02:00
f6774cb592 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-15 15:03:41 +02:00
90dae62922 [bugfix] pickDlg manipulate pick copy, rba error 2017-08-15 15:02:45 +02:00
3c7b9eb8ea [change] code cleanup on setPicks from pickDlg 2017-08-15 14:54:13 +02:00
Ludger Küperkoch
503f72d6b0 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-08-15 14:49:11 +02:00
Ludger Küperkoch
f1d2467780 Smaller CF-recalculation window for iterative picking. 2017-08-15 14:48:19 +02:00
c7e4cd0c8b [bugfix] savepath might be None as well! 2017-08-15 14:16:34 +02:00
a23af62d23 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-15 14:15:18 +02:00
604edea95a [change] pick plot style (spe->fill_between) 2017-08-15 14:14:39 +02:00
c45b997aec [add] phase text color sync to phase marker color 2017-08-15 14:00:16 +02:00
67b3f4f363 [bugfix] TypeError has no attr. 'message' 2017-08-15 13:52:26 +02:00
8ce4f05a05 [bugfix] manual phase text not shown 2017-08-15 13:46:05 +02:00
Ludger Küperkoch
b542a99293 Relaxed checkZ4S, vertical component RMS must exceed average RMS of both horizontal components. 2017-08-15 13:06:26 +02:00
Ludger Küperkoch
ec1f9bc3f2 Calculate SNR from HOS/AR-CF instead of AIC-CF. 2017-08-15 12:43:09 +02:00
Ludger Küperkoch
66da4bd442 [Bugfix] Take into account None for Perror, removed needles parameters. 2017-08-15 12:02:46 +02:00
Ludger Küperkoch
cb38651898 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-08-15 10:17:58 +02:00
Ludger Küperkoch
4a2d118191 [Bugfix] savepath might be 'None', not None. 2017-08-15 10:17:08 +02:00
4bb616492c [bugfix] use identifyPhase instead of phase[0] 2017-08-15 10:02:46 +02:00
ff1ab722df [minor] code cleanup 2017-08-15 09:49:10 +02:00
a9d06790d2 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-14 17:00:15 +02:00
0f61799024 [add] new colors appl. to matplot, added quality 2017-08-14 16:59:39 +02:00
37373864ce [add] new flexible linestyles and colors pyqtgraph 2017-08-14 16:15:42 +02:00
Ludger Küperkoch
fd3305c694 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-08-14 15:10:57 +02:00
Ludger Küperkoch
eb66c381cd [Bugfix] Wrong commit of observation-file directory. 2017-08-14 15:09:49 +02:00
9edabc6aef Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-14 14:29:45 +02:00
7ec2006967 [workaround] python 3 raw_input 2017-08-14 14:29:31 +02:00
Ludger Küperkoch
9f955f4f5f [Bugfix] Typo, and list of output formats extended for NLLoc-obs files. 2017-08-14 14:17:37 +02:00
07c16695ba [minor] bugfix in unused function 2017-08-14 14:13:35 +02:00
100a39afd9 [bugfix] prevent error on mousewheel zoom outside axis 2017-08-14 13:56:08 +02:00
fda9de5738 [idea] copy pick not event and add to blank event 2017-08-14 13:44:38 +02:00
3cd64d09de [add] parameter savexml added to autoPyLoT 2017-08-14 13:30:27 +02:00
0a8f6f8a39 [bugfix] regard uncertainty == None 2017-08-14 11:43:09 +02:00
e0077524f4 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-14 11:40:48 +02:00
b585f571da [bugfix] no quality set if else was hit 2017-08-14 11:40:22 +02:00
c20ea78e52 [bugfix] check for station in picks before plot 2017-08-14 11:38:31 +02:00
3c8ed2e44e [add] traceback for error in Thread 2017-08-14 11:29:32 +02:00
Ludger Küperkoch
f1f6082cd8 Enabled terminal based plotting. 2017-08-11 17:33:41 +02:00
Ludger Küperkoch
df2d5929d3 [Bugfix] If Sweight >= 4, SNR and/or slope might be None. 2017-08-11 17:32:59 +02:00
Ludger Küperkoch
a48bb60809 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-08-11 16:59:26 +02:00
Ludger Küperkoch
537b7cb4a3 [Bugfix] Take into account different formats of input arguments iplot and fig. 2017-08-11 16:57:10 +02:00
b3b3dca41a Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-11 16:07:43 +02:00
2554534759 [bugfix] a lot of different bugfixes 2017-08-11 16:07:23 +02:00
Ludger Küperkoch
f393585831 New function to get quality classes from uncertainties, plot only automatic picks, if pick qualities are less than 4. 2017-08-11 16:04:18 +02:00
bd37b60dcb [reset] changes in QtPyLoT 2017-08-11 15:15:58 +02:00
Ludger Küperkoch
fe2957f76d Cosmetics 2017-08-11 15:02:47 +02:00
039f98a811 [add] check for nsamples and negative slope of cf 2017-08-11 15:01:32 +02:00
e6aa1ad031 [add] continue if no station coords
[bugfix] return if no isignal window
2017-08-11 14:50:12 +02:00
Ludger Küperkoch
571b90e5b7 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-08-11 12:49:18 +02:00
Ludger Küperkoch
e9a0be347c [Bugfix] Take into account different formats of input argument iplot. 2017-08-11 12:48:43 +02:00
fe2a2a9714 [add] trim_station_comp also for tuneAutopicker 2017-08-11 10:28:35 +02:00
7846e1303a [bugfix] in tuneautopicker 2017-08-11 10:24:25 +02:00
9b97937049 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-11 10:15:42 +02:00
942b606fca [change] workaround reinit tuneAutopicker widget 2017-08-11 10:14:47 +02:00
Ludger Küperkoch
b36f20ff59 [Bugfix] Take into account that initial pick might be very close to start of CF. 2017-08-10 17:54:50 +02:00
Ludger Küperkoch
526cd4303e [Bugfix] Still unclear, sometimes time array larger than data array. 2017-08-10 17:23:08 +02:00
874fdd730a [add] check for gaps and trim traces for one station
[change] restitute data only if necessary!
2017-08-10 16:25:32 +02:00
Ludger Küperkoch
42dcf7576b Deleted annotated line. 2017-08-10 15:11:14 +02:00
Ludger Küperkoch
8023ba2993 [Bugfix] Wrong use of indices. 2017-08-10 15:10:15 +02:00
Ludger Küperkoch
55c1a38f29 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-08-10 14:06:59 +02:00
Ludger Küperkoch
7ae8f651d3 [Bugfix] Slope must be counts/s! 2017-08-10 14:06:33 +02:00
fd2b82e978 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-10 14:01:55 +02:00
4e6a6dc2a8 [bugfix] self used in function (not method) 2017-08-10 14:01:25 +02:00
Ludger Küperkoch
726c823646 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-08-10 12:47:08 +02:00
Ludger Küperkoch
071c18f649 Take into account very small prediction errors (synthetics!), [Bugfix] take into account very close zero crossings 2017-08-10 12:44:28 +02:00
460af0e094 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-10 12:25:42 +02:00
2cc05329f9 [bugfix] huge bug in slope calculation 2017-08-10 12:25:03 +02:00
8a80af78cf [bugfix] use z-trace starttime instead of full_range 2017-08-10 12:00:43 +02:00
1ed4f73e5c [bugfix] darius: comparison of P-pick slope to minAIC-S-slope instead of S-pick slope 2017-08-10 11:04:46 +02:00
Ludger Küperkoch
a450189ba2 Take empty trace into account. 2017-08-09 17:37:11 +02:00
fd9e4f0c05 [add] remove automatic phases possible from pickDlg 2017-08-09 15:10:36 +02:00
5c6f1eb564 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-08-09 14:16:45 +02:00
acaf7f5172 [add] differentiation between automatic and manual picks imported from new
style XML file
2017-08-09 14:15:50 +02:00
Ludger Küperkoch
1b16c13525 [Bugfix] autoPyLoT was running always non-parallel due to iplot argument. 2017-08-09 13:28:00 +02:00
Ludger Küperkoch
87b617b924 [Bugfix] Control figure output of autoPyLoT via optional input argument iplot. 2017-08-09 13:17:54 +02:00
Ludger Küperkoch
de5392ac33 Some more cosmetics. 2017-08-09 12:25:21 +02:00
Ludger Küperkoch
f6ecc57d26 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-08-09 12:14:46 +02:00
Ludger Küperkoch
9662827273 Cosmetics 2017-08-09 12:14:24 +02:00
29165aadc7 [bugfix] fixed former bugfix 2017-08-09 09:44:01 +02:00
Ludger Küperkoch
a7b02c68de Re-introduced multicore processing, temporarly disabled for bug fixing. 2017-08-08 17:09:17 +02:00
Ludger Küperkoch
9e48bb1fa4 Removed hard coded, unnecessary saftey gap. 2017-08-08 17:06:41 +02:00
Ludger Küperkoch
811f52c95c Enabled plotting of figures when called from terminal. 2017-08-08 16:38:29 +02:00
Ludger Küperkoch
ab410b790c If one horizontal component is missing, AR prediction is calculated on original trace and copy of it. 2017-08-08 14:19:13 +02:00
Ludger Küperkoch
cc2da4fc41 [Bugfix] 'NoneType' object has no attribute 'axes'. 2017-08-08 11:53:21 +02:00
Ludger Küperkoch
6891591ae9 [Bugfix] Wrong use of boolean variable. 2017-08-08 11:26:40 +02:00
Ludger Küperkoch
7d5bfe8107 ilen was referenced before assignment. 2017-08-08 10:24:12 +02:00
863718a3f8 [add] support str as outformat 2017-08-07 16:53:21 +02:00
aa954dcd52 [add] current event saved as XML before picking in GUI 2017-08-07 16:49:56 +02:00
0692569056 [change] removed .obs from default export formats which is causing
problems
2017-08-07 16:45:20 +02:00
b260c23deb [change] behavior of saveEvent button changed 2017-08-07 16:44:45 +02:00
2fa9a60023 [rename] functions renamed 2017-08-07 16:41:50 +02:00
014152e30e [add] saveAllEvents now connected to export for Autopick process and saveProject 2017-08-07 16:33:45 +02:00
6042b38ee9 [change] completely restructured saveData method (testing needed)
[add] method to export all events of current project
2017-08-07 16:25:48 +02:00
4f1541ce4e [change] autoPyLoT output folder automatically set to event folder 2017-08-07 13:35:05 +02:00
57295c4a17 [minor] removed prompt 2017-08-07 12:17:18 +02:00
d310cf3ff7 [bugfix] For some unknown reason QPushButtons in event table caused
segmentation fault
2017-08-07 12:14:54 +02:00
0018ae10d0 [bugfix] wrong index used 2017-08-07 12:03:15 +02:00
17a93cf62f [add] for global seismology CF pick windows will now be calculated
relative to estimated tt from TauPy, metadata and source location (in XML
file) needed
[TO DO]: automatic export of XML (esp. source loc) before autopicking
2017-08-07 11:21:20 +02:00
60ebaa6528 [bugfix] few typos 2017-08-04 11:05:52 +02:00
9499688887 [add] parameter taup_model 2017-08-04 11:03:10 +02:00
41e5c004b2 [add] new parameter use_taup 2017-08-04 10:28:00 +02:00
04bf655cf1 [bugfix] init Checkbox if parameter is not found 2017-08-04 10:27:23 +02:00
924eb8aae6 [cosmetics] rearranged autopick menu 2017-08-03 15:33:28 +02:00
ddb1fb8b97 [add] multiple eventIDs possible as eventID pylot_parameter (testing needed) 2017-08-03 14:49:32 +02:00
cab9061030 [change] abortButton for Thread removed by default, cause it was not
working properly
2017-08-03 14:39:58 +02:00
125b72a582 [bugfix] autoPyLoT crashed when getSlope() method of AICPicker returned
None (comparing None to float), workaround: if not slope: slope=0
2017-08-03 12:05:19 +02:00
154e7b459f [add] --ncores flag added to autoPyLoT call, also enabled in GUI widget 2017-08-03 11:49:15 +02:00
90006809a5 [add] new autopick options added to file menu 2017-08-03 11:10:26 +02:00
e8a0a87dad [change] removed __del__ method reimplementation from thread objects
causing problems (no idea why it is there at all)
2017-08-03 11:09:50 +02:00
85a01fb0f1 [minor] cosmetics in print 2017-08-03 10:33:58 +02:00
5e2dc6c9f9 [add] improved submit functions 2017-08-03 10:15:54 +02:00
20b31a1c5c [reformat] code reformatting with PyCharm 2017-08-03 09:41:54 +02:00
4107f0249d [add] widgets for GUI independent spawning of autoPyLoT processes, WIP 2017-08-02 15:20:32 +02:00
482ae112e8 [bugfix] missing string emitting signal 2017-08-02 13:19:09 +02:00
dfa04f7b0a [add] change seperator for event initiation from system specific to '/' 2017-08-02 11:37:17 +02:00
d5645cf979 [bugfix] string transformation of None values 2017-08-02 11:02:24 +02:00
a5a3087283 [add] system specific path SEPERATOR 2017-08-02 10:47:41 +02:00
c60c659608 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-07-31 17:00:55 +02:00
aa5d11d735 [WIP] changed multiThread structure to QThreadPool 2017-07-31 17:00:19 +02:00
b084490f74 [bugfix] updated syntax to python 3 2017-07-31 15:52:09 +02:00
Ludger Küperkoch
8b7496a2fb Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop
Conflicts:
	pylot/RELEASE-VERSION
2017-07-31 15:40:11 +02:00
c353c24283 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-07-31 14:57:36 +02:00
7ca6509611 [bugfix] has_keys not a method of dict in python3 2017-07-31 14:56:59 +02:00
bd62115e5d Merge remote-tracking branch 'origin/develop' into develop 2017-07-31 14:56:31 +02:00
Ludger Küperkoch
290a623664 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-07-31 14:18:40 +02:00
Ludger Küperkoch
7009983925 [Bugfix] Wrong derivation of method_id. 2017-07-31 14:17:06 +02:00
17e6169cee [bugfix] untabify code 2017-07-31 13:52:57 +02:00
06b8c8413f merge release version 2017-07-31 13:44:37 +02:00
121ef4357f [WIP] using multiThread to call autopylot 2017-07-31 13:43:06 +02:00
Ludger Küperkoch
4244c4209b New function to derive onset quality classes and to plot them if desired. 2017-07-31 12:04:03 +02:00
f13542840f [add] MultiThread class added 2017-07-31 10:40:03 +02:00
f86f33b22f [minor] removed output 2017-07-20 16:18:00 +02:00
04d43f67c5 [bugfix] default phases from obspy not unique
[add] toggle button for checking phases
2017-07-20 15:11:07 +02:00
f93713fdad [bugfixes] filtering should be possible for all recognized phases now 2017-07-20 14:09:35 +02:00
d48d29f7ec [change] code restructured for flexibility 2017-07-20 11:50:57 +02:00
9c089329f3 [bugfix] string changed by accident 2017-07-20 11:42:31 +02:00
389965e573 [add] plot arrivals option added
[change] code reformated by PyCharm
2017-07-20 11:33:01 +02:00
c644095b5a [add] phase defaults for phasesTab 2017-07-19 15:12:01 +02:00
7748a39a72 [bugfix] checked for attribute invPath instead of inv_path 2017-07-19 10:11:26 +02:00
548c863f10 [minor] tight_layout for waveformwidget figure 2017-07-18 16:17:04 +02:00
d21afcf31a [minor] changed linewidth of wf plot slightly 2017-07-18 16:12:33 +02:00
be588252cf [add] events can be removed by clicking a button in event_table 2017-07-18 16:07:08 +02:00
60594c97cf [bugfix] wrong if cause in for loop in read_eventfile_info
[add] function to remove events from project
2017-07-18 15:27:52 +02:00
37875d5c87 [add] finished remove picks feature, testing needed 2017-07-18 14:34:09 +02:00
dbb3fab6d0 [add] possibility to remove picks added to pickDlg 2017-07-18 13:54:47 +02:00
1918c11b42 [bugfix/improvement] checkZ4s independent of different trace starttimes and sampling rates 2017-07-17 18:02:29 +02:00
176f13db09 [bugfix] slope window was used for calculation of checkz4s leading to huge problems 2017-07-17 16:58:40 +02:00
547355fbdf [change] updated parameters of function call exportEvent in autoPyLoT 2017-07-17 13:44:38 +02:00
52f9e61c9f [bugfix] locflag was set active when initialized in tune mode without metadata 2017-07-17 13:40:35 +02:00
f41a330606 [add] default event output name += .xml 2017-07-17 13:10:02 +02:00
2633f4b9cf [bugfix] error-prone check for method_id.id 2017-07-17 11:58:32 +02:00
7e0f4efbcc [bugfix] wrong usage of instrinsic function list() 2017-07-17 11:50:51 +02:00
7f0ab4dd94 [merge] merged changes in QtPyLoT manually 2017-07-17 11:38:50 +02:00
e5f5ab8412 [change] improved code behavior; exportEvent now checks for magnitudes and origins as well 2017-07-17 11:32:38 +02:00
b286290797 [change] exportEvent now checks for existing picks of type 'fcheck' in xml file and replaces them with new picks 2017-07-17 10:55:02 +02:00
Ludger Küperkoch
cf5cae0ad4 [Bugfix] fname referenced before assignment. 2017-07-17 10:04:57 +02:00
897b915eff [bugfix] origins object will be created independent to notes.txt,
[update] pycharm code restructuring (accidently)
2017-07-14 16:25:59 +02:00
90e27f1d08 [WIP] autopicks -> update xml file 2017-07-14 16:24:37 +02:00
a017c4deb4 [bugfix] various bugfixes while testing on Windows with py3 2017-07-14 15:26:39 +02:00
3869922378 [bugfix] typo in variable name 2017-07-14 14:16:12 +02:00
227112cbac [change] parameter evtdata of class Data has to be called as str object
(instead of outdated basestring) to make the class python 3 compatible
2017-07-14 13:30:54 +02:00
20e86cee5a Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-07-14 11:11:49 +02:00
68f864e93a [bugfixes] changed iplot flag default to 0, intercept Exception on false
filter settings
2017-07-14 11:09:18 +02:00
Ludger Küperkoch
01fe32c9b2 [Bugfix] Reversed change of a former commit supposed to make it compatible to Python3. 2017-07-14 11:05:09 +02:00
a560f4140b [update] icons will be imported depending on python version 2017-07-14 09:51:43 +02:00
Sebastian Wehling-Benatelli
e46f9066d9 [change] increased inter platform compatibility 2017-07-13 17:40:21 +02:00
f57aa37d99 [change] changed some functions to work with Python 3 and Windows 2017-07-13 17:27:48 +02:00
ac25f9cacb [bugfix] set locflag = 2 if traces could not be corrected 2017-07-13 11:23:51 +02:00
154f802f27 [bugfix] removed useless prompt 2017-07-12 16:56:39 +02:00
721874dbb7 [change] layout of sub-parameters of PylotParameter changed back to vertical alignment to save horizontal space in tuneautopick window 2017-07-12 16:49:11 +02:00
aa6f4324d0 Merge branch 'filterOptions' into develop 2017-07-12 16:33:14 +02:00
818fb7a296 [change] final adjustments made to filteroptionsdialog and parabox, ready for testing 2017-07-12 16:24:50 +02:00
Ludger Küperkoch
4b67481ffa Removed unwanted screen output. 2017-07-12 15:27:36 +02:00
Ludger Küperkoch
76a99005ec [Change] Save picks in cnv-, xml, and obs-format simultaneously. cnv not working! 2017-07-12 15:24:55 +02:00
Ludger Küperkoch
351d473cbf [Bugfix] Wrong format of nested if conditions. 2017-07-12 13:05:43 +02:00
Ludger Küperkoch
da372b435c [Bugfix] Wrong processing flow for checking picks. 2017-07-12 12:09:08 +02:00
Ludger Küperkoch
9ee32ee95e [Bugfix] Save only real determined onsets. 2017-07-12 10:45:22 +02:00
Ludger Küperkoch
2a0cb9f6c8 Additional screen output to inform the user about pick saving details. 2017-07-12 09:58:19 +02:00
Ludger Küperkoch
6e2861fe24 Cosmetics. 2017-07-12 08:59:43 +02:00
Ludger Küperkoch
34d5f9bf7d Additional screen output when saving picks. 2017-07-11 20:43:28 +02:00
Ludger Küperkoch
49092a928e Save only picks for NLLoc, VELEST, etc. that not exceed adjusted uncertainties. 2017-07-11 16:23:23 +02:00
43116ec2c6 [add] filtering in pickDlg will not be done by default anymore, changes in pushing filter in main traces window, still WIP (not going back to original wf after first filtering?) 2017-07-11 16:22:22 +02:00
1d9e52f577 [change] several updates updates to filterOptions, FILTERDEFAULTS now loaded from pylot.in, filterOptions should be 'shared' between filterOptionsDialog and pylotParameter 2017-07-11 16:03:24 +02:00
e3a4a2861d [bugfix/test] idea to fix problem with different ressource_id's on autoPyLoT 2017-07-10 17:37:54 +02:00
0e566f9748 [add] latest pylot.in file added to inputs! 2017-07-10 15:49:15 +02:00
e0926c6b20 [change] phase/expected phase arrivals text position now stays readable around pickDlg axes 2017-07-10 15:39:44 +02:00
d966b87eba Merge branch 'taup' into develop 2017-07-10 11:32:51 +02:00
bd4da2cc84 Merge branch 'master' into develop 2017-07-10 11:31:04 +02:00
8dcff4a467 Merge branch 'master' into taup 2017-07-10 11:30:37 +02:00
d0b5626c91 Merge branch 'master' into filterOptions 2017-07-10 11:29:16 +02:00
fedb7c2c0d [hotfix refs #220] Missmatching ressource_id's only produced warning on exporting picks, but did not prevent event mixing 2017-07-07 13:15:20 +02:00
a9334372e8 [add] working version of expected arrivals of chosen phases 2017-07-07 12:16:38 +02:00
138aeebf2c [bugfix] metadata not loaded from default value (TO DO: still not loading automatically from project file) 2017-07-07 11:43:58 +02:00
f7e54275c3 [change] structural changes to filteroptions WIP 2017-07-06 17:22:23 +02:00
09b2dfa5d1 [hotfix] could not load multiple parameters from pylot.in if values are type==string 2017-07-06 09:53:13 +02:00
dbc38385b5 [add] semi working version of filterOption dialog, WIP 2017-07-04 16:37:05 +02:00
097222a43d [add] namestrings for default parameters, filteroptions connected to parameters (WIP)
[change] layout of pylotparabox
2017-07-04 14:39:10 +02:00
1b3c29c47e [bugfix] missing comma in dictionary definition, also corrected misspelling 2017-07-04 10:31:23 +02:00
5bc9f14074 Merge branch 'develop' into filterOptions 2017-07-04 10:19:42 +02:00
Ludger Küperkoch
532a90a61f [Bugfix, not fixed completly] Locating event possible now out of GUI, class export obsolete? updateEvent still buggy! 2017-06-30 17:20:18 +02:00
74393432da [bugfix] do not show file menu when embedded, stretch changed (still problems on ludgers machine) 2017-06-30 15:06:17 +02:00
8e12bb1bc6 [bugfix] when no settings are given for phases use empty list 2017-06-30 14:43:06 +02:00
1c610d22f0 [add] restore default options for some tabs 2017-06-30 14:29:37 +02:00
beed46229a [add] plot phase name in pickDlg, also plot network code 2017-06-30 13:56:59 +02:00
533f7ea353 merge origin/develop into develop 2017-06-30 13:31:19 +02:00
3c0db3efa4 [add] different phases can now be selected in picks_menu on pickDlg depending on phases set in preferences 2017-06-30 13:26:46 +02:00
Ludger Küperkoch
13666312fa [Bugfix] Enable locate button as soon as manual picks are available. 2017-06-30 11:04:49 +02:00
Ludger Küperkoch
92f4ae3923 [Bugfix] One argument for export was missing. 2017-06-30 10:41:47 +02:00
a61eebba29 [proposal] use checkable QPushButtons for phases instead of QLineEdit, as line edit is highly vulnerable to incorrect user input 2017-06-30 09:42:36 +02:00
Ludger Küperkoch
9b22d0f8d6 Started activating PhasesTab for phase declaration. 2017-06-29 17:20:36 +02:00
3931f13fbe Merge branch 'develop' 2017-06-29 17:05:02 +02:00
9e6b376c62 [bugfix] reintroduced previous bugfix 2017-06-29 17:02:05 +02:00
marcel
5fc83459e2 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-06-29 16:50:00 +02:00
marcel
2da1d81d3d [change] icons edited again 2017-06-29 16:49:21 +02:00
Ludger Küperkoch
647cb1e32b Reintroduced changes of MP spuriously removed by previous commit. 2017-06-29 16:41:09 +02:00
Ludger Küperkoch
1e99ae8272 File extention for output taken from preferences OutputsTab. 2017-06-29 16:35:52 +02:00
583f39dd17 Merge branch 'develop' 2017-06-29 15:18:38 +02:00
marcel
fc0934ba1d [change] updated icons after jour fixe survey 2017-06-29 15:02:50 +02:00
574704cc49 Merge branch 'develop' of ariadne:/data/git/pylot into develop 2017-06-29 10:24:27 +02:00
3ae166b147 [bugfix] picks not plotted in PickDlg if type(picks .or. picksdict) was AttribDict instead of dict 2017-06-29 10:23:45 +02:00
Ludger Küperkoch
5564fb54dc Additional screen output to inform the user about status of saving picks. 2017-06-29 09:51:24 +02:00
marcel
0691992850 [add] deleted icons added again... 2017-06-29 09:18:42 +02:00
Ludger Küperkoch
12e383738d Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop
Conflicts:
	icons/Matlab_PILOT_icon.png
2017-06-28 23:11:16 +02:00
marcel
aff08d3a9c [add] some more icons added, hopefully fixed problem on ludgers commit deleting icons (changes in data.py should be correct as well) 2017-06-28 17:20:02 +02:00
Ludger Küperkoch
e7bd1c8d31 Export for VELEST-cnv format. 2017-06-28 16:55:12 +02:00
4f8631e829 [revert] changes of previous commit reverted as problems with QDialog seem to be caused by windows XServer 2017-06-28 16:40:44 +02:00
marcel
9b7b22c305 [bugfix] one icon misplaced 2017-06-28 16:35:54 +02:00
marcel
afd7a94852 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-06-28 16:26:16 +02:00
marcel
cb5f7b6946 [new/change] updated PyLoT icons to a more homogeneous icon set 2017-06-28 16:25:14 +02:00
marcel
2f7033329b [bugfix] possible that dialog was hidden behind other windows 2017-06-28 16:24:24 +02:00
Ludger Küperkoch
d31fec8781 Before exporting phases, check for manual picks and export them instead of automatic picks. 2017-06-28 14:23:24 +02:00
Ludger Küperkoch
f52b42f009 [Bugfix] Write header only, if export has been successfull. 2017-06-28 12:40:03 +02:00
Ludger Küperkoch
85829b22eb Write header in ObsPy-generated NLLoc-observation file. 2017-06-28 12:38:21 +02:00
marcel
b140dd4f53 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-06-28 09:27:21 +02:00
795733cc5f Merge branch 'develop' 2017-06-27 15:30:18 +02:00
cb1fb60eec Merge branch 'develop' of ariadne:/data/git/pylot into develop 2017-06-27 15:11:06 +02:00
f1f9295370 [add] user prompt when event_id not matching on load_data 2017-06-27 15:08:19 +02:00
Ludger Küperkoch
96ce713337 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2017-06-27 14:00:00 +02:00
Ludger Küperkoch
a3487b66ea [Bugfix] Take care that chosen window lengths fit to length of time series. 2017-06-27 13:59:00 +02:00
f1a9726f91 Merge branch 'develop' of ariadne:/data/git/pylot into develop 2017-06-27 13:54:51 +02:00
02da277f04 [bugfix] loading data from XML used same event multiple times as it was still part of current data object 2017-06-27 13:54:13 +02:00
Ludger Küperkoch
68ef127617 [Bugfix] Network code was missing. 2017-06-27 11:46:21 +02:00
a90e0bd78b [change] data._new moved to applyEVTData 2017-06-27 10:49:11 +02:00
ab260e45f2 [add/bugfix] data._new = False after first picks application 2017-06-27 10:39:44 +02:00
Ludger Küperkoch
987f5c4d62 Additional info for user. 2017-06-27 10:11:11 +02:00
Ludger Küperkoch
4e735b3672 [Bugfix] If too few onsets are available, no export of phases (except xml). 2017-06-27 09:57:00 +02:00
Ludger Küperkoch
a8bfc3c68f Parameter eventID uses wildcard (*) if all events of database supposed to be processed. 2017-06-27 09:44:38 +02:00
53089a3279 [add] rootpath will be applied to QSettings as well 2017-06-26 18:02:07 +02:00
30e2e1df84 [bugfix] query for data flag/attribute isNew changed 2017-06-26 17:41:08 +02:00
71da6ded2b [bugfix] Error when getEventFromPath returned None 2017-06-26 17:40:36 +02:00
Ludger Küperkoch
a0633cafa4 Prevent export of phases when tuning picker. 2017-06-26 16:19:57 +02:00
Ludger Küperkoch
c56a11634a Uncomment setNew, though still not sure, what its all about. 2017-06-26 16:10:18 +02:00
Ludger Küperkoch
bec8604904 autoPyLoT appends manual picks to xml-file, and manualPyLoT appends automatic picks to xml-file. 2017-06-26 14:47:36 +02:00
b0405cf213 [change] load AUTO picks button will be reused now (old function deprecated as there is only one file for both types of picks) to automatically load all event information for all events given (TODO: currently only XML files!) 2017-06-26 14:22:00 +02:00
42c288ad82 [bugfix] return when no file is selected on load_data 2017-06-26 14:10:40 +02:00
c07642653d [change] default open path for load_data is event folder 2017-06-26 14:08:17 +02:00
581a85b81f [bugfix] missing network code in picksdict_from_picks triggered silent Exception using picks generated by picks_from_picksdict 2017-06-26 13:58:26 +02:00
b10b79ea79 [change] renamed picks attribute for pylot to pylot_picks, picks attribute of events will now be used exclusively for ObsPy picks 2017-06-26 12:19:06 +02:00
d08bd4cc9e [move] class Event finally moved to new module event 2017-06-26 12:03:04 +02:00
acaf592590 [move] class Event moved to pylot.core.util.utils 2017-06-26 10:47:40 +02:00
Ludger Küperkoch
0f05be6a50 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop
Conflicts:
	pylot/RELEASE-VERSION
2017-06-23 15:47:09 +02:00
Ludger Küperkoch
9746913f8b Consistent prefix for all PyLoT-output. 2017-06-23 15:45:45 +02:00
8e6c4d06ce [add] array_map now plotting event location if given 2017-06-23 15:40:13 +02:00
ed4c112e99 [add] additional event information will be displayed in eventlist tab
[bugfix] project.search_eventfile_info was using relative path for filename
2017-06-23 14:56:56 +02:00
f409861d10 Merge branch 'develop' of ariadne:/data/git/pylot into develop 2017-06-23 14:16:06 +02:00
103ae716a2 [add] additional event information can now be read by project from a simple textfile and added to each event (time, location, magnitude) 2017-06-23 14:14:42 +02:00
Ludger Küperkoch
c9f0b126df Equal xml-file name for both automatic and manual picks, i.e. PyLoT_evID.xml. 2017-06-23 14:11:35 +02:00
929f58b942 merge origin/develop into develop 2017-06-23 12:12:55 +02:00
7bb2d54f6e [change] Event class now bases on ObsPy Event class which should be more efficient in future, origin time will be read from notes file if possible 2017-06-23 12:04:26 +02:00
Ludger Küperkoch
27597e6b4b Take into account parameter extent when writing header for PyLoT-input file. 2017-06-23 11:32:08 +02:00
Ludger Küperkoch
5958e05f3b Cosmetics. 2017-06-23 10:26:49 +02:00
Ludger Küperkoch
6ebad273a9 Improved screen output. 2017-06-23 10:10:45 +02:00
410fe18390 Merge branch 'develop' of ariadne:/data/git/pylot into develop 2017-06-22 16:32:31 +02:00
c44f351636 [add] new method to load multiple XML files at once for all events, WIP: picks loaded from XML files cannot be saved afterwards 2017-06-22 16:30:22 +02:00
8e60268fc5 [hotfix] output XML name clipped 2017-06-22 15:52:28 +02:00
Ludger Küperkoch
33d81eb538 Bugfix: Wrong naming of module in previous commit: PyLoTParameter - PylotParameter. 2017-06-22 15:18:19 +02:00
Ludger Küperkoch
9f9d492b8b Restored former changes of Marcel (AutoPickParameter - PyLoTParameter). 2017-06-22 15:09:40 +02:00
Ludger Küperkoch
71876638c8 Flexible calculation of local magnitude including station magntiude scaling as well as network magnitude scaling.
auoPyLot-output-file names have prefix event ID.
2017-06-22 15:04:16 +02:00
2b6297859b Merge branch 'develop' 2017-06-22 13:28:34 +02:00
ca1d3dca38 [add] filter parameters added to default parameters 2017-06-22 12:01:22 +02:00
97ee03b443 Merge branch 'develop' into filterOptions 2017-06-22 11:26:02 +02:00
8e8b3e0462 [rename] AutoPickPara ---> PylotPara 2017-06-22 11:22:17 +02:00
f91e1cde6f [change] structure changed to make parabox more flexible 2017-06-22 11:03:24 +02:00
203974cd83 [bugfix] parameters interchanged 2017-06-22 10:54:17 +02:00
f6a20c4ea2 [bugfix] advanced_cb acciddently pushed to bottom of layout 2017-06-22 10:53:56 +02:00
9dc472f907 Merge branch 'develop' 2017-06-22 10:28:15 +02:00
Ludger Küperkoch
9f164fc075 Still in progress: flexible local magnitude estimation. 2017-06-21 16:42:26 +02:00
Ludger Küperkoch
477aacbb4a Preparation of flexible local magnitude estimation. 2017-06-21 15:43:12 +02:00
Ludger Küperkoch
cf200e1425 Preparation of flexible local magnitude estimation, renamed module. 2017-06-21 15:41:12 +02:00
5928967e28 [closes #212] tuneAutopicker always tries to load current event in mainwindow 2017-06-21 15:33:49 +02:00
6feffaeadb [closes #209] spacebar can now be used to accept pickDlg, also added a checkbox to automatically open next station (experimental) 2017-06-21 15:20:36 +02:00
b0dcf5ff4b [change] local magnitude section added 2017-06-21 14:20:22 +02:00
d77abdc1d0 Merge branch 'develop' of ariadne:/data/git/pylot into develop 2017-06-21 14:10:24 +02:00
5214d31908 [add] space hotkey to close window 2017-06-21 14:09:39 +02:00
Ludger Küperkoch
b96af41324 In progress: new parametters for magnitude estimation 2017-06-21 13:53:53 +02:00
c10639b49c [merge] manual merging to new function structure (widget insertion with position) 2017-06-21 13:28:44 +02:00
43c314a1f8 [add/change] dataroot added to project file, improvements in behavior of create/save project 2017-06-21 13:24:45 +02:00
Ludger Küperkoch
9dc1545b63 Renamed/added new main parameter sequence Seismic Moment and Local Magnitude. 2017-06-21 13:03:17 +02:00
Ludger Küperkoch
51be558560 New parameters added for local magnitude estimation and scaling. 2017-06-21 13:01:14 +02:00
0a6ad8b663 [add] folder structure automatically recognized when adding events 2017-06-21 11:45:35 +02:00
be463c2adf [add] functionality to display one groupbox of AutoPickParaBox exclusively 2017-06-21 10:36:22 +02:00
6daccad341 [add] testing: saveProjectAs option 'always' enabled when project is active 2017-06-20 16:30:13 +02:00
d5a7e1f35f Merge branch 'develop' 2017-06-20 16:26:32 +02:00
1b512a0864 [closes #207, closes #208] when supressing user prompt, applyEVTData to data object was accidently removed 2017-06-20 16:23:54 +02:00
ab979e9b10 [bugfix] events not properly provided to autoPyLoT by TuneAutopicker, wrong parameter name in plotting routine 2017-06-20 14:32:21 +02:00
0be5c4b694 [add] verbosity on import pyqtgraph exception 2017-06-20 13:22:29 +02:00
0ff6f78a6c [add] parameter localMag added 2017-06-20 12:10:56 +02:00
62a7d94816 [bugfix] expecting deprecated return parameter of autoPyLoT 2017-06-20 12:10:17 +02:00
a8544dfb93 [bugfix] save XML does not set project clean 2017-06-20 10:35:31 +02:00
d293a5d9e1 Merge branch 'develop' 2017-06-20 10:29:50 +02:00
718879fad0 merge origin/develop into develop 2017-06-20 09:57:52 +02:00
300ff9215b [fixes #210] missing paranthesis in function call 2017-06-20 09:54:23 +02:00
Ludger Küperkoch
16003b6353 Bugfix: Different number of elements in used arrays. 2017-06-19 18:21:38 +02:00
Ludger Küperkoch
2601ec2865 Bugfix: Empty polyfit-object is avoided. 2017-06-19 16:35:51 +02:00
1b17842f63 [fixes #201] test events will be skipped when using TuneAutopicker 2017-06-19 16:30:39 +02:00
0717f491aa [closes #203] events can be saved as pickle now, not intended to save back event notes to notes.txt file as it is only used for automatically generated event folders 2017-06-19 13:54:43 +02:00
0d5c0e5bd2 Merge branch 'develop' 2017-06-19 11:38:34 +02:00
Ludger Küperkoch
9aba69686d Richter magnitude scaling is hard-wired, should not be handled internal. First step to flexible local-
magnitude estimation.
2017-06-19 11:37:08 +02:00
08b9cec674 [refs #206] savepicks XML now opens current event folder by default, also gives default filename
[bugfix] could not save XML files with . in name
[change] removed user prompt when changing picks on different event (redundant)
2017-06-19 11:28:11 +02:00
053caa5cf6 [change] replot after manual picking only if necessary (picks changed) 2017-06-19 10:37:24 +02:00
aea77cd49c [change] removed redundant propmpt because new picks have to be accepted in the first place when closing PickDlg 2017-06-19 10:30:08 +02:00
7257d43155 [fixes #205] call replot thread after manual picking 2017-06-19 10:23:39 +02:00
754883c5c9 [refs #204] adding application name/organisation/domain when building app before calling settings 2017-06-14 16:22:26 +02:00
15799feee7 Merge branch 'develop' 2017-06-14 10:20:41 +02:00
d2d8498739 [bugfix] stream oabject overwritten when using alter_comp causing traces to disappear in plot 2017-06-12 14:36:38 +02:00
5412de8249 [add] notes can be read from event folders 2017-06-12 11:34:45 +02:00
ddedd3ed7a [hotfix] ignoring error when mouseclick signal cannot be disconnected 2017-06-12 10:42:44 +02:00
a2c73f7726 Merge branch 'pyqtgraph' into develop 2017-06-09 14:01:31 +02:00
marcel
01c556562e [bugfix] newer version of pyqtgraph could not cope with UTCDatetime, now min/max_range for axes working 2017-06-09 13:51:20 +02:00
8e839df718 [add] pyqtgraph now part of Settings object; if installed will be used by default but can be deactivated 2017-06-09 13:23:16 +02:00
b061c81b2c [change] removed axes on startup 2017-06-08 16:58:44 +02:00
d6dd8bfaa8 [bugfix] several bugfixes mostly refering to plotting from plotWaveformDataThread, now only plot data are generated from within thread 2017-06-08 16:36:47 +02:00
909e2241a7 [change] working version of pyqtgraph for dataPlot, WIP: fill not working on versions lower 0.9.9 2017-06-08 14:09:01 +02:00
a07162d668 first semi-working plot of all traces 2017-06-07 17:05:48 +02:00
marcel
abfb8c86e7 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2017-06-07 11:31:37 +02:00
be8035e118 [bugfix] update to previous commit 2017-06-07 11:31:03 +02:00
9e85a9df47 [bugfix] using default channel components in case QSettings is not working with OS 2017-06-07 11:29:38 +02:00
50750fc4e0 [bugfix] using default channel components in case QSettings is not working with OS 2017-06-07 11:22:00 +02:00
66c5142cb9 [change] major changes in AutoPickParaBox layout, now structured as groupboxes that can be hidden individually 2017-06-07 10:30:15 +02:00
0af795969b [add] parameters now changed as part of project, some small fixes 2017-06-06 16:30:27 +02:00
f7d0e49458 [change] some updates of main window title changed to new QtPyLoT 2017-06-06 15:51:06 +02:00
20300daecf [change] metadata not saved as part of project file anymore (files might get really big), still possible to load same project, idea: add QSetting whether to save or not to PyLoTprefs 2017-06-06 15:28:43 +02:00
bdc85fa56a [bugfix] channel order mixed 2017-06-06 14:43:36 +02:00
9007197786 [add] network code added to station map 2017-06-06 14:08:19 +02:00
4077ec207c [bugfix] contourf plot not shown in station map. min() max() was not working when nan in list 2017-06-06 13:49:40 +02:00
86c76c6f61 [bugfix] 3 comp. window, time correction for trace overdone 2017-06-06 11:16:57 +02:00
530a629d15 [bugfix] changed code order for QSettings 2017-06-02 14:02:08 +02:00
f7af1d0b1b Merge branch 'develop' of ariadne:/data/git/pylot into develop 2017-06-02 11:52:39 +02:00
6434366e55 [bugfixes] several fixes relating to Channel Components, main issue: SetChannelComponents object was newly initated every time. Now: One object saved inside global QSettings. Testing needed. 2017-06-02 11:51:00 +02:00
Ludger Küperkoch
1e03541d6d Stabilized slope calculation for quality control. 2017-06-02 11:41:52 +02:00
Ludger Küperkoch
e2c1b8501e Exception for ValueError, if autoPyLoT has been started from terminal.
Raise SacIOError if obspy.read spuriously wants to read SAC data.
2017-06-02 11:09:32 +02:00
0fb6e5d4df [bugfix] pickDlg takes into account timeshift of trace.starttime for different components
[add] initial pick displayed in pickDlg
2017-06-01 15:25:43 +02:00
04304d3db8 [hotfix] adding decimals to AutopickParaBox 2017-06-01 14:01:43 +02:00
eaa4849a20 added network code to TuneAutopicker, small bugfix 2017-05-31 17:31:58 +02:00
cf399ed747 added parameter selection with ParameterBox to QtPyLoT Mainwindow 2017-05-31 17:12:34 +02:00
7d736823b1 [bugfix] min/max values of automatically generated spinboxes changed to -10e7 to 10e7 2017-05-31 16:28:05 +02:00
cd612def81 WIP: working on saving filter options as part of project 2017-05-31 16:25:46 +02:00
62fa3ad8b1 several updates to internal refreshing of widgets when manual picks are set 2017-05-31 15:41:25 +02:00
02a59f46a9 [bugfix] fixed filter settings for pylot.in file on open/save action in AutoPickParaBox 2017-05-31 14:35:52 +02:00
5897113140 [bugfix] fixed behavior of createNewProject, changed some hotkeys and renamed actions in file tools
[new] added saveAs button for prject, TO DO: possibly change saveAs icon slightly from save icon
2017-05-31 14:30:06 +02:00
eb5cf08d58 Merge branch 'develop' of ariadne:/data/git/pylot into develop 2017-05-31 13:46:37 +02:00
16c2ecb82f added main window zoom with [STRG] and [SHIFT] + mousewheel 2017-05-31 13:45:48 +02:00
Ludger Küperkoch
33e34ef194 Removed former changes, made it worse! 2017-05-31 12:21:40 +02:00
c540cd0f81 Merge branch 'develop' of ariadne:/data/git/pylot into develop 2017-05-31 11:48:51 +02:00
17cdffe735 some updates on saving/closing and user interaction 2017-05-31 11:48:16 +02:00
Ludger Küperkoch
d7abd3bef9 Stabilized slope determination. 2017-05-31 11:41:24 +02:00
1ff3b845bb some changes on dirty flag, added keyPress/release Events for Ctrl-Key 2017-05-31 10:56:45 +02:00
60c882fe04 [bugfix] changes in default_parameters not applied 2017-05-31 10:33:45 +02:00
396555b4b4 changes in resolution window (added parameter for extent), TRIAL: changes in YLims of pickwindow after init Pick 2017-05-31 10:28:31 +02:00
f493359c26 [bugfix] fixes and modifications for (inhomogeneous) global datasets, WIP 2017-05-30 16:27:38 +02:00
ceed165307 [bugfix] accidential function rename in code fixed 2017-05-30 11:45:53 +02:00
a745381e8e some changes in propertiesDlg 2017-05-30 10:17:07 +02:00
395295a295 changed some things in properties dialog to keep settings when opened again. added settings 'nth_sample' to speed up plotting a little bit 2017-05-29 18:03:31 +02:00
0f1292e9f2 [bugfix] setValue not working when type(item) in QLineEdit was 'int' instead of 'str'(i.e. 'unicode') 2017-05-29 16:24:44 +02:00
41a870d720 some changes in dataPlot resizing/height adjustments 2017-05-29 16:21:36 +02:00
5115705c4e Merge branch 'develop' of ariadne:/data/git/pylot into develop 2017-05-29 13:50:30 +02:00
a2ca96ae57 wfDataPlot stations now sorted by network and then by name 2017-05-29 13:49:34 +02:00
Ludger Küperkoch
b542f83201 Bugfix, sligthly changed SNR and noise-level calculation. 2017-05-29 12:02:56 +02:00
cb91911313 Merge remote-tracking branch 'origin/develop' into develop 2017-05-29 11:57:14 +02:00
b2d48cd523 changed some dirty things 2017-05-29 11:56:22 +02:00
3ad82c0c9e small fix on saving back loaded project 2017-05-29 11:34:22 +02:00
8975913143 added load project option from command line (QtPyLoT.py -p) 2017-05-29 11:31:09 +02:00
Ludger Küperkoch
5e593fc932 New class for getting/setting channel order, replaces old globals COMPNAME_MAP and COMPPOS_MAP. 2017-05-29 11:23:39 +02:00
b3a4470910 slightly changed qtpylot to call it from console 2017-05-24 15:28:52 +02:00
69b2daaab8 Merge remote-tracking branch 'origin/develop' into develop 2017-05-24 14:13:43 +02:00
50129fc8d9 [fix] some small fixes, new QtPylot functions commented 2017-05-24 14:12:41 +02:00
Ludger Küperkoch
9bc6f601a1 A littlebit more pythonic. 2017-05-24 11:23:35 +02:00
Ludger Küperkoch
c954614544 Bugfix: PyLoT can now cope with databases named with number (e.g. year). 2017-05-24 10:19:50 +02:00
Ludger Küperkoch
74b19ac094 Bugfix: PyLoT could not cope with input file if not called pylot.in. 2017-05-24 10:12:12 +02:00
Ludger Küperkoch
92525732a3 Cosmetics. 2017-05-23 16:36:02 +02:00
Ludger Küperkoch
3da76e9f1c Connected new ChannelOrderTab to component positions and names. 2017-05-23 16:13:58 +02:00
Ludger Küperkoch
36b4a2a05f Removed needless print output. 2017-05-23 15:33:19 +02:00
Ludger Küperkoch
4b3687fd2b New preferences tap ChannelOrderTab for assigning channel numbers to components. 2017-05-23 15:31:13 +02:00
840610cb18 [new] added some mousewheel zooming for array map 2017-05-23 13:34:39 +02:00
83fd0efd83 Merge branch 'develop' of ariadne:/data/git/pylot into develop 2017-05-22 15:36:35 +02:00
22eb46999c map beautification 2017-05-22 15:34:07 +02:00
Ludger Küperkoch
eb0cb7d5ab Cosmetics: Reasonable name for autopick-tune tap. 2017-05-22 14:59:48 +02:00
Ludger Küperkoch
cf4615a438 Removed obsolete class ParametersTab (Now done in class TuneAutopicker). 2017-05-22 14:38:48 +02:00
ba56bfbd25 added scroll functionality when mouse inside dataPlot canvas 2017-05-22 10:53:20 +02:00
Ludger Küperkoch
a3fbeafeac TuneAutopicker now gets event id independent from input of pylot.in. 2017-05-19 15:39:43 +02:00
Ludger Küperkoch
2a054f75f5 autoPyLoT working properly now, incl. getting right event id and data path. 2017-05-19 14:25:24 +02:00
5a3b77dc7b Merge remote-tracking branch 'origin/develop' into develop 2017-05-19 13:54:33 +02:00
f3a96ae200 small bugfix 2017-05-19 13:53:58 +02:00
Ludger Küperkoch
092aeb4cec autoPyLoT button works nearly properly now. 2017-05-19 13:22:04 +02:00
Ludger Küperkoch
4767add68f Re-initialized autoPyLoT from GUI, new input parameter eventid to make sure processing the right event. Buggy! 2017-05-19 12:30:03 +02:00
e911262c3e added some buttons for setting current event to ref/test, made ref/test color settings 'global', some fixes 2017-05-19 10:56:27 +02:00
cf971d6a87 Mainwindow plotWidget size fix 2017-05-19 09:23:02 +02:00
1143d97f36 added manual picks to tune autopick figures 2017-05-18 15:24:30 +02:00
Ludger Küperkoch
f814ec8656 Bugfix: if no plotflag set, fig was not assigned. 2017-05-18 13:53:22 +02:00
77153bc8e9 Merge remote-tracking branch 'origin/develop' into develop 2017-05-18 13:22:13 +02:00
a8861dfdab [bugfix] multiprocessing problem fixed, caused by a general bug passing wrong argument [fig_dict] to AIC instead of [fig_dict[key]]; also iplot flag is correctly read from parameter file now 2017-05-18 13:16:53 +02:00
Ludger Küperkoch
d9f087cb72 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop
Conflicts:
	pylot/RELEASE-VERSION
2017-05-18 12:02:07 +02:00
Ludger Küperkoch
72f5f160c2 Tried to fix bug when calling autoPyLoT from GUI, still not working ... 2017-05-18 11:58:12 +02:00
46236eeb55 changed PyQt import to PySide import! 2017-05-18 11:44:51 +02:00
0a911154ca Merge remote-tracking branch 'origin/develop' into develop 2017-05-18 11:42:42 +02:00
11a7f17655 small fix preventing eventID from being changed in TuneAutopick when parameters are loaded 2017-05-18 11:41:14 +02:00
Ludger Küperkoch
6405350dcc Introduced new button for autoPyLoT. 2017-05-18 11:02:20 +02:00
Ludger Küperkoch
b979649e82 Cosmetics. 2017-05-18 10:31:59 +02:00
Ludger Küperkoch
45ff145616 Take into account, that input_dict is not available when calling from terminal. 2017-05-18 10:09:51 +02:00
Ludger Küperkoch
f4f7615bf8 Take into account, that key eventID is not always available. 2017-05-18 09:55:07 +02:00
fa2b65ea3d removed focmec parameter 2017-05-17 14:52:50 +02:00
b97f79c31d Merge branch 'tap_thread' into develop 2017-05-17 13:27:03 +02:00
d81fb3e2e9 several bugfixes, mainly on map_projection with updated pick structure as part of event class 2017-05-17 13:25:41 +02:00
55bc0de036 working on connection between picks/autopicks of different tools [WIP], to do: fix array map number of picks/points mismatch in map 2017-05-16 17:26:42 +02:00
ba58cb548b bugfix iterating over same index as eventBox index 2017-05-16 14:20:32 +02:00
f43611aeda added pickdlg to tune autopick, small fixes; to do: add manual picks 2017-05-16 13:41:35 +02:00
c9d872d52b added load/save buttons for parameters 2017-05-15 18:12:26 +02:00
cae5c961b0 some fixes calling autopylot (figures=None), added log for autoTuner 2017-05-15 17:21:22 +02:00
a2ab98c202 added station list to TuneAutopicker 2017-05-15 12:03:53 +02:00
4d9c7b02cf autoPyLoT: figure beautification
also added nav toolbar to TuneAutopicker
2017-05-15 11:21:45 +02:00
77b076d560 threading for tuneAutopicker working now, to do: change figures (vfill), tight layout? 2017-05-12 15:40:19 +02:00
12e6106227 first working version of threaded tuneAutopicker 2017-05-12 13:58:05 +02:00
184983bc87 WIP: figure generating in threads partly working 2017-05-12 11:03:41 +02:00
f58d17be14 WIP restructuring fig_dict to be created inside Qt Main Thread 2017-05-11 17:15:20 +02:00
Ludger Küperkoch
d1354a33b1 Reintroduced activation of compare_button, spuriously removed formerly. 2017-05-11 08:33:08 +02:00
6847bfe8c4 WIP autopick parameters
to do: save/load/station+trace selection
2017-05-10 16:28:07 +02:00
dc656e5c57 merge origin develop into develop 2017-05-10 15:48:02 +02:00
862fb3240a added parameters tab to TuneAutopicker widget. Enabled direct call of autoPyLoT with AP-Settings object 2017-05-10 15:46:08 +02:00
d96bc3c621 updated autopick parameter writing routine 2017-05-10 14:56:29 +02:00
7d56e15ccf WIP autopicker tuning
added default parameters and widget to show/edit them
2017-05-10 13:17:58 +02:00
aeaa13e277 WIP on autopick settings widget 2017-05-10 11:06:55 +02:00
Ludger Küperkoch
89a70aae0b Enabled comparison button if manual and automatic picks are available. 2017-05-09 18:22:23 +02:00
Ludger Küperkoch
141dd3c9e6 Bugfix: wrong parameter naming 2017-05-09 18:12:00 +02:00
29915f3669 added first small qwidget for later tuning of autopicker with figures (tight_layout not working?) 2017-05-08 17:48:59 +02:00
3090d5fca0 added two missing figures 2017-05-08 16:23:10 +02:00
a8577ac80a Merge remote-tracking branch 'origin/develop' into develop 2017-05-08 15:43:09 +02:00
c784d46521 changed whole autoPyLoT figure structure to fig/ax structure to keep connections to figures in memory, iPlot now part of autoPyLoT function call parameters (not yet in argparser) 2017-05-08 15:38:41 +02:00
Ludger Küperkoch
2ef647251e Modified plot output. 2017-05-05 14:07:35 +02:00
Ludger Küperkoch
f4a76680ad Use maximum of HOS/AR-CF instead of AIC-CF to start searching for global minimum in AIC function. 2017-05-05 14:06:58 +02:00
6563b01293 bugfix self._inputs not assigned 2017-05-04 11:50:28 +02:00
Ludger Küperkoch
2628e9d568 Partly fixed bug when plotting corrupted trace, formerly killed by ValueError. 2017-05-03 16:19:08 +02:00
Ludger Küperkoch
e9660eea9c Exchanged Reference Set with Tuning Set to be consistent to reference picking cook book. 2017-05-03 15:38:54 +02:00
50ee351995 added scrollbar vor main wf plot for huge datasets, some changes in basemap figure size 2017-05-03 15:16:48 +02:00
efe47d7a20 fix for station scatter error 2017-05-03 12:00:34 +02:00
413a921e5d small fixes 2017-05-03 11:28:43 +02:00
fce0c98a89 Merge remote-tracking branch 'origin/develop' into develop 2017-05-02 12:19:16 +02:00
b0c80075fa small fix, preventing access to drag and drop in open folders dialog 2017-05-02 12:13:55 +02:00
Ludger Küperkoch
e5189fd3aa Disable additional buttons when overview plot is cleared 2017-04-28 16:01:31 +02:00
Ludger Küperkoch
94bf08df60 Disabled/enabled locationInfo button. 2017-04-28 13:56:28 +02:00
Ludger Küperkoch
312932ce5e Disabled/enabled saveProject button. 2017-04-28 13:47:24 +02:00
Ludger Küperkoch
39a7ce2d89 New project icon. 2017-04-28 13:42:57 +02:00
Ludger Küperkoch
62254e8af0 methodID also taken into account for automatic picks. 2017-04-28 11:47:56 +02:00
Ludger Küperkoch
1b3fc717a6 Not really fixed, but bypassed bug occuring when saving picks and no channel nor station coding is available. 2017-04-27 15:50:08 +02:00
Ludger Küperkoch
d4dea0d356 Compiled new, smaller versions of pick icons. 2017-04-27 10:44:41 +02:00
Ludger Küperkoch
8f92b4ec25 Implemented new, smaller versions of pick icons. 2017-04-27 10:42:31 +02:00
Ludger Küperkoch
d1cb6fe41f Detrend of waveforms for overview plot. 2017-04-26 15:59:29 +02:00
686ca4489c Merge branch 'project_events' into develop 2017-04-21 15:50:10 +02:00
08dfe35620 final commit of first project/event branch, ready for merging to develop [open issues: no differentiation between auto and manual picks mainly for map (internal structure change incoming), new icon integration failed...] 2017-04-21 15:46:57 +02:00
6b7dbe3f9a some bugfixes 2017-04-20 17:06:36 +02:00
b23228253a [bugfix] plotting pick of lower most channel 2017-04-20 15:28:43 +02:00
29701ea68b plotting picks problem was no bug, but resulted from a high sensitivity of the code to random files or folders in the event directory causing HUGE problems... [fix this] 2017-04-20 15:08:36 +02:00
bcc58e4937 changed eventlist string and coloring, [bug]: picks not displayed 2017-04-20 14:03:26 +02:00
f5dcfc654d added eventlist, some changes in tab structure (layouts for each tab to keep tabs when refreshing) 2017-04-20 12:05:34 +02:00
227faf14c2 saving picks in events as part of project 2017-04-19 16:51:19 +02:00
f935da8296 few bugfixes 2017-04-19 16:05:45 +02:00
80577dcfc7 added map_projection plot 2017-04-19 15:40:22 +02:00
fd70ef2251 adding some tabs for map_projection, WIP 2017-04-18 17:17:46 +02:00
62876dd01d added first project structure and event lists (testing needed) 2017-04-18 16:24:26 +02:00
3092b4f657 Merge branch 'map_projection' into develop 2017-04-18 09:48:00 +02:00
486aadd791 color change in map projection 2017-04-13 15:51:58 +02:00
22ced8c07c [fix] parameters tab window flag for new qwidget window with parent 2017-04-13 11:55:09 +02:00
de38b60893 qlineedit for autopylot parameter settings 2017-04-13 11:26:01 +02:00
54222b7f11 added method for array plotting to QtPyLoT, to do: button to call array plot 2017-04-12 16:43:29 +02:00
50f6d7d987 Merge branch 'develop' into map_projection 2017-04-12 15:21:58 +02:00
e75c34afeb button color changed, 3 comp. window 2017-04-12 15:20:06 +02:00
6c214bbc77 changed structure to class with PyLoT mainwindow as input 2017-04-12 15:07:13 +02:00
488068105b Merge branch 'develop' into map_projection 2017-04-12 12:18:16 +02:00
bb60093657 changed PickDlg layout to simpler button layout with hotkeys 2017-04-12 12:14:01 +02:00
786879d4ad Merge branch 'develop' into map_projection 2017-04-12 10:22:39 +02:00
Ludger Küperkoch
79163206f8 First step to realize GUI based setting of picking parameters in pylot.in-file. 2017-04-11 16:55:07 +02:00
76d4d59ed9 added PickDlg testwise for onpicked traces 2017-04-11 15:41:41 +02:00
d037e0a1f2 Merge branch 'develop' into map_projection 2017-04-11 15:17:48 +02:00
2e6d39c52e small bugfixes and widget added 2017-04-11 15:16:53 +02:00
bf63348151 first working version of basemap plot 2017-04-11 14:32:29 +02:00
Ludger Küperkoch
b3a4928a9c Implemented push buttons for selecting parameters to change within the PyLoT.in file. Work in progress. 2017-04-11 11:41:54 +02:00
Ludger Küperkoch
640ed1acda Removed location tool popup from Preferences GUI, as there is yet only NonLonLoc as location routine available. Changed size of GUI. Implemented additional diaolg for picking parameters, yet not finished. 2017-04-11 10:55:29 +02:00
f1e3720a0e gathering some ideas for map projection 2017-04-10 17:06:39 +02:00
d370ef67c0 Merge branch 'develop' of ariadne:/data/git/pylot into develop 2017-04-10 15:07:48 +02:00
085eee7d75 added autopicks in 3 component windows, also added vertical dashed lines for autopicks for better visibility 2017-04-10 15:06:30 +02:00
Ludger Küperkoch
2dda4d8e04 First action is to ask for PyLoT.in file. 2017-04-10 14:54:47 +02:00
Ludger Küperkoch
43eecfe78b Locate button is initialized as soon as number of picks is equal/greater 4. 2017-04-10 14:43:11 +02:00
Ludger Küperkoch
95dce91ada Major changes: PyLoT GUI opens immediately when calling PyLoT, buttons are deactivated and reactivated as soon as waveforms are loaded. 2017-04-10 14:24:39 +02:00
0656a571cd now returning pylot_form to have access to GUI modules in ipython 2017-04-10 14:01:08 +02:00
50d3c5f235 added ipython support for developing 2017-04-10 13:32:53 +02:00
3f7a61736a changed PyQT import to PySide import 2017-04-10 13:22:56 +02:00
Ludger Küperkoch
49a4cccc92 Bug fix: PyLoT displays warning message end terminates if no PyLoT-input file or autoPyLoT-output file is declared. 2017-04-10 09:50:53 +02:00
35705f1f1d Merge branch 'develop' 2017-04-07 13:58:07 +02:00
8bc390fb74 small bugfix 2017-04-06 16:18:08 +02:00
393289245f multiprocessing implemented for restitution and autopicker 2017-04-06 15:37:54 +02:00
ef1755a80f added new files as well 2017-04-06 13:17:06 +02:00
c90b061de9 coppied files from Ludgers Laptop 2017-04-06 13:16:28 +02:00
Ludger Küperkoch
9122d8debf Marginal changes. 2017-04-05 14:26:38 +02:00
Ludger Küperkoch
6c149b7119 Removed (temporary?) one function of two for estimating source spectrum to speed up code. 2017-04-05 11:41:29 +02:00
Ludger Küperkoch
3f027bedf5 Exchanged autopick with autoPyLoT to get full accees to entire autoPyLoT procederes within GUI. 2017-04-05 11:40:24 +02:00
Ludger Küperkoch
94c1e85484 Implented GUI dialog to select directory for autoPyLoT output. 2017-04-05 11:38:43 +02:00
Ludger Küperkoch
4244047096 Implented GUI dialog to select directory for autoPyLoT output. 2017-04-05 11:38:02 +02:00
Ludger Küperkoch
6269632875 Exchanged external function autopick with autoPyLoT to enable iterative picking also from GUI. Furthermore, implemented QDialog to search for PyLoT.in-file via pop-up windows. 2017-04-05 11:26:10 +02:00
Ludger Küperkoch
3d5cce9e7a Removed double read in of input file. 2017-04-03 11:54:41 +02:00
Ludger Küperkoch
43a7da41f2 Removed obsolete AUTOMATIC_DEFAULTS, as they are read in from pylot.in. 2017-04-03 11:54:09 +02:00
Ludger Küperkoch
1266f08da8 Additional restore button in preferences-dialog box to reset preferences. Gets values from infile (e.g. pylot.in) assumed as default values. 2017-03-31 11:26:42 +02:00
Ludger Küperkoch
4ca8b2b86c Minor changes for extended preferences dialog box. 2017-03-31 11:24:40 +02:00
Ludger Küperkoch
4ae19675f1 Marginal changes. 2017-03-29 10:03:42 +02:00
Ludger Küperkoch
b233d80cb4 Removed hard coded parameters for earllatepicker, takes paramters now from pylot.in-file. 2017-03-29 09:58:30 +02:00
Ludger Küperkoch
fa7a0e9c10 Minor changes 2017-03-28 16:51:45 +02:00
Ludger Küperkoch
f51761146b Minor changes 2017-03-28 16:51:35 +02:00
Ludger Küperkoch
4b6eac5e52 Minor changes 2017-03-28 16:51:26 +02:00
Ludger Küperkoch
2dd815fb2b Minor changes 2017-03-28 16:51:10 +02:00
Ludger Küperkoch
fe7bae50e6 Fixed some minor bugs. 2017-03-28 09:47:01 +02:00
Ludger Küperkoch
af7b0e1887 Fixed some minor bugs. 2017-03-28 09:46:40 +02:00
Ludger Küperkoch
b235733d2b Real user info in manual pick dictionary. Additional information in manual pick dictionary. 2017-03-27 16:03:15 +02:00
Ludger Küperkoch
ea4cc6a1a3 Implemented Qt4-dialogue box for input-file name. 2017-03-27 14:15:50 +02:00
Ludger Küperkoch
fced74473f Cleaned. 2017-03-27 11:34:53 +02:00
Ludger Küperkoch
842de86544 Flexible handling of individual input-file names. 2017-03-27 11:32:24 +02:00
Ludger Küperkoch
39748ca7c2 Finished flexible handling of different input file names. 2017-03-27 11:31:58 +02:00
Ludger Küperkoch
fcfa2e9edc Cosemtics and first steps to make PyLoT more flexible to different input-file names. 2017-03-27 10:25:19 +02:00
Ludger Küperkoch
ce341dc6e0 Removed temporary module import of pdb. 2017-03-22 12:03:27 +01:00
Ludger Küperkoch
15fd175813 Export of phases for VELEST, hypoDD and HASH only possible if event location is available. 2017-03-22 12:02:01 +01:00
Ludger Küperkoch
92a1c77f9c Finished phases output for HASH. 2017-03-21 17:53:41 +01:00
Ludger Küperkoch
a01b6f6db5 Minor changes. 2017-03-21 17:53:15 +01:00
Ludger Küperkoch
6d5e9fdfcd Additional item network in pick dictionary. 2017-03-21 17:52:16 +01:00
Ludger Küperkoch
380c96e5a5 Removed inconsistencies. 2017-03-16 11:47:01 +01:00
Ludger Küperkoch
fcd977c9bc Additional screen output. 2017-03-16 11:28:13 +01:00
Ludger Küperkoch
181a87facb Additional export of phases for FOCMEC. 2017-03-16 11:27:48 +01:00
Ludger Küperkoch
f6bf551187 Additional export of phases for FOCMEC. 2017-03-16 11:27:20 +01:00
Ludger Küperkoch
368994a28f Removed pdb. 2017-03-15 14:19:37 +01:00
Ludger Küperkoch
e2ec6b3574 Flexible input-file naming possible now. 2017-03-15 14:19:17 +01:00
Ludger Küperkoch
305122d02b Default is now pylot.in even for autoPyLoT. 2017-03-15 14:18:28 +01:00
Ludger Küperkoch
55c5291121 Flexibel for input-file naming, default is pylot.in. 2017-03-15 14:17:56 +01:00
Ludger Küperkoch
47b41a1296 Flexibel for input-file naming now. 2017-03-15 14:17:02 +01:00
Ludger Küperkoch
a95120ba5e In writephases: export of phase information for focmec. Still under construction. 2017-03-14 10:35:33 +01:00
Ludger Küperkoch
2fc1c7031d Export of phases for focmec. Yet not finished. 2017-03-14 10:33:56 +01:00
Ludger Küperkoch
c74205c46f In setIniPickP and setIniPickS: get parameters from pylot.in instead of hard programmed values. 2017-03-14 10:32:43 +01:00
Ludger Küperkoch
f0c1ec14f2 Cosmetics. 2017-03-02 11:44:32 +01:00
Ludger Küperkoch
d57cfa0085 Export of phases formated for focmec. 2017-03-02 11:44:03 +01:00
Ludger Küperkoch
b5d081841b Updated for additional phase export for hypoDD. 2017-03-02 11:13:14 +01:00
Ludger Küperkoch
2c3ad881f1 Updated for additional phase export. 2017-03-02 11:11:38 +01:00
Ludger Küperkoch
5a87d0d3b3 Additional phase export formated for hypoDD. 2017-03-02 11:11:00 +01:00
Ludger Küperkoch
749e42b778 Implemented additional phase output formated for hypoDD. 2017-03-02 11:10:28 +01:00
Ludger Küperkoch
bb48946fe2 Cosmetics. 2017-03-02 09:31:30 +01:00
Ludger Küperkoch
4435d8d855 Cosmetics. 2017-03-02 09:31:21 +01:00
Ludger Küperkoch
3bb7156e65 Cosmetics 2017-03-02 09:30:08 +01:00
Ludger Küperkoch
cf1ed748d2 Additional phases output for further VELEST processing. 2017-03-02 09:20:17 +01:00
Ludger Küperkoch
008d730609 Implemented output formated for further VELEST processing. 2017-03-02 09:19:42 +01:00
Ludger Küperkoch
44d2acf331 Output formated for further VELEST processing. 2017-03-02 09:19:11 +01:00
Ludger Küperkoch
7b22eb1620 Additional phase output formated for HYPOSAT, additional header information for HYPO71- and NLLoc-phase files. 2017-02-28 15:02:39 +01:00
Ludger Küperkoch
4c82f29b1a Phase output formated for HYPO71, replaces old hsat.py. 2017-02-28 15:01:52 +01:00
Ludger Küperkoch
8bb5d9dd2c Additional header information. 2017-02-28 14:59:21 +01:00
Ludger Küperkoch
7671b76f2f Phase output for HYPOSAT, additional header information for NLLoc and HYPO71 output. 2017-02-28 14:57:25 +01:00
Ludger Küperkoch
11a3839cff Additional phase output formated for HYPOSAT. 2017-02-28 14:56:09 +01:00
Ludger Küperkoch
8ffa37eea6 In plotcomparison: Better readable legends now. 2017-02-23 15:43:55 +01:00
Ludger Küperkoch
b4c463b16f Bugfix in from_pick: Something was wrong with calculation of expectation value. However, this might still not be fully correctly! 2017-02-23 15:43:05 +01:00
Ludger Küperkoch
1b92d88403 Re-introduced barycentre in pdf object. 2017-02-22 16:23:19 +01:00
Ludger Küperkoch
6ff8069fe0 Bugfix in from_pick: type must be exp to be consistent! 2017-02-22 16:20:47 +01:00
Ludger Küperkoch
919f4dd2d6 Cosmetics 2017-02-22 16:19:37 +01:00
Ludger Küperkoch
21e068ec24 Bugfix in exp_parameter: If resulting sigmas are infinite, values are set to finite values. Leads then to a symmetric distribution. 2017-02-22 12:34:05 +01:00
Ludger Küperkoch
fab785d164 Bugfix in plotcomparison: pdf was provided as method instead of data. Enabled plot_pdf to deal with method as well as with pdf-data. 2017-02-22 12:31:20 +01:00
Ludger Küperkoch
5d35fb419d Cosmetics. 2017-02-21 14:07:21 +01:00
Ludger Küperkoch
049b2b6991 Cosmetics. 2017-02-21 14:05:41 +01:00
Ludger Küperkoch
f1f54bf7b5 Additional new icon design. 2017-02-20 14:32:12 +01:00
Ludger Küperkoch
ef2db012be Additional new icon design. 2017-02-20 14:32:06 +01:00
Ludger Küperkoch
2b926c4466 Additional new icon design. 2017-02-20 14:31:59 +01:00
Ludger Küperkoch
01d90b715b New icon design. 2017-02-20 11:41:13 +01:00
Ludger Küperkoch
a9e70adbcd New button designed. 2017-02-17 17:46:52 +01:00
Ludger Küperkoch
8dbb19380f Additional new icon design. 2017-02-17 17:46:22 +01:00
Ludger Küperkoch
653ab1ad4d Additional new icon design. 2017-02-17 17:46:04 +01:00
Ludger Küperkoch
7559f45b5b Additional new icon design. 2017-02-17 15:21:15 +01:00
Ludger Küperkoch
f959e5f9f3 Additional new icon design. 2017-02-17 15:21:02 +01:00
Ludger Küperkoch
58bdf3b147 Additional new icon design. 2017-02-17 15:20:45 +01:00
Ludger Küperkoch
e306a60b27 New icon design. 2017-02-17 12:09:14 +01:00
Ludger Küperkoch
3949c6b3f1 New icon design. 2017-02-17 12:09:02 +01:00
Ludger Küperkoch
2d8bb0b700 New icon design. 2017-02-17 12:08:18 +01:00
Ludger Küperkoch
a9c9e45942 New compiled via pyrcc4. 2017-02-16 16:37:38 +01:00
Ludger Küperkoch
75d2d79ee5 New locate button. 2017-02-16 16:36:38 +01:00
Ludger Küperkoch
0a54e627eb Implemented new locate button. 2017-02-16 16:35:54 +01:00
Ludger Küperkoch
17e9f8b5fe New designed locate button. 2017-02-16 16:35:33 +01:00
Ludger Küperkoch
2954e5acea Reversed former changes, no need for math module. 2017-02-09 17:15:00 +01:00
Ludger Küperkoch
af555ab1ee Marginal changes 2017-02-09 17:09:21 +01:00
Ludger Küperkoch
200695e7ca Fixed bug in plot_pdf: wrong input for _axes.plot, method instead of values of method! 2017-02-09 16:59:47 +01:00
Ludger Küperkoch
a3d3c02773 Bugfix: Wrong use of MessageBox.question. 2017-01-26 16:24:07 +01:00
Ludger Küperkoch
41ca6114b1 Additional print output. 2017-01-25 14:46:54 +01:00
Ludger Küperkoch
86819f6b4a In read_metadata: Removed raise IOError if no station-meta info are available, instead print info and leave parameters as None. In restitute_data: break if no station-meta info are available. 2017-01-25 14:02:14 +01:00
Ludger Küperkoch
c502f26c88 Cleaned up. 2016-10-28 16:34:31 +02:00
Ludger Küperkoch
52e481abc5 Accelerated calculations in fitSourceModel. 2016-10-28 16:33:44 +02:00
Ludger Küperkoch
b69387e49f Replaced fixed plotting advice with iplot parameter. 2016-10-28 14:54:55 +02:00
Ludger Küperkoch
c2c2047dcf Fixed oversight: if automatic picks have been processed, picks of dictionary were not written to picks list. 2016-10-28 13:40:14 +02:00
Ludger Küperkoch
236a1a43f8 Bugfix in applyPicks: If there are automatic picks, OverwriteError is suppressed. 2016-10-28 11:04:56 +02:00
Ludger Küperkoch
61e4aa98c6 Marginal changes. 2016-10-27 16:26:06 +02:00
Ludger Küperkoch
d7418d2b30 Fixed oversight 2016-10-27 16:17:21 +02:00
Ludger Küperkoch
0318fe7c32 Bugfix in calcsourcespec: take into account special case of components 1, 2, and Z. 2016-10-27 16:15:38 +02:00
Ludger Küperkoch
9e5b3f6916 Bugfix in fitSourceModel: Be sure, to set trial window aroun initial corner frequency within available data. 2016-10-27 16:06:45 +02:00
Ludger Küperkoch
41eebfbcda Bugfix in calcsourcespec: If no rotation of traces is possible, use component 3 instead of component z. 2016-10-27 15:50:24 +02:00
Ludger Küperkoch
42268cd3e9 Optimized and cleaned fitSourceModel to speed it up. 2016-10-27 14:55:03 +02:00
Ludger Küperkoch
bcde390d42 Bugfix in class MomentMagnitude: calcsourcespec was feeded with 1 component only, thus rotation of traces was no more possible. 2016-10-27 09:07:08 +02:00
Ludger Küperkoch
c055b52325 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2016-10-26 11:37:39 +02:00
Ludger Küperkoch
877bd69b59 Cosmetics. 2016-10-25 16:26:13 +02:00
Ludger Küperkoch
064c9fb919 More detailed output on screen. 2016-10-25 16:24:25 +02:00
Ludger Küperkoch
4beae3bb2b Implemented try-except in restitute_data to capture failed instrument correction. Additional output on screen. 2016-10-25 16:21:48 +02:00
Ludger Küperkoch
b11a03af58 Bugfix: corrected key search in dictionary. 2016-10-25 10:26:32 +02:00
Ludger Küperkoch
0ce8b7afb3 Additional screen output in verbose mode. 2016-10-24 13:58:34 +02:00
Ludger Küperkoch
d578b0f0dc Bug fix: import of find_horizontals was missing. 2016-10-24 13:56:51 +02:00
Ludger Küperkoch
18d2654029 Additional screen output in verbose mode. 2016-10-21 14:16:45 +02:00
Ludger Küperkoch
cb0b8c5735 Some cosmetics. 2016-10-21 14:16:20 +02:00
Marc S. Boxberg
8e54594260 Corrected Markdown-Syntax in README.md. 2016-10-04 11:35:37 +02:00
d668a483fc Merge tag '0.1a' into develop
First release of PyLoT
2016-10-04 06:42:34 +02:00
f5c06cd6b7 Merge branch 'release/0.1a' 2016-10-04 06:41:54 +02:00
b8840dff13 [version] edited release version 2016-10-04 06:40:48 +02:00
91c181ef2d [README] added some necessary information to the README for first release; renamed pylot_sample.in for convenience and removed an obsolete import 2016-10-04 06:32:10 +02:00
ae0cc5e160 [remove] moved correlation code from PyLoT to the seisobs utils scope 2016-10-03 08:56:23 +02:00
45184fd888 [move] acitveSeismoPick3D removed from PyLoT project
will be under version control on its own
2016-10-03 08:20:54 +02:00
75a8397b21 [release] edit to README and deleted duplicate LICENSE file 2016-09-30 16:32:34 +02:00
96124537cd Merge branch 'master' into develop 2016-09-29 14:18:39 +02:00
ad909804d1 Merge branch 'master'
Conflicts:
	pylot/core/analysis/magnitude.py
	pylot/core/pick/autopick.py
	pylot/core/util/dataprocessing.py
2016-09-29 14:01:15 +02:00
04da34deec Merge branch 'feature/magnitude4QtPyLoT' into develop
Conflicts:
	pylot/core/analysis/magnitude.py
	pylot/core/util/widgets.py
2016-09-29 13:54:18 +02:00
2e840cdfeb [fix] reformatted code and fixed magnitude_type bug 2016-09-29 12:44:37 +02:00
dfefd8af87 [enhancement] make use of new Magnitude method in QtPyLoT 2016-09-29 12:08:59 +02:00
34c1e80e78 [enhancement] make use of the new methods introduced in [900c7af931] 2016-09-29 11:55:08 +02:00
900c7af931 [new] added referenced information on Magnitude properties to the recently introduced Magnitude objects 2016-09-29 11:53:25 +02:00
010963dcd1 [bugfix] not all processing entries have to contain remove but at least one of them 2016-09-28 15:07:49 +02:00
d68a1bcf0e [fix] some bugs found and fixed 2016-09-28 14:58:27 +02:00
019a3ae0f3 [new] added origin information to the net_magnitude 2016-09-28 14:58:27 +02:00
d093349b50 changed function position 2016-09-28 14:38:16 +02:00
be2bacf5e8 bugfix: metadata not read from default file 2016-09-28 14:37:24 +02:00
5f92d1f0db [refactor] major refactoring of autoPyLoT and making use of the newly introduced Magnitude objects 2016-09-28 11:03:53 +02:00
231e7dafa9 [new] added a function to easily add amplitude information to a given Obspy event object 2016-09-28 11:01:09 +02:00
4e520df145 [new] added Wood-Anderson amplitude output for further analysis 2016-09-28 10:59:50 +02:00
ae967b3429 [remove] removed Wood-Anderson peak-to-peak amplitude reading from autopick.py; newly introduced in autoPyLoT in a future commit 2016-09-28 10:57:52 +02:00
c1bddd5c0b [change] improved verbosity and plotting control for Magnitude objects 2016-09-28 10:56:05 +02:00
72d15e1fc5 [new] implemented new magnitude concept into QtPyLoT 2016-09-27 15:15:53 +02:00
699ba6f122 [new] added a new Error -> ProcessingError raised in case of failed restitution 2016-09-27 15:14:48 +02:00
cf514ae024 [change] traces that could not be restituted are now removed from trace 2016-09-27 15:13:51 +02:00
28a5cedbc6 [refactor] further refactoring done -> obsolete functions deleted, imports optimized, output suppressed and calculation done in __init__ 2016-09-27 15:12:14 +02:00
405402ffdc [refactor] major refactoring of Magnitude objects finished
now the changed usage of the Magnitude object has to be implemented into autoPyLoT and QtPyLoT (pending)
2016-09-27 13:57:14 +02:00
d4481e4acd [new] added peak_to_peak, get and net_magnitude giving Wood-Anderson simulated peak amplitude, single station magnitudes and network magnitude for a given event, respectively 2016-09-26 16:04:09 +02:00
c52277e4a2 [new] added attributes, properties and special method __str__ to the Magnitude superclass -> improves significantly convenience of sub-class programming 2016-09-26 15:56:40 +02:00
9288a169a4 [change] if folder selection is canceled do not empty editable text 2016-09-26 14:49:29 +02:00
dc38bd6e79 [fix, refactor] started major refactoring of magnitude.py and fixed some smaller bugs 2016-09-26 14:47:50 +02:00
eaa3c2e75d [change] do some major refactoring on Magnitude and subclasses to be more efficient and clean 2016-09-26 10:49:02 +02:00
51f4082e04 [fix] imported Magnitude overwrite prevented by renamed import; changed wrong function call 2016-09-23 15:21:34 +02:00
0dffe37d3b [namefix] rename data file and corresponding function 2016-09-23 15:12:43 +02:00
bfa7ffc960 [move] moving functions for Richter and moment magnitude calculation to magnitude module for re-use in autoPyLoT 2016-09-23 15:12:04 +02:00
65740e6cff [namefix] rename data file and corresponding function 2016-09-23 14:28:02 +02:00
Ludger Küperkoch
d0a46eb2bb Changed iplot flag. 2016-09-23 10:31:42 +02:00
Ludger Küperkoch
dc677062f4 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop
Something unholy happend!
2016-09-23 10:25:52 +02:00
Ludger Küperkoch
18f8fc25a8 Marginal changes. 2016-09-23 10:25:48 +02:00
04ec43c699 [fix] restitute waveform data prior to Wood-Anderson simulation 2016-09-22 14:12:24 +02:00
8307974edf [new] added richter magnitude calculation (to be tested) 2016-09-22 11:39:07 +02:00
bcb3eca8b2 [new] added data file and a function that evaluates the Gutenberg-Richter relation for a given distance 2016-09-22 10:54:37 +02:00
f35559e7c0 [new] added data file and a function that evaluates the Gutenberg-Richter relation for a given distance 2016-09-22 10:53:09 +02:00
Ludger Küperkoch
180cd25b51 Fixed bug in read_metadata.py: path to inventory file was not taken into account. 2016-09-21 14:36:25 +02:00
80e0ca99d7 [new] added function to calculate symmetrized pickerror on the fly 2016-09-21 14:12:58 +02:00
a215ba35b1 Merge branch 'feature/magnitude4QtPyLoT'
Conflicts:
	pylot/core/analysis/magnitude.py
2016-09-21 10:41:38 +02:00
ca7ce5f13c [change] signature of calcMoMw changed; renamed getinvdir to get_metadata
removed an unused remnant parameter invdir from definition of calcMoMw; method getinvdir from Magnitude class has been renamed and modified and returns now the metadata information and not only the inventory directory
2016-09-21 10:27:47 +02:00
777941b669 [fix] corrected docstring for new signature 2016-09-21 10:13:25 +02:00
Ludger Küperkoch
db3347b17c Removed pdb. 2016-09-20 15:29:45 +02:00
Ludger Küperkoch
a95a33abc9 Implemented read_metadata.py in calcsourcespec.py (was this intended?). 2016-09-20 15:26:55 +02:00
Ludger Küperkoch
e4c1912896 Additional screen output for read_metadata.py. 2016-09-20 15:25:26 +02:00
Ludger Küperkoch
ee2f462c92 Fixed bug in read_metadata.py: path to inventory file was not taken into account. 2016-09-20 14:30:24 +02:00
a54ffe01f8 [new, bugfix] use new metadata concept in the scope of QtPyLoT; consistent use of input variables
input variables should always be used; avoid hard-coded parameters
2016-09-20 13:45:49 +02:00
21042bc071 Merge branch 'feature/magnitude4QtPyLoT'
Conflicts:
	pylot/core/util/dataprocessing.py
	pylot/core/util/widgets.py
2016-09-20 13:24:37 +02:00
Ludger Küperkoch
6a2bbe3f91 Stabilized zero-crosings determination for source spectrum estimation from P pulse. 2016-09-20 13:22:05 +02:00
Ludger Küperkoch
f46c618748 Stabilized zero-crosings determination for source spectrum estimation from P pulse. 2016-09-20 10:40:21 +02:00
df002ce9ac [change] use read in metadata information instead of reading metadata each time invoked 2016-09-20 09:58:33 +02:00
7e76bf7577 [change] make use of new metadata reading utility function to improve performance 2016-09-20 09:57:09 +02:00
4a6b653a72 [new] added new function to read metadata from disk
this new function prevents multiple reading of large dataless seed volume to enhance overall performance
2016-09-20 09:55:54 +02:00
c73435dec3 [fix] do not calculate moment magnitude for S phases 2016-09-20 09:54:14 +02:00
Ludger Küperkoch
b3edeca81d Changed input for P-quality factor. 2016-09-19 16:10:57 +02:00
Ludger Küperkoch
c60689c8ad Removed import pdb 2016-09-19 13:35:35 +02:00
Ludger Küperkoch
aacfbf3bbb Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2016-09-19 13:22:50 +02:00
Ludger Küperkoch
93f9070396 Fixed bug: path seperator was not taken inot account. 2016-09-19 13:22:46 +02:00
84739ed8ab [new] added new function to find common time window within a stream 2016-09-19 11:43:16 +02:00
420f382051 [cherry-pick] merged conflicts after cherry-pick of commit [17585f9381] 2016-09-19 11:42:52 +02:00
f34262d931 [enhancement] catch possible exceptions during restitution process without losing code's verbosity 2016-09-19 11:39:15 +02:00
ce4ac4fd04 [pep8] use naming and style conventions 2016-09-19 11:36:51 +02:00
fa19ae9b9c [bugfix] only try to calculate moment magnitude given w0 and fc 2016-09-19 11:35:59 +02:00
8ee515e79f [bugfix] do not continue calculation without given data 2016-09-19 11:34:03 +02:00
5155efc710 [bugfix] do not try to give a full filepath for searching issue 2016-09-19 11:33:08 +02:00
8d37e9299c [new] added new function to find common time window within a stream 2016-09-19 11:32:00 +02:00
17585f9381 [rename] renaming getGlobalTimes for consistency and introduction of similar new function in future commit 2016-09-19 11:29:33 +02:00
c8d8525c11 [bugs fixed and found] dataprocessing doesn't work as expected, np.bool_ substituted by bool 2016-09-15 14:51:11 +02:00
1e4b1d691a [bugfix] using get method and account for not existing autopylot input file 2016-09-15 12:14:43 +02:00
4233af55c6 [bugfix] which now also uses the nllocbin parameter from the input file 2016-09-15 12:11:24 +02:00
fa42134a00 [modified] use os.path to create path strings for reading data 2016-09-15 11:41:30 +02:00
Ludger Küperkoch
d099e4b466 Bug fixed: Parser could not find dless-file as path was not given. 2016-09-14 13:43:10 +02:00
d7680f8ae3 Merge branch 'feature/magnitude4QtPyLoT'
Conflicts:
	pylot/core/util/utils.py
2016-09-13 12:02:21 +02:00
15700b074d [major, refs #200] major change for the magnitude estimation from GUI
restitution of waveform data has been moved to dataprocessing; the routines have been cleaned up and work in changed order now:
new function restitute_data is a wrapper function in order to restitute seismic data with the most popular kinds of station metadata
2016-09-13 12:00:37 +02:00
8a5fcf05bf [move] pseudo method restituteWFData changed to function restitute_data and moved to dataprocessing 2016-09-10 13:24:42 +02:00
7c5b8cb646 [move] pseudo method restituteWFData changed to function restitute_data and moved to dataprocessing 2016-09-10 13:24:12 +02:00
8866d54428 [bugfix] now plotting of picks works also if less data than picks are available 2016-09-09 06:31:30 +02:00
94236190ba [bugfix] cancelling localization now works and gives information about the localization state 2016-09-09 06:31:04 +02:00
3d41e0abcd [refs #200] take advantage of the newly imported input file for magnitude calculation 2016-09-08 15:31:23 +02:00
6e6b3570a8 [bugfix] now plotting of picks works also if less data than picks are available 2016-09-08 15:29:37 +02:00
a2ddd04b2f [bugfix] cancelling localization now works and gives information about the localization state 2016-09-08 15:28:40 +02:00
cbbe019475 [new] read generalized parameter input file 2016-09-08 14:02:21 +02:00
7d5b8db232 [new] pylot.in which will substitute other input files later
a more general input file might help prevent ambiguity among use cases
2016-09-08 13:45:16 +02:00
fd8abd18b5 Merge branch 'develop'
[bugfixes] bringing bugfixes into master
2016-09-08 09:56:57 +02:00
49b07163ad [bugfix] saving data did not work properly due to changed variable signature; picking on just one horizontal component now possible, crash was caused by mismatching component labels -> new function added to find these labels from the available data 2016-09-08 09:54:43 +02:00
d953609419 [bugfix] just parse filter options if available 2016-09-07 12:17:51 +02:00
9632ecf41f [bugfix] cover all possible cases (some correct components have been dropped before) 2016-09-07 11:10:51 +02:00
f6d05dd2cc [refs #200] use distance in kilometres
ObsPy provides the epicentral distance in degree if the event information are read from a NLLoc hyp-file. To calculate the correct moment magnitude values it is essential to have the distance in kilometres instead.
2016-09-07 11:05:10 +02:00
12641f8d52 [refs #200] fixing some minor bugs during processing of magnitude 2016-09-05 15:00:08 +02:00
e1e3d54f8e [refs #200] corrected call to QFileDialog 2016-09-05 10:16:12 +02:00
e6b788d423 Merge branch 'develop'
Conflicts:
	QtPyLoT.py
	pylot/core/io/data.py
2016-09-02 14:24:34 +02:00
76a856aa11 [clean-up] some code cosmetics and started to implement eventinformation 2016-09-02 14:21:59 +02:00
9f13f8db49 [refs #200] finished magnitude calculation (to be tested) 2016-09-02 09:03:51 +02:00
d98ecea18a [refs #200] now merging picks without destroyed reference resource IDs 2016-09-01 14:21:25 +02:00
81640d30f9 [refs #200] ongoing work on parameter derivation 2016-08-31 13:41:18 +02:00
facffa1bf2 [refs #200] started to implement magnitude determination from QtPyLoT 2016-08-31 12:16:48 +02:00
f1d806c154 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-08-30 15:00:34 +02:00
a8e56dba8b added repicking layout UI 2016-08-30 14:59:38 +02:00
bcff0b74fe Merged feature/NLL4QtPylLoT into develop 2016-08-30 14:54:23 +02:00
280e954cac [closes #137] location out of QtPyLoT now possible 2016-08-30 14:53:58 +02:00
a4c2666584 adding repicking qt layout 2016-08-30 11:54:38 +02:00
ad91504211 [ref #137] removing last bugs before closing feature 2016-08-29 15:52:58 +02:00
060bc1d0c8 [refs #137] bugfix value now is specified by user on demand 2016-08-26 14:36:33 +02:00
eb1d7c07a0 preparations for QT repicking interface 2016-08-26 14:31:09 +02:00
30ccd331d4 [refs #137] bugfix in widgets.py badly formatted string corrupted load of settings; added a functionality to utils' which function to also look for NLLoc installation in the settings' binary path 2016-08-26 10:48:16 +02:00
b29c7068e3 [refs #137] some improvements in autoPyLoT and ongoing work in the QtPyLoT NLL implementation 2016-08-25 21:32:41 +02:00
e53dd99d75 [refs #137] implementation of GUI driven NonLinLoc location started 2016-08-25 13:31:51 +02:00
135ac0ef80 successfully implemented a working version of QT postprocessing interface 2016-08-24 14:58:51 +02:00
e51704f2b7 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-08-24 13:13:41 +02:00
9c3770ea9f working on postprocessing GUI 2016-08-24 13:13:24 +02:00
74d31afa3d Merged branch develop into develop 2016-08-19 16:32:41 +02:00
f428a72e86 [enhancement] improved functionality and flexibility of PDFstatistics class 2016-08-19 16:32:31 +02:00
c500f1b8bb [add] added new utility function to find a substring in a list of strings 2016-08-19 16:09:29 +02:00
f9d40439a9 [change] oversampling reduced to avoid computational overhead 2016-08-19 16:08:18 +02:00
71f59b3c64 [change] extracted plotting and started new module for plotting; improved docstring quality 2016-08-18 10:22:30 +02:00
sebastianp
08749840ba resetting oversampling to 1 "one" 2016-08-16 09:14:56 +02:00
5228657a60 small changes for synthetic tests 2016-08-15 13:35:01 +02:00
7921d12c80 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop
Conflicts:
	pylot/core/util/utils.py
2016-08-12 19:57:11 +02:00
49727b25df [change] improved docstrings and testing of utils.py 2016-08-12 09:50:36 +02:00
sebastianp
36e7bc1bb2 [documentation] adding docstring to all the methods. 2016-08-11 16:13:53 +02:00
a6ce93cd9f [modification] added missing docstring content 2016-08-10 16:30:28 +02:00
c72ed1e169 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-08-10 14:24:40 +02:00
7b9d1f172a semi working QT interface for postprocessing 2016-08-10 14:24:07 +02:00
sebastianp
dd6bce89fb Merge remote-tracking branch 'origin/develop' into develop 2016-08-10 10:06:48 +02:00
sebastianp
14c22d73b7 [enhancement] adding a save option for plotting 2016-08-10 10:06:34 +02:00
94782f6758 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-08-09 13:10:49 +02:00
f8623fc454 [enhancement] added capability of searching for files in subdirectories 2016-08-09 13:10:25 +02:00
sebastianp
37ed561f73 removing unnecessary code 2016-08-09 12:21:00 +02:00
28d2464aee got working window layout for postprocessing (no functions yet) 2016-08-09 11:48:37 +02:00
sebastianp
a4c7e61e1a Merge remote-tracking branch 'origin/develop' into develop 2016-08-09 11:07:26 +02:00
sebastianp
7c8a437dd8 [task] additional changes for phase separation 2016-08-09 11:07:18 +02:00
9f15376fd8 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-08-09 10:38:19 +02:00
9d51339268 start of improving postprocessing ui 2016-08-09 10:37:26 +02:00
sebastianp
f4bdb38e16 [task] PDFStatistics object is now far more flexible 2016-08-09 10:07:27 +02:00
sebastianp
b72e16aaed Merge remote-tracking branch 'origin/develop' into develop 2016-08-04 16:07:47 +02:00
sebastianp
87f87ffb95 [task] rewriting some functions to make them more flexible 2016-08-04 16:07:01 +02:00
4c42e9ceb5 bugfixes, added fullscreen mode 2016-08-04 14:17:22 +02:00
30049baf94 added constant SNR possibility (plotting), changed replotting structure 2016-08-04 12:16:25 +02:00
3efb237452 fix: wait for process obsdata (p.wait()) 2016-08-04 10:35:09 +02:00
471cfe755b [fix] be sure to start the external programs in the right directory 2016-08-03 13:28:54 +02:00
c13bdd2cf2 code cleanup 2016-08-02 12:21:25 +02:00
a8522d0fae pre code cleanup 2016-08-02 11:54:28 +02:00
sebastianp
2a798a554b [task] read statistics from file 2016-07-29 12:01:34 +02:00
sebastianp
10fbfe5554 Merge remote-tracking branch 'origin/develop' into develop 2016-07-28 13:43:23 +02:00
sebastianp
19ced8b8c5 [task] plot routine for quantile distance quotients 2016-07-28 13:42:50 +02:00
638f552d6d changed structure of callFMTOMO to class 2016-07-27 14:42:11 +02:00
adfe9cc027 bugfixes 2016-07-27 13:46:42 +02:00
8bd9f7debc rename 2016-07-27 11:13:20 +02:00
987ee597fd Release version modified!?!? 2016-07-27 11:12:27 +02:00
48c0dbacfb changed structure of active GUI code, autopicker window changed to class 2016-07-26 14:48:08 +02:00
3273709b54 code for first three windows changed to class structure 2016-07-19 15:19:03 +02:00
05cc8e52b9 last commit before structural changes (classes for each window) 2016-07-19 12:16:37 +02:00
c7f7d9785b Rearranged Main Layout (buttons to top menu), several tweaks for plotDynSNR 2016-07-18 11:54:29 +02:00
fb8d888845 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-07-18 11:12:43 +02:00
8ee075c2b1 added SNR modification/plot 2016-07-14 13:59:52 +02:00
sebastianp
1ed83d786d implementen some new functions to PDFStatistics 2016-07-13 15:26:36 +02:00
8433767b22 [change] consequently use new pdf evaluation concept throughout the entire code 2016-07-13 14:37:12 +02:00
sebastianp
d4fd93ed8f Merge remote-tracking branch 'origin/develop' into develop 2016-07-13 14:15:50 +02:00
sebastianp
c7d8d0ecf5 undid earlier changes in PDFStatistics 2016-07-13 14:15:44 +02:00
6ad78acc85 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-07-13 14:15:30 +02:00
63ff8e48c5 changed generateFMTOMOinput from z, y, x to x, y, z 2016-07-13 14:15:01 +02:00
sebastianp
6fd1f9e2cc Merge remote-tracking branch 'origin/develop' into develop 2016-07-13 11:00:51 +02:00
sebastianp
38d225fbcf undid earlier changes in PDFStatistics 2016-07-13 11:00:30 +02:00
fd569823f8 bugfix typo 2016-07-13 10:58:39 +02:00
288bbe13d7 bugfix fstart before path 2016-07-13 10:52:42 +02:00
5890e905fc Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-07-13 10:04:48 +02:00
e3100562da pseudo 2D model generation working after some fixes (+2 cushion for propgrid) 2016-07-13 10:04:13 +02:00
8cef8ff2db [bugfix] due to changes in the usage of ProbabiltyDensityFunction.data expectation and standard deviation were wrongly calculated 2016-07-12 16:19:27 +02:00
39184ef150 [change] new concept for evaluation of the pdf instead of holding a sampled array works now also for difference pdfs using a scipy's spline interpolation capabilities 2016-07-12 15:31:59 +02:00
ed85d0ef12 added minimum cushion for 2D case (for input file generation) 2016-07-12 14:39:28 +02:00
546dfad722 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-07-12 14:09:50 +02:00
c47bf7911a GUI refinements, added 2D structure for plots, adde input filename specifications 2016-07-12 14:09:08 +02:00
ef613e48a4 [change] pdf for difference of picks estimated via curve_fit (to be tested) 2016-07-11 14:15:41 +02:00
08fc5d554b [change] introducing a whole new concept of handling pdfs; evaluating function on demand rather than holding a sampled array 2016-07-11 10:42:04 +02:00
950696053c [fixed] pdf values are now evaluated on demand not stored in an array in advance 2016-07-08 14:16:48 +02:00
sebastianp
7eded42142 [bugfixing] quantile function loops inifinte for small epsilon. See docstring. 2016-07-07 15:30:05 +02:00
55a589b525 Added Surface plots, text windows and plotting of single shots. 2016-07-07 14:25:37 +02:00
5293bb6ec7 activating vtk_tools widget, bugfix on merging rays.dat (too many linebreaks) 2016-07-06 11:40:08 +02:00
0be69de6f7 busy adding VTK tools to main UI 2016-07-05 13:59:01 +02:00
5c7123af66 added a feature to generate a survey object from a SeisArray 2016-07-05 10:38:28 +02:00
e8cbc2f377 [change] implementation of quantile calculation corrected 2016-06-30 13:14:38 +02:00
sebastianp
4f47f9f343 Merge remote-tracking branch 'origin/develop' into develop 2016-06-29 15:31:00 +02:00
sebastianp
a8b7eff561 [task] implementing new methods for pdf comparison. 2016-06-29 15:29:58 +02:00
9e3f3b29d2 changed general structure of seisarray and survey. survey object can now be generated by using a seismic array (also in GUI). 2016-06-28 14:57:48 +02:00
8714616d1b Working on input file format (SEG2/SEGY) etc. 2016-06-27 15:20:17 +02:00
253e9f4b1e Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-06-27 14:47:44 +02:00
a813eb462f adding tooltips 2016-06-27 14:47:34 +02:00
4591b7b1d9 [bugfix] changed the order of trying to read seismic data for reassessment 2016-06-27 10:59:50 +02:00
4bbb40c8b7 window resizing pt.3 2016-06-23 12:06:59 +02:00
3bec20bd45 window resizing pt.2 2016-06-23 11:59:12 +02:00
30d911b5cc window resizing 2016-06-23 11:55:54 +02:00
47bd7384f8 bugfixes, replotting of SeisArray figure 2016-06-23 11:42:09 +02:00
0abbb79e64 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-06-21 13:29:28 +02:00
806b974011 further GUI implementations, plot of seismic array in main window 2016-06-21 13:29:10 +02:00
043f60dc2a [change] make Python 3 compatible calls to print 2016-06-21 09:32:37 +02:00
952a2ea535 make use of formerly implemented subprocess call routine 2016-06-21 09:31:26 +02:00
8393f283c7 GUI changes and updates 2016-06-17 13:14:20 +02:00
f01187615b fix 2016-06-16 14:00:04 +02:00
579461f7b4 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-06-16 13:57:50 +02:00
9f71bf8082 restructured GUI and added first Seismic Array options 2016-06-16 13:57:15 +02:00
b3acef0bcd [closes #198] comparison dialog now available from QtPyLoT 2016-06-15 14:52:42 +02:00
c3d134e6ca changed GUI organization (single files for each window) 2016-06-15 12:19:11 +02:00
1ec468a586 bugfix, boxes clickable 2016-06-15 10:01:28 +02:00
3583f70e2b [CAUTION] this rev is not working, implementation of the individaul pdf plots for the picks pending 2016-06-14 15:26:16 +02:00
e554330154 [change] now the station selector entries are sorted for convience 2016-06-14 15:03:13 +02:00
3c4cbff9f3 [fix] do not try to add a Layout to a QWidget which already has one 2016-06-14 14:56:15 +02:00
78ebb1f8db [change] decreased verbosity 2016-06-14 14:55:18 +02:00
073ed658b3 [edit] changed calculation of difference pdf to include large differences also 2016-06-14 14:28:46 +02:00
4093dd0ce7 name change 2016-06-13 14:37:56 +02:00
410b3c2f55 added GUI 2016-06-13 14:37:12 +02:00
d02bb369ec Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-06-13 14:35:47 +02:00
69b5b410f0 minor changes for GUI 2016-06-13 14:35:29 +02:00
3cee0e6df9 [change] added plots for debugging 2016-06-13 14:23:42 +02:00
79f0982558 [bugfix] use only vaild values for plotting 2016-06-13 11:27:16 +02:00
3568a8a59a [bugfix] changed the way the the expectation and the std array are calculated; not sure how to deal with values 'inf' 2016-06-11 08:03:16 +02:00
a3deb2a9d3 Merged 195 into develop 2016-06-10 14:37:40 +02:00
467f0ae79b [new] histogram plot added; debugging in progress 2016-06-10 14:37:33 +02:00
280f8544e4 [prepare] starting implementation of a histogram overview plot from pick comparison dialog 2016-06-10 09:04:10 +02:00
be326cba7b [bugfix] automatic data with the S-P time saved in the pickdict caused Exception in the ProbabilityDensityFunction constructor 2016-06-10 09:03:16 +02:00
14cd175297 [bugfix] it was not possible to pick the very first station manually 2016-06-10 09:01:37 +02:00
b5d94eed61 [closes #195] implementation of comparison within GUI ready for testing 2016-06-08 15:00:47 +02:00
b96366e321 [ref #195] implementation done; some bugs have to be fixed 2016-06-08 13:14:38 +02:00
e6d8701411 Merged branch 195 into develop 2016-06-07 14:09:41 +02:00
8e09fd7c42 [refs #195] pushing GUI element implementation forward 2016-06-07 13:51:03 +02:00
661b4d11c0 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-06-07 13:39:34 +02:00
f3769846ba GUI testing 2016-06-07 13:39:21 +02:00
7e33502824 GUI tests 2016-06-07 13:38:35 +02:00
dd668b90d6 Merged branch 195 into develop 2016-06-06 14:12:18 +02:00
536019259e [adresses 195] preparing GUI elements for a new dialog widget for interactive comparison 2016-06-06 14:10:46 +02:00
de89fc83ce moved widget to utils widgets for consistency and reusability
additionally the filter for PHASES and LOC files has been modified to avoid false selection
2016-06-02 09:39:01 +02:00
2395c12b26 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-06-01 14:15:14 +02:00
a255718f59 added script to VC 2016-06-01 14:14:57 +02:00
9c8c5bb842 - 2016-06-01 14:14:12 +02:00
02117399b5 output change 2016-06-01 14:13:15 +02:00
9996033ca5 cleanup (worker) 2016-06-01 14:12:49 +02:00
0d7ee9d779 [fixed] loading of automatic picks did not plot any result (fixed in this rev) 2016-06-01 08:55:43 +02:00
62b1a4e670 making widget reusable 2016-05-31 17:36:00 +02:00
73c49d8291 improved plotting performance especially for large data sets 2016-05-31 17:27:59 +02:00
7965239a92 [closes #124] PILOT event data can be loaded now 2016-05-31 15:53:23 +02:00
724032b3f6 capturing multiply stored station labels 2016-05-31 13:12:42 +02:00
e341994825 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-05-31 11:15:38 +02:00
0520df5963 bugfix 2016-05-31 11:15:30 +02:00
ae2fc73d89 parallelization 2016-05-31 11:14:51 +02:00
51aa949b56 debugging in progress 2016-05-30 17:08:35 +02:00
36b0aea86c [edit] fixing bugs (in progress) 2016-05-27 12:53:34 +02:00
618dd10c23 [task] further steps to implement pick comparison from QtPyLoT 2016-05-27 11:25:47 +02:00
a1d29a45cb Merge branch 'develop' 2016-05-27 07:45:04 +02:00
163a501ae9 introducing automatic data into QtPyLoT 2016-05-27 07:43:54 +02:00
53614bb5b9 [fix] fixing a bug introduced accidently by merge 2016-05-27 06:49:20 +02:00
0dd69a0e19 added default value for cores 2016-05-25 14:28:25 +02:00
ecf4a7ced7 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-05-25 14:24:51 +02:00
5057664b1d code changes for parallelization 2016-05-25 14:24:19 +02:00
e46e8cb71b [reformat] corrected formatting after merge 2016-05-25 14:22:08 +02:00
f8db6b1d9f [merge] resolved conflicts in utils due to two-sided coding 2016-05-25 14:05:25 +02:00
8ca87bc777 changes while testing parallelization of autopicker 2016-05-24 14:20:59 +02:00
a6eaac6c33 Changes during parallelization tests of autopicker 2016-05-24 14:19:37 +02:00
sebastianp
d49c90026d Merge branch 'master' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot 2016-05-24 13:23:08 +02:00
sebastianp
4962561d6c changes made to have better control of the output directory 2016-05-24 13:21:38 +02:00
46ccd44e16 changed to generation of reference grids 2016-05-23 14:25:24 +02:00
d9844fff17 added worker 2016-05-23 14:25:06 +02:00
42cbfeb787 temporary retaining of parallel tests 2016-05-23 14:24:02 +02:00
25ca11f572 minor tweaks 2016-05-23 14:22:52 +02:00
093f750aa1 tried worker function 2016-05-23 12:06:55 +02:00
41b7ca6968 [task] reformatting activeSeismoPick and editing pool mapping to work properly 2016-05-23 11:53:22 +02:00
3cc77f4868 bugfixes 2016-05-23 11:24:01 +02:00
73d71a61d5 restructuring for parallization 2016-05-23 11:23:23 +02:00
1f47f3dd85 parallization of picking algorithm 2016-05-23 11:22:39 +02:00
392a556ac4 [restructure] Wall-E wasting time 2016-05-20 14:46:10 +02:00
08df7c3304 [edit] decreased unwanted verbosity 2016-05-20 10:11:40 +02:00
54b557930f [edit] inserted verbosity option to control the amount of output 2016-05-20 09:58:10 +02:00
sebastianp
9b7db91037 [task] started to implement data processing step for checking corrupted GSE files 2016-05-19 15:35:11 +02:00
db17cb4f8d code cleanup 2016-05-19 14:24:48 +02:00
4edd5f8e52 code cleanup 2016-05-19 11:21:24 +02:00
5f740783f0 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-05-19 11:20:47 +02:00
3138bbfa93 code cleanup and commenting 2016-05-19 11:20:37 +02:00
7c5aff0a27 [fix] correctly formatting the timestring now 2016-05-19 11:16:28 +02:00
731acc7117 [double-checked] code has been double checked before running on data 2016-05-19 10:51:37 +02:00
sebastianp
521de9ee89 Merge branch 'master' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot 2016-05-19 10:25:19 +02:00
dc5d76efb8 [fix] fixing docstring problem caused by merge of conflicting files 2016-05-18 13:17:05 +02:00
eb5f028a47 Merge branch 'develop'
Conflicts:
	pylot/core/io/phases.py
2016-05-18 13:02:51 +02:00
c315b917b8 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-05-18 12:55:43 +02:00
e62ff9d68c [fix] returning variables now, docstrings corrected to be able to use single quotes in docstrings 2016-05-18 12:55:04 +02:00
dbaead4754 code cleanup + commenting 2016-05-18 12:00:45 +02:00
30e8f0c96a code cleanup and commenting 2016-05-17 16:19:44 +02:00
ca77b06293 Code cleanup 2016-05-17 11:53:32 +02:00
sebastianp
c84632fb27 Merge remote-tracking branch 'origin/master'
Conflicts:
	pylot/core/util/dataprocessing.py
2016-05-13 14:57:27 +02:00
4a836fd1f7 [task] started to implement data processing step for checking corrupted GSE files 2016-05-13 14:56:42 +02:00
019b801603 code rearrange and minor processing changes 2016-05-12 14:01:18 +02:00
f09af16120 [task] started to implement data processing step for checking corrupted GSE files 2016-05-12 10:08:29 +02:00
a2b0854345 Merged branch develop into master 2016-05-11 14:51:30 +02:00
79e429db8d [edit] rearrangement fastens up a bit 2016-05-11 14:50:52 +02:00
Ludger Küperkoch
2bb2ddbc7b Cleaned input file 2016-05-11 13:44:26 +02:00
Ludger Küperkoch
1cb86d7b47 Cleaned input file, additional parameter apverbose 2016-05-11 13:42:51 +02:00
8a79addb4e Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-05-11 12:02:43 +02:00
67c11558f3 Merged branch develop into master 2016-05-11 12:02:37 +02:00
46c152b7a1 improved speed on writing to file (write instead of writelines) 2016-05-11 12:02:09 +02:00
f7e1247060 [fix] make all scripts executable
new script for pilot data base reassessmant
2016-05-11 12:01:10 +02:00
Ludger Küperkoch
c34fbe1228 Removed needless terminal output 2016-05-11 10:51:33 +02:00
Ludger Küperkoch
97ca69a07d Modified for controlling amount of terminal output using new input parameter apverbose 2016-05-11 09:54:33 +02:00
Ludger Küperkoch
366ac29481 Additional input parameter apverbose to control terminal output 2016-05-11 09:52:59 +02:00
f8807a7ea6 [edit] docstring added and returning the figure instead of showing the plot
additionally hide_labels is now defined only once before going into the loop
2016-05-11 09:49:19 +02:00
63ac0107d0 [edit] implemented a plotting method for pdf dictionaries 2016-05-11 06:01:26 +02:00
c7d7acd7e3 [edit] implemented loop over PILOT database for reassessment
additionally the output of reassess_pilot_event is more verbose now
2016-05-10 09:54:21 +02:00
3705eb567b [fix] overcome numerical instabilities
due to the usage of large absolute values (timestamp) on time axis the estimation of the expectation value gets instable
2016-05-09 12:06:47 +02:00
4480854ee5 [workaround] set minimum difference of mpp with lpp and epp
this workaround elevates the difference between the uncertainty-picks and the mpp to a minimum value of three samples (needed for a reasonable pdf represetation of the pick)
2016-05-06 12:04:27 +02:00
d8a764db31 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-05-04 10:22:06 +02:00
f58c5a5f9d merge correction 2016-05-04 10:21:39 +02:00
fd27a43110 fixing import problems 2016-05-03 15:09:51 +02:00
41991c5d81 [edit] further restructuring and bugfixing 2016-05-03 13:54:59 +02:00
a82c1d39c6 [fix] fixing obvious problems in advance 2016-05-03 09:35:31 +02:00
ecb3670aeb Merge branch 'master' into develop
Conflicts:
	scripts/pylot-reasses-pilot-event.py
2016-05-03 08:58:33 +02:00
210d39882d further development on the reassessment routines for PILOT data 2016-05-03 08:46:13 +02:00
ae0c08eeb2 Merge branch 'master' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot 2016-05-02 14:10:41 +02:00
8cb4f11bf8 [edit] implementing reassessment functions 2016-05-02 14:10:11 +02:00
ec42e1bd15 added first version of fmtomo_parallel script 2016-05-02 12:08:58 +02:00
dbe47690eb Merged branch develop into master 2016-05-02 11:31:17 +02:00
ddb1ad4a15 Resolved conflicts fmtomoUtils 2016-05-02 11:28:56 +02:00
Marcel Paffrath
f906211064 fmtomo2vtk merged with fmtomoUtils 2016-05-02 11:19:06 +02:00
edd8920d54 WALL-E --- Small robot, big job! Restructuring the code and preparing implementation of a re-assessment tool for PILOT phases. 2016-05-01 21:10:30 +02:00
72fa9e8feb [install] did some work on the implementation of an installation script 2016-04-29 11:50:28 +02:00
28fc226750 [update] update installation script in order to distribute current version 2016-04-28 15:20:46 +02:00
df44979337 [reorganize] some reorganization done to hand program to partner 2016-04-28 14:18:42 +02:00
37f9292c39 renamed class method 2016-04-28 14:03:32 +02:00
c489fad6ba [bugfix] comparison should not through an KeyError due to missing picks 2016-04-12 14:50:21 +02:00
416f4c7aa7 [bugfix] special method __nonzero__ should always return type bool 2016-04-12 14:48:57 +02:00
6181829ef6 [bugfix] make uncertainties from autoPyLoT may be corrupted
consequently there is minimum uncertainty gap between mpp and lpp/epp
2016-04-12 14:47:49 +02:00
4a9c02e1d1 [closes 195] in principle comparing automatic and manual picks works 2016-04-12 04:55:04 +02:00
9359338e81 [refs #195] make autoPyLoT export automatic picks in QuakeML format 2016-04-11 13:59:32 +02:00
9519372247 [bugfix] autopick accidently interchanged latest and earliest possible pick 2016-04-11 13:57:59 +02:00
2139674afa [bugfix] guessed that checking the same variable twice was not intended
instead of checking for mpickX's twice it was probably meant to check for lpickX's value
2016-04-11 12:39:46 +02:00
a9cd53886b [enhancement, task] there was no routine to read obs pick files available; default values for autopicking should be the same for all parts of PyLoT, thus defaults should be defined only once 2016-04-11 05:47:38 +02:00
2a8729c39b [refs #195] changed some default parameters for plotting the histograms 2016-04-08 14:35:20 +02:00
f15e27e81d [refs #195] hitsogram plots implemented for expectation and standard deviation 2016-04-07 16:29:29 +02:00
b5345bb5d3 [refs #195] implementation of histogram plots 2016-04-07 15:47:11 +02:00
27e334609c [refs #195] plotting method for Comparison object implemented 2016-04-06 11:27:09 +02:00
5f9a9242d1 [refs #195] realized an object oriented implementation of comparison
comparing pdf represented picks should be easy, thus objects returning everything needed are implemented; histograms and other plots are planned next
2016-04-05 22:19:55 +02:00
a475b366d4 [adresses #195] comparison dictionaries can now be compiled from QuakeML files 2016-03-31 14:29:29 +02:00
5fcaddb028 [adresses #195] started to implement comparison function 2016-03-31 09:00:49 +02:00
1fecec1696 [adresses #195] read_data now working correctly on QuakeML data 2016-03-31 08:50:09 +02:00
bd2bad7367 [adresses #195] task related new function introduced 2016-03-30 15:25:06 +02:00
76788c0223 [refs #195] initial import of new interfaces module 2016-03-30 11:45:49 +02:00
7a712ca37c [fixes #194] automatic filtering works also when switching phase selection
Switching the phase selection without picking the last onset did not filter according to the selected phase filter parameter. With this revision a displaying bug showing muliple '( filtered, filtered, filtered)' statements due to switching the phases is fixed as well.
2016-03-30 09:12:56 +02:00
d7cfd0d176 WALL-E: Einmal aufräumen und zurück! 2016-03-30 08:14:58 +02:00
a2640e3126 reformatting code 2016-03-30 07:00:31 +02:00
320b7b7219 [bugfix] pick blocker was not reset after phase was picked 2016-03-29 14:42:51 +02:00
2d66248cf9 [fixes #172] now also in overview all horizontals are plotted 2016-03-29 14:06:57 +02:00
4409a9c3ce [fixes #179] plotting of picks preserved after filtering 2016-03-29 12:09:26 +02:00
fef1a95391 [fixes #193] fixed bug introduced by component mapping
fixes a bug which was introduced in revision b8d680f54f
2016-03-29 11:40:16 +02:00
7b22bce2b0 [close #190] pick handling is now consistent for manual and automatic picks
manual and automatic picks are now treated in the same way but separately; implementation of comparison routines should be much more easy now
2016-03-29 11:26:08 +02:00
14048d6784 [edit] reformat string only if certain prefix is found 2016-03-29 11:00:31 +02:00
f075970f5e [adresses #190] autopicks in QtPyLoT can now also be updated
this change is necessary to be able to load autopickdata from storage independently
2016-03-29 10:30:45 +02:00
e164b1f168 Merged branch develop into 190 2016-03-29 08:47:20 +02:00
040c21dc13 [adresses #190] read information on the picker if available 2016-03-29 08:47:03 +02:00
4c5b58dbf1 [addresses #190, closes #192] handles unknown picker information
pick tag is set to 'Unknown' for loaded data that do not provide picker information when saved with PyLoT prior to revision 06576586c6
2016-03-29 08:24:32 +02:00
cee48146d0 [closes #178] makes use of the new status variable pick_block introduced as filter_block to solve #174 2016-03-29 07:58:20 +02:00
a1c79b554a Merge branch '174' into develop 2016-03-25 05:08:09 +01:00
65df2c7dde [closes #174] now the filter button in the picking window is no toggle button anymore and has no effect when in picking mode 2016-03-25 05:07:18 +01:00
c1c2aa4b7c [bugfix] value has to be returned in either case 2016-03-23 12:01:46 +01:00
06576586c6 [edit] make use of new pick tag
find out the person's name for tagging the picks set within PyLoT
2016-03-23 12:00:54 +01:00
722e21f582 [edit] avoid catching unspecified Exceptions
specific Exception catchment is better than general; additionally errors are raised for better debugging control
2016-03-23 11:57:07 +01:00
31d56cb287 [edit] introducing picker tag
New tag introduced to distinguish between pickers (either person's or programs name)
2016-03-23 11:48:58 +01:00
438b2706b7 [edit] removed calls to names marked as deprecated
with the last update of obspy some modules and functions names will be removed in future releases and consequently have been marked as deprecated; PyLoT now uses the desired names
2016-03-22 10:52:20 +01:00
cad6ed2274 [edit] exit if no waveform files are selected
PyLoT will only start if waveformfiles are selected
2016-03-22 10:49:06 +01:00
7225da87db [edit] reformatted code
Code indentation and PEP 8 violations automatically reduced with IDE tool
2016-03-22 08:42:09 +01:00
fa6626d62a [edit] catch reference before assignment
charactersitic function variable might be referenced before they are assigned; now they are assigned as None and calls to assert help finding wrong definitions if not assigned correctly within if clause
2016-03-21 12:06:11 +01:00
d954c3bbe8 [edit] restructuring autopicking module
renamed several function and classes, moved script files to scripts
2016-03-21 11:14:16 +01:00
b8d680f54f 189 Channels shown in wrong order. 2016-03-18 15:35:12 +01:00
15080f1699 [fix] fixed the nonzero test for pdf definition that all values have to be greater than zero and the integration over the whole interval has to evaluate to 1 with given precision 2016-03-09 11:21:33 +01:00
a5fe838514 added a str representation for the pdf class 2016-03-09 06:22:26 +01:00
f3467221cc finished implementation of summation of two independent variables represented by a pdf 2016-03-09 06:21:48 +01:00
2de79eac77 [change] moved recursive function for broadcasting pdf in a new shape into the class' body 2016-03-09 06:19:41 +01:00
c651b5ca78 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-03-08 20:36:12 +01:00
db4dd47daa [bugfixes] made some fixes to the subtraction method; in some cases ValueErrors are raised which are now handled but raised as Warning 2016-03-08 20:35:56 +01:00
e6f404a219 [closes #188] picks are set correctly now
earliest and latest possible picks are now derived from the actually displayed (in some cases filtered) waveforms
2016-03-07 10:15:42 +01:00
9f7f00314a [closes #187] pdf methods for some values like expectation and plotting ready 2016-03-04 14:13:44 +01:00
e6b5848f36 [add] untested implementations of standard deviation and probability value determination methods to class ProbabilityDensityFunction 2016-03-04 06:27:11 +01:00
78a5a5117a [add] new function added which return the index of the value of an array which is nearest to a desired value 2016-03-04 06:25:17 +01:00
4606f84809 [new] implementing comparison methods into pdf class 2016-03-03 15:14:17 +01:00
18785edf68 [fixes #186] filteroptions are only parsed if they are not NoneType 2016-03-03 14:02:49 +01:00
6f26ab07b7 [closes #184] saving picks works
saving now works without openening the filename prompt  twice or more often
2016-03-03 13:17:10 +01:00
c2168dbef3 [fixes #185] filtering of waveforms now conserved for picking 2016-03-03 11:12:27 +01:00
6108519acb [closes #182]
noiselevel now determined as the maximum of the absolute values of the noisewindow (holds also for signallevel); now the SNR and noiselevel is determined from the filtered waveform
2016-03-03 10:40:20 +01:00
848d11270b [fixes #181] now picking on horizontal components 1, 2 and N,E is possible 2016-03-02 13:37:40 +01:00
827a0da210 [fix] imports to obspy's read_events changed due to deprecated naming of function readEvents 2016-03-02 13:36:18 +01:00
c14650d33c [change] changed filter settings for local seismic data 2016-03-02 13:34:24 +01:00
c09a3271f9 make use of new option to getSNR 2016-03-02 11:08:14 +01:00
8c7a2af2db [fix] do not try to proceed if no picks are available 2016-03-02 11:07:32 +01:00
5e26519d66 [fix] avoid usage of hardly programmed indices 2016-03-02 11:06:31 +01:00
ddc682de95 [bugfix] selected file filter should be evaluated 2016-03-02 11:04:11 +01:00
96ea0d7ac3 improved readability of formula 2016-03-01 12:26:56 +01:00
e7b454bae8 [edit] just style related changes 2016-02-16 08:47:42 +01:00
3ee221b8eb [edit] implementation of difference of two independent random variable as the correlation of the PDFs completed; summation pending due to unclear axis determination of the resultant PDF 2016-02-15 20:15:54 +01:00
f2cad2e151 [edit] changed implementation name from findlimits to commonlimits which is probably more intuitive for the user along with a new signature using other instead of giving the limits in advance 2016-02-15 20:15:54 +01:00
d5e16d64da [edit] implemented method to derive limits for the special methods for addition and subtraction 2016-02-15 20:15:54 +01:00
2956f3b733 [edit] subclassing has been substituted by classmethod fromPick opportunity for creating a PDF object 2016-02-15 20:15:54 +01:00
e7a5e388f6 [edit] implementation of probability density function interface ready for testing 2016-02-15 20:15:54 +01:00
303a5f9cf0 [edit] probability density function superclass implemented due to the different character of these functions 2016-02-15 20:15:54 +01:00
ada9f4e780 [new] started implementation of probability density representation routines 2016-02-15 20:15:54 +01:00
sebastianp
0d0b43103b editing of Docstring 2016-02-03 14:49:16 +01:00
sebastianp
8f6f6cf8b6 completition of Docstring 2016-02-03 14:35:07 +01:00
Marcel Paffrath
8893a8ec6b statistic plots added 2016-02-01 11:18:42 +01:00
5170a0b1c6 [new] implementation of a probability density function representation of the pick (untested) 2016-02-01 06:13:17 +01:00
70f2761003 [reformat] reformatted indentation 2016-02-01 06:11:25 +01:00
3cbb6138e0 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2016-01-29 07:24:45 +01:00
f01c6109a8 [reformat] reformatted imports and parentheses indentation 2016-01-29 07:21:17 +01:00
Marcel Paffrath
ce705888f1 bugfixes and other not further specified changes 2016-01-19 10:31:06 +01:00
Marcel Paffrath
7edee1266a Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop
Conflicts:
	pylot/core/active/activeSeismoPick.py
2016-01-19 10:29:45 +01:00
Marcel Paffrath
acd9e942f9 improved SNR plots 2016-01-04 15:47:46 +01:00
Marcel Paffrath
3c1be950b9 removed most of the folm = 0.6 default values 2016-01-04 15:47:05 +01:00
Marcel Paffrath
3b4e1dcd1e added changes for manual picks 2016-01-04 15:46:24 +01:00
Ludger Küperkoch
5f0e59d95a Additional comments to make the code clearer. 2015-12-14 09:34:56 +01:00
Ludger Küperkoch
f6930618f2 calcMoMw: modified for calculating Mo and Mw using metric units. calcsourcespec: modified correction for attenutation using an exponential including Q(f). 2015-12-11 15:53:35 +01:00
Marcel Paffrath
0b1f16866b added plotHist 2015-12-11 11:08:06 +01:00
Ludger Küperkoch
f29d285910 Relaxed some quality-control parameters in order to increase quantity of picks. 2015-12-10 15:52:30 +01:00
Ludger Küperkoch
534718aadf Improved figure caption, shows vertical trace including station ID and channel even if no or only bad pick is available. 2015-12-10 15:50:36 +01:00
Ludger Küperkoch
d2b39ff078 Improved some print output, bugfix: avoids getting negative value for pstart when iterative re-picking. 2015-12-10 14:30:38 +01:00
44f19f02d8 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-12-10 13:17:23 +01:00
537b18774a [fix] fixed multiple calls to print by print one formatted message 2015-12-10 13:16:44 +01:00
Ludger Küperkoch
2bb99a6f2e bugfix: Even if no location is possible, autoPyLoT can handle finalpicks. 2015-12-10 12:02:32 +01:00
Marcel Paffrath
17c3dd4f69 plot2dttc textposition changes etc 2015-12-09 14:03:20 +01:00
Marcel Paffrath
29c14fb512 added plot2dttc mode to plotAllShots 2015-12-09 14:02:58 +01:00
Marcel Paffrath
943432dfb3 updated plot of 2d ttcs 2015-12-09 13:39:58 +01:00
Marcel Paffrath
a866bf5228 added methods for auto to manual comparisons 2015-12-09 12:01:41 +01:00
Marcel Paffrath
490ad0f0c2 bugfix: setParameters for shot not working, because survey needed parameters on init 2015-12-09 11:18:49 +01:00
Marcel Paffrath
ee16cef901 renaming 2015-12-08 13:50:19 +01:00
Marcel Paffrath
c9a75ca2d0 renaming 2015-12-08 13:50:08 +01:00
Marcel Paffrath
feab50af28 bugfixes + renaming 2015-12-08 13:49:47 +01:00
Marcel Paffrath
cb3f9804f9 implemented setting manual picks from file 2015-12-08 11:34:55 +01:00
Marcel Paffrath
cdf924e8c2 bugfix: earliest and latest pp not changed when repicking manually 2015-12-07 11:47:57 +01:00
Marcel Paffrath
5083c5a876 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-12-07 11:21:50 +01:00
Marcel Paffrath
1a9f68f741 bugfixes (minSNR was 1, problem in for loop with break?) 2015-12-07 11:21:11 +01:00
Marcel Paffrath
d5b277db99 implemented cleanBySPE and plotSPE 2015-12-07 11:20:30 +01:00
Ludger Küperkoch
0d18e35f6a New parameter Qp to correct for attenuation, i.e. frequency dependent Q value. 2015-12-04 16:08:49 +01:00
Ludger Küperkoch
1312d06ccf Corrected for modified class MoMw, which needs additional parameter Qp. 2015-12-04 16:07:36 +01:00
Ludger Küperkoch
0c7c5645b6 Implemented correction for attenuation in calcsourcespek. 2015-12-04 16:05:53 +01:00
Ludger Küperkoch
28276d1f8c Set default path for autoPyLoT_local.in to /home/user/.pylot using os.expanduser("~"). 2015-12-04 14:39:17 +01:00
sebastianp
686002567c Merge remote-tracking branch 'origin/develop' into develop 2015-12-03 17:20:43 +01:00
sebastianp
74794061f6 alphabetical sorting of functions and editing docstring 2015-12-03 17:20:05 +01:00
Ludger Küperkoch
7c490d5e1f Little changes. 2015-12-03 16:15:26 +01:00
Ludger Küperkoch
5f8018a8dc Modified some parameters. 2015-12-03 16:02:41 +01:00
79829706be Merge commit 'a9d5f74a032bfa63ac167f5cc4c1d8772126a3ff' into develop
Conflicts:
	pylot/core/util/utils.py
2015-12-03 15:28:34 +01:00
0d8324a4ae Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-12-03 15:25:24 +01:00
2b90c73f9f changed quotes for consistency 2015-12-03 15:25:04 +01:00
Ludger Küperkoch
67e37fe530 Initialization of picks dictionary including Mo, Mw, w0 and fc. 2015-12-03 14:59:39 +01:00
Ludger Küperkoch
d6ae82e070 Included rotation of seismograms using Obspys stream.rotation for a more reliable estimation of source spectra. 2015-12-03 14:57:44 +01:00
Ludger Küperkoch
77ad274f8f Some bugs fixed, implemented calculation of network moment magnitude. 2015-12-03 14:55:07 +01:00
Marcel Paffrath
df5f0f41b4 comment 2015-12-03 12:21:18 +01:00
Marcel Paffrath
69d3f43db9 code commenting 2015-12-03 12:19:34 +01:00
1a5eed5559 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop
Conflicts:
	pylot/core/pick/autopick.py
2015-12-02 22:05:47 +01:00
f3ba22b235 [new] introduced verbose flag to suppress to much output during auto picking (slows down especially to GUI triggered auto picking process) 2015-12-02 19:17:04 +01:00
Ludger Küperkoch
c227b6499e Modified for extended class MoMw of object magntitude. MoMw returns pick dictionary containing individual corner frequencies, w0-values, seismic moments and moment magnitudes. 2015-12-02 10:15:05 +01:00
Ludger Küperkoch
46cbe96a43 Extended class MoMw for calculating source spectrum. New functions calcsourcespec, calcMoMw and run_calcMoMw implemented. 2015-12-02 10:12:37 +01:00
Ludger Küperkoch
40f38ebf84 Removed calculation of source spectrum from autopick, as azimuth and angle of incidence are necessary and thus a location is needed for a reliable calculation of the source spectrum. Source spectrum is now calculated after locating the event. 2015-12-02 10:09:17 +01:00
Ludger Küperkoch
30970b8451 Modified class MoMw: new functio run_calcMoMw using subfunction calcMoMw, gets hypocentral distances from NLLoc-location file. Returns modified pick dictionary including individual seismic moments and corresponding moment magnitudes. 2015-12-01 15:41:37 +01:00
Ludger Küperkoch
c3d7581f94 Implemented modified class MoMw of object magnitude. 2015-12-01 15:39:28 +01:00
sebastianp
a9d5f74a03 minor change at createResourceID 2015-12-01 12:30:24 +01:00
sebastianp
d4bb265c37 first time commiting, please rectify and tell me what is wrong. 2015-12-01 11:12:45 +01:00
ed7a323c50 [new] reverting stdout redirection after auto picking is done; added method finalizeAutoPick for purposes to be done after the auto picking thread has finished 2015-12-01 05:04:26 +01:00
Ludger Küperkoch
41a495371d Changed average radiation pattern for P-waves to exact definition in Aki and Richards, 1980. 2015-11-30 16:45:29 +01:00
Ludger Küperkoch
f7a84233bf Changed some parameters, esspecially for seismic moment estimation. 2015-11-30 16:38:09 +01:00
Ludger Küperkoch
2e8926ea5b Implemented new class M0Mw of object magnitude. 2015-11-30 16:37:28 +01:00
Ludger Küperkoch
23b9fda5e4 New class M0Mw for calculating seismic moment and moment magnitude. 2015-11-30 16:35:58 +01:00
Ludger Küperkoch
9f93c25aa8 Put additional parameters w0 and fc to picks dictionary. 2015-11-30 14:41:59 +01:00
Ludger Küperkoch
466e0020a6 w0fc: Plateau omega0 and corner frequency are are now taken as the median of previously calculated values from different functions synthsourcespek and fitSourceModel. 2015-11-30 13:27:08 +01:00
Ludger Küperkoch
957d2ccfe7 New function to derive plateau and corner frequency of observed source spectrum. Additional to scipys implicit function curve_fit, as seismic moment is sensitive to estimated plateau of source spectrum, which in turn is sensitivec to estimated corner frequency. 2015-11-30 13:14:23 +01:00
d29c57ab4b [bugfix] AutoPickLog is now directly attached to the MainWindow on the LeftDockWidgetArea and autoscrolls to the bottom 2015-11-30 09:55:33 +01:00
5f8569c7d9 [bugfix] now catching all cases 2015-11-30 09:53:55 +01:00
d67556796c [bugfix] plotting autopicks has to be done within thread because code outside the threads scope is executed in parallel 2015-11-30 09:52:31 +01:00
3f91fddd3e [new] added attribute autopicks to and modified corresponding handling methods in class MainWindow 2015-11-30 09:50:47 +01:00
ae21c9a149 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-11-26 05:18:10 +01:00
50a5586355 [bugfix] autoPickListWidget is directly attached to the main window and autoScrolls to the latest entry 2015-11-26 05:17:26 +01:00
Ludger Küperkoch
43646e8e63 Marginal changes. 2015-11-24 14:23:18 +01:00
Ludger Küperkoch
021cb873ae Optimized some parameters. 2015-11-24 13:37:47 +01:00
Ludger Küperkoch
7e76b30460 Marginal changes. 2015-11-24 13:37:11 +01:00
Ludger Küperkoch
7f05568f65 Bugfix: Captured error, if earllatepicker returns None for lpickS1/2, epickS1/2, and Serror1/2. 2015-11-24 13:35:23 +01:00
Ludger Küperkoch
ab8775c58d PragPicker: Upweight of left pick. 2015-11-24 13:31:14 +01:00
Marcel Paffrath
a2eb5868a7 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-11-24 12:38:16 +01:00
Marcel Paffrath
b310062687 changed SNR threshold (scaled by exp function) 2015-11-24 12:37:53 +01:00
f1cee0cbfd [fixes #168] now any TypeError is handled by try ... except clause 2015-11-24 11:30:58 +01:00
7a9c44198f [bugfix] currently set data structure now selected in QComboBox widget 2015-11-24 11:05:19 +01:00
69efd4d411 finished implementation of location tool tab in properties window (used to modify settings from the GUI) 2015-11-24 10:27:35 +01:00
Ludger Küperkoch
0a1d177d60 Additional picking parameters to be temporary modified for iterative picking. 2015-11-23 16:40:24 +01:00
Ludger Küperkoch
e5bddab2be Finished iterative picking: If bad picks are found, autoPyLoT iteratively re-picks these traces with modified picking parameters at maximum three times, if the former runs still leave bad picks. 2015-11-23 16:38:52 +01:00
Ludger Küperkoch
574c26c3ec Modified some parameters. 2015-11-23 16:36:43 +01:00
cffca858aa Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-11-23 15:07:50 +01:00
8a4ac82c3a [new] added a new location tools tab to the properties widget (not working yet) 2015-11-23 15:07:43 +01:00
Marcel Paffrath
fdd7ff003b [bugfix] SNR minimum for setFittedSNR is now 1 2015-11-23 13:01:36 +01:00
4fdcf1cf60 [bugsearch] trying to fix UnpicklingError by clearing GUI element containing attributes 2015-11-23 12:11:04 +01:00
1f1d0aa118 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-11-23 11:41:14 +01:00
851da7eb15 re-design of the properties tabbed window 2015-11-23 11:41:04 +01:00
Marcel Paffrath
56a89ae386 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-11-23 11:38:36 +01:00
Marcel Paffrath
bd0d96c2ff changed input for generateFMTOMOinpu 2015-11-23 11:35:15 +01:00
Ludger Küperkoch
8173e44b04 Matginal changes. 2015-11-20 16:02:54 +01:00
Ludger Küperkoch
8a16643bd8 Marginal changes. 2015-11-20 16:02:25 +01:00
Ludger Küperkoch
67ac580778 Suppressed print output in setParam. 2015-11-20 15:53:25 +01:00
Ludger Küperkoch
8197d8f3d5 Some input parameters changed from integers to floats. 2015-11-20 15:52:14 +01:00
Ludger Küperkoch
07bbc2926e New function iteratepicker for iterative picking. 2015-11-20 15:51:22 +01:00
Ludger Küperkoch
734eca30db Implementation of new function iteratepicker of module autopick. 2015-11-20 15:49:34 +01:00
386131e9f3 started implementation of NLLoc properties selection into manualPyLoT; new utility routine to find indices throughout QComboBox' items 2015-11-20 09:06:52 +01:00
Marcel Paffrath
7f85ed99c0 bugfix textoutput 2015-11-19 11:38:54 +01:00
Marcel Paffrath
82089a6490 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-11-18 17:22:51 +01:00
Marcel Paffrath
657472f576 added shifting of SNR threshold along y axis 2015-11-18 17:22:18 +01:00
Marcel Paffrath
0a00aab3ba changed pickerror to SPE for exportFMTOMO
minor additions
2015-11-18 17:21:29 +01:00
Marcel Paffrath
abc45a4c8f bugfix: getPickError (/2)
added earliest and latest to plot_traces
2015-11-18 17:20:46 +01:00
Ludger Küperkoch
96fcc2470b Modified pick dictionary: writes dummy onset times (start of seismic trace) into dictionary in order to derive theoretical onset times later needed for iterative picking. 2015-11-18 11:12:53 +01:00
Ludger Küperkoch
e1c2629f97 Modified writephases for NLLoc: writes dummy onset times (start of seismic trace) into phase file in order to derive theoretical onset times later needed for iterative picking. 2015-11-18 11:11:10 +01:00
Ludger Küperkoch
8592557613 Minor changes 2015-11-18 10:28:46 +01:00
Ludger Küperkoch
8a84342883 Implementation of module /loc/nll finished, running for single and multiple event processing. 2015-11-18 10:27:42 +01:00
c51ba1bd56 [bugfix] trying to figure out cause of segmentation fault 2015-11-18 09:30:32 +01:00
Ludger Küperkoch
1d6d786dbb Modyfied picksExport: additional parameter locrt to choose location routine, i.e. phase-file format. 2015-11-17 17:05:36 +01:00
Ludger Küperkoch
19e60e5f0c Replaced writephases with new function picskExport from module nll. 2015-11-17 17:03:59 +01:00
Marcel Paffrath
f192a72ad7 slimmed down the code 2015-11-17 10:29:32 +01:00
Marcel Paffrath
b700940f54 bugfix: seismicshot dictionary for repick button was overwritten 2015-11-17 10:28:18 +01:00
Marcel Paffrath
2e45456a6e Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-11-16 12:12:11 +01:00
Marcel Paffrath
160ee81c44 improved and fixed delete button 2015-11-16 12:11:42 +01:00
Marcel Paffrath
647fddb904 bugfix: could not highlight pick after it was deleted in plot_traces 2015-11-16 12:09:00 +01:00
Marcel Paffrath
0f1427a9f0 first try of shot.plot_traces delete button 2015-11-16 11:50:09 +01:00
Marcel Paffrath
78d61a9822 added writeVTK files 2015-11-16 11:49:57 +01:00
Marcel Paffrath
0a0ab4bfa9 added checkerboard to fmtomo utils and added different checkerboard ampl. functions 2015-11-16 11:48:45 +01:00
ed17272999 [bugfix] attribute was unset before using property setter 2015-11-14 11:46:46 +01:00
bb3e068232 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-11-13 14:05:39 +01:00
69011f13ac [new] started to incorporate NLLoc into manualPyLoT 2015-11-13 14:05:29 +01:00
Marcel Paffrath
165419cb88 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-11-12 19:09:08 +01:00
Marcel Paffrath
db3429e780 improved text output and fixed some bugs 2015-11-12 19:08:33 +01:00
Ludger Küperkoch
6177c6292c Cosmetics, focused on python-3 compatibility of print statements. 2015-11-12 17:21:04 +01:00
Marcel Paffrath
d53e4b7c0c implemented a function that generates all grids for FMTOMO 2015-11-12 13:24:48 +01:00
Marcel Paffrath
d611b8606e finished generatePropgrid, changed getThetaPhiFromArray output to the right order 2015-11-12 11:25:51 +01:00
d933c30148 [bugfix] now the whole line containing LOCFILES is replaced with a modified string using the getPatternLine utility function 2015-11-12 09:25:33 +01:00
1f383579b4 [new] added a new utility function to find a pattern in a text file and returning the particular line as a string or None if not found 2015-11-12 09:23:28 +01:00
Ludger Küperkoch
a1fbea98be Debuged: checks minimum number of zero crossings before calculating source spectrum from P pulse. 2015-11-11 16:11:25 +01:00
Marcel Paffrath
39a12bd1d1 bugfix: rays2vtk last point not displayed 2015-11-11 15:45:56 +01:00
Ludger Küperkoch
dc088509d4 For multiple event processing eventID has to be derived out of event string. Uses module string. 2015-11-11 15:45:07 +01:00
Marcel Paffrath
54cb6d2f9a added interfaces generation for FMTOMO from SeisArray
still working on propgrid generation for FMTOMO from SeisArray
2015-11-11 15:36:43 +01:00
Ludger Küperkoch
b5b7453214 Debuged writephases: if first motion (fm) is None, ? is written to NLLoc-phase file. 2015-11-11 15:09:50 +01:00
Ludger Küperkoch
2ea2db0791 Debuged: Calculates real onset times for pick dictionary only, if earliest and latest possible pick are not None. 2015-11-11 14:53:50 +01:00
Ludger Küperkoch
c01c88b657 earllatepicker: take half wavelength for getting earliest possible pick as suggested by Diehl et al.. 2015-11-11 14:51:14 +01:00
Ludger Küperkoch
cd26d85f7c Debuged: Checks additionally for component 3 if component Z not available. 2015-11-11 14:10:44 +01:00
Ludger Küperkoch
7ed1ad2983 Debuged indentation error at lines 341 to 345. 2015-11-11 14:04:06 +01:00
Ludger Küperkoch
4f67e3e31a Debuged: Checks additionally for component 3 if component Z not available. 2015-11-11 13:58:25 +01:00
Marcel Paffrath
02dbca06f2 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-11-09 16:12:45 +01:00
Marcel Paffrath
7aedc35c16 first implementation of a checkerboard modification for a given vgrids.in file 2015-11-09 16:12:12 +01:00
8ae692db70 [new] added a locate button to the toolbar in the GUI (not working yet) 2015-11-09 08:53:26 +01:00
9c7fbc4725 [new] introduced new attribute loc in order to control localization relevant GUI elements depending on the number of available phase onsets 2015-11-06 15:40:21 +01:00
21bb39d528 [new] preparing MainWindow for location button 2015-11-06 08:20:08 +01:00
Marcel Paffrath
2a15ec75d2 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-11-05 12:20:12 +01:00
Marcel Paffrath
c28e2bda2a added surface2VTK 2015-11-05 12:19:56 +01:00
06337b4d66 [bugsearch] tried to figure out why topography correction did not work for fmtomo model output 2015-11-05 12:16:08 +01:00
Marcel Paffrath
5d378f9f0f Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-11-05 10:14:34 +01:00
Marcel Paffrath
f2fc5e5071 working on implementing of gradients for different layers 2015-11-05 10:13:04 +01:00
5ee85d89a3 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-11-05 09:17:29 +01:00
afb7a189ad [new] preparing new modules for location routines planned to be implemented 2015-11-05 09:17:20 +01:00
0f8b228931 [new] module "nll" containing utility function to handle NonLinLoc input and output as well as execution of the external program from python 2015-11-05 09:16:11 +01:00
d69db63132 [new] started to implement a new package containing modules for location purposes featuring different external location programs like NonLinLoc 2015-11-05 09:14:36 +01:00
Ludger Küperkoch
d74aeb237c Implemented phase writing in multiple event processing mode. 2015-11-05 08:51:50 +01:00
Ludger Küperkoch
686395defc Marginal changes 2015-11-05 08:49:44 +01:00
Ludger Küperkoch
f738160a8b Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop
Conflicts:
	autoPyLoT.py
2015-11-05 08:47:06 +01:00
Ludger Küperkoch
3fa4a31978 Extended function writephases for writing phases to HYPO71-input phase file. 2015-11-04 16:53:03 +01:00
Ludger Küperkoch
b8c26a6588 Implemented extended function writephases for writing phases to HYPO71-input phase file. 2015-11-04 16:52:39 +01:00
223902f2d4 reformatted the file to avoid usage of tabs and spaces and made a more pythonic splash message than multiple calls to print 2015-11-04 13:11:48 +01:00
Marcel Paffrath
d8a59ac81d bugfix: not yet done: problem with cusioning around topography 2015-11-04 10:13:52 +01:00
Marcel Paffrath
dc4d19ba88 bugfixes: formula for gradients in multiple layers for vgrid corrected, fixed issue with integer division that would lead to a wrong spacing 2015-11-04 10:04:05 +01:00
Marcel Paffrath
c5fc9ee89c Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-11-03 10:31:18 +01:00
Marcel Paffrath
c28641d629 changed plot traces for presentation (SNR, _drawStream etc.) 2015-11-03 10:29:09 +01:00
Marcel Paffrath
1c08152e65 vkt file "rel" changed to changes in percent 2015-11-03 10:27:06 +01:00
Marcel Paffrath
bcc6c8a73d enabled use of parameter file "mygrid.in" for generation of a starting model, prepared generation of vgrid model from array dimensions 2015-11-03 10:25:52 +01:00
a31e1a21f0 [bugfix] now filtering in the main window works; filter parameters are not stored -> has to be checked again 2015-10-31 00:07:24 +01:00
Marcel Paffrath
1b95ed0da7 relative velocities in percent 2015-10-30 12:37:41 +01:00
Marcel Paffrath
422a76012e vert. exag for surface plot 2015-10-30 12:00:03 +01:00
Marcel Paffrath
84f1639e59 added transformation to vgrids vtk with relative values using vgrids.in and vgridsref.in from FMTOMO 2015-10-30 11:56:45 +01:00
2201c3ea4d [modified] restructured filterWaveformData method in order to make the GUI more intuitive 2015-10-30 08:39:51 +01:00
a2047aa37b [disabled] P and S buttons preliminary removed due to unclear functionality 2015-10-30 08:37:00 +01:00
809b6bea61 make use of the new __nonzero__ method 2015-10-30 08:33:05 +01:00
0cd427486c [modified] updateUi method for the FilterOptionsDlg has been restructured and simplified 2015-10-30 06:16:00 +01:00
9b1f7541fd [added] isSorted function for iterables 2015-10-30 06:12:23 +01:00
43f9e6fe0d [added] __nonzero__ method for boolean tests on FilterOptions object 2015-10-30 06:11:15 +01:00
Ludger Küperkoch
94448297bb Marginal changes. 2015-10-28 09:13:30 +01:00
Ludger Küperkoch
fc319f7162 Introduced option for running autoPyLoT without location routine, if parameter nllocbin in autoPyLoT.in is not set. 2015-10-28 09:13:13 +01:00
Ludger Küperkoch
43d243e0a1 Same for multiple event processing. 2015-10-27 16:53:11 +01:00
Ludger Küperkoch
6676484a61 Debuged: Avoids writing multiple LOCFILES-command lines if same event is processed several times. 2015-10-27 16:51:42 +01:00
Ludger Küperkoch
d5b3a7d40f Marginal changes. 2015-10-27 16:26:40 +01:00
Ludger Küperkoch
f13dda9a0f Cosmetics. 2015-10-27 15:50:37 +01:00
Ludger Küperkoch
fbaaac8435 New parameters for default location routine NLLoc. 2015-10-27 15:26:55 +01:00
Ludger Küperkoch
f8cbdf7ff0 Implemented location routine NLLoc. 2015-10-27 15:26:25 +01:00
Ludger Küperkoch
55d3692f33 New parameters phasefile, locfile and ttpattern for auomatic modifying NLLoc-control file. 2015-10-27 10:03:40 +01:00
Ludger Küperkoch
a315384417 New function writephases.py for writing phases files for various kinds of location routines. Started with NLLoc-phase file. 2015-10-27 10:01:07 +01:00
Ludger Küperkoch
7029c0b576 Implemted writephases.py. 2015-10-27 10:00:16 +01:00
Ludger Küperkoch
c0ca788c5c Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop
Conflicts:
	autoPyLoT.py
	pylot/core/analysis/magnitude.py
	pylot/core/pick/utils.py
2015-10-27 09:25:29 +01:00
Ludger Küperkoch
b96f81553d Implemented new function for writing phase files for various kinds of location tools. 2015-10-26 09:42:25 +01:00
Ludger Küperkoch
69a023e048 Introduced new function for writing phases files for various kinds of location tools. 2015-10-26 09:41:02 +01:00
Ludger Küperkoch
158da88523 Marginal changes only. 2015-10-26 09:40:07 +01:00
Marcel Paffrath
30680a7820 cosmetics for array plots (title, legend) 2015-10-22 10:54:24 +02:00
Marcel Paffrath
0223869df6 commit after recover of scripts from .pyc:
implementation of buttons for plotAllPicks/region object, printOutput to figure window, refreshing now with SNR, PE, SPE
2015-10-21 13:35:02 +02:00
Marcel Paffrath
eb873fd69f commit after recover of scripts from .pyc:
code cleanup after transfer of functions to survey methods
2015-10-21 13:33:47 +02:00
Marcel Paffrath
52e304b0af commit after recover of scripts from .pyc:
repick button for .plot_traces implemented
2015-10-21 13:33:11 +02:00
Marcel Paffrath
2b3e40b3b6 commit after recover of scripts from .pyc:
figure refreshing of plotAllPicks, cbar, survey.recover()
2015-10-21 13:30:55 +02:00
0064ff1889 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-10-20 12:02:01 +02:00
Marcel Paffrath
21ffbcabc8 deleted obsolete files 2015-10-20 10:52:05 +02:00
Marcel Paffrath
2dd36379a8 prepared application of stealth mode 2015-10-20 10:38:00 +02:00
Marcel Paffrath
195352a7ca merged 3 files
Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop

Conflicts:
	pylot/core/active/activeSeismoPick.py
	pylot/core/active/seismicshot.py
	pylot/core/active/surveyPlotTools.py
2015-10-19 13:15:28 +02:00
0a7b02c04a general clean-up 2.0 even more checks made and issues resolved 2015-10-19 11:25:15 +02:00
Marcel Paffrath
793e09910c *** empty log message *** 2015-10-19 10:34:45 +02:00
Marcel Paffrath
4498c72c90 repick button for plot_traces 2015-10-19 10:33:51 +02:00
0fa701a878 general code clean-up 2015-10-19 05:32:10 +02:00
b49206407a Merge using remote to resolve conflicts 2015-10-18 21:23:09 +02:00
Marcel Paffrath
d78b0f1cff added polygon selection!! 2015-10-13 18:41:55 +02:00
Marcel Paffrath
07395802b7 minor changes (plotAllPicks: inkByVal) 2015-10-12 15:13:08 +02:00
Marcel Paffrath
ddbfb03f27 *** empty log message *** 2015-10-12 15:10:53 +02:00
Marcel Paffrath
cdd33d7e2f improvements, refreshFigure() now possible and done automatically after deleting of picks 2015-10-12 14:40:29 +02:00
Marcel Paffrath
34abad46e2 refresh plot for plotAllPicks by replotting 2015-10-12 14:39:40 +02:00
Marcel Paffrath
a19cdc4fee implied stealth mode 2015-10-12 13:00:09 +02:00
Marcel Paffrath
0adc890aef implied stealth mode to suppress huge amounts of text output 2015-10-12 12:59:53 +02:00
Marcel Paffrath
5bb50d5be4 added captions for shotnumbers in plotArray2D 2015-10-08 12:16:03 +02:00
Marcel Paffrath
8e7b2e5b8a removed pick_backup. implied flag for each pick instead 2015-10-07 14:53:10 +02:00
Marcel Paffrath
c71e28ecb7 shots no longer None if they are removed, but flag = 0 2015-10-07 14:51:20 +02:00
Marcel Paffrath
09f0cd3e71 shots no longer None if they are deleted, but flag = 0 2015-10-07 14:51:00 +02:00
Marcel Paffrath
cfbcc9d362 bugfix: if invalid ray is generated by FMTOMO it will be skipped 2015-10-06 11:42:33 +02:00
4109696800 meet style conventions 2015-10-02 06:06:26 +02:00
Marcel Paffrath
7120a20499 changed vtk file structure for vgrids, making it way faster and smaller and enabling paraview to display surfaces instead of points 2015-10-01 17:30:57 +02:00
Marcel Paffrath
3d3cac7085 cosmetics 2015-10-01 17:21:18 +02:00
Marcel Paffrath
9faf42fd79 bugfix: import numpy missing 2015-10-01 17:20:01 +02:00
Marcel Paffrath
376d1cc6f8 name change 2015-10-01 13:14:44 +02:00
Marcel Paffrath
c58bb53002 output cosmetics 2015-10-01 11:33:39 +02:00
Marcel Paffrath
4399004277 cleaned up surveyUtils 2015-10-01 11:32:28 +02:00
Marcel Paffrath
3e7e693a66 changed structure: plot option -> survey method 2015-10-01 11:30:46 +02:00
Marcel Paffrath
2c1e9c63d8 changed structure: added plot option to survey methods 2015-10-01 11:30:16 +02:00
Marcel Paffrath
dd5523b2ac *** empty log message *** 2015-10-01 10:35:47 +02:00
Marcel Paffrath
e41b1436f9 *** empty log message *** 2015-09-30 14:32:08 +02:00
Marcel Paffrath
e78314461b *** empty log message *** 2015-09-30 14:31:55 +02:00
Marcel Paffrath
03eac54ced added new files to pylot active 2015-09-30 13:58:13 +02:00
Marcel Paffrath
2308695fa8 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-09-30 13:55:01 +02:00
Marcel Paffrath
3473ce732c changed structure -> all FMTOMO to vtk functions to one module 2015-09-30 13:06:51 +02:00
Ludger Küperkoch
708f0a1f1a Some cosmetics on DCfc of class magnitude. 2015-09-29 14:55:15 +02:00
Ludger Küperkoch
f4b905c2e6 Removed inserted plot command for debugging purposes. 2015-09-29 11:19:25 +02:00
Ludger Küperkoch
ce57f184e7 In order to calculate DC value and corner frequency of source spectrum a synthetic spectrum is calculated and optimized using scipys curve_fit. 2015-09-29 11:17:47 +02:00
Ludger Küperkoch
8035903fa5 Zero crossings are calculated to derive only P pulse for calculating source spectrum. 2015-09-29 11:15:51 +02:00
Marcel Paffrath
5b8e2da59e *** empty log message *** 2015-09-28 12:24:28 +02:00
Marcel Paffrath
48c889129a Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop 2015-09-28 12:22:09 +02:00
4bd92565b9 reformat code (fix indentation and python 3.x issues) 2015-09-28 10:57:48 +02:00
Marcel Paffrath
fd3d4cc476 -> import numpy 2015-09-28 10:23:41 +02:00
Marcel Paffrath
f7878cdb4a implemented vgrids2VTK to surveyUtils 2015-09-28 10:20:26 +02:00
3dc9bb3d06 some pick plotting issues solved; replotting main window if picks have been changed, otherwise just plot additional/deleted picks 2015-09-25 15:06:59 +02:00
33164d4d1f corrected for some python 3 compatibility issues; added a new delete picks button to the picking window 2015-09-25 09:03:59 +02:00
Marcel Paffrath
98df4db95d cosmetics 2015-09-24 10:14:39 +02:00
Ludger Küperkoch
b391f5e082 Modified class DCfc: calculation of fft bins after Bath. 2015-09-23 17:02:27 +02:00
Ludger Küperkoch
c790b4f353 Implemented new class DCfc. 2015-09-23 16:32:18 +02:00
Ludger Küperkoch
30ee81a39d New class DCfc of object Magnitude for calculating source spectrum and to derive DC value and corner frequency. 2015-09-23 16:31:48 +02:00
Marcel Paffrath
d38adb75b2 deleted import * from pylab 2015-09-23 14:11:24 +02:00
Marcel Paffrath
9d5b7ad5ae name change 2015-09-22 14:38:27 +02:00
Marcel Paffrath
19e4435497 name change 2015-09-22 14:36:19 +02:00
Marcel Paffrath
bb97df6179 name change 2015-09-22 14:35:04 +02:00
Marcel Paffrath
217db9bbdd [bugfix] updated EPick nan fix 2015-09-22 13:41:19 +02:00
844708bbac [hotfix] earllatepicker recursively modifies isignal to obtain zero-crossing also for low frequency onsets 2015-09-22 12:29:42 +02:00
Marcel Paffrath
dedf6eff00 Changed earllatepicker. If EPick = Nan, signal window is doubled. 2015-09-22 11:58:43 +02:00
130dc8db4e [bugfix] wrong functions import fixed 2015-09-22 10:31:37 +02:00
d1f1fb42f3 [fixes #176] event files are now opened and loaded correctly and picks are plotted in place 2015-09-21 08:48:29 +02:00
34d31a1aa8 Merge branch 'develop' 2015-09-18 09:54:43 +02:00
ff2b50f615 made some changes to make the code more idiomatic and renamed method convertPicks4PyLoT to updatePicks 2015-09-18 09:54:29 +02:00
2b42583999 debugged some code fragments while trying to solve the load event data problem 2015-09-17 17:55:40 +02:00
7a47594614 debugged some code fragments while trying to solve the load event data problem 2015-09-17 17:45:10 +02:00
Marcel Paffrath
26c958b421 initial import of new modules working on active seismic data 2015-09-17 11:09:30 +02:00
Marcel Paffrath
61c7e9f417 removed stashed changes 2015-09-17 11:07:22 +02:00
Marcel Paffrath
57a9444478 commiting changes to suppress output; necessary for fast calculation in active mode 2015-09-14 11:01:23 +02:00
f5fa4f4faf Python 3 compatibility 2015-09-07 10:03:12 +02:00
efd8f1f0c6 Merge branch 'develop' of ariadne:/data/git/pylot into 176 2015-09-05 09:46:05 +02:00
e9c4987ca0 Merge branch 'develop' of ariadne:/data/git/pylot into develop 2015-09-05 09:41:52 +02:00
49cbfd92e5 Merge branch 'develop' of ariadne:/data/git/pylot into 176 2015-09-05 09:40:52 +02:00
Ludger Küperkoch
70b3f031f8 Optimized some parameters. 2015-09-04 15:29:04 +02:00
Ludger Küperkoch
5d8346b1ca Optimized some parameters. 2015-09-04 15:28:57 +02:00
Ludger Küperkoch
cfca52e576 Debuged slope determination [counts/s] within AICPicker. 2015-09-04 15:28:37 +02:00
4eef4d238b 176 open event failure 2015-09-04 15:01:59 +02:00
Ludger Küperkoch
ac7d239b40 Optimized parameter pstop, as this is a cruicial parameter for stable AIC-CF calculation. 2015-09-04 12:09:17 +02:00
Ludger Küperkoch
0753071cfb Removed import of scipy as this is no more necessary. 2015-09-04 11:23:59 +02:00
Ludger Küperkoch
254c745f25 Marginal changes. 2015-09-04 11:19:57 +02:00
Ludger Küperkoch
956e16fdca Modified parameter minsiglength for modified routine checksignallength. 2015-09-04 11:17:56 +02:00
Ludger Küperkoch
1001da728e Modified parameter minsiglength for modified routine checksignallength. 2015-09-04 11:17:46 +02:00
Ludger Küperkoch
23430c9d90 Modofied checksignallength: uses RMS trace of all components (if available) to check signal length. This avoids skipping of P pick, if P coda is very weak. If only vertical trace is available, rms of vertical trace is used instead with smaller required minimum signal length. 2015-09-04 11:16:34 +02:00
Ludger Küperkoch
de608798b9 Modified checking of signal length, uses RMS trace of all components now (if available). 2015-09-04 11:13:52 +02:00
Ludger Küperkoch
0dc1091078 restituteWFData: introduced return flag restflag to indicate whether restitution could be performed or not. 2015-09-04 11:12:25 +02:00
Ludger Küperkoch
ab1d27747a Some reformating. 2015-09-03 15:42:20 +02:00
Ludger Küperkoch
60b9f176f0 Cosmetics, changed print commands to keep compatibility to Python 3. 2015-09-03 14:55:25 +02:00
cc0b1e0a5b 176 open event failure 2015-09-03 13:21:46 +02:00
81b95e6a22 [addresses #167] started fixing the multiple phase saving issue 2015-09-03 09:15:31 +02:00
Ludger Küperkoch
bf1194ec3b Changed?? 2015-09-01 14:32:36 +02:00
Ludger Küperkoch
3ba57cfc56 Introduced new class DCfc for calculating the source spectrum and to derive the DC-value and the corner frquency of the source spectrum. Just at the beginning! 2015-09-01 14:32:09 +02:00
Ludger Küperkoch
258b8b1ff4 Marginal changes only. 2015-09-01 14:30:54 +02:00
Ludger Küperkoch
de5c65bc1d Wood-Anderson peak-to-peak amplitude is now calculated even if S weight is 4. At least P pick must be confident, if S weight > 3 a larger window for getting maximum peak-to-peak amplitude is used. 2015-09-01 14:25:48 +02:00
c940b092d0 Merge branch 'master' into develop 2015-08-31 13:47:22 +02:00
7588ad3c5b resolved conflicts 2015-08-31 13:45:25 +02:00
623f5d7b7e [addresses #167] started fixing the multiple phase saving issue 2015-08-31 13:37:18 +02:00
Ludger Küperkoch
fb3b599f50 restituteWFData: If input streams is None, a copy of streams derived by self.getWFData() is used for further processing. 2015-08-31 10:24:17 +02:00
Ludger Küperkoch
d756f5d2e1 Replaced hard coded window length for getting Wood-Anderson peak-to-peak amplitude with formerly set window length for calculating CF for S-picking. 2015-08-31 10:10:42 +02:00
Ludger Küperkoch
d0d38b81cb Removed indentation error. 2015-08-31 09:38:18 +02:00
Ludger Küperkoch
69c17f9fdb Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2015-08-31 09:02:16 +02:00
1f7049691c [addresses #167] started fixing the multiple phase saving issue 2015-08-28 16:01:42 +02:00
Ludger Küperkoch
eb592a3426 Claculation of Wood-Anderson amplitude only, if S-weight < 4. 2015-08-28 11:39:39 +02:00
Ludger Küperkoch
827a07a7ef Skipped restitution of entire traces at the beginning of processing as this is too time consuming. Instead, only traces are corrected within autopickstation, where at least automatically a P pick has been set. 2015-08-28 11:31:19 +02:00
Ludger Küperkoch
533ccc7b5c Implemented new class wapp to calculate Wood-Anderson amplitudes for local magnitude calculation. Before calculating Wood-Anderson amplitude the certain traces are instrument corrected. 2015-08-28 11:29:00 +02:00
Ludger Küperkoch
ef8ebc300e New object to calculate magnitude. Finished class wapp to calculate amplitude as seen on Wood-Anderson seismograph. 2015-08-28 11:27:09 +02:00
497ca39c91 reformatted data.py to meet coding conventions 2015-08-28 10:15:28 +02:00
038caf4d54 reformat code 2015-08-28 09:05:50 +02:00
6597c881a6 reformatting code 2015-08-27 15:42:51 +02:00
779b9e7313 Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop
Conflicts:
	pylot/core/read/data.py
2015-08-27 15:42:01 +02:00
7785bd1900 Merge branch 'master' into develop
Conflicts:
	pylot/core/read/data.py
2015-08-27 15:28:54 +02:00
Ludger Küperkoch
ee777b4beb Removed import pdb. 2015-08-27 14:26:15 +02:00
Ludger Küperkoch
3e164fd0c6 restituteWFData: More output for user. 2015-08-27 14:24:52 +02:00
3dd65b9cc3 [addresses #167] started fixing the multiple phase saving issue 2015-08-27 12:55:34 +02:00
Ludger Küperkoch
96395f6a1a restituteWFData: searches now for keyword processing to check, whether this trace has already been corrected or not. 2015-08-27 11:40:42 +02:00
Ludger Küperkoch
845fd6a7b3 restituteWFData: able to handle several dataless-, inventory- or resp-files, calculates prefiltering from sampling rate of trace. Processing with inventory- or resp-file has yet not been checked! 2015-08-27 11:04:46 +02:00
Ludger Küperkoch
834e836a3d Removed parameter prefilt, no more necessary. 2015-08-27 11:01:59 +02:00
Ludger Küperkoch
4bfe4ce047 Marginal changes. 2015-08-27 09:53:05 +02:00
Ludger Küperkoch
0f4d13b8a5 Changed permissions. 2015-08-27 09:46:35 +02:00
2dc7819a84 restitute seismometer response 2015-08-27 05:51:03 +02:00
Ludger Küperkoch
8af4f8ad1e Finished (temporary!) new function restitueWFData. 2015-08-26 17:00:17 +02:00
Ludger Küperkoch
6719939a66 New parmater prefilt for filtering traces before restitution. 2015-08-26 16:45:19 +02:00
5d970fde1e [closes #164] test 2015-08-18 11:28:38 +02:00
b1736358b7 [closes #164] test 2015-08-18 11:23:04 +02:00
70d9389f4b [closes #164] test 2015-08-18 11:13:16 +02:00
f844f7b316 [closes #164] test 2015-08-18 11:09:34 +02:00
8c8ef7bb2a [closes #164] test 2015-08-18 10:39:58 +02:00
Ludger Küperkoch
def9760f4b Cosmetics. 2015-08-13 11:02:07 +02:00
Ludger Küperkoch
ceed663a77 AICPicker: if iplot > 1, figure with waveform and CF is raised, even when slope is calculation failed. 2015-08-13 10:57:46 +02:00
Ludger Küperkoch
64b8e1a9e8 checksignallength: Added more detailed information for user. 2015-08-13 10:54:17 +02:00
Ludger Küperkoch
fba2aad664 Added more detailed information for user about skipped picks. 2015-08-13 10:52:07 +02:00
Ludger Küperkoch
2668f4435c Removed unsused import-pdb command. 2015-08-13 09:01:47 +02:00
Ludger Küperkoch
4f634cc43a Debuged getDataArray: Reliable cutting of waveforms independetn from actual waveform lengths. 2015-08-12 16:48:55 +02:00
d9cb3517cc [closes #160] the picking window has now a home button for easy reset of zoom 2015-07-21 08:10:15 +02:00
0e3576d193 [closes #157] filter defaults are now read from text file like the sample filter.in coming with this commit simply copy to .pylot folder in your home directory (this is preliminary because the filter parameters should be settable project wide by one responsible person) 2015-07-21 07:41:41 +02:00
0b02e8c213 Merge branch 'export-and-save-picks' into develop 2015-07-18 16:13:37 +02:00
0b6fbd22c5 reformatting code to meet coding conventions 2015-07-18 16:13:11 +02:00
f4f744e22c export and save picks implemented successfully 2015-07-18 16:11:20 +02:00
fc86179c39 [closes #145], [addresses #146] this commit introduces the handling of picks as obspy event objects 2015-07-18 16:09:50 +02:00
17933c75f0 file format for exporting event data is controlled by the extension used; this behavior is more convenient for a GUI driven file selection 2015-07-18 15:59:42 +02:00
2115864d5c revert RELEASE-VERSION manually 2015-07-14 08:32:05 +02:00
1e58a86110 [bugfix] forgot to commit changed imports due to class naming changes in [49bf0ecd3c] 2015-07-14 08:10:49 +02:00
49bf0ecd3c make the naming of the Thread self explaining 2015-07-14 08:08:02 +02:00
092852d745 fix import error on debian machine 2015-07-13 15:15:37 +02:00
8802267628 fix zooming issue after S Pick is set 2015-07-13 10:03:43 +02:00
e31890d8fc export and save picks to hard drive 2015-07-13 09:24:16 +02:00
108d6c75d6 Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop 2015-07-13 06:41:02 +02:00
da22dcce90 renaming run_autopicking to autopickstation 2015-07-13 06:40:51 +02:00
d79165a9f2 [bugfix] pick times are absolute times, thus for plotting the start time has to be subtracted 2015-07-13 06:40:10 +02:00
641cb498f0 make labeling the trace slightly more efficient 2015-07-13 06:36:33 +02:00
Ludger Küperkoch
707618c6b1 Found bug in fmpicker, copy-and-paste error. 2015-07-10 15:23:48 +02:00
ae563454af Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop 2015-07-10 09:23:05 +02:00
ea976295d0 huge structural rearrangement to resolve circular import problems
[add] new feature added to QtPyLoT capable of automatically picking an event from overview window
2015-07-10 09:22:58 +02:00
Ludger Küperkoch
2bd31f433b Changed labeling within overview window, station IDs are shown instead of running number. 2015-07-09 15:50:29 +02:00
f704d8b258 Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop 2015-07-09 11:37:11 +02:00
398a25f902 non-working commit of autoPyLoT functionality in overview window 2015-07-09 11:37:03 +02:00
120f2743d2 preparing call to autoPyLoT from QtPyLoT 2015-07-09 11:34:41 +02:00
Ludger Küperkoch
dde7d73d2a Improved text output on stdout for some control routines. 2015-07-09 09:17:10 +02:00
1bee360bbb use get methods rather than directly access attributes 2015-07-08 15:14:05 +02:00
591e5a7110 standard output format should be QuakeML for saving the event relevant data, moreover the other formats should only be written temporarily for processing purposes 2015-07-08 15:12:35 +02:00
0236a19db1 [bugfix] the type of obspy.core.event.Event objects resource_id attribute is of type obspy.core.event.ResourceID but must be of type str; simple conversion fixed this 2015-07-08 15:00:51 +02:00
ec9840839e preserve the occurrence of the authority id in the filenames for write support of event information 2015-07-08 14:58:42 +02:00
05d38f583f corrected names for the output format to write event information on disk 2015-07-08 14:57:22 +02:00
173724ee5a make use of the __version__ variable other than updating the RELEASE_VERSION file 2015-07-07 14:27:29 +02:00
3320cd64a4 switching components enabled in overview window 2015-07-07 14:21:11 +02:00
6078338757 added a splash screen 2015-07-07 12:14:18 +02:00
cf944358dd removed unnecessary apply button 2015-07-07 11:23:29 +02:00
ca1b41511c draw picks from main window to the picking window 2015-07-07 11:23:01 +02:00
d53a3dad04 make the test work again 2015-07-07 11:22:19 +02:00
960f9ca71a use only the high resolution icon 2015-07-07 11:21:06 +02:00
b8c92ed551 preparing to parse the picks to the picking window 2015-07-07 11:02:46 +02:00
b8aabfce99 implement changes proposed by deprecation warning from matplotlib 2015-07-07 10:49:42 +02:00
a8fe4b7419 give variable declaration a sense 2015-07-07 10:47:55 +02:00
5507a22865 actually draw picks into the overview window 2015-07-07 10:46:27 +02:00
e051be8a06 code cosmetics and give some hint on the usage of the overview window in the status bar 2015-07-07 10:45:42 +02:00
3dd02d7f0c do not print information to standard out but into the status bar (recognizable for the user) 2015-07-07 10:44:06 +02:00
dd8766277a last four commits might not work without the imports coming with this one 2015-07-07 10:39:51 +02:00
5d2900510e added methods for drawing picks to the main window 2015-07-07 10:39:01 +02:00
06d6060a9f added method to add picks to the picks dictionary and warn the user if he/she is about to overwrite pick information 2015-07-07 10:37:54 +02:00
4990e33d27 added utility functions for pick handling 2015-07-07 10:33:14 +02:00
f99f5dbc8f unified icon set used for PyLoT in order to match the license restriction 2015-07-07 10:31:39 +02:00
Ludger Küperkoch
b5e279a318 removed fixed iplot flag. 2015-07-06 15:53:56 +02:00
Ludger Küperkoch
8463a87507 Introduced saftey factor for jackknife test to be less conservative. 2015-07-06 15:52:25 +02:00
29de650b4e reformatting code to avoid mixing up whitespace and tabulator characters 2015-07-06 10:57:34 +02:00
76f04bec6f [task] starting method to make PyLoT capable of restituting waveform data with given inventory xml files 2015-07-06 10:20:25 +02:00
a08c9e91e0 Ludger reported a Qt Problem that the MPLWidget was not recognized as an PySide.QtGui.QWidget; the problem was not reproducible on my system; maybe the problem was caused because getnoisewin is now imported from pick/utils and there matplotlib is imported for plotting reasons but to clarify the Qt backend used by matplotlib, it should not be imported before 2015-07-06 09:51:59 +02:00
Ludger Küperkoch
b73f9fab45 Cosmetics. 2015-07-02 15:26:48 +02:00
97aaa0b0d3 convenience imports and implementation of initial pick set for S phases (including zooming to re-scaled horizontal data) 2015-07-02 10:40:01 +02:00
a5c1f68f03 [bugfix] draw all picked phases not only the actually picked one 2015-07-02 10:37:31 +02:00
5e6173b351 [bugfix] fixes an issue where the zoom action is not reset when setting the initial pick 2015-07-02 10:36:33 +02:00
d05e9320e5 make MPLWidget able to distinguish scaled and unscaled data; additionally make plotting noise levels more convenient 2015-07-02 10:35:36 +02:00
a46b0db583 new method to return the traceID for given channel names 2015-07-02 10:32:35 +02:00
f77ba344c3 make the implementation of the picking dialog widget initialization method better readable 2015-07-02 10:31:39 +02:00
e99d2630a1 moved static methods as functions to the util package for flexibility reasons 2015-07-02 10:29:50 +02:00
Ludger Küperkoch
a32f6fc037 Marginal changes. 2015-07-02 09:27:11 +02:00
Ludger Küperkoch
0d8b6b4446 New key in pick dictionary: marker, indicating if pick has been rejected by checksignallength or checkZ4S. 2015-07-02 09:26:05 +02:00
Ludger Küperkoch
8282a7aa12 Marginal changes. 2015-07-02 09:23:51 +02:00
Ludger Küperkoch
82d9d45abf Marginal changes. 2015-07-01 15:37:07 +02:00
Ludger Küperkoch
3e81adfec6 Marginal changes. 2015-07-01 15:31:50 +02:00
Ludger Küperkoch
5bb616ffc5 Marginal changes. 2015-07-01 15:31:02 +02:00
Ludger Küperkoch
fb956f381a Implmented new quality control function checkZ4S. 2015-07-01 15:30:13 +02:00
Ludger Küperkoch
489199af10 New parameters for new quality control function checkZ4S. 2015-07-01 15:23:37 +02:00
Ludger Küperkoch
69b345c96b New parameters for new quality control function checkZ4S. 2015-07-01 15:23:21 +02:00
1af88fbe85 default values changed to the defaults from autopylot 2015-06-29 16:23:46 +02:00
327a22818a added static method demeanWFData which simply returns the demeaned waveform stream object while the individual trace data are decreased by the average value of the waveform in a given window 2015-06-29 16:21:17 +02:00
9aa8a5bf13 function getSNR re-implemented in order to allow SNR calculation for stream object with more than one trace; the resulting SNR is the maximum SNR found over all traces in the stream object 2015-06-29 16:16:59 +02:00
0fcd6fab9d clean-up to meet coding conventions 2015-06-29 16:14:11 +02:00
a46fb88282 Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop 2015-06-28 19:35:08 +02:00
a854cf2762 use default filter options for all expected phases set up by the project leader 2015-06-28 19:35:01 +02:00
Ludger Küperkoch
90bf6cb99e Modified parameters for checkPonset. 2015-06-26 16:01:43 +02:00
Ludger Küperkoch
9e124436e3 Modified parameters for checkPonset. 2015-06-26 16:01:17 +02:00
Ludger Küperkoch
27155ad816 Marginal changes. 2015-06-26 16:00:20 +02:00
Ludger Küperkoch
99adb5ce9c Finialized new function checkPonset. 2015-06-26 15:59:50 +02:00
Ludger Küperkoch
0789f51d69 Implemented additional quality control function checkPonsets, using subfunction jackknife to skip misspicks. Yet not entirely finished. 2015-06-26 08:48:24 +02:00
Ludger Küperkoch
ab840fbcf1 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop
Try to solve conflict, only marginal changes.
Conflicts:
	pylot/core/pick/utils.py
2015-06-25 11:17:32 +02:00
Ludger Küperkoch
edd925af99 Some cosmetics. 2015-06-25 11:11:19 +02:00
e542aa70d9 doctesting added without having doctests inserted (pending) 2015-06-25 10:36:45 +02:00
4292197818 [bugfix] switching between zooming types now does not cause weird mouse event behavior anymore 2015-06-25 10:35:58 +02:00
ec3ecd04bb pick colors now depend on the type of phase picked; blueish colors for compressional wave (p) phases and reddish colors for shear wave (s) phases 2015-06-25 10:34:15 +02:00
a383f8c769 [bugfix] labels are now drawn correctly after picking an onset 2015-06-25 10:31:55 +02:00
cb5bd7dc09 differentiate between initial picks for p and s phases as they are picked from different components; zoom window determination for s phases not implemented yet 2015-06-25 10:30:59 +02:00
bb52f8ac83 moved the determination of the time resolution window to the utils module within the pick package 2015-06-25 10:27:00 +02:00
b42f88605b the main application window now opens in fullscreen mode 2015-06-25 10:25:08 +02:00
7635f790fd [bugfix] one filter parameter was type string and caused problems when parsing the parameters to the filter function of an obspy object 2015-06-25 10:24:17 +02:00
7ec28664b4 new function getResolutionWindow and doc testing added 2015-06-25 10:21:52 +02:00
Ludger Küperkoch
c9f07b6540 getSNR: demean using only mean determined from noise window. 2015-06-25 10:07:35 +02:00
Ludger Küperkoch
2cd7572ee4 Removed fixed plotting flag. 2015-06-24 16:44:15 +02:00
Ludger Küperkoch
7281220b55 wadaticheck: bug fixed, initialization of running index at wrong place. 2015-06-24 16:42:50 +02:00
Ludger Küperkoch
1abcb9d9a9 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2015-06-24 15:47:14 +02:00
Ludger Küperkoch
c68597ce62 Debugging. 2015-06-24 15:43:59 +02:00
311b3f1de1 Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop 2015-06-24 14:33:30 +02:00
c840e07635 filtering of the waveform in the picking window implemented (work in progress, still bugs inside which have to be located and fixed) 2015-06-24 14:33:19 +02:00
0d3fb8be93 [bugfix] false indentation corrected (broken program logic fixed) 2015-06-24 14:31:43 +02:00
8dd100792e [bugfix] obspy filter function do not use order but corners as parameter name (keyword changed for argument parser) 2015-06-24 14:30:48 +02:00
Ludger Küperkoch
0cc29802a4 Added/modified parameters for new function checksignallength. 2015-06-24 14:25:18 +02:00
Ludger Küperkoch
a6d19eae7d Added/modified parameters for new function checksignallength. 2015-06-24 14:25:09 +02:00
4548f361e4 Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop 2015-06-24 14:24:20 +02:00
Ludger Küperkoch
017532272f Modified: new function checksignallength added. 2015-06-24 14:17:43 +02:00
Ludger Küperkoch
68bbea9854 Implemented new function for quality control: checksignallength, checks signal length in order to detect spuriously picked noise peaks. 2015-06-24 14:15:54 +02:00
Ludger Küperkoch
b44fbe0b02 Some Cosmetics. 2015-06-24 10:23:24 +02:00
Ludger Küperkoch
61c745cd79 Modified parameters. 2015-06-24 09:31:18 +02:00
Ludger Küperkoch
7ede5a7859 Modified parameters. 2015-06-24 09:31:01 +02:00
Ludger Küperkoch
728cf15f19 Demean: Mean to be subtracted from time series is now calculated from noise part only. 2015-06-24 09:29:59 +02:00
ac99ec8a76 added static method to the FilterOptionsDialog in order to be able to directly get an filter object without having to create an dialog object in advance explicitly 2015-06-24 09:24:21 +02:00
Ludger Küperkoch
123634924b Removed fix iplot flag. 2015-06-23 16:27:28 +02:00
Ludger Küperkoch
8f0c1fb8ec Debugging. 2015-06-23 16:24:10 +02:00
Ludger Küperkoch
5410b4481a Debugging. 2015-06-23 16:23:18 +02:00
Ludger Küperkoch
54fd3004b4 Debugging. 2015-06-23 16:22:21 +02:00
2c9ad97a4a avoid weird behavior of the picking window 2015-06-23 13:26:37 +02:00
37e50b12e6 use more reliable hard coded sample phase names 2015-06-23 13:25:27 +02:00
03219e69d6 substract the mean of the waveform data within the noise window prior to picking 2015-06-23 13:24:47 +02:00
dec3e733a2 use settings and defaults rather than hard coded parameters 2015-06-23 13:23:31 +02:00
ca4c5edb18 make the code more readable 2015-06-23 13:22:30 +02:00
b1990e6e1c filter waveform with default parameter for selected phase prior to initial phase identification 2015-06-23 13:22:01 +02:00
2393b88f05 rearranged filter waveform data method to match signature of the parseFilterOptions method of the FilterOptions object which will be used to hold filter information which can be defined by the project leader in advance 2015-06-23 13:15:39 +02:00
f1c7f00193 new local variable reused in plotting command for noise level positioning while plotting 2015-06-23 13:12:20 +02:00
c1818622de [bugfix] obsolete plotting command causing the plot to appear differently than desired 2015-06-23 13:09:03 +02:00
c94c569fcb closes ticket #151 : in the picking window always the entire waveform data is plotted with varying zoom window sizes 2015-06-23 13:07:24 +02:00
c851fa6901 avoid direct manipulation of attributes of an object; use get and set methods instead; new methods added to feature the desired behavior 2015-06-23 12:57:36 +02:00
6d8a17b7e2 deleting obsolete class definition 2015-06-23 12:51:27 +02:00
Ludger Küperkoch
1c749dd9a8 Debugging. 2015-06-23 12:24:13 +02:00
Ludger Küperkoch
c54ba04ae2 Marginal changes. 2015-06-23 12:19:16 +02:00
Ludger Küperkoch
add4944c05 Marginal changes. 2015-06-23 12:18:45 +02:00
Ludger Küperkoch
c35dd456fe Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop
Merge necessary after commit before pull.
2015-06-23 12:02:51 +02:00
Ludger Küperkoch
44050564b8 Debugging. 2015-06-23 12:02:04 +02:00
Ludger Küperkoch
931853016a Debugging. 2015-06-23 12:01:36 +02:00
231a8b0244 Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop 2015-06-23 08:49:34 +02:00
8d4aaab92a [bugfix] return value of getnoisewin and getsignalwin should be of expected type numpy.ndarray (was tuple) 2015-06-23 08:49:10 +02:00
a2ca6fd66f [bugfix] return value of getnoisewin and getsignalwin should be of expected type numpy.ndarray (was tuple) 2015-06-23 08:48:14 +02:00
dc281c6c0e [bugfix] determine the SNR according to the demeaned waveform between the beginning of the noise window and the end of the signal window 2015-06-23 08:24:21 +02:00
bb6ebc7ee1 reformatting code for reasons of coding conventions 2015-06-23 08:22:59 +02:00
Ludger Küperkoch
9ec7da7e4e Example of autoPyLoT.in for regional data set. 2015-06-22 16:28:35 +02:00
Ludger Küperkoch
cab58a10aa Example of autoPyLoT.in for local data set. 2015-06-22 16:28:21 +02:00
Ludger Küperkoch
d25e791bb8 Debugging. 2015-06-22 16:01:25 +02:00
Ludger Küperkoch
833b29a488 Debugging. 2015-06-22 16:01:16 +02:00
Ludger Küperkoch
f2510ff400 Switched off warnings. 2015-06-22 15:35:16 +02:00
Ludger Küperkoch
4a911a4ac9 Marginal changes only. 2015-06-22 15:20:03 +02:00
Ludger Küperkoch
ab53a72c57 Debugging: If not enough S-P times are available, the plotting is modified. 2015-06-22 15:07:54 +02:00
Ludger Küperkoch
99a5a4499a Debugging: If no P-Pick was determined, no plot of of horizontal data comes up. 2015-06-22 14:59:57 +02:00
Ludger Küperkoch
eb153679ba Removed axis limits from plotting part. 2015-06-22 14:37:47 +02:00
Ludger Küperkoch
aba3997b20 Modified earllatepicker: Mean is removed from trace calculated from noise + signal window. 2015-06-22 12:39:29 +02:00
Ludger Küperkoch
635ac1686b Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop
Conflicts:
	pylot/core/pick/utils.py
2015-06-22 11:27:01 +02:00
Ludger Küperkoch
fd6e4cb02a Uses now UTCDateTime.timestamp as this is more efficient and shorter. 2015-06-22 11:07:22 +02:00
30bc8ccd82 reformatting code to avoid indentation inconsistencies 2015-06-22 11:06:53 +02:00
245a7455ff FilterOptions class has new method parseFilterOptions which establishes a valid keyword arguments dictionary to be parsed to the obspy.core.stream.Stream 's filter method 2015-06-22 10:59:14 +02:00
ff52ec5410 started implementation of running of external programs (work in progress, pending until release of picking window) 2015-06-22 10:56:16 +02:00
6b14c452e2 Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop
Conflicts:
	pylot/core/pick/utils.py
2015-06-22 10:54:30 +02:00
864ef6c64d [bugfix] determination of zero crossings breaks down if data is not demeaned in the signal window (explicitly demeaning data in the signal window when determining the zero crossings) 2015-06-22 10:52:26 +02:00
Ludger Küperkoch
3330a3ae35 Corrected calculation of Vp/Vs ratio in wadaticheck, now determined from slope of trend as it should be. 2015-06-22 09:32:33 +02:00
Ludger Küperkoch
a95caa5efc Weight 9 now for skiped S onsets, turned rank warning off. 2015-06-19 15:48:04 +02:00
Ludger Küperkoch
aa624c0358 Added new function wadaticheck to test certainty of S-onsets using Wadati diagram. 2015-06-19 15:28:53 +02:00
Ludger Küperkoch
b91f4c9619 Implemented new function wadaticheck. 2015-06-19 15:27:24 +02:00
Ludger Küperkoch
613bef1678 Implmented dictionary containing onset parameters. 2015-06-19 09:09:22 +02:00
Ludger Küperkoch
fd796ba6e1 Implemented dictionary containing onset parameters. 2015-06-19 09:08:28 +02:00
57dfb86819 [bugfix] importing of run_autopicking.py was inhibited by badly indented call to raw_input() (fixed) 2015-06-18 10:55:26 +02:00
04b6c53ec0 Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop
Conflicts:
	pylot/core/pick/Picker.py
2015-06-12 09:38:19 +02:00
883fdf6bf5 just cleaning up the code to meet coding conventions 2015-06-12 09:36:52 +02:00
c5ce958a41 just cleaning up the code to meet coding conventions 2015-06-12 09:31:58 +02:00
c5da8fd994 changed usage signature of some function from module utils and the corresponding calls 2015-06-11 10:12:50 +02:00
546e919dc9 code clean-up following several conventions 2015-06-11 10:07:21 +02:00
3d8bea8f7e deleted obsolete module 2015-06-11 10:02:44 +02:00
63849177be package active will provide capabilities for processing reflection seismic surveys automatically 2015-06-11 05:36:56 +02:00
77b7d26902 selectable phases should be edited elsewhere not in the combobox itself 2015-06-11 05:34:07 +02:00
e6e38dbb95 Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop 2015-06-10 15:49:15 +02:00
93dfe76b7e fixed some bugs concerning plotting and implemented a more flexible way of drawing the picks including error plotting 2015-06-10 15:49:06 +02:00
864cb112bc usage changed due to release [1d70a23] 2015-06-10 15:47:40 +02:00
b3ea4229a4 implement opportunity to apply different kind of event data to the data object 2015-06-10 15:46:37 +02:00
1d70a236d1 [bugfix] avoid forming invalid pickID strings (line 194)
do not use altered resource identifier for all kinds of event  objects
2015-06-10 15:45:49 +02:00
ba7ab07473 catch non string type input for filename construction 2015-06-10 15:43:43 +02:00
3cb73fb948 alternative for storing event data (discussable) 2015-06-10 15:41:37 +02:00
0721e225a7 never return values for without a meaning 2015-06-10 15:40:36 +02:00
e6b0c2b470 zero xings are now be derived from demeaned data 2015-06-10 15:37:58 +02:00
e0568e3849 write picks into data object (work in progress) 2015-06-10 15:36:37 +02:00
Ludger Küperkoch
b0acee7136 Added component splitting also for channels 1 and 2. 2015-06-02 13:46:10 +02:00
Ludger Küperkoch
0dce58ede4 Marginal changes. 2015-06-02 13:43:39 +02:00
Ludger Küperkoch
ce75a82f5b Some cosmetics. 2015-06-02 13:42:44 +02:00
Ludger Küperkoch
15b245c2e8 Debuging, temporary solved problems occuring when reading channels of not oriented sondes (channels 1/2). 2015-06-01 16:30:22 +02:00
Ludger Küperkoch
5488d4e0fc Debuged loop, seperate loops for single event or complete data structure processing, respectively. 2015-06-01 16:28:27 +02:00
Ludger Küperkoch
85f0717f10 Implemented first-motion picker, some debugging. 2015-06-01 14:18:18 +02:00
Ludger Küperkoch
ab9a49a727 Additional parameters for first-motion picker. 2015-06-01 14:16:52 +02:00
Ludger Küperkoch
c676fc5762 Modified loop over all available stations to prevent processing of one station several times. 2015-06-01 14:15:37 +02:00
Ludger Küperkoch
74682952e7 New function invoked by autoPyLoT for automated picking of onset times. Main tool for automatic picking! 2015-05-29 16:48:58 +02:00
Ludger Küperkoch
5be662524f Debuged AIC picker for plotting smoothed CF instead of unsmoothed CF, implemented quick and dirty a temporary solution to process restituted data in order to calculate apropriate slope (line 204). 2015-05-29 16:43:32 +02:00
Ludger Küperkoch
6e51c05c94 Running indicies changed after kai Olbert to calculate equal CF as done in MatLab, implemented some tools to compensate numerical artefacts. 2015-05-29 16:35:00 +02:00
Ludger Küperkoch
1c71286fd8 Modified picking parameter input file for new function run_autopicking. 2015-05-29 16:30:12 +02:00
Ludger Küperkoch
0b6b7a7aed Marginal changes only. 2015-05-29 16:28:50 +02:00
Ludger Küperkoch
6c73e30754 Modified to run new function run_autopicking. 2015-05-29 16:26:31 +02:00
0c76c496fb Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop 2015-05-28 12:14:29 +02:00
c86adb4e6e preparing storing the picks and making the GUI work more intuitively 2015-05-28 12:14:16 +02:00
2da7861b6f todo mark deleted 2015-05-28 11:54:16 +02:00
Ludger Küperkoch
c04235dffc Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2015-05-27 09:36:21 +02:00
Ludger Küperkoch
caa0dce637 Adopted zero-crossing plotting to output of new function for calculating zero-crossings. 2015-05-27 09:36:12 +02:00
a239de26e8 bugfix: eventID is now appended to the path in autoPyLoT if eventID is given in autoPyLoT.in 2015-05-27 08:48:07 +02:00
b9ce5b4f41 try to read lists of files not wildcards 2015-05-20 11:29:55 +02:00
6dc0b206e9 changed string representation of data object 2015-05-20 11:20:37 +02:00
0a6cff5f23 Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop
Conflicts:
	autoPyLoT.py
2015-05-20 11:05:53 +02:00
bd10f7b61e bugfix: searching event directory 2015-05-20 10:58:48 +02:00
Ludger Küperkoch
b588c29513 Dirty revision 2015-05-20 10:56:53 +02:00
9a4677c794 bugfix: deleted default value for suffix 2015-05-20 10:33:59 +02:00
5f8b6de1ec bugfix: method hasParam did not return any value 2015-05-20 10:23:47 +02:00
82540c50af changed argument parser and glob call to search directory 2015-05-20 10:01:19 +02:00
b46f085a74 added option to process single event 2015-05-20 09:59:06 +02:00
4994168247 number of arguments changed, filenames not necessary for starting 2015-05-20 09:43:32 +02:00
5badf2ba34 implementation of different data structure type handling 2015-05-20 09:38:25 +02:00
56a0563709 implementation of PilotDataStructure as subclass to GenericDataStructure 2015-05-18 13:12:12 +02:00
f177901883 rearranging methods to provide a superclass to all other structure classes 2015-05-11 13:41:08 +02:00
Ludger Küperkoch
c4b6b4c648 Changed permitions. 2015-05-04 12:11:32 +02:00
Ludger Küperkoch
6ee3a1b0b4 Pulling latest release from server ariadne.
Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop
2015-05-04 12:07:17 +02:00
7cab62b97e release version committed to avoid conflicting files while update 2015-05-04 12:05:14 +02:00
15bdc47f84 data reading interface not clear yet, major changes have to be done to the data structure and the data reading part of PyLoT (DataStructure superclass is needed providing generalized methods to use by the Data object) 2015-05-04 05:31:10 +02:00
367610d032 made AutoPickParameter class more flexible in reading and handling parameters; export routine defined: exports in the new autoPyLoT.in format (see docstring) 2015-05-04 05:25:40 +02:00
426c2d0d4c TODO: restructuring the datastructure classes; suggestion: write a Superclass GenericDataStructure which is than inherited by PilotDataStructure and SeiscompDataStructure 2015-04-29 07:57:52 +02:00
0760c2fe3a introducing new attribute __name to the datastructure objects. Used in autoPyLoT to distinguish between structure types. 2015-04-29 06:29:08 +02:00
8bf9b55288 task: create development frame for autoPyLoT 2015-04-22 12:46:24 +02:00
ca8081b7aa debugging: return the exception text whenever an error occurs - makes debugging much easier 2015-04-22 12:38:10 +02:00
58aad840c8 task: read also old autoPILOT parameter files 2015-04-22 12:22:34 +02:00
4b641f1b3c reversed polarity in picking mode 2015-04-21 08:21:59 +02:00
463535f01a improved flexibility of the GUI actions (Matplotlib) implementation 2015-04-21 08:16:32 +02:00
bb84e27e54 implemented a much faster calculation of the zero crossing beside an average calculation over the whole signal window of the dominant period 2015-04-21 08:14:26 +02:00
Ludger Küperkoch
694a10bd4a Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2015-04-13 09:52:55 +02:00
4d268da435 suppress output of earllatepicker 2015-04-13 09:52:45 +02:00
Ludger Küperkoch
fee0d05253 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2015-04-13 09:42:32 +02:00
7816e6342f zooming for 3-component window changed now zooming is done by using the mouse wheel
bugfix: calculation of the snr corrected
2015-04-13 09:42:17 +02:00
Ludger Küperkoch
b42b87602b Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop
Conflicts:
	pylot/core/pick/earllatepicker.py
	pylot/core/pick/fmpicker.py
	pylot/core/pick/getSNR.py
2015-04-13 09:36:22 +02:00
Ludger Küperkoch
492aac831a Commited to pull changes 2015-04-13 09:27:26 +02:00
67dd66535a bugfix: zooming with scroll wheel now working properly
task: panning now available while in exploration mode, if a phase is selected initial pick can be set and afterwards the onset itself (procedure questionable as two picks are needed)
panning not tested yet!
2015-04-09 08:49:11 +02:00
Ludger Küperkoch
6213962654 Deleted. 2015-04-08 11:32:02 +02:00
Ludger Küperkoch
0494f2a11b Deleted: 2015-04-08 11:29:50 +02:00
c15716388d new zoom icon added 2015-04-07 15:00:53 +02:00
d21798f633 test pickingdialog and prepare figures for the poster 2015-04-07 15:00:00 +02:00
043c45e02c bugfix: undo filtering when checkbox is unchecked
code improvement: class PickDlg -> distinguish between setting the initial pick (for zooming) and setting the actual pick (phase onset); methods renamed -> setPick is now setIniPick and plotPick became setPick
2015-04-06 11:42:21 +02:00
b243be8075 task: implementation of picking (work in progress) 2015-04-02 18:48:06 +02:00
e35d6b9371 bugfix: modified icon management and corrected usage of references 2015-04-02 18:36:21 +02:00
0824026159 standalone python files now import definitions from module pylot.core.pick.utils and parse arguments when called from shell (deleted "if __name__ == '__main__' :" clauses from the module) 2015-04-02 15:45:38 +02:00
Ludger Küperkoch
f6f1c9cf2f Modified to handle new module utils. 2015-03-30 16:25:04 +02:00
Ludger Küperkoch
a015b0c90d New functions in module: getnoisewin and getsignalwin to extract noise and signal parts. 2015-03-30 16:22:20 +02:00
Ludger Küperkoch
e8aa9de060 Modified to handle new module utils.py. 2015-03-30 16:20:41 +02:00
Ludger Küperkoch
1cdda3652f New module containing some helpful functions, replaces getSNR, fmpicker, and earllatepicker. 2015-03-30 14:35:21 +02:00
Ludger Küperkoch
bebe3a3c45 Cleaned up source code, debuged: calculates now T/4 instead of T/8 out of zero crossings. 2015-03-30 14:18:19 +02:00
Ludger Küperkoch
0ad7e629ce Marginal changes only. 2015-03-30 10:59:27 +02:00
Ludger Küperkoch
45eb138717 New function to derive SNR, returns SNR and SNR[dB]. 2015-03-30 10:58:24 +02:00
5b52f718fe mutable default arguments may cause problems as unexpected default behavior 2015-03-30 06:04:24 +02:00
814906ef65 module restructured: beginning with general utils followed by utils concerning obspy event creation 2015-03-30 05:55:54 +02:00
27ecdb899b plotting scheme restructured: the same widgets are used for plotting the overview and the station plots, the plotting method has been moved to the widget side which makes more sense than having it on the data side;
new functions in utils module: prepTimeAxis returns a proper time axis array for a given start time and an obspy trace; getGlobalTimes returns the minimum start time and the maximum end time (edges) of a given obspy stream object
2015-03-29 08:07:46 +02:00
ae57381733 Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop 2015-03-19 15:38:13 +01:00
c46b8a7821 made a copy and modified run_makeCF.py (now test_autopick.py in the root directory) 2015-03-19 15:36:55 +01:00
Ludger Küperkoch
dc78abed09 Modified to handle new function fmpicker. 2015-03-19 14:36:56 +01:00
Ludger Küperkoch
a606b030e2 New function to derive automatically first motion (polarity) of phase onset based on zero crossings and slope determination. 2015-03-19 14:32:50 +01:00
Ludger Küperkoch
787cac7d68 Removed class EarlLatePicker, replaced by new function earllatepicker. 2015-03-18 14:45:49 +01:00
Ludger Küperkoch
16ae4bdfe9 Modified for using new function earllatepicker instead of removed class EarlLatePicker of object Picker. 2015-03-18 14:45:08 +01:00
Ludger Küperkoch
8ba34db05c New function to calculate earliest and latest possible pick from a given initial (most likely) pick. Replaces class EarlLatePicker of object Picker. 2015-03-18 14:44:08 +01:00
Ludger Küperkoch
49a248d139 Debuged AICPicker: Now values equal zero are removed from CF to avoid numerical instabilities. 2015-03-12 15:45:54 +01:00
474622027e now the station selection works fine and a picking window is opened when the waveform has been clicked 2015-03-12 13:59:29 +01:00
a0bbe8ca04 trying to get the picking of plot coordinates working (pending for poster preparation) 2015-03-11 12:05:52 +01:00
Ludger Küperkoch
486449fbb5 Debuged EarLatePicker noise level exceedance part. 2015-03-11 12:01:06 +01:00
Ludger Küperkoch
85f0445e6b Stabilized AICPicker: if no minimum was found, try 1st derivative of AIC-CF. 2015-03-10 16:48:48 +01:00
Ludger Küperkoch
ea68b38f7e Stabilized AICPicker by introducing 1st derivative of CF to find global maximum. 2015-03-10 16:18:32 +01:00
Ludger Küperkoch
380cccdf16 New attribute getPickError in class EarlLatePicker to derive symmetric picking error out of earliest and latest possible and most probable pick. 2015-03-09 16:14:03 +01:00
Ludger Küperkoch
a3fb4770c6 Modified to apply and show symmetric picking error derived from EarlLatePicker.py with new attribute getPickError. 2015-03-09 16:11:52 +01:00
c7aeb1959b implement picking window and station selection (tests pending due to not working station selection so far) 2015-03-09 11:21:33 +01:00
54916fa421 Merge branch 'filter-handling' into develop
Conflicts:
	pylot/core/util/widgets.py
2015-03-06 09:14:51 +01:00
78b41f3d57 initialization of a picking window (work doubled due to system crash before commit) 2015-03-06 09:05:52 +01:00
Sebastian Wehling
e321ad26b2 make creating new event work 2015-03-06 09:03:04 +01:00
Sebastian Wehling
a86a2efb8a debugging in progress (filter waveform not working) 2015-03-05 14:52:34 +01:00
Sebastian Wehling
ffa58c1f89 Merge branch 'develop' of ariadne:/data/git/pylot into develop 2015-03-05 11:54:32 +01:00
Dennis Wlecklik
5fbd9d7fa9 initial import from coincidence trigger to generate coincidence triggerlists
with obspys coincidenceTrigger
2015-03-05 11:49:27 +01:00
Dennis Wlecklik
3507314955 initial git import of module trigger which introduces simple triggerlist
modification functionality
2015-03-05 11:44:38 +01:00
Ludger Küperkoch
77c87067da Different time windows for slope determination from AR- and HOS-CF. 2015-03-04 15:53:18 +01:00
Ludger Küperkoch
8f71297884 Debuged, stable slope determination of CF, modified plotting. 2015-03-04 15:52:14 +01:00
Sebastian Wehling
567ae16f1d bugfix: FilterOptionsDialog should only provide logic options 2015-03-04 15:42:08 +01:00
Sebastian Wehling
5f0b7fbdc0 bugfix: fixed usage of createAction do to outsourcing 2015-03-04 15:40:25 +01:00
Ludger Küperkoch
714e70de69 Modified for improved class Picker.py 2015-03-04 13:49:02 +01:00
Ludger Küperkoch
f6922fafef Implemented quality assessment for AICPicker based on slope and SNR from CF. New attributes getSNR and getSlope. 2015-03-04 13:45:29 +01:00
Sebastian Wehling
cc2d823272 user interface setup for picking dialog added 2015-03-04 11:54:56 +01:00
Sebastian Wehling
0ceba15118 corrected MatLab code remnant semicolon 2015-03-04 11:53:15 +01:00
Sebastian Wehling
0dbcca1c6f moved function createAction to the widgets module (reused in additional widget)
bugfix: on Linux systems os.getlogin raises an exception (reimplementation: getLogin)
2015-03-04 11:52:04 +01:00
b23c9d1104 initialized new widget and window for picking (work in progress) 2015-03-01 19:59:41 +01:00
addb8ae815 try to make filtering work 2015-03-01 19:59:41 +01:00
Ludger Küperkoch
b953377c58 Major changes: 1) Implemented new class EarlLatePicker for calculating earliest and lates possible pick from initial (most likely) onset, based on cook book for consistent phase picking by Diehl & Kissling 2) Modified AICPicker, uses now unsmoothed and smoothed CF for not sticking in some local minima 3) Implemented optional plotting of interims results 2015-02-25 10:07:16 +01:00
Ludger Küperkoch
4a48874f88 Debuged and cleaned source code 2015-02-25 09:59:59 +01:00
Ludger Küperkoch
1966a2b612 Extended for applying new class EarlLatePicker and for plotting earliest and lates possible picks 2015-02-25 09:56:23 +01:00
Ludger Küperkoch
3556a2becc Changed index for AR-CF calculation, no more shift in getTimeArray needed. 2015-02-24 09:08:38 +01:00
Ludger Küperkoch
acd8f70369 AR-CFs now have same sampling rate as raw seismograms, new attribute getXCF 2015-02-23 15:42:35 +01:00
Ludger Küperkoch
16c07da6e4 Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop 2015-02-23 15:06:22 +01:00
Ludger Küperkoch
125728f2b1 Closes Ticket #143, uses now None instead of -1 2015-02-23 15:04:39 +01:00
c5f9842c37 added a toolbar (work in progress) 2015-02-23 14:47:38 +01:00
d9b685eebb display more detailed status messages 2015-02-23 14:46:18 +01:00
cb114dc696 bugfix: displayed status message has not been updated properly 2015-02-23 14:45:47 +01:00
d4d464d400 generalized method addActions in order to be more flexible in adding actions to different QtObject types 2015-02-23 14:38:26 +01:00
cc002c9460 bugfix: wrong return type expectation corrected 2015-02-23 14:35:00 +01:00
4184fcffdc make waveform filtering work (in progress) 2015-02-20 08:38:26 +01:00
4344a7c8a6 unnecessary code overhead; return type is clear anyway (different return type for PyQt!!!) 2015-02-20 08:37:21 +01:00
b10d8606cc at least print error messages to screen (helps debugging ^^) 2015-02-20 08:36:20 +01:00
7dd1519f83 use similar method names for similar types of methods (e.g. xWFData for all methods connected to waveform data) 2015-02-20 08:35:26 +01:00
35c184ede7 bugfix: in order to be able to check for checkable these should be available in the namespace, thus these actions have been set as attributes of the MainWindow object 2015-02-20 08:30:17 +01:00
5496b2deaa bugfix: use get and set methods instead of directly changes values of attributes 2015-02-20 08:28:24 +01:00
757a6d784b better use call to the classes method then returning a value 2015-02-18 15:35:54 +01:00
cdb8af56b3 bugfix: avoid empty parts of the data display 2015-02-18 15:35:12 +01:00
abbe9cb2c4 bugfix: missed to call get method before trying to fetch an item 2015-02-18 15:34:21 +01:00
693362a278 normalize waveform data to avoid overlapping 2015-02-18 15:32:37 +01:00
dd360bd9cc code clean up 2015-02-18 15:32:01 +01:00
1878b887f6 give information on files which could not be read and thus not be attended to the waveform container 2015-02-18 15:31:35 +01:00
82ac85d743 bugfix: return value of QFileDialog method calls must be handled carefully 2015-02-18 15:30:24 +01:00
5c9f17bce3 bugfix: attribute was of wrong kind for which the successive call raised an exception 2015-02-18 15:27:50 +01:00
d15441900e bugfixes in order to make the GUI work 2015-02-17 13:17:01 +01:00
091ab23b90 version string changed for testing reasons 2015-02-16 10:32:19 +01:00
8acd84976e optimization of the codes outer appearance 2015-02-16 10:31:25 +01:00
fa6db084b8 Data object restructured for convenience; fixed problems in the class logic; restructured imports 2015-02-16 10:30:35 +01:00
2b8c60a3d4 now only Signal is imported from PySide avoiding overhead by importing SIGNAL additionally 2015-02-16 10:28:28 +01:00
d477467b02 method renamed to avoid misunderstanding 2015-02-16 10:27:32 +01:00
61c136fec3 fixed a startup problem: a figure was opened without parent object (MainWindow) and led to crash before the MainApplication opened properly 2015-02-16 10:26:05 +01:00
0e73f21bda imports restructured and optimized 2015-02-16 10:24:17 +01:00
be0bf20382 cross-correlation analysis 2015-02-16 07:01:41 +01:00
d32b401508 changed due to testing 2015-02-13 11:36:44 +01:00
759697add8 problem with the creation of a valid resource identifier fixed (still problematic, see #145) 2015-02-13 11:36:09 +01:00
c35eea4588 several bugfixes for the read routine for PILOT event data (testing not yet completed, see also tickets #145 and #146) 2015-02-13 11:35:00 +01:00
1b86d3bfa4 nothing changed 2015-02-13 11:32:00 +01:00
cdd24e23fb added missing method for GenericDataStructure 2015-02-13 11:31:20 +01:00
e66e0701a4 catching a problem with sloppy formatted GSE data 2015-02-13 11:30:45 +01:00
47f0fcb030 corrected wrong logic of the routine 2015-02-13 11:29:32 +01:00
6a59bee73d the call to the parents method makes no sense - deleted; typo corrected 2015-02-13 11:28:58 +01:00
3508d00c28 catch case where no filename for the actual opened event is defined 2015-02-13 11:24:27 +01:00
2b5e8216ba new method the get the latest event that has been opened see also [7e3bcef] 2015-02-13 11:23:01 +01:00
922cb6a807 recursive call to openWaveFormData deleted 2015-02-13 11:20:29 +01:00
81ce161744 automatic reformatting of the code 2015-02-13 11:19:10 +01:00
30503185e4 initialize all attributes that might be used in startup methods (bugfix) 2015-02-13 11:17:18 +01:00
7e3bcefd19 only store the last 5 events 2015-02-13 11:16:20 +01:00
1c40cb3852 bugfix: wrong call to a method 2015-02-13 11:15:48 +01:00
35e477c13f by default the last opened event is loaded on restart 2015-02-13 11:14:17 +01:00
903e87e1e1 usage of DATASTRUCTURE modified 2015-02-13 11:13:21 +01:00
b07f1b5b78 picks.py deleted new classes are not needed; ~obspy.core.event.Pick object used instead 2015-02-11 13:11:12 +01:00
bec1ee1716 new function added: createAmplitude - routine for convenient ~obspy.core.event.Amplitude object creation 2015-02-11 08:19:13 +01:00
d5c9ad41be Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop
Conflicts:
	pylot/core/util/utils.py
2015-02-10 13:17:46 +01:00
46a20a10e6 new functions added for event creation purposes:
getHash - returns a hash string from an UTCDateTime object
	createResourceID - returns a valid PyLoT resourceID for arbitrary types of event data
	createOrigin - returns an ObsPy Origin object (work in progress)
	createEvent - returns an ObsPy Event object (work in progress)
	createPick - returns an ObsPy Pick object (work in progress)
	createArrival - returns an ObsPy Arrival object (work in progress)
	createMagnitude - returns an ObsPy Magnitude object (work in progress)
	createAmplitude - returns an ObsPy Amplitude object (work in progress)
testing should be carried out as a next step
2015-02-10 13:12:04 +01:00
c88ba18d2f new functions added for event creation purposes:
getHash - returns a hash string from an UTCDateTime object
	createResourceID - returns a valid PyLoT resourceID for arbitrary types of event data
	createOrigin - returns an ObsPy Origin object (work in progress)
	createEvent - returns an ObsPy Event object (work in progress)
	createPick - returns an ObsPy Pick object (work in progress)
	createArrival - returns an ObsPy Arrival object (work in progress)
2015-02-09 13:24:55 +01:00
f6bf37c920 new package io.py which should contain all import and export routines written by ourselves, such as reading old PILOT phase and location information file; implementation of the readPILOTevent function; new routines in utils: createArrival will be split into two functions: createPick and createArrival; also planned: createOrigin, createAmplitude and createMagnitude as well as giving createEvent functionality 2015-02-07 09:12:58 +01:00
d3199a5798 implementation of reading and plotting seismograms (work in progress) 2015-02-07 09:05:08 +01:00
7092f6e8b5 the MainWindow now should give the right component in the title 2015-02-07 09:03:03 +01:00
bc87c12cfa new attribute dispComponent added to the MainWindow class to control the displayed component 2015-02-04 14:50:49 +01:00
401c09d0b4 added new methods to the MPLWidget class to control the axes labels 2015-02-04 14:49:49 +01:00
36675d4a92 code clean up 2015-01-29 08:53:01 +01:00
9dc5b57ee0 new attribute introduced holding information about the component of the seismic waveforms to display in the overview plot 2015-01-29 08:52:01 +01:00
eab0ea5a7e modified the GenericDataStructure class in order to fit into the concept of different data structures (work in progress) 2015-01-29 08:50:39 +01:00
f5eda74730 method getWFFnames implemented returning the file names of the waveform data files given in a particular data structure case as well as setting the attribute pointing to the same information; method openWaveformData implemented in order to read waveform data into the Data object 2015-01-29 08:48:25 +01:00
8eb69822b1 re-organization of the MainWindow methods (for convenience only) 2015-01-29 08:41:38 +01:00
a8330b6d91 PilotDataStructure's method expandDataPath return the actual datapath as SeiscompDataStructure's does 2015-01-27 05:22:06 +01:00
89f996ffe3 problem fixed: renaming of getFields method implemented into expandDataPath method (unified usage of either DataStructure object) 2015-01-27 05:19:41 +01:00
1accc92421 Merge branch 'develop' 2015-01-27 05:01:45 +01:00
d22a224804 data plotting; waveform filtering and convenience imports in order to get a overview window displaying data; new data structure available -> PyLoT should be able to read PILOT data 2015-01-26 21:11:53 +01:00
dbd53024b2 new module: make selection of either data structure easier 2015-01-26 21:08:07 +01:00
Ludger Küperkoch
75ffe0c37a Some changes to be actual to Python2.7 2015-01-26 10:55:25 +01:00
Ludger Küperkoch
41a2e840f8 Some changes to be actual to Python2.7 2015-01-26 10:55:18 +01:00
Ludger Küperkoch
2d48ad3bb2 Some changes to be actual to Python2.7 2015-01-26 10:54:58 +01:00
23fa136dc5 get data from the NewEvtDlg dialog for event creation 2015-01-23 10:21:34 +01:00
64158174e6 currently working on the plotting of waveforms; changes made to meet pre-requisites to data plotting 2015-01-22 16:41:52 +01:00
ef50c3d4d8 bugfix: single element tuple declaration was wrong 2015-01-21 16:07:43 +01:00
538c2e2dff Merge branch 'add-save' 2015-01-20 14:04:12 +01:00
19eaa171fd Merge branch 'master' into devGUI 2015-01-20 14:03:22 +01:00
b4c19acd99 release version change due to testing 2015-01-20 14:02:56 +01:00
45fb1935ef added FormatError to convenience imports of package util 2015-01-20 14:02:29 +01:00
540891f3d7 preferences panel works for me; settings saved properly 2015-01-20 13:58:23 +01:00
4769b447a8 added help menu to the menubar 2015-01-20 13:56:15 +01:00
ff98371a04 add recent events to file menu 2015-01-20 13:55:15 +01:00
0bfe2ccc3d new method added in order to add actions and separators to the menu in the menubar more easily 2015-01-20 13:54:17 +01:00
9bbbe89b36 add recent events to file menu 2015-01-20 13:46:16 +01:00
2961867c10 insert assert statement in Picker.py 2014-12-19 10:50:50 +01:00
1d61b4936c add save data method 2014-12-18 13:49:16 +01:00
6be85efa1f Merge branch 'develop' 2014-12-18 13:36:05 +01:00
f5ab88909f Merge branch 'add-save' into develop 2014-12-18 13:35:23 +01:00
d46d5c2bb0 Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop 2014-12-17 12:17:02 +01:00
f0d60de745 add save data method 2014-12-17 12:16:32 +01:00
92ed582c01 Merge branch 'develop' of 134.147.164.251:/data/git/pylot into add-save 2014-12-17 12:01:07 +01:00
c5e55fd867 Merge branch 'installation'
Conflicts:
	pylot/RELEASE-VERSION
2014-12-17 08:00:07 +01:00
e6301af2bb Merge branch 'devFilterWidget' into develop 2014-12-17 07:53:32 +01:00
9d1a78222e PropertiesDlg changed: retrieve additional information about the user, use QSettings to store the derived parameters 2014-12-17 07:52:55 +01:00
3fe1e3906e OUTPUTFORMATS in defaults defined; manage available formats just from here 2014-12-17 06:37:36 +01:00
8213cdc575 PropertiesDlg added to the MainWindow (not tested yet) 2014-12-17 06:33:34 +01:00
0749420f9a filter possible event format file extension for selection from file dialog 2014-12-17 06:30:03 +01:00
Ludger Küperkoch
2fcf325a6e Debugged getDataArray, same data lengths are now guaranteed 2014-12-16 16:15:53 +01:00
Ludger Küperkoch
13b8a9daec Debugged 2014-12-16 16:13:52 +01:00
Ludger Küperkoch
fa58ec2aee Modified for applying pragmatic picking algorithm, new class PragPicker in Picker.py 2014-12-15 15:04:48 +01:00
Ludger Küperkoch
59930c3238 Implemented pragmatic picking algorithm developed by TM, JL, and LK 2014-12-15 15:03:41 +01:00
5d85a4bdc8 returning value in set method is not straight forward 2014-12-15 05:15:43 +01:00
Ludger Küperkoch
2eace0d304 Debugging, cleaning up 2014-12-12 13:37:18 +01:00
Ludger Küperkoch
31273b384e Simplified AIC-picking algorithm: Onset is definetly the minimum in front of maximum of AIC-CF! Smoothing of AIC-CF no more necessary. 2014-12-11 16:30:21 +01:00
Ludger Küperkoch
201c34a85b Modified for using TimeArray object for plotting and expanded for picking on ARH-CF. 2014-12-11 15:57:25 +01:00
Ludger Küperkoch
112e0bc7fa Modified internal function getTimeArray for calculating correct time stamps even for AR prediction, where CF time array is different to data time array. Implemented getARdetStep and setARdetStep where ARdetStep is the recalculation step of AR coefficients. 2014-12-11 15:55:23 +01:00
3c9865c767 add station selection 2014-12-11 09:43:59 +01:00
d665e47d02 get values for filter parameters from widget 2014-12-09 05:25:43 +01:00
9e7f20a9fb create a working MainWindow 2014-12-08 11:38:24 +01:00
223c992f20 Merge branch 'develop' of 134.147.164.251:/data/git/pylot into develop 2014-12-08 11:02:04 +01:00
4bb75d17fb remove variables which are attributes of classes 2014-12-08 11:01:47 +01:00
ef8bd6572e create a working MainWindow 2014-12-08 10:26:14 +01:00
04e28943d5 remove variables which are attributes of classes 2014-12-08 08:53:58 +01:00
32eee12f25 using the new implementation of the AutoPicking object 2014-12-08 08:48:33 +01:00
752811c8fd implemented method getTimeArray in the same fashion as used in run_makeCF.py 2014-12-08 08:45:43 +01:00
ce8b954a8b now cf is an CharacteristicFunction object and not an array (changes should also be made to the caller run_makeCF.py) 2014-12-08 05:27:54 +01:00
Ludger Küperkoch
479058a41e Included AICPicker of class Picker 2014-12-05 16:32:55 +01:00
Ludger Küperkoch
ca809c4673 Initial version of new class of methods for automatic picking, AICPicker is running but without quality attributes 2014-12-05 16:14:03 +01:00
70a700101b Merge branch 'devGUI' into develop 2014-12-05 10:27:42 +01:00
5650f7bfc7 started to implement read capability for matlab binary phases files (AUTO- and PHASES.mat) 2014-12-05 10:26:37 +01:00
9603f7127c imports corrected; menu definition changed 2014-12-04 05:13:32 +01:00
609005433a added verbose output functionality 2014-12-02 12:07:02 +01:00
e6ac337466 testing GUI; execution updates RELEASE-VERSION 2014-12-01 12:46:04 +01:00
553bb9990b loading data by initialization of a Data object (not working yet) 2014-12-01 12:45:20 +01:00
41684cd282 filterOptions has now a buttonBox 2014-12-01 12:44:25 +01:00
3e559f61da fnConstructor now works on eventIDs also 2014-12-01 12:43:49 +01:00
d7a4692afc tried to get filter options popup working (not working yet) 2014-12-01 12:42:50 +01:00
ec1cc26b8c new method okToContinue written in order to prevent accidental dataloss 2014-12-01 12:41:56 +01:00
dc43a3520d do not "save" actions as Attributes of the MainWindow 2014-12-01 12:39:56 +01:00
4acf634f8d loadData changed; now uses information from the sender to evaluate the fname to read 2014-12-01 12:37:52 +01:00
9d38ed9771 new QSettings added 2014-12-01 12:36:23 +01:00
746b073572 changed imports as some were not necessary and others are now mandatory 2014-12-01 12:34:44 +01:00
fc3e1a613e added quit functionality 2014-12-01 08:40:35 +01:00
04e6a51e99 edit on makePyLoT.py: a symlink is created an darwin systems in order to get the right application name on Mac OS X's menubar 2014-11-29 11:39:25 +01:00
d405e9e6f9 debug GUI 2014-11-28 11:15:49 +01:00
9dc57e3977 icon for P and S phase selection added 2014-11-28 09:19:16 +01:00
c7f09988e5 started implementation of a makePyLoT routine capable of building and installing PyLoT to a desired directory 2014-11-27 11:51:40 +01:00
1702051d8f Merge commit '8ed281ae2d9e45c842d93da99f641842cdfb8bb4' into installation 2014-11-27 10:59:55 +01:00
d47623ed65 implementation of standard icons corrected 2014-11-27 10:59:34 +01:00
8ed281ae2d printer icon added licensed under Creative Commons (Attribution 3.0); source: https://www.iconfinder.com/icons/59191/print_printer_icon#size=32 (27.11.2014) 2014-11-27 10:57:33 +01:00
094213bd21 method createAction implemented in order to create menu entries 2014-11-27 10:13:17 +01:00
411b365987 template for argparse program imported; will be changed to make PyLoT (build, install, re- or uninstall); 2014-11-26 09:09:19 +01:00
4b7bfc6aa9 make GUI working even without actual data 2014-11-26 08:48:42 +01:00
4bb03d6418 all picks classes are now collected in the same module 2014-11-26 08:47:21 +01:00
9ff18c7425 changes made in order to get the GUI working for the first time 2014-11-26 08:46:16 +01:00
d0d17ee656 reorganization of graphical and help resources; they are not part of the code and therefore they do not really match in util package 2014-11-26 08:45:04 +01:00
8cb638e5bc indentation fixed 2014-11-25 05:04:47 +01:00
758de94fff indentation fixed 2014-11-24 05:39:57 +01:00
Ludger Küperkoch
8fb9ca9dc2 Modified for running updated CharFuns.py showing all kinds of CFs on all 3 components 2014-11-21 14:52:19 +01:00
Ludger Küperkoch
8fa9ec74c0 Included AR prediction on all 3 components 2014-11-21 14:50:51 +01:00
2a385512ee version number changes each time the Main program is started (should not be the case, to be fixed before release) 2014-11-21 10:08:18 +01:00
9958c86287 fixed wrong usage of attribute wfdata 2014-11-21 10:06:04 +01:00
25921e3718 started to improve documentation in read/data 2014-11-21 10:05:27 +01:00
0e8c5a7e48 exporting is much easier using obspy routines 2014-11-21 10:04:32 +01:00
Ludger Küperkoch
7da6b57ed1 Modified to handle two-component data 2014-11-20 09:06:13 +01:00
Ludger Küperkoch
03033f57a1 Included autoregressive prediction on horizontal components 2014-11-20 09:05:30 +01:00
fbce83293d initial import of classes for automatic picking purposes [just imported by me; module has originally been written by Ludger Küperkoch] 2014-11-14 07:40:00 +01:00
c40aec192c test modules added and modified (not working yet) 2014-11-13 11:30:19 +01:00
8c66f1823a cleaning up main window for first test runs 2014-11-13 11:29:42 +01:00
86803cdff0 debugging UI problems to get the main application running 2014-11-06 15:07:05 +01:00
013c948b33 fix convenience import problems 2014-11-06 15:05:56 +01:00
7fd191dcc6 component testing scripts added 2014-10-30 13:38:41 +01:00
97344c9f21 cleaned up object type class definition for FilterOptions, programs now only use methods to access attributes 2014-10-30 13:38:03 +01:00
bff84ede81 moved QtPyLoT.py (main program) to the base directory 2014-10-30 13:36:19 +01:00
3b613d8330 see ticket #129 (future changes very likely) 2014-10-30 08:13:05 +01:00
da18039c87 line added 2014-10-27 12:19:48 +01:00
224c6b625c FilterOptionsDialog processes parameter filter option of type FilterOption 2014-10-27 12:19:04 +01:00
185b308166 adding new package containing picking relevant data types 2014-10-27 12:16:14 +01:00
4f440d282d added a string representation for data type FilterOptions 2014-10-27 12:14:59 +01:00
c3e072e952 trying to implement generic data structure import 2014-10-27 12:12:48 +01:00
d4bf29e4ff avoid using python keywords as format as variable name; empty method definition for data plotting 2014-10-27 12:10:35 +01:00
32cf20b81d avoid imports within class definitions 2014-10-27 12:06:30 +01:00
c03b8a220f changed loading of filter options, now immediately either a error status message or a success message is displayed in the main window if the filter parameter could not be loaded or were loaded respectively 2014-10-27 12:04:01 +01:00
77e7f666f0 added 'TestType' to plotting options (only for testing) 2014-10-27 11:57:34 +01:00
c41eb36a34 widget name changed to match the actual QtGUI type name 2014-10-27 11:56:44 +01:00
2d776f84da deleted unnecessary import 2014-10-27 11:55:39 +01:00
12c6fecf74 modified establishment of data plot 2014-10-27 11:55:06 +01:00
Sebastian Wehling
db76861124 added write support for Events in QuakeML and JSON format utilizing ObsPy 2014-07-25 14:16:11 +02:00
Sebastian Wehling
898169647b added new convenience import from new module within package 2014-07-25 14:15:06 +02:00
Sebastian Wehling
e4ddb8b55e new module utils within package util containing helpers for this and that 2014-07-25 14:14:19 +02:00
Sebastian Wehling
dde360d4cc modified: docstrings modified 2014-07-17 11:04:16 +02:00
Sebastian Wehling
8de25cc149 modified: docstring for class FilterOptions established using Sphinx-markups 2014-07-17 10:28:29 +02:00
Sebastian Wehling
6e2c1851ec modified: added imports
added: new class Data added (container class for waveform- and event data)
2014-07-16 12:07:42 +02:00
Sebastian Wehling
5268d35d39 modified: introduce data container class 2014-07-16 12:06:05 +02:00
Sebastian Wehling
34e27f3e67 modified: enhanced readability of convience imports 2014-07-16 12:02:57 +02:00
1266ced058 modification: PropertiesDlg started (not working) 2014-07-03 10:21:36 +02:00
29700e793e modification: fixed qt-resources alias for the offline help alternative 2014-07-03 10:19:51 +02:00
ff39d97b82 modification: url of the wiki-page changed to full domain (certificate validation issue) 2014-07-03 10:18:42 +02:00
a079bd331b deletion: line deleted contain call to a not implemented method 2014-07-03 10:17:25 +02:00
0cee4cd644 modified: imports adjusted to only those used in the code really 2014-07-03 10:15:25 +02:00
a385553a29 enhancements and fixes:
import QTabBar
started to implement PropertiesDlg
deleted unnecessary buttonBox assignment
entered default page for HelpForm (NOT WORKING YET)
2014-06-11 15:25:26 +02:00
00f52c444a file head fixed 2014-06-11 15:21:30 +02:00
4c8174f5ae convenience imports completed 2014-06-11 15:20:55 +02:00
0481fa748b the help form should look like this or similar but it is not working at the moment; maybe QTextBrowser element of HelpForm should be replaced by QWebView (pending) 2014-06-11 15:19:37 +02:00
46f5e55c8e improved imports for better debugging 2014-06-11 05:49:53 +02:00
cb80170ccf some non-functional snippets deleted to promote GUI debugging 2014-06-11 05:48:21 +02:00
e7507a325f fixed usage of keyword arguments; 2014-06-11 05:43:27 +02:00
e659e13a0e FilterOptionsWidget debugged; next it will be tested as a QDockWidget (QMainWindow necessary) 2014-06-11 05:38:41 +02:00
cb7eb481d9 improved imports for better debugging 2014-06-10 16:37:07 +02:00
3278470deb Started to work on ticket #122 2014-05-14 11:45:45 +02:00
307e960d34 pushbutton layout implemented (variable number of buttons according to the number of stations used) 2014-05-09 15:00:08 +02:00
d9ca0141de alphabetic order of convenience imports 2014-04-11 19:40:11 +02:00
fb2553e980 check main case; corrected usage of import 2014-04-11 19:39:29 +02:00
6af43fc9fd bugfix: imports corrected;
imports updated, layout of 'FilterOptionsDock' started
2014-04-10 09:34:13 +02:00
8df11078b4 bugfix: private methods name corrected;
set default values instead of 'None'
2014-04-10 09:31:16 +02:00
bead7a24c3 documentation updated in order to automatically provide online documentation via sphinx.ext.autodoc 2014-04-01 16:49:28 +02:00
0dec3eb7f0 unified class naming 2014-04-01 16:48:16 +02:00
36531c9923 convenience imports added 2014-04-01 16:47:24 +02:00
88b2a319fd added status label; not sure how to implement loading of data (different types of databases) 2014-04-01 16:46:10 +02:00
ef8adc6c0a doc strings corrected 2014-03-31 13:01:51 +02:00
faacfc423c resources file added in order to provide binary media file for the User Interfaces 2014-03-31 13:00:57 +02:00
c26782bf7c imports fixed and classes renamed for better readability 2014-03-31 12:59:52 +02:00
e6b49cfdb3 module pylot.core.util.connection added: contains routines for web and network utilization 2014-03-31 12:58:58 +02:00
b049dda90f imports fixed; doc string as RST added 2014-03-31 12:57:08 +02:00
9b8413beaf icons and help documents added; main application has been modified slightly; new method definitions added (ToDo) 2014-03-28 22:26:15 +01:00
d58b671d36 started to write initialization method for the GenericDataBase class in order to read data from an arbitrary data folder structure 2014-03-28 05:30:55 +01:00
0af8ab2b08 holds now all widgets' classes used in the main application 2014-03-28 05:28:16 +01:00
90936bd47a emphasize modular structure by outsourcing widgets and errors 2014-03-28 05:25:46 +01:00
dac3be5110 package wide imports for convenience 2014-03-27 21:29:41 +01:00
5b044a3f14 container module for error handling added 2014-03-27 15:34:42 +01:00
253a49c06b implementation of the PyLoT icon 2014-03-19 12:24:41 +01:00
fbbfcbcaea make use of new module widgets, set a matplotlib figure the central GUI element 2014-03-19 12:16:41 +01:00
e347e8eef9 implement new module widgets 2014-03-19 12:15:30 +01:00
9a2d127e30 added class MPLWidget in order to create updatable Matplotlib Figures within a Qt GUI 2014-03-19 12:14:54 +01:00
8edea03fe7 cleanup, switched to PySide (more flexible licensing), started to implement the filter options depending on the phase to be picked 2014-03-13 13:27:34 +01:00
ac27a8ef2e clean-up 2014-03-13 13:26:13 +01:00
c83a11a2c3 moved class FilterOptions to the read module 2014-03-13 13:25:37 +01:00
84f3a29a86 new file defaults.py written to provide default value if no user configuration file is available 2014-03-13 09:24:17 +01:00
d0b3f0ee5d cleanup: module naming re-structured 2014-02-21 23:39:42 +01:00
c0f7060368 SeiscompDataStructure objects contain all relevant information to expand a desired data path (including unix shell wildcards) [not tested for Windows yet] 2014-02-20 14:20:57 +01:00
e38b917623 removing QtDesigner project files due to decision to code the PyQt stuff by ourselves 2014-02-19 14:58:45 +01:00
8eb82cabc0 Merge branch 'master' into develop 2014-02-19 14:56:32 +01:00
Sebastian Wehling
bddc2ab83e bugfix: corrected call to special method __getitem__ 2014-02-19 14:43:56 +01:00
Sebastian Wehling
270e3b6d00 modifications concerning the usage of __specialmethods__ made 2014-02-19 13:07:39 +01:00
Sebastian Wehling
45999de6d2 made some modifications (debugging special method implementation)
item assignment not working yet
2014-02-18 15:07:50 +01:00
Sebastian Wehling
98c50e5312 made some modifications on special methods 2014-02-18 14:16:55 +01:00
ede06550cd reorganized initialization to IO-type class SeisCompDataStructure; see also ticket #118 2014-02-18 09:38:40 +01:00
c3ec80d947 planned imports of PyLoT of not yet existing PyLoT classes commented from pylot/__init__.py 2014-02-18 09:35:55 +01:00
f9d8173b2f class AutoPickParameter is now working; work on ticket #119 not finished yet (closure pending) 2014-02-18 09:33:36 +01:00
5a093ed736 AutoPickParamter class modified; not working at the moment (!) 2014-02-15 08:09:55 +01:00
34c1f9111b initial AutoPickParameter class import. Attributes are not callable at the moment (implementation pending). 2014-02-13 14:28:41 +01:00
Sebastian Wehling
4aa7856267 started initialization of SDS data organization scheme 2014-02-12 14:18:12 +01:00
Sebastian Wehling
a4f948fd76 modified initialization method of GenericDataBase class 2014-02-11 13:21:05 +01:00
1a4d306a40 initialized readinput module; there will be type classes to handle different input data types, e.g. inputs for automatic Picking, inputs for correlation detection, input for reference Picking ... 2014-02-07 05:42:31 +01:00
738f280abe started to implement a filter Widget 2014-02-07 05:40:49 +01:00
Sebastian Wehling
d016a80a72 classes for I/O started, QtPyLoT.py cleaned 2014-02-03 12:51:23 +01:00
25351d3827 changes made during workshop 2014-01-30 13:11:44 +01:00
0c1e64895b added collection class FilterOptions for filter option handling (container class in order to keep GUI up-to-date) 2014-01-28 12:07:23 +01:00
Sebastian Wehling
aaf04a13d5 started to write initialization methods for Dialogs, Windows and other Widgets 2014-01-24 14:31:57 +01:00
dcc3881720 permissions repaired and QtPyLoT.py started with some MainWindow stuff 2014-01-10 05:45:03 +01:00
e05c3d56bc initialized software versioning similar to obspy 2014-01-09 10:43:40 +01:00
32a1c8bcd3 commit master 2013-12-09 13:34:01 +01:00
33d10300f5 commit staged changes 2013-12-09 13:31:14 +01:00
336572bfc3 stage all unstaged files 2013-12-09 13:28:13 +01:00
8bf51c9315 added QtProject files. Testing the capabilities of QtDesigner for our purposes. Maybe it is better to design the GUI directly via PyQt/PySide instead of utilizing the QtDesigner and translate the *.ui file to *.py scripts. 2013-12-09 13:25:05 +01:00
bf37a6546d Started to build the basic structure. Most classes will inherit functionality of the ObsPy Core classes, but slightly redefined to fit PyLoTs’ purposes. 2013-11-20 06:02:43 +01:00
a484709bc4 removing file created by accident 2013-11-08 15:08:04 +01:00
e92c00af48 initial commit for the first blank files
preparing git spare initialization on remote system
2013-11-08 15:05:39 +01:00
5d4084ac8a no message 2013-11-08 14:31:09 +01:00
6c363d34ff updated contacts in README 2013-11-08 10:33:33 +01:00
91cd80bdb5 changed the README text to match the context 2013-10-11 06:01:12 +02:00
a3a959d75a first commit of GNU LGPL3 text and the readme file of the latest matlab version of PILOT. 2013-10-11 05:27:33 +02:00
127 changed files with 631179 additions and 1 deletions

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
\.idea/
*.pyc

3149
QtPyLoT.py Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +1,90 @@
# PyLoT
Python picking and Location Tool
version: 0.1a
The Python picking and Localisation Tool
This python library contains a graphical user interfaces for picking
seismic phases. This software needs [ObsPy][ObsPy]
and the PySide Qt4 bindings for python to be installed first.
PILOT has originally been developed in Mathworks' MatLab. In order to
distribute PILOT without facing portability problems, it has been decided
to redevelop the software package in Python. The great work of the ObsPy
group allows easy handling of a bunch of seismic data and PyLoT will
benefit a lot compared to the former MatLab version.
The development of PyLoT is part of the joint research project MAGS2.
## Installation
At the moment there is no automatic installation procedure available for PyLoT.
Best way to install is to clone the repository and add the path to your Python path.
#### Prerequisites:
In order to run PyLoT you need to install:
- python
- scipy
- numpy
- matplotlib
- obspy
- pyside
#### Some handwork:
PyLoT needs a properties folder on your system to work. It should be situated in your home directory:
mkdir ~/.pylot
In the next step you have to copy some files to this directory:
cp path-to-pylot/inputs/pylot.in ~/.pylot/
for local distance seismicity
cp path-to-pylot/inputs/autoPyLoT_local.in ~/.pylot/autoPyLoT.in
for regional distance seismicity
cp path-to-pylot/inputs/autoPyLoT_regional.in ~/.pylot/autoPyLoT.in
and some extra information on error estimates (just needed for reading old PILOT data) and the Richter magnitude scaling relation
cp path-to-pylot/inputs/PILOT_TimeErrors.in path-to-pylot/inputs/richter_scaling.data ~/.pylot/
You may need to do some modifications to these files. Especially folder names should be reviewed.
PyLoT has been tested on Mac OSX (10.11) and Debian Linux 8.
## Release notes
#### Features:
- consistent manual phase picking through predefined SNR dependant zoom level
- uniform uncertainty estimation from waveform's properties for automatic and manual picks
- pdf representation and comparison of picks taking the uncertainty intrinsically into account
- Richter and moment magnitude estimation
- location determination with external installation of [NonLinLoc](http://alomax.free.fr/nlloc/index.html)
#### Known issues:
- Magnitude estimation from manual PyLoT takes some time (instrument correction)
We hope to solve these with the next release.
## Staff
Original author(s): L. Kueperkoch, S. Wehling-Benatelli, M. Bischoff (PILOT)
Developer(s): S. Wehling-Benatelli, L. Kueperkoch, K. Olbert, M. Bischoff,
C. Wollin, M. Rische, M. Paffrath
Others: A. Bruestle, T. Meier, W. Friederich
[ObsPy]: http://github.com/obspy/obspy/wiki
October 2016

505
autoPyLoT.py Executable file
View File

@@ -0,0 +1,505 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import datetime
import glob
import os
import pylot.core.loc.focmec as focmec
import pylot.core.loc.hash as hash
import pylot.core.loc.hypo71 as hypo71
import pylot.core.loc.hypodd as hypodd
import pylot.core.loc.hyposat as hyposat
import pylot.core.loc.nll as nll
import pylot.core.loc.velest as velest
from obspy import read_events
from obspy.core.event import ResourceIdentifier
# from PySide.QtGui import QWidget, QInputDialog
from pylot.core.analysis.magnitude import MomentMagnitude, LocalMagnitude
from pylot.core.io.data import Data
from pylot.core.io.inputs import PylotParameter
from pylot.core.pick.autopick import autopickevent, iteratepicker
from pylot.core.util.dataprocessing import restitute_data, read_metadata
from pylot.core.util.defaults import SEPARATOR
from pylot.core.util.event import Event
from pylot.core.util.structure import DATASTRUCTURE
from pylot.core.util.utils import real_None, remove_underscores, trim_station_components, check4gaps, check4doubled, \
check4rotated
from pylot.core.util.version import get_git_version as _getVersionString
__version__ = _getVersionString()
def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, eventid=None, savepath=None,
savexml=True, station='all', iplot=0, ncores=0):
"""
Determine phase onsets automatically utilizing the automatic picking
algorithms by Kueperkoch et al. 2010/2012.
:param inputfile: path to the input file containing all parameter
information for automatic picking (for formatting details, see.
`~pylot.core.io.inputs.PylotParameter`
:type inputfile: str
:return:
.. rubric:: Example
"""
if ncores == 1:
sp_info = 'autoPyLoT is running serial on 1 cores.'
else:
if ncores == 0:
ncores_readable = 'all available'
else:
ncores_readable = ncores
sp_info = 'autoPyLoT is running in parallel on {} cores.'.format(ncores_readable)
splash = '''************************************\n
*********autoPyLoT starting*********\n
The Python picking and Location Tool\n
Version {version} 2017\n
\n
Authors:\n
L. Kueperkoch (BESTEC GmbH, Landau i. d. Pfalz)\n
M. Paffrath (Ruhr-Universitaet Bochum)\n
S. Wehling-Benatelli (Ruhr-Universitaet Bochum)\n
{sp}
***********************************'''.format(version=_getVersionString(),
sp=sp_info)
print(splash)
parameter = real_None(parameter)
inputfile = real_None(inputfile)
eventid = real_None(eventid)
fig_dict = None
fig_dict_wadatijack = None
locflag = 1
if input_dict and isinstance(input_dict, dict):
if 'parameter' in input_dict:
parameter = input_dict['parameter']
if 'fig_dict' in input_dict:
fig_dict = input_dict['fig_dict']
if 'fig_dict_wadatijack' in input_dict:
fig_dict_wadatijack = input_dict['fig_dict_wadatijack']
if 'station' in input_dict:
station = input_dict['station']
if 'fnames' in input_dict:
fnames = input_dict['fnames']
if 'eventid' in input_dict:
eventid = input_dict['eventid']
if 'iplot' in input_dict:
iplot = input_dict['iplot']
if 'locflag' in input_dict:
locflag = input_dict['locflag']
if 'savexml' in input_dict:
savexml = input_dict['savexml']
if not parameter:
if inputfile:
parameter = PylotParameter(inputfile)
#iplot = parameter['iplot']
else:
infile = os.path.join(os.path.expanduser('~'), '.pylot', 'pylot.in')
print('Using default input file {}'.format(infile))
parameter = PylotParameter(infile)
else:
if not type(parameter) == PylotParameter:
print('Wrong input type for parameter: {}'.format(type(parameter)))
return
if inputfile:
print('Parameters set and input file given. Choose either of both.')
return
evt = None
# reading parameter file
if parameter.hasParam('datastructure'):
# getting information on data structure
datastructure = DATASTRUCTURE[parameter.get('datastructure')]()
dsfields = {'root': parameter.get('rootpath'),
'dpath': parameter.get('datapath'),
'dbase': parameter.get('database')}
exf = ['root', 'dpath', 'dbase']
if parameter['eventID'] is not '*' and fnames == 'None':
dsfields['eventID'] = parameter['eventID']
exf.append('eventID')
datastructure.modifyFields(**dsfields)
datastructure.setExpandFields(exf)
# check if default location routine NLLoc is available
if real_None(parameter['nllocbin']) and locflag:
# get NLLoc-root path
nllocroot = parameter.get('nllocroot')
# get path to NLLoc executable
nllocbin = parameter.get('nllocbin')
nlloccall = '%s/NLLoc' % nllocbin
# get name of phase file
phasef = parameter.get('phasefile')
phasefile = '%s/obs/%s' % (nllocroot, phasef)
# get name of NLLoc-control file
ctrf = parameter.get('ctrfile')
ctrfile = '%s/run/%s' % (nllocroot, ctrf)
# pattern of NLLoc ttimes from location grid
ttpat = parameter.get('ttpatter')
# pattern of NLLoc-output file
nllocoutpatter = parameter.get('outpatter')
maxnumit = 3 # maximum number of iterations for re-picking
else:
locflag = 0
print(" !!! ")
print("!!No location routine available, autoPyLoT is running in non-location mode!!")
print("!!No source parameter estimation possible!!")
print(" !!! ")
if not input_dict:
# started in production mode
datapath = datastructure.expandDataPath()
if fnames == 'None' and parameter['eventID'] is '*':
# multiple event processing
# read each event in database
events = [events for events in glob.glob(os.path.join(datapath, '*')) if os.path.isdir(events)]
elif fnames == 'None' and parameter['eventID'] is not '*' and not type(parameter['eventID']) == list:
# single event processing
events = glob.glob(os.path.join(datapath, parameter['eventID']))
elif fnames == 'None' and type(parameter['eventID']) == list:
# multiple event processing
events = []
for eventID in parameter['eventID']:
events.append(os.path.join(datapath, eventID))
else:
# autoPyLoT was initialized from GUI
events = []
events.append(eventid)
evID = os.path.split(eventid)[-1]
locflag = 2
else:
# started in tune or interactive mode
datapath = os.path.join(parameter['rootpath'],
parameter['datapath'])
events = []
for eventID in eventid:
events.append(os.path.join(datapath,
parameter['database'],
eventID))
if not events:
print('autoPyLoT: No events given. Return!')
return
# transform system path separator to '/'
for index, eventpath in enumerate(events):
eventpath = eventpath.replace(SEPARATOR, '/')
events[index] = eventpath
allpicks = {}
glocflag = locflag
for eventpath in events:
evID = os.path.split(eventpath)[-1]
fext = '.xml'
filename = os.path.join(eventpath, 'PyLoT_' + evID + fext)
try:
data = Data(evtdata=filename)
data.get_evt_data().path = eventpath
print('Reading event data from filename {}...'.format(filename))
except Exception as e:
print('Could not read event from file {}: {}'.format(filename, e))
data = Data()
pylot_event = Event(eventpath) # event should be path to event directory
data.setEvtData(pylot_event)
if fnames == 'None':
data.setWFData(glob.glob(os.path.join(datapath, eventpath, '*')))
# the following is necessary because within
# multiple event processing no event ID is provided
# in autopylot.in
try:
parameter.get('eventID')
except:
now = datetime.datetime.now()
eventID = '%d%02d%02d%02d%02d' % (now.year,
now.month,
now.day,
now.hour,
now.minute)
parameter.setParam(eventID=eventID)
else:
data.setWFData(fnames)
eventpath = events[0]
# now = datetime.datetime.now()
# evID = '%d%02d%02d%02d%02d' % (now.year,
# now.month,
# now.day,
# now.hour,
# now.minute)
parameter.setParam(eventID=eventid)
wfdat = data.getWFData() # all available streams
if not station == 'all':
wfdat = wfdat.select(station=station)
if not wfdat:
print('Could not find station {}. STOP!'.format(station))
return
wfdat = remove_underscores(wfdat)
# trim components for each station to avoid problems with different trace starttimes for one station
wfdat = check4gaps(wfdat)
wfdat = check4doubled(wfdat)
wfdat = trim_station_components(wfdat, trim_start=True, trim_end=False)
metadata = read_metadata(parameter.get('invdir'))
# rotate stations to ZNE
wfdat = check4rotated(wfdat, metadata)
corr_dat = None
if locflag:
print("Restitute data ...")
corr_dat = restitute_data(wfdat.copy(), *metadata, ncores=ncores)
if not corr_dat and locflag:
locflag = 2
print('Working on event %s. Stations: %s' % (eventpath, station))
print(wfdat)
##########################################################
# !automated picking starts here!
fdwj = None
if fig_dict_wadatijack:
fdwj = fig_dict_wadatijack[evID]
picks = autopickevent(wfdat, parameter, iplot=iplot, fig_dict=fig_dict,
fig_dict_wadatijack=fdwj,
ncores=ncores, metadata=metadata, origin=data.get_evt_data().origins)
##########################################################
# locating
if locflag > 0:
# write phases to NLLoc-phase file
nll.export(picks, phasefile, parameter)
# For locating the event the NLLoc-control file has to be modified!
nllocout = '%s_%s' % (evID, nllocoutpatter)
# create comment line for NLLoc-control file
nll.modify_inputs(ctrf, nllocroot, nllocout, phasef,
ttpat)
# locate the event
nll.locate(ctrfile, inputfile)
# !iterative picking if traces remained unpicked or occupied with bad picks!
# get theoretical onset times for picks with weights >= 4
# in order to reprocess them using smaller time windows around theoretical onset
# get stations with bad onsets
badpicks = []
for key in picks:
if picks[key]['P']['weight'] >= 4 or picks[key]['S']['weight'] >= 4:
badpicks.append([key, picks[key]['P']['mpp']])
# TODO keep code DRY (Don't Repeat Yourself) the following part is written twice
# suggestion: delete block and modify the later similar block to work properly
if len(badpicks) == 0:
print("autoPyLoT: No bad onsets found, thus no iterative picking necessary!")
# get NLLoc-location file
locsearch = '%s/loc/%s.????????.??????.grid?.loc.hyp' % (nllocroot, nllocout)
if len(glob.glob(locsearch)) > 0:
# get latest NLLoc-location file if several are available
nllocfile = max(glob.glob(locsearch), key=os.path.getctime)
evt = read_events(nllocfile)[0]
# calculate seismic moment Mo and moment magnitude Mw
moment_mag = MomentMagnitude(corr_dat, evt, parameter.get('vp'),
parameter.get('Qp'),
parameter.get('rho'), True, \
iplot)
# update pick with moment property values (w0, fc, Mo)
for stats, props in moment_mag.moment_props.items():
picks[stats]['P'].update(props)
evt = moment_mag.updated_event()
net_mw = moment_mag.net_magnitude()
print("Network moment magnitude: %4.1f" % net_mw.mag)
# calculate local (Richter) magntiude
WAscaling = parameter.get('WAscaling')
magscaling = parameter.get('magscaling')
local_mag = LocalMagnitude(corr_dat, evt,
parameter.get('sstop'),
WAscaling, True, iplot)
for stats, amplitude in local_mag.amplitudes.items():
picks[stats]['S']['Ao'] = amplitude.generic_amplitude
print("Local station magnitudes scaled with:")
print("log(Ao) + %f * log(r) + %f * r + %f" % (WAscaling[0],
WAscaling[1],
WAscaling[2]))
evt = local_mag.updated_event(magscaling)
net_ml = local_mag.net_magnitude(magscaling)
print("Network local magnitude: %4.1f" % net_ml.mag)
print("Network local magnitude scaled with:")
print("%f * Ml + %f" % (magscaling[0], magscaling[1]))
else:
print("autoPyLoT: No NLLoc-location file available!")
print("No source parameter estimation possible!")
locflag = 9
else:
# get theoretical P-onset times from NLLoc-location file
locsearch = '%s/loc/%s.????????.??????.grid?.loc.hyp' % (nllocroot, nllocout)
if len(glob.glob(locsearch)) > 0:
# get latest file if several are available
nllocfile = max(glob.glob(locsearch), key=os.path.getctime)
nlloccounter = 0
while len(badpicks) > 0 and nlloccounter <= maxnumit:
nlloccounter += 1
if nlloccounter > maxnumit:
print("autoPyLoT: Number of maximum iterations reached, stop iterative picking!")
break
print("autoPyLoT: Starting with iteration No. %d ..." % nlloccounter)
if input_dict:
if 'fig_dict' in input_dict:
fig_dict = input_dict['fig_dict']
picks = iteratepicker(wfdat, nllocfile, picks, badpicks, parameter,
fig_dict=fig_dict)
else:
picks = iteratepicker(wfdat, nllocfile, picks, badpicks, parameter)
# write phases to NLLoc-phase file
nll.export(picks, phasefile, parameter)
# remove actual NLLoc-location file to keep only the last
os.remove(nllocfile)
# locate the event
nll.locate(ctrfile, inputfile)
print("autoPyLoT: Iteration No. %d finished." % nlloccounter)
# get updated NLLoc-location file
nllocfile = max(glob.glob(locsearch), key=os.path.getctime)
# check for bad picks
badpicks = []
for key in picks:
if picks[key]['P']['weight'] >= 4 or picks[key]['S']['weight'] >= 4:
badpicks.append([key, picks[key]['P']['mpp']])
print("autoPyLoT: After iteration No. %d: %d bad onsets found ..." % (nlloccounter, \
len(badpicks)))
if len(badpicks) == 0:
print("autoPyLoT: No more bad onsets found, stop iterative picking!")
nlloccounter = maxnumit
evt = read_events(nllocfile)[0]
if locflag < 2:
# calculate seismic moment Mo and moment magnitude Mw
moment_mag = MomentMagnitude(corr_dat, evt, parameter.get('vp'),
parameter.get('Qp'),
parameter.get('rho'), True, \
iplot)
# update pick with moment property values (w0, fc, Mo)
for stats, props in moment_mag.moment_props.items():
if picks.has_key(stats):
picks[stats]['P'].update(props)
evt = moment_mag.updated_event()
net_mw = moment_mag.net_magnitude()
print("Network moment magnitude: %4.1f" % net_mw.mag)
# calculate local (Richter) magntiude
WAscaling = parameter.get('WAscaling')
magscaling = parameter.get('magscaling')
local_mag = LocalMagnitude(corr_dat, evt,
parameter.get('sstop'),
WAscaling, True, iplot)
for stats, amplitude in local_mag.amplitudes.items():
if picks.has_key(stats):
picks[stats]['S']['Ao'] = amplitude.generic_amplitude
print("Local station magnitudes scaled with:")
print("log(Ao) + %f * log(r) + %f * r + %f" % (WAscaling[0],
WAscaling[1],
WAscaling[2]))
evt = local_mag.updated_event(magscaling)
net_ml = local_mag.net_magnitude(magscaling)
print("Network local magnitude: %4.1f" % net_ml.mag)
print("Network local magnitude scaled with:")
print("%f * Ml + %f" % (magscaling[0], magscaling[1]))
else:
print("autoPyLoT: No NLLoc-location file available! Stop iteration!")
locflag = 9
##########################################################
# write phase files for various location
# and fault mechanism calculation routines
# ObsPy event object
if evt is not None:
event_id = eventpath.split('/')[-1]
evt.resource_id = ResourceIdentifier('smi:local/' + event_id)
data.applyEVTData(evt, 'event')
data.applyEVTData(picks)
if savexml:
if savepath == 'None' or savepath == None:
saveEvtPath = eventpath
else:
saveEvtPath = savepath
fnqml = '%s/PyLoT_%s' % (saveEvtPath, evID)
data.exportEvent(fnqml, fnext='.xml', fcheck=['auto', 'magnitude', 'origin'])
if locflag == 1:
# HYPO71
hypo71file = '%s/PyLoT_%s_HYPO71_phases' % (eventpath, evID)
hypo71.export(picks, hypo71file, parameter)
# HYPOSAT
hyposatfile = '%s/PyLoT_%s_HYPOSAT_phases' % (eventpath, evID)
hyposat.export(picks, hyposatfile, parameter)
# VELEST
velestfile = '%s/PyLoT_%s_VELEST_phases.cnv' % (eventpath, evID)
velest.export(picks, velestfile, evt, parameter)
# hypoDD
hypoddfile = '%s/PyLoT_%s_hypoDD_phases.pha' % (eventpath, evID)
hypodd.export(picks, hypoddfile, parameter, evt)
# FOCMEC
focmecfile = '%s/PyLoT_%s_FOCMEC.in' % (eventpath, evID)
focmec.export(picks, focmecfile, parameter, evt)
# HASH
hashfile = '%s/PyLoT_%s_HASH' % (eventpath, evID)
hash.export(picks, hashfile, parameter, evt)
endsplash = '''------------------------------------------\n'
-----Finished event %s!-----\n'
------------------------------------------'''.format \
(version=_getVersionString()) % evID
print(endsplash)
locflag = glocflag
if locflag == 0:
print("autoPyLoT was running in non-location mode!")
# save picks for current event ID to dictionary with ALL picks
allpicks[evID] = picks
endsp = '''####################################\n
************************************\n
*********autoPyLoT terminates*******\n
The Python picking and Location Tool\n
************************************'''.format(version=_getVersionString())
print(endsp)
return allpicks
if __name__ == "__main__":
# parse arguments
parser = argparse.ArgumentParser(
description='''autoPyLoT automatically picks phase onset times using higher order statistics,
autoregressive prediction and AIC followed by locating the seismic events using
NLLoc''')
parser.add_argument('-i', '-I', '--inputfile', type=str,
action='store',
help='''full path to the file containing the input
parameters for autoPyLoT''')
parser.add_argument('-p', '-P', '--iplot', type=int,
action='store',
help='''optional, logical variable for plotting: 0=none, 1=partial, 2=all''')
parser.add_argument('-f', '-F', '--fnames', type=str,
action='store',
help='''optional, list of data file names''')
parser.add_argument('-e', '--eventid', type=str,
action='store',
help='''optional, event path incl. event ID''')
parser.add_argument('-s', '-S', '--spath', type=str,
action='store',
help='''optional, save path for autoPyLoT output''')
parser.add_argument('-c', '-C', '--ncores', type=int,
action='store', default=0,
help='''optional, number of CPU cores used for parallel processing (default: all available(=0))''')
cla = parser.parse_args()
picks = autoPyLoT(inputfile=str(cla.inputfile), fnames=str(cla.fnames),
eventid=str(cla.eventid), savepath=str(cla.spath),
ncores=cla.ncores, iplot=str(cla.iplot))

8
git_out Normal file
View File

@@ -0,0 +1,8 @@
git pull
Entferne qrc_resources.py
KONFLIKT (ändern/löschen): pylot/core/pick/getSNR.py gelöscht in HEAD und geändert in 67dd66535a213ba5c7cfe2be52aa6d5a7e8b7324. Stand 67dd66535a213ba5c7cfe2be52aa6d5a7e8b7324 von pylot/core/pick/getSNR.py wurde im Arbeitsbereich gelassen.
KONFLIKT (ändern/löschen): pylot/core/pick/fmpicker.py gelöscht in HEAD und geändert in 67dd66535a213ba5c7cfe2be52aa6d5a7e8b7324. Stand 67dd66535a213ba5c7cfe2be52aa6d5a7e8b7324 von pylot/core/pick/fmpicker.py wurde im Arbeitsbereich gelassen.
KONFLIKT (ändern/löschen): pylot/core/pick/earllatepicker.py gelöscht in HEAD und geändert in 67dd66535a213ba5c7cfe2be52aa6d5a7e8b7324. Stand 67dd66535a213ba5c7cfe2be52aa6d5a7e8b7324 von pylot/core/pick/earllatepicker.py wurde im Arbeitsbereich gelassen.
Automatisches Zusammenfügen von icons.qrc
Automatischer Merge fehlgeschlagen; beheben Sie die Konflikte und committen Sie dann das Ergebnis.

19
help/index.html Normal file
View File

@@ -0,0 +1,19 @@
<html>
<head><title>PyLoT - the Python picking and Localisation Tool</title></head>
<body>
<p><b>PyLoT</b> is a program which is capable of picking seismic phases,
exporting these as numerous standard phase format and localize the corresponding
seismic event with external software as, e.g.:</p>
<ul type="circle">
<li><a href="http://alomax.free.fr/nlloc/index.html">NonLinLoc</a></li>
<li>HypoInvers</li>
<li>HypoSat</li>
<li>whatever you want ...</li>
</ul>
<p>Read more on the
<a href="https://ariadne.geophysik.rub.de/trac/PyLoT/wiki/">PyLoT WikiPage</a>.</p>
<p>Bug reports are very much appreciated and can also be delivered on our
<a href="https://ariadne.geophysik.rub.de/trac/PyLoT">PyLoT TracPage</a> after
successful registration.</p>
</body>
</html>

55
icons.qrc Normal file
View File

@@ -0,0 +1,55 @@
<RCC>
<qresource>
<file>icons/pylot.ico</file>
<file>icons/pylot.png</file>
<file>icons/newfile.png</file>
<file>icons/open.png</file>
<file>icons/openproject.png</file>
<file>icons/add.png</file>
<file>icons/save.png</file>
<file>icons/saveas.png</file>
<file>icons/saveproject.png</file>
<file>icons/saveprojectas.png</file>
<file>icons/manupicksicon_small.png</file>
<file>icons/autopicksicon_small.png</file>
<file>icons/tune.png</file>
<file>icons/autopylot_button.png</file>
<file>icons/pick.png</file>
<file>icons/waveform.png</file>
<file>icons/openpick.png</file>
<file>icons/openpicks.png</file>
<file>icons/openpick.png</file>
<file>icons/openpicks.png</file>
<file>icons/savepicks.png</file>
<file>icons/preferences.png</file>
<file>icons/parameter.png</file>
<file>icons/inventory.png</file>
<file>icons/map.png</file>
<file>icons/openloc.png</file>
<file>icons/compare_button.png</file>
<file>icons/locate_button.png</file>
<file>icons/Matlab_PILOT_icon.png</file>
<file>icons/printer.png</file>
<file>icons/delete.png</file>
<file>icons/key_E.png</file>
<file>icons/key_N.png</file>
<file>icons/key_P.png</file>
<file>icons/key_Q.png</file>
<file>icons/key_R.png</file>
<file>icons/key_S.png</file>
<file>icons/key_T.png</file>
<file>icons/key_U.png</file>
<file>icons/key_V.png</file>
<file>icons/key_W.png</file>
<file>icons/key_Z.png</file>
<file>icons/filter.png</file>
<file>icons/sync.png</file>
<file>icons/zoom_0.png</file>
<file>icons/zoom_in.png</file>
<file>icons/zoom_out.png</file>
<file>splash/splash.png</file>
</qresource>
<qresource prefix="/help">
<file>help/index.html</file>
</qresource>
</RCC>

BIN
icons/Matlab_PILOT_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
icons/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
icons/autopicsicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

BIN
icons/autopylot_button.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
icons/compare_button.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
icons/delete.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
icons/filter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
icons/inventory.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
icons/key_E.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
icons/key_N.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
icons/key_P.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
icons/key_Q.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
icons/key_R.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
icons/key_S.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

BIN
icons/key_T.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
icons/key_U.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
icons/key_V.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
icons/key_W.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
icons/key_Z.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
icons/locate_button.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
icons/manupicsicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
icons/map.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
icons/newfile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
icons/open.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
icons/openfile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
icons/openloc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
icons/openpick.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
icons/openpicks.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
icons/openproject.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
icons/parameter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
icons/pick.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
icons/preferences.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
icons/printer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
icons/pylot.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
icons/pylot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
icons/save.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
icons/saveas.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
icons/savepicks.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
icons/saveproject.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
icons/saveprojectas.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
icons/sync.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
icons/tune.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
icons/waveform.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
icons/zoom_0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
icons/zoom_in.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
icons/zoom_out.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

102636
icons_rc_2.py Normal file

File diff suppressed because it is too large Load Diff

102636
icons_rc_3.py Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
## default time errors for old PILOT phases
0.04 0.08 0.16 0.32 #timeerrorsP# %discrete time errors [s] corresponding to picking weights [0 1 2 3] for P
0.04 0.08 0.16 0.32 #timeerrorsS# %discrete time errors [s] corresponding to picking weights [0 1 2 3] for S

100
inputs/autoPyLoT.in Normal file
View File

@@ -0,0 +1,100 @@
%This is a parameter input file for autoPyLoT.
%All main and special settings regarding data handling
%and picking are to be set here!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#main settings#
/DATA/Insheim #rootpath# %project path
EVENT_DATA/LOCAL #datapath# %data path
2013.02_Insheim #database# %name of data base
e0019.048.13 #eventID# %certain evnt ID for processing
True #apverbose#
PILOT #datastructure# %choose data structure
0 #iplot# %flag for plotting: 0 none, 1, partly, >1 everything
AUTOPHASES_AIC_HOS4_ARH #phasefile# %name of autoPILOT output phase file
AUTOLOC_AIC_HOS4_ARH #locfile# %name of autoPILOT output location file
AUTOFOCMEC_AIC_HOS4_ARH.in #focmecin# %name of focmec input file containing polarities
HYPOSAT #locrt# %location routine used ("HYPOINVERSE" or "HYPOSAT")
6 #pmin# %minimum required P picks for location
4 #p0min# %minimum required P picks for location if at least
%3 excellent P picks are found
2 #smin# %minimum required S picks for location
/home/ludger/bin/run_HYPOSAT4autoPILOT.csh #cshellp# %path and name of c-shell script to run location routine
7.6 8.5 #blon# %longitude bounding for location map
49 49.4 #blat# %lattitude bounding for location map
#parameters for moment magnitude estimation#
5000 #vp# %average P-wave velocity
2800 #vs# %average S-wave velocity
2200 #rho# %rock density [kg/m^3]
300 #Qp# %quality factor for P waves
100 #Qs# %quality factor for S waves
#common settings picker#
15 #pstart# %start time [s] for calculating CF for P-picking
40 #pstop# %end time [s] for calculating CF for P-picking
-1.0 #sstart# %start time [s] after or before(-) P-onset for calculating CF for S-picking
7 #sstop# %end time [s] after P-onset for calculating CF for S-picking
2 20 #bpz1# %lower/upper corner freq. of first band pass filter Z-comp. [Hz]
2 30 #bpz2# %lower/upper corner freq. of second band pass filter Z-comp. [Hz]
2 15 #bph1# %lower/upper corner freq. of first band pass filter H-comp. [Hz]
2 20 #bph2# %lower/upper corner freq. of second band pass filter z-comp. [Hz]
#special settings for calculating CF#
%!!Be careful when editing the following!!
#Z-component#
HOS #algoP# %choose algorithm for P-onset determination (HOS, ARZ, or AR3)
7 #tlta# %for HOS-/AR-AIC-picker, length of LTA window [s]
4 #hosorder# %for HOS-picker, order of Higher Order Statistics
2 #Parorder# %for AR-picker, order of AR process of Z-component
1.2 #tdet1z# %for AR-picker, length of AR determination window [s] for Z-component, 1st pick
0.4 #tpred1z# %for AR-picker, length of AR prediction window [s] for Z-component, 1st pick
0.6 #tdet2z# %for AR-picker, length of AR determination window [s] for Z-component, 2nd pick
0.2 #tpred2z# %for AR-picker, length of AR prediction window [s] for Z-component, 2nd pick
0.001 #addnoise# %add noise to seismogram for stable AR prediction
3 0.1 0.5 0.1 #tsnrz# %for HOS/AR, window lengths for SNR-and slope estimation [tnoise,tsafetey,tsignal,tslope] [s]
3 #pickwinP# %for initial AIC pick, length of P-pick window [s]
8 #Precalcwin# %for HOS/AR, window length [s] for recalculation of CF (relative to 1st pick)
0 #peps4aic# %for HOS/AR, artificial uplift of samples of AIC-function (P)
0.2 #aictsmooth# %for HOS/AR, take average of samples for smoothing of AIC-function [s]
0.1 #tsmoothP# %for HOS/AR, take average of samples for smoothing CF [s]
0.001 #ausP# %for HOS/AR, artificial uplift of samples (aus) of CF (P)
1.3 #nfacP# %for HOS/AR, noise factor for noise level determination (P)
#H-components#
ARH #algoS# %choose algorithm for S-onset determination (ARH or AR3)
0.8 #tdet1h# %for HOS/AR, length of AR-determination window [s], H-components, 1st pick
0.4 #tpred1h# %for HOS/AR, length of AR-prediction window [s], H-components, 1st pick
0.6 #tdet2h# %for HOS/AR, length of AR-determinaton window [s], H-components, 2nd pick
0.3 #tpred2h# %for HOS/AR, length of AR-prediction window [s], H-components, 2nd pick
4 #Sarorder# %for AR-picker, order of AR process of H-components
6 #Srecalcwin# %for AR-picker, window length [s] for recalculation of CF (2nd pick) (H)
3 #pickwinS# %for initial AIC pick, length of S-pick window [s]
2 0.2 1.5 0.5 #tsnrh# %for ARH/AR3, window lengths for SNR-and slope estimation [tnoise,tsafetey,tsignal,tslope] [s]
0.05 #aictsmoothS# %for AIC-picker, take average of samples for smoothing of AIC-function [s]
0.02 #tsmoothS# %for AR-picker, take average of samples for smoothing CF [s] (S)
0.2 #pepsS# %for AR-picker, artificial uplift of samples of CF (S)
0.4 #ausS# %for HOS/AR, artificial uplift of samples (aus) of CF (S)
1.5 #nfacS# %for AR-picker, noise factor for noise level determination (S)
%first-motion picker%
1 #minfmweight# %minimum required p weight for first-motion determination
2 #minFMSNR# %miniumum required SNR for first-motion determination
0.2 #fmpickwin# %pick window around P onset for calculating zero crossings
%quality assessment%
#inital AIC onset#
0.01 0.02 0.04 0.08 #timeerrorsP# %discrete time errors [s] corresponding to picking weights [0 1 2 3] for P
0.04 0.08 0.16 0.32 #timeerrorsS# %discrete time errors [s] corresponding to picking weights [0 1 2 3] for S
80 #minAICPslope# %below this slope [counts/s] the initial P pick is rejected
1.2 #minAICPSNR# %below this SNR the initial P pick is rejected
50 #minAICSslope# %below this slope [counts/s] the initial S pick is rejected
1.5 #minAICSSNR# %below this SNR the initial S pick is rejected
#check duration of signal using envelope function#
1.5 #prepickwin# %pre-signal window length [s] for noise level estimation
0.7 #minsiglength# %minimum required length of signal [s]
0.2 #sgap# %safety gap between noise and signal window [s]
2 #noisefactor# %noiselevel*noisefactor=threshold
60 #minpercent# %per cent of samples required higher than threshold
#check for spuriously picked S-onsets#
3.0 #zfac# %P-amplitude must exceed zfac times RMS-S amplitude
#jackknife-processing for P-picks#
3 #thresholdweight#%minimum required weight of picks
3 #dttolerance# %maximum allowed deviation of P picks from median [s]
4 #minstats# %minimum number of stations with reliable P picks
3 #Sdttolerance# %maximum allowed deviation from Wadati-diagram

99
inputs/autoPyLoT_local.in Normal file
View File

@@ -0,0 +1,99 @@
%This is a parameter input file for autoPyLoT.
%All main and special settings regarding data handling
%and picking are to be set here!
%Parameters are optimized for local data sets!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#main settings#
/DATA/Insheim #rootpath# %project path
EVENT_DATA/LOCAL #datapath# %data path
2016.08_Insheim #database# %name of data base
e0007.224.16 #eventID# %event ID for single event processing
/DATA/Insheim/STAT_INFO #invdir# %full path to inventory or dataless-seed file
PILOT #datastructure#%choose data structure
0 #iplot# %flag for plotting: 0 none, 1 partly, >1 everything
True #apverbose# %choose 'True' or 'False' for terminal output
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#NLLoc settings#
/home/ludger/NLLOC #nllocbin# %path to NLLoc executable
/home/ludger/NLLOC/Insheim #nllocroot# %root of NLLoc-processing directory
AUTOPHASES.obs #phasefile# %name of autoPyLoT-output phase file for NLLoc
%(in nllocroot/obs)
Insheim_min1d032016_auto.in #ctrfile# %name of autoPyLoT-output control file for NLLoc
%(in nllocroot/run)
ttime #ttpatter# %pattern of NLLoc ttimes from grid
%(in nllocroot/times)
AUTOLOC_nlloc #outpatter# %pattern of NLLoc-output file
%(returns 'eventID_outpatter')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#parameters for seismic moment estimation#
3530 #vp# %average P-wave velocity
2500 #rho# %average rock density [kg/m^3]
300 0.8 #Qp# %quality factor for P waves ([Qp, ap], Qp*f^a)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AUTOFOCMEC_AIC_HOS4_ARH.in #focmecin# %name of focmec input file containing derived polarities
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#common settings picker#
15.0 #pstart# %start time [s] for calculating CF for P-picking
60.0 #pstop# %end time [s] for calculating CF for P-picking
-1.0 #sstart# %start time [s] relative to P-onset for calculating CF for S-picking
10.0 #sstop# %end time [s] after P-onset for calculating CF for S-picking
2 20 #bpz1# %lower/upper corner freq. of first band pass filter Z-comp. [Hz]
2 30 #bpz2# %lower/upper corner freq. of second band pass filter Z-comp. [Hz]
2 15 #bph1# %lower/upper corner freq. of first band pass filter H-comp. [Hz]
2 20 #bph2# %lower/upper corner freq. of second band pass filter z-comp. [Hz]
#special settings for calculating CF#
%!!Edit the following only if you know what you are doing!!%
#Z-component#
HOS #algoP# %choose algorithm for P-onset determination (HOS, ARZ, or AR3)
7.0 #tlta# %for HOS-/AR-AIC-picker, length of LTA window [s]
4 #hosorder# %for HOS-picker, order of Higher Order Statistics
2 #Parorder# %for AR-picker, order of AR process of Z-component
1.2 #tdet1z# %for AR-picker, length of AR determination window [s] for Z-component, 1st pick
0.4 #tpred1z# %for AR-picker, length of AR prediction window [s] for Z-component, 1st pick
0.6 #tdet2z# %for AR-picker, length of AR determination window [s] for Z-component, 2nd pick
0.2 #tpred2z# %for AR-picker, length of AR prediction window [s] for Z-component, 2nd pick
0.001 #addnoise# %add noise to seismogram for stable AR prediction
3 0.1 0.5 0.5 #tsnrz# %for HOS/AR, window lengths for SNR-and slope estimation [tnoise,tsafetey,tsignal,tslope] [s]
3.0 #pickwinP# %for initial AIC pick, length of P-pick window [s]
6.0 #Precalcwin# %for HOS/AR, window length [s] for recalculation of CF (relative to 1st pick)
0.2 #aictsmooth# %for HOS/AR, take average of samples for smoothing of AIC-function [s]
0.1 #tsmoothP# %for HOS/AR, take average of samples for smoothing CF [s]
0.001 #ausP# %for HOS/AR, artificial uplift of samples (aus) of CF (P)
1.3 #nfacP# %for HOS/AR, noise factor for noise level determination (P)
#H-components#
ARH #algoS# %choose algorithm for S-onset determination (ARH or AR3)
0.8 #tdet1h# %for HOS/AR, length of AR-determination window [s], H-components, 1st pick
0.4 #tpred1h# %for HOS/AR, length of AR-prediction window [s], H-components, 1st pick
0.6 #tdet2h# %for HOS/AR, length of AR-determinaton window [s], H-components, 2nd pick
0.3 #tpred2h# %for HOS/AR, length of AR-prediction window [s], H-components, 2nd pick
4 #Sarorder# %for AR-picker, order of AR process of H-components
5.0 #Srecalcwin# %for AR-picker, window length [s] for recalculation of CF (2nd pick) (H)
3.0 #pickwinS# %for initial AIC pick, length of S-pick window [s]
2 0.2 1.5 0.5 #tsnrh# %for ARH/AR3, window lengths for SNR-and slope estimation [tnoise,tsafetey,tsignal,tslope] [s]
0.5 #aictsmoothS# %for AIC-picker, take average of samples for smoothing of AIC-function [s]
0.7 #tsmoothS# %for AR-picker, take average of samples for smoothing CF [s] (S)
0.9 #ausS# %for HOS/AR, artificial uplift of samples (aus) of CF (S)
1.5 #nfacS# %for AR-picker, noise factor for noise level determination (S)
%first-motion picker%
1 #minfmweight# %minimum required P weight for first-motion determination
2 #minFMSNR# %miniumum required SNR for first-motion determination
0.2 #fmpickwin# %pick window around P onset for calculating zero crossings
%quality assessment%
#inital AIC onset#
0.05 0.10 0.20 0.40 #timeerrorsP# %discrete time errors [s] corresponding to picking weights [0 1 2 3] for P
0.10 0.20 0.40 0.80 #timeerrorsS# %discrete time errors [s] corresponding to picking weights [0 1 2 3] for S
4 #minAICPslope# %below this slope [counts/s] the initial P pick is rejected
1.2 #minAICPSNR# %below this SNR the initial P pick is rejected
2 #minAICSslope# %below this slope [counts/s] the initial S pick is rejected
1.5 #minAICSSNR# %below this SNR the initial S pick is rejected
#check duration of signal using envelope function#
3 #minsiglength# %minimum required length of signal [s]
1.0 #noisefactor# %noiselevel*noisefactor=threshold
40 #minpercent# %required percentage of samples higher than threshold
#check for spuriously picked S-onsets#
2.0 #zfac# %P-amplitude must exceed at least zfac times RMS-S amplitude
#check statistics of P onsets#
2.5 #mdttolerance# %maximum allowed deviation of P picks from median [s]
#wadati check#
1.0 #wdttolerance# %maximum allowed deviation from Wadati-diagram

View File

@@ -0,0 +1,100 @@
%This is a parameter input file for autoPyLoT.
%All main and special settings regarding data handling
%and picking are to be set here!
%Parameters are optimized for regional data sets!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#main settings#
/DATA/Egelados #rootpath# %project path
EVENT_DATA/LOCAL #datapath# %data path
2006.01_Nisyros #database# %name of data base
e1412.008.06 #eventID# %event ID for single event processing
/DATA/Egelados/STAT_INFO #invdir# %full path to inventory or dataless-seed file
PILOT #datastructure# %choose data structure
0 #iplot# %flag for plotting: 0 none, 1, partly, >1 everything
True #apverbose# %choose 'True' or 'False' for terminal output
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#NLLoc settings#
/home/ludger/NLLOC #nllocbin# %path to NLLoc executable
/home/ludger/NLLOC/Insheim #nllocroot# %root of NLLoc-processing directory
AUTOPHASES.obs #phasefile# %name of autoPyLoT-output phase file for NLLoc
%(in nllocroot/obs)
Insheim_min1d2015_auto.in #ctrfile# %name of autoPyLoT-output control file for NLLoc
%(in nllocroot/run)
ttime #ttpatter# %pattern of NLLoc ttimes from grid
%(in nllocroot/times)
AUTOLOC_nlloc #outpatter# %pattern of NLLoc-output file
%(returns 'eventID_outpatter')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#parameters for seismic moment estimation#
3530 #vp# %average P-wave velocity
2700 #rho# %average rock density [kg/m^3]
1000f**0.8 #Qp# %quality factor for P waves (Qp*f^a)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AUTOFOCMEC_AIC_HOS4_ARH.in #focmecin# %name of focmec input file containing derived polarities
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#common settings picker#
20 #pstart# %start time [s] for calculating CF for P-picking
100 #pstop# %end time [s] for calculating CF for P-picking
1.0 #sstart# %start time [s] after or before(-) P-onset for calculating CF for S-picking
100 #sstop# %end time [s] after P-onset for calculating CF for S-picking
3 10 #bpz1# %lower/upper corner freq. of first band pass filter Z-comp. [Hz]
3 12 #bpz2# %lower/upper corner freq. of second band pass filter Z-comp. [Hz]
3 8 #bph1# %lower/upper corner freq. of first band pass filter H-comp. [Hz]
3 6 #bph2# %lower/upper corner freq. of second band pass filter H-comp. [Hz]
#special settings for calculating CF#
%!!Be careful when editing the following!!
#Z-component#
HOS #algoP# %choose algorithm for P-onset determination (HOS, ARZ, or AR3)
7 #tlta# %for HOS-/AR-AIC-picker, length of LTA window [s]
4 #hosorder# %for HOS-picker, order of Higher Order Statistics
2 #Parorder# %for AR-picker, order of AR process of Z-component
1.2 #tdet1z# %for AR-picker, length of AR determination window [s] for Z-component, 1st pick
0.4 #tpred1z# %for AR-picker, length of AR prediction window [s] for Z-component, 1st pick
0.6 #tdet2z# %for AR-picker, length of AR determination window [s] for Z-component, 2nd pick
0.2 #tpred2z# %for AR-picker, length of AR prediction window [s] for Z-component, 2nd pick
0.001 #addnoise# %add noise to seismogram for stable AR prediction
5 0.2 3.0 1.5 #tsnrz# %for HOS/AR, window lengths for SNR-and slope estimation [tnoise,tsafetey,tsignal,tslope] [s]
3 #pickwinP# %for initial AIC and refined pick, length of P-pick window [s]
8 #Precalcwin# %for HOS/AR, window length [s] for recalculation of CF (relative to 1st pick)
1.0 #aictsmooth# %for HOS/AR, take average of samples for smoothing of AIC-function [s]
0.3 #tsmoothP# %for HOS/AR, take average of samples for smoothing CF [s]
0.3 #ausP# %for HOS/AR, artificial uplift of samples (aus) of CF (P)
1.3 #nfacP# %for HOS/AR, noise factor for noise level determination (P)
#H-components#
ARH #algoS# %choose algorithm for S-onset determination (ARH or AR3)
0.8 #tdet1h# %for HOS/AR, length of AR-determination window [s], H-components, 1st pick
0.4 #tpred1h# %for HOS/AR, length of AR-prediction window [s], H-components, 1st pick
0.6 #tdet2h# %for HOS/AR, length of AR-determinaton window [s], H-components, 2nd pick
0.3 #tpred2h# %for HOS/AR, length of AR-prediction window [s], H-components, 2nd pick
4 #Sarorder# %for AR-picker, order of AR process of H-components
10 #Srecalcwin# %for AR-picker, window length [s] for recalculation of CF (2nd pick) (H)
25 #pickwinS# %for initial AIC and refined pick, length of S-pick window [s]
5 0.2 3.0 3.0 #tsnrh# %for ARH/AR3, window lengths for SNR-and slope estimation [tnoise,tsafetey,tsignal,tslope] [s]
3.5 #aictsmoothS# %for AIC-picker, take average of samples for smoothing of AIC-function [s]
1.0 #tsmoothS# %for AR-picker, take average of samples for smoothing CF [s] (S)
0.2 #ausS# %for HOS/AR, artificial uplift of samples (aus) of CF (S)
1.5 #nfacS# %for AR-picker, noise factor for noise level determination (S)
%first-motion picker%
1 #minfmweight# %minimum required p weight for first-motion determination
2 #minFMSNR# %miniumum required SNR for first-motion determination
6.0 #fmpickwin# %pick window around P onset for calculating zero crossings
%quality assessment%
#inital AIC onset#
0.04 0.08 0.16 0.32 #timeerrorsP# %discrete time errors [s] corresponding to picking weights [0 1 2 3] for P
0.04 0.08 0.16 0.32 #timeerrorsS# %discrete time errors [s] corresponding to picking weights [0 1 2 3] for S
3 #minAICPslope# %below this slope [counts/s] the initial P pick is rejected
1.2 #minAICPSNR# %below this SNR the initial P pick is rejected
5 #minAICSslope# %below this slope [counts/s] the initial S pick is rejected
2.5 #minAICSSNR# %below this SNR the initial S pick is rejected
#check duration of signal using envelope function#
30 #minsiglength# %minimum required length of signal [s]
2.5 #noisefactor# %noiselevel*noisefactor=threshold
60 #minpercent# %required percentage of samples higher than threshold
#check for spuriously picked S-onsets#
0.5 #zfac# %P-amplitude must exceed at least zfac times RMS-S amplitude
#check statistics of P onsets#
45 #mdttolerance# %maximum allowed deviation of P picks from median [s]
#wadati check#
3.0 #wdttolerance# %maximum allowed deviation from Wadati-diagram

2
inputs/filter.in Normal file
View File

@@ -0,0 +1,2 @@
P bandpass 4 2.0 20.0
S bandpass 4 2.0 15.0

98
inputs/pylot.in Normal file
View File

@@ -0,0 +1,98 @@
%This is a parameter input file for PyLoT/autoPyLoT.
%All main and special settings regarding data handling
%and picking are to be set here!
%Parameters are optimized for %extent data sets!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#main settings#
/home/marcel/marcel_scratch #rootpath# %project path
alparray #datapath# %data path
waveforms #database# %name of data base
e0006.036.13 #eventID# %event ID for single event processing (* for all events found in database)
None #invdir# %full path to inventory or dataless-seed file
PILOT #datastructure# %choose data structure
True #apverbose# %choose 'True' or 'False' for terminal output
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#NLLoc settings#
/progs/bin #nllocbin# %path to NLLoc executable
/home/ludger/NLLOC/Insheim #nllocroot# %root of NLLoc-processing directory
AUTOPHASES.obs #phasefile# %name of autoPyLoT-output phase file for NLLoc
Insheim_min1d032016_auto.in #ctrfile# %name of autoPyLoT-output control file for NLLoc
ttime #ttpatter# %pattern of NLLoc ttimes from grid
AUTOLOC_nlloc #outpatter# %pattern of NLLoc-output file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#parameters for seismic moment estimation#
3530.0 #vp# %average P-wave velocity
2500.0 #rho# %average rock density [kg/m^3]
300.0 0.8 #Qp# %quality factor for P waves (Qp*f^a); list(Qp, a)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#settings local magnitude#
1.0 1.0 1.0 #WAscaling# %Scaling relation (log(Ao)+Alog(r)+Br+C) of Wood-Anderson amplitude Ao [nm] If zeros are set, original Richter magnitude is calculated!
1.0 1.0 #magscaling# %Scaling relation for derived local magnitude [a*Ml+b]. If zeros are set, no scaling of network magnitude is applied!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#filter settings#
0.01 0.01 #minfreq# %Lower filter frequency [P, S]
0.3 0.3 #maxfreq# %Upper filter frequency [P, S]
3 3 #filter_order# %filter order [P, S]
bandpass bandpass #filter_type# %filter type (bandpass, bandstop, lowpass, highpass) [P, S]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#common settings picker#
global #extent# %extent of array ("local", "regional" or "global")
50.0 #pstart# %start time [s] for calculating CF for P-picking
600.0 #pstop# %end time [s] for calculating CF for P-picking
200.0 #sstart# %start time [s] relative to P-onset for calculating CF for S-picking
1150.0 #sstop# %end time [s] after P-onset for calculating CF for S-picking
True #use_taup# %use estimated traveltimes from taupy for calculating windows for CF
0.05 0.5 #bpz1# %lower/upper corner freq. of first band pass filter Z-comp. [Hz]
0.01 0.5 #bpz2# %lower/upper corner freq. of second band pass filter Z-comp. [Hz]
0.05 0.5 #bph1# %lower/upper corner freq. of first band pass filter H-comp. [Hz]
0.01 0.5 #bph2# %lower/upper corner freq. of second band pass filter z-comp. [Hz]
#special settings for calculating CF#
%!!Edit the following only if you know what you are doing!!%
#Z-component#
HOS #algoP# %choose algorithm for P-onset determination (HOS, ARZ, or AR3)
15.0 #tlta# %for HOS-/AR-AIC-picker, length of LTA window [s]
4 #hosorder# %for HOS-picker, order of Higher Order Statistics
2 #Parorder# %for AR-picker, order of AR process of Z-component
6.0 #tdet1z# %for AR-picker, length of AR determination window [s] for Z-component, 1st pick
2.0 #tpred1z# %for AR-picker, length of AR prediction window [s] for Z-component, 1st pick
3.0 #tdet2z# %for AR-picker, length of AR determination window [s] for Z-component, 2nd pick
1.0 #tpred2z# %for AR-picker, length of AR prediction window [s] for Z-component, 2nd pick
0.001 #addnoise# %add noise to seismogram for stable AR prediction
60.0 10.0 150.0 3.0 #tsnrz# %for HOS/AR, window lengths for SNR-and slope estimation [tnoise, tsafetey, tsignal, tslope] [s]
10.0 #pickwinP# %for initial AIC pick, length of P-pick window [s]
20.0 #Precalcwin# %for HOS/AR, window length [s] for recalculation of CF (relative to 1st pick)
6.0 #aictsmooth# %for HOS/AR, take average of samples for smoothing of AIC-function [s]
4.0 #tsmoothP# %for HOS/AR, take average of samples for smoothing CF [s]
0.001 #ausP# %for HOS/AR, artificial uplift of samples (aus) of CF (P)
1.1 #nfacP# %for HOS/AR, noise factor for noise level determination (P)
#H-components#
ARH #algoS# %choose algorithm for S-onset determination (ARH or AR3)
6.0 #tdet1h# %for HOS/AR, length of AR-determination window [s], H-components, 1st pick
4.0 #tpred1h# %for HOS/AR, length of AR-prediction window [s], H-components, 1st pick
6.0 #tdet2h# %for HOS/AR, length of AR-determinaton window [s], H-components, 2nd pick
3.0 #tpred2h# %for HOS/AR, length of AR-prediction window [s], H-components, 2nd pick
4 #Sarorder# %for AR-picker, order of AR process of H-components
5.0 #Srecalcwin# %for AR-picker, window length [s] for recalculation of CF (2nd pick) (H)
15.0 #pickwinS# %for initial AIC pick, length of S-pick window [s]
100.0 10.0 40.0 6.0 #tsnrh# %for ARH/AR3, window lengths for SNR-and slope estimation [tnoise, tsafetey, tsignal, tslope] [s]
2.0 #aictsmoothS# %for AIC-picker, take average of samples for smoothing of AIC-function [s]
3.0 #tsmoothS# %for AR-picker, take average of samples for smoothing CF [s] (S)
0.9 #ausS# %for HOS/AR, artificial uplift of samples (aus) of CF (S)
1.2 #nfacS# %for AR-picker, noise factor for noise level determination (S)
#first-motion picker#
1 #minfmweight# %minimum required P weight for first-motion determination
2.0 #minFMSNR# %miniumum required SNR for first-motion determination
0.2 #fmpickwin# %pick window around P onset for calculating zero crossings
#quality assessment#
1.0 2.0 4.0 8.0 #timeerrorsP# %discrete time errors [s] corresponding to picking weights [0 1 2 3] for P
4.0 8.0 16.0 32.0 #timeerrorsS# %discrete time errors [s] corresponding to picking weights [0 1 2 3] for S
0.5 #minAICPslope# %below this slope [counts/s] the initial P pick is rejected
1.1 #minAICPSNR# %below this SNR the initial P pick is rejected
1.0 #minAICSslope# %below this slope [counts/s] the initial S pick is rejected
1.5 #minAICSSNR# %below this SNR the initial S pick is rejected
5.0 #minsiglength# %length of signal part for which amplitudes must exceed noiselevel [s]
1.0 #noisefactor# %noiselevel*noisefactor=threshold
10.0 #minpercent# %required percentage of amplitudes exceeding threshold
1.5 #zfac# %P-amplitude must exceed at least zfac times RMS-S amplitude
6.0 #mdttolerance# %maximum allowed deviation of P picks from median [s]
1.0 #wdttolerance# %maximum allowed deviation from Wadati-diagram

View File

@@ -0,0 +1,53 @@
0 1.4
10 1.5
20 1.7
25 1.9
30 2.1
35 2.3
40 2.4
45 2.5
50 2.6
60 2.8
70 2.8
75 2.9
85 2.9
90 3.0
100 3.0
110 3.1
120 3.1
130 3.2
140 3.2
150 3.3
160 3.3
170 3.4
180 3.4
190 3.5
200 3.5
210 3.6
230 3.7
240 3.7
250 3.8
260 3.8
270 3.9
280 3.9
290 4.0
300 4.0
310 4.1
320 4.2
330 4.2
340 4.2
350 4.3
360 4.3
370 4.3
380 4.4
390 4.4
400 4.5
430 4.6
470 4.7
510 4.8
560 4.9
600 5.1
700 5.2
800 5.4
900 5.5
1000 5.7

220
makePyLoT.py Normal file
View File

@@ -0,0 +1,220 @@
#!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
"""
makePyLoT -- build and install PyLoT
makePyLoT is a python make file in order to establish the folder structure and
meet requisites
It defines
:class CLIError:
:method main:
:author: Sebastian Wehling-Benatelli
:copyright: 2014 MAGS2 EP3 Working Group. All rights reserved.
:license: GNU Lesser General Public License, Version 3
(http://www.gnu.org/copyleft/lesser.html)
:contact: sebastian.wehling@rub.de
updated: Updated
"""
import glob
import os
import sys
import shutil
import copy
from argparse import ArgumentParser
from argparse import RawDescriptionHelpFormatter
__all__ = []
__version__ = 0.1
__date__ = '2014-11-26'
__updated__ = '2016-04-28'
DEBUG = 0
TESTRUN = 0
PROFILE = 0
class CLIError(Exception):
"""Generic exception to raise and log different fatal errors."""
def __init__(self, msg):
super(CLIError).__init__(type(self))
self.msg = "E: %s" % msg
def __str__(self):
return self.msg
def __unicode__(self):
return self.msg
def main(argv=None): # IGNORE:C0111
'''Command line options.'''
if argv is None:
argv = sys.argv
else:
sys.argv.extend(argv)
program_name = os.path.basename(sys.argv[0])
program_version = "v%s" % __version__
program_build_date = str(__updated__)
program_version_message = 'makePyLoT %s (%s)' % (
program_version, program_build_date)
program_shortdesc = __import__('__main__').__doc__.split("\n")[1]
program_license = '''{0:s}
Created by Sebastian Wehling-Benatelli on {1:s}.
Copyright 2014 MAGS2 EP3 Working Group. All rights reserved.
GNU Lesser General Public License, Version 3
(http://www.gnu.org/copyleft/lesser.html)
Distributed on an "AS IS" basis without warranties
or conditions of any kind, either express or implied.
USAGE
'''.format(program_shortdesc, str(__date__))
try:
# Setup argument parser
parser = ArgumentParser(description=program_license,
formatter_class=RawDescriptionHelpFormatter)
parser.add_argument("-b", "--build", dest="build", action="store_true",
help="build PyLoT")
parser.add_argument("-v", "--verbose", dest="verbose", action="count",
help="set verbosity level")
parser.add_argument("-i", "--install", dest="install",
action="store_true",
help="install PyLoT on the system")
parser.add_argument("-d", "--directory", dest="directory",
help="installation directory", metavar="RE")
parser.add_argument('-V', '--version', action='version',
version=program_version_message)
# Process arguments
args = parser.parse_args()
verbose = args.verbose
build = args.build
install = args.install
directory = args.directory
if verbose > 0:
print("Verbose mode on")
if install and not directory:
raise CLIError("""Trying to install without appropriate
destination; please specify an installation
directory!""")
if build and install:
print("Building and installing PyLoT ...\n")
buildPyLoT(verbose)
installPyLoT(verbose)
elif build and not install:
print("Building PyLoT without installing! Please wait ...\n")
buildPyLoT(verbose)
cleanUp()
return 0
except KeyboardInterrupt:
cleanUp(1)
return 0
except Exception as e:
if DEBUG or TESTRUN:
raise e
indent = len(program_name) * " "
sys.stderr.write(program_name + ": " + repr(e) + "\n")
sys.stderr.write(indent + " for help use --help")
return 2
def buildPyLoT(verbosity=None):
system = sys.platform
if verbosity > 1:
msg = ("... on system: {0}\n"
"\n"
" Current working directory: {1}\n"
).format(system, os.getcwd())
print(msg)
if system.startswith(('win', 'microsoft')):
raise CLIError(
"building on Windows system not tested yet; implementation pending")
elif system == 'darwin':
# create a symbolic link to the desired python interpreter in order to
# display the right application name
for path in os.getenv('PATH').split(':'):
found = glob.glob(os.path.join(path, 'python'))
if found:
os.symlink(found, './PyLoT')
break
def installPyLoT(verbosity=None):
files_to_copy = {'autoPyLoT_local.in': ['~', '.pylot'],
'autoPyLoT_regional.in': ['~', '.pylot']}
if verbosity > 0:
print('starting installation of PyLoT ...')
if verbosity > 1:
print('copying input files into destination folder ...')
ans = input('please specify scope of interest '
'([0]=local, 1=regional) :') or 0
if not isinstance(ans, int):
ans = int(ans)
ans = 'local' if ans is 0 else 'regional'
link_dest = []
for file, destination in files_to_copy.items():
link_file = ans in file
if link_file:
link_dest = copy.deepcopy(destination)
link_dest.append('autoPyLoT.in')
link_dest = os.path.join(*link_dest)
destination.append(file)
destination = os.path.join(*destination)
srcfile = os.path.join('input', file)
assert not os.path.isabs(srcfile), 'source files seem to be ' \
'corrupted ...'
if verbosity > 1:
print('copying file {file} to folder {dest}'.format(file=file, dest=destination))
shutil.copyfile(srcfile, destination)
if link_file:
if verbosity:
print('linking input file for autoPyLoT ...')
os.symlink(destination, link_dest)
def cleanUp(verbosity=None):
if verbosity >= 1:
print('cleaning up build files...')
if sys.platform == 'darwin':
os.remove('./PyLoT')
if __name__ == "__main__":
if DEBUG:
sys.argv.append("-h")
sys.argv.append("-v")
if TESTRUN:
import doctest
doctest.testmod()
if PROFILE:
import cProfile
import pstats
profile_filename = 'makePyLoT_profile.txt'
cProfile.run('main()', profile_filename)
statsfile = open("profile_stats.txt", "wb")
p = pstats.Stats(profile_filename, stream=statsfile)
stats = p.strip_dirs().sort_stats('cumulative')
stats.print_stats()
statsfile.close()
sys.exit(0)
sys.exit(main())

BIN
pylot/PyLoT.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

27
pylot/__init__.py Normal file
View File

@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
# --------------------------------------------------------
# Purpose: Convience imports for PyLoT
#
'''
================================================
PyLoT - the Python picking and Localization Tool
================================================
This python library contains a graphical user interfaces for picking
seismic phases. This software needs ObsPy (http://github.com/obspy/obspy/wiki)
and the Qt4 libraries to be installed first.
PILOT has been developed in Mathworks' MatLab. In order to distribute
PILOT without facing portability problems, it has been decided to re-
develop the software package in Python. The great work of the ObsPy
group allows easy handling of a bunch of seismic data and PyLoT will
benefit a lot compared to the former MatLab version.
The development of PyLoT is part of the joint research project MAGS2.
:copyright:
The PyLoT Development Team
:license:
GNU Lesser General Public License, Version 3
(http://www.gnu.org/copyleft/lesser.html)
'''

1
pylot/core/__init__.py Normal file
View File

@@ -0,0 +1 @@
# -*- coding: utf-8 -*-

View File

@@ -0,0 +1 @@
# -*- coding: utf-8 -*-

View File

@@ -0,0 +1,761 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created autumn/winter 2015.
Revised/extended summer 2017.
:author: Ludger Küperkoch / MAGS2 EP3 working group
"""
import matplotlib.pyplot as plt
import numpy as np
import obspy.core.event as ope
from obspy.geodetics import degrees2kilometers
from pylot.core.pick.utils import getsignalwin, crossings_nonzero_all, \
select_for_phase
from pylot.core.util.utils import common_range, fit_curve
from scipy import integrate, signal
from scipy.optimize import curve_fit
def richter_magnitude_scaling(delta):
distance = np.array([0, 10, 20, 25, 30, 35, 40, 45, 50, 60, 70, 75, 85, 90, 100, 110,
120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 230, 240, 250,
260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 360, 370, 380,
390, 400, 430, 470, 510, 560, 600, 700, 800, 900, 1000])
richter_scaling = np.array([1.4, 1.5, 1.7, 1.9, 2.1, 2.3, 2.4, 2.5, 2.6, 2.8, 2.8, 2.9,
2.9, 3.0, 3.1, 3.1, 3.2, 3.2, 3.3, 3.3, 3.4, 3.4, 3.5, 3.5,
3.6, 3.7, 3.7, 3.8, 3.8, 3.9, 3.9, 4.0, 4.0, 4.1, 4.2, 4.2,
4.2, 4.2, 4.3, 4.3, 4.3, 4.4, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9,
5.1, 5.2, 5.4, 5.5, 5.7])
# prepare spline interpolation to calculate return value
func, params = fit_curve(distance, richter_scaling)
return func(delta, params)
class Magnitude(object):
"""
Base class object for Magnitude calculation within PyLoT.
"""
def __init__(self, stream, event, verbosity=False, iplot=0):
self._type = "M"
self._stream = stream
self._plot_flag = iplot
self._verbosity = verbosity
self._event = event
self._magnitudes = dict()
def __str__(self):
print(
'number of stations used: {0}\n'.format(len(self.magnitudes.values())))
print('\tstation\tmagnitude')
for s, m in self.magnitudes.items(): print('\t{0}\t{1}'.format(s, m))
def __nonzero__(self):
return bool(self.magnitudes)
@property
def type(self):
return self._type
@property
def plot_flag(self):
return self._plot_flag
@plot_flag.setter
def plot_flag(self, value):
self._plot_flag = value
@property
def verbose(self):
return self._verbosity
@verbose.setter
def verbose(self, value):
if not isinstance(value, bool):
print('WARNING: only boolean values accepted...\n')
value = bool(value)
self._verbosity = value
@property
def stream(self):
return self._stream
@stream.setter
def stream(self, value):
self._stream = value
@property
def event(self):
return self._event
@property
def origin_id(self):
return self._event.origins[0].resource_id
@property
def arrivals(self):
return self._event.origins[0].arrivals
@property
def magnitudes(self):
return self._magnitudes
@magnitudes.setter
def magnitudes(self, value):
"""
takes a tuple and saves the key value pair to private
attribute _magnitudes
:param value: station, magnitude value pair
:type value: tuple or list
:return:
"""
station, magnitude = value
self._magnitudes[station] = magnitude
def calc(self):
pass
def updated_event(self, magscaling=None):
self.event.magnitudes.append(self.net_magnitude(magscaling))
return self.event
def net_magnitude(self, magscaling=None):
if self:
if magscaling is not None and str(magscaling) is not '[0.0, 0.0]':
# scaling necessary
print("Scaling network magnitude ...")
mag = ope.Magnitude(
mag=np.median([M.mag for M in self.magnitudes.values()]) * \
magscaling[0] + magscaling[1],
magnitude_type=self.type,
origin_id=self.origin_id,
station_count=len(self.magnitudes),
azimuthal_gap=self.origin_id.get_referred_object().quality.azimuthal_gap)
else:
# no saling necessary
mag = ope.Magnitude(
mag=np.median([M.mag for M in self.magnitudes.values()]),
magnitude_type=self.type,
origin_id=self.origin_id,
station_count=len(self.magnitudes),
azimuthal_gap=self.origin_id.get_referred_object().quality.azimuthal_gap)
return mag
return None
class LocalMagnitude(Magnitude):
"""
Method to derive peak-to-peak amplitude as seen on a Wood-Anderson-
seismograph. Has to be derived from instrument corrected traces!
"""
# poles, zeros and sensitivity of WA seismograph
# (see Uhrhammer & Collins, 1990, BSSA, pp. 702-716)
_paz = {
'poles': [5.6089 - 5.4978j, -5.6089 - 5.4978j],
'zeros': [0j, 0j],
'gain': 2080,
'sensitivity': 1
}
_amplitudes = dict()
def __init__(self, stream, event, calc_win, wascaling, verbosity=False, iplot=0):
super(LocalMagnitude, self).__init__(stream, event, verbosity, iplot)
self._calc_win = calc_win
self._wascaling = wascaling
self._type = 'ML'
self.calc()
@property
def calc_win(self):
return self._calc_win
@calc_win.setter
def calc_win(self, value):
self._calc_win = value
@property
def wascaling(self):
return self._wascaling
@property
def amplitudes(self):
return self._amplitudes
@amplitudes.setter
def amplitudes(self, value):
station, a0 = value
self._amplitudes[station] = a0
def peak_to_peak(self, st, t0):
try:
iplot = int(self.plot_flag)
except:
if self.plot_flag == True or self.plot_flag == 'True':
iplot = 2
else:
iplot = 0
# simulate Wood-Anderson response
st.simulate(paz_remove=None, paz_simulate=self._paz)
# trim waveform to common range
stime, etime = common_range(st)
st.trim(stime, etime)
# get time delta from waveform data
dt = st[0].stats.delta
power = [np.power(tr.data, 2) for tr in st if tr.stats.channel[-1] not
in 'Z3']
if len(power) != 2:
raise ValueError('Wood-Anderson amplitude defintion only valid for '
'two horizontals: {0} given'.format(len(power)))
power_sum = power[0] + power[1]
#
sqH = np.sqrt(power_sum)
# get time array
th = np.arange(0, len(sqH) * dt, dt)
# get maximum peak within pick window
iwin = getsignalwin(th, t0 - stime, self.calc_win)
ii = min([iwin[len(iwin) - 1], len(th)])
iwin = iwin[0:ii]
wapp = np.max(sqH[iwin])
if self.verbose:
print("Determined Wood-Anderson peak-to-peak amplitude for station {0}: {1} "
"mm".format(st[0].stats.station, wapp))
# check for plot flag (for debugging only)
fig = None
if iplot > 1:
st.plot()
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(th, sqH)
ax.plot(th[iwin], sqH[iwin], 'g')
ax.plot([t0, t0], [0, max(sqH)], 'r', linewidth=2)
ax.title(
'Station %s, RMS Horizontal Traces, WA-peak-to-peak=%4.1f mm' \
% (st[0].stats.station, wapp))
ax.set_xlabel('Time [s]')
ax.set_ylabel('Displacement [mm]')
return wapp, fig
def calc(self):
for a in self.arrivals:
if a.phase not in 'sS':
continue
pick = a.pick_id.get_referred_object()
station = pick.waveform_id.station_code
wf = select_for_phase(self.stream.select(
station=station), a.phase)
if not wf:
if self.verbose:
print(
'WARNING: no waveform data found for station {0}'.format(
station))
continue
delta = degrees2kilometers(a.distance)
onset = pick.time
a0, self.p2p_fig = self.peak_to_peak(wf, onset)
amplitude = ope.Amplitude(generic_amplitude=a0 * 1e-3)
amplitude.unit = 'm'
amplitude.category = 'point'
amplitude.waveform_id = pick.waveform_id
amplitude.magnitude_hint = self.type
amplitude.pick_id = pick.resource_id
amplitude.type = 'AML'
self.event.amplitudes.append(amplitude)
self.amplitudes = (station, amplitude)
# using standard Gutenberg-Richter relation
# or scale WA amplitude with given scaling relation
if str(self.wascaling) == '[0.0, 0.0, 0.0]':
print("Calculating original Richter magnitude ...")
magnitude = ope.StationMagnitude(mag=np.log10(a0) \
+ richter_magnitude_scaling(delta))
else:
print("Calculating scaled local magnitude ...")
a0 = a0 * 1e03 # mm to nm (see Havskov & Ottemöller, 2010)
magnitude = ope.StationMagnitude(mag=np.log10(a0) \
+ self.wascaling[0] * np.log10(delta) + self.wascaling[1]
* delta + self.wascaling[
2])
magnitude.origin_id = self.origin_id
magnitude.waveform_id = pick.waveform_id
magnitude.amplitude_id = amplitude.resource_id
magnitude.station_magnitude_type = self.type
self.event.station_magnitudes.append(magnitude)
self.magnitudes = (station, magnitude)
class MomentMagnitude(Magnitude):
'''
Method to calculate seismic moment Mo and moment magnitude Mw.
Requires results of class calcsourcespec for calculating plateau w0
and corner frequency fc of source spectrum, respectively. Uses
subfunction calcMoMw.py. Returns modified dictionary of picks including
Dc-value, corner frequency fc, seismic moment Mo and
corresponding moment magntiude Mw.
'''
_props = dict()
def __init__(self, stream, event, vp, Qp, density, verbosity=False,
iplot=False):
super(MomentMagnitude, self).__init__(stream, event, verbosity, iplot)
self._vp = vp
self._Qp = Qp
self._density = density
self._type = 'Mw'
self.calc()
@property
def p_velocity(self):
return self._vp
@property
def p_attenuation(self):
return self._Qp
@property
def rock_density(self):
return self._density
@property
def moment_props(self):
return self._props
@moment_props.setter
def moment_props(self, value):
station, props = value
self._props[station] = props
@property
def seismic_moment(self):
return self._m0
@seismic_moment.setter
def seismic_moment(self, value):
self._m0 = value
def calc(self):
for a in self.arrivals:
if a.phase not in 'pP':
continue
pick = a.pick_id.get_referred_object()
station = pick.waveform_id.station_code
scopy = self.stream.copy()
wf = scopy.select(station=station)
if not wf:
continue
onset = pick.time
distance = degrees2kilometers(a.distance)
azimuth = a.azimuth
incidence = a.takeoff_angle
w0, fc = calcsourcespec(wf, onset, self.p_velocity, distance,
azimuth, incidence, self.p_attenuation,
self.plot_flag, self.verbose)
if w0 is None or fc is None:
if self.verbose:
print("WARNING: insufficient frequency information")
continue
WF = select_for_phase(self.stream.select(
station=station), a.phase)
WF = select_for_phase(WF, "P")
m0, mw = calcMoMw(WF, w0, self.rock_density, self.p_velocity,
distance, self.verbose)
self.moment_props = (station, dict(w0=w0, fc=fc, Mo=m0))
magnitude = ope.StationMagnitude(mag=mw)
magnitude.origin_id = self.origin_id
magnitude.waveform_id = pick.waveform_id
magnitude.station_magnitude_type = self.type
self.event.station_magnitudes.append(magnitude)
self.magnitudes = (station, magnitude)
def calcMoMw(wfstream, w0, rho, vp, delta, verbosity=False):
'''
Subfunction of run_calcMoMw to calculate individual
seismic moments and corresponding moment magnitudes.
:param: wfstream
:type: `~obspy.core.stream.Stream`
:param: w0, height of plateau of source spectrum
:type: float
:param: rho, rock density [kg/m³]
:type: integer
:param: delta, hypocentral distance [km]
:type: integer
:param: inv, name/path of inventory or dataless-SEED file
:type: string
'''
tr = wfstream[0]
delta = delta * 1000 # hypocentral distance in [m]
if verbosity:
print(
"calcMoMw: Calculating seismic moment Mo and moment magnitude Mw for station {0} ...".format(
tr.stats.station))
# additional common parameters for calculating Mo
rP = 2 / np.sqrt(
15) # average radiation pattern of P waves (Aki & Richards, 1980)
freesurf = 2.0 # free surface correction, assuming vertical incidence
Mo = w0 * 4 * np.pi * rho * np.power(vp, 3) * delta / (rP * freesurf)
# Mw = np.log10(Mo * 1e07) * 2 / 3 - 10.7 # after Hanks & Kanamori (1979), defined for [dyn*cm]!
Mw = np.log10(Mo) * 2 / 3 - 6.7 # for metric units
if verbosity:
print(
"calcMoMw: Calculated seismic moment Mo = {0} Nm => Mw = {1:3.1f} ".format(
Mo, Mw))
return Mo, Mw
def calcsourcespec(wfstream, onset, vp, delta, azimuth, incidence,
qp, iplot=0, verbosity=False):
'''
Subfunction to calculate the source spectrum and to derive from that the plateau
(usually called omega0) and the corner frequency assuming Aki's omega-square
source model. Has to be derived from instrument corrected displacement traces,
thus restitution and integration necessary! Integrated traces are rotated
into ray-coordinate system ZNE => LQT using Obspy's rotate modul!
:param: wfstream (corrected for instrument)
:type: `~obspy.core.stream.Stream`
:param: onset, P-phase onset time
:type: float
:param: vp, Vp-wave velocity
:type: float
:param: delta, hypocentral distance [km]
:type: integer
:param: azimuth
:type: integer
:param: incidence
:type: integer
:param: Qp, quality factor for P-waves
:type: integer
:param: iplot, show results (iplot>1) or not (iplot<1)
:type: integer
'''
if verbosity:
print("Calculating source spectrum for station %s ...." % wfstream[0].stats.station)
try:
iplot = int(iplot)
except:
if iplot == True or iplot == 'True':
iplot = 2
else:
iplot = 0
# get Q value
Q, A = qp
dist = delta * 1000 # hypocentral distance in [m]
fc = None
w0 = None
zdat = select_for_phase(wfstream, "P")
dt = zdat[0].stats.delta
freq = zdat[0].stats.sampling_rate
# trim traces to common range (for rotation)
trstart, trend = common_range(wfstream)
wfstream.trim(trstart, trend)
# rotate into LQT (ray-coordindate-) system using Obspy's rotate
# L: P-wave direction
# Q: SV-wave direction
# T: SH-wave direction
LQT = wfstream.rotate('ZNE->LQT', azimuth, incidence)
ldat = LQT.select(component="L")
if len(ldat) == 0:
# if horizontal channels are 1 and 2
# no azimuth information is available and thus no
# rotation is possible!
if verbosity:
print("calcsourcespec: Azimuth information is missing, "
"no rotation of components possible!")
# instead, use component 3
ldat = LQT.select(component="3")
if len(ldat) == 0:
# maybe component z available
ldat = LQT.select(component="Z")
# integrate to displacement
# unrotated vertical component (for comparison)
inttrz = signal.detrend(integrate.cumtrapz(zdat[0].data, None, dt))
# rotated component Z => L
Ldat = signal.detrend(integrate.cumtrapz(ldat[0].data, None, dt))
# get window after P pulse for
# calculating source spectrum
rel_onset = onset - trstart
impickP = int(rel_onset * freq)
wfzc = Ldat[impickP: len(Ldat) - 1]
# get time array
t = np.arange(0, len(inttrz) * dt, dt)
# calculate spectrum using only first cycles of
# waveform after P onset!
zc = crossings_nonzero_all(wfzc)
if np.size(zc) == 0 or len(zc) <= 3:
if verbosity:
print("calcsourcespec: Something is wrong with the waveform, "
"no zero crossings derived!\n")
print("No calculation of source spectrum possible!")
plotflag = 0
else:
plotflag = 1
index = min([3, len(zc) - 1])
calcwin = (zc[index] - zc[0]) * dt
iwin = getsignalwin(t, rel_onset, calcwin)
xdat = Ldat[iwin]
# fft
fny = freq / 2
l = len(xdat) / freq
# number of fft bins after Bath
n = freq * l
# find next power of 2 of data length
m = pow(2, np.ceil(np.log(len(xdat)) / np.log(2)))
N = int(np.power(m, 2))
y = dt * np.fft.fft(xdat, N)
Y = abs(y[: N / 2])
L = (N - 1) / freq
f = np.arange(0, fny, 1 / L)
# remove zero-frequency and frequencies above
# corner frequency of seismometer (assumed
# to be 100 Hz)
fi = np.where((f >= 1) & (f < 100))
F = f[fi]
YY = Y[fi]
# correction for attenuation
wa = 2 * np.pi * F # angular frequency
D = np.exp((wa * dist) / (2 * vp * Q * F ** A))
YYcor = YY.real * D
# get plateau (DC value) and corner frequency
# initial guess of plateau
w0in = np.mean(YYcor[0:100])
# initial guess of corner frequency
# where spectral level reached 50% of flat level
iin = np.where(YYcor >= 0.5 * w0in)
Fcin = F[iin[0][np.size(iin) - 1]]
# use of implicit scipy otimization function
fit = synthsourcespec(F, w0in, Fcin)
[optspecfit, _] = curve_fit(synthsourcespec, F, YYcor, [w0in, Fcin])
w0 = optspecfit[0]
fc = optspecfit[1]
# w01 = optspecfit[0]
# fc1 = optspecfit[1]
if verbosity:
print("calcsourcespec: Determined w0-value: %e m/Hz, \n"
"calcsourcespec: Determined corner frequency: %f Hz" % (w0, fc))
# use of conventional fitting
# [w02, fc2] = fitSourceModel(F, YYcor, Fcin, iplot, verbosity)
# get w0 and fc as median of both
# source spectrum fits
# w0 = np.median([w01, w02])
# fc = np.median([fc1, fc2])
# if verbosity:
# print("calcsourcespec: Using w0-value = %e m/Hz and fc = %f Hz" % (
# w0, fc))
if iplot > 1:
f1 = plt.figure()
tLdat = np.arange(0, len(Ldat) * dt, dt)
plt.subplot(2, 1, 1)
# show displacement in mm
p1, = plt.plot(t, np.multiply(inttrz, 1000), 'k')
p2, = plt.plot(tLdat, np.multiply(Ldat, 1000))
plt.legend([p1, p2], ['Displacement', 'Rotated Displacement'])
if plotflag == 1:
plt.plot(t[iwin], np.multiply(xdat, 1000), 'g')
plt.title('Seismogram and P Pulse, Station %s-%s' \
% (zdat[0].stats.station, zdat[0].stats.channel))
else:
plt.title('Seismogram, Station %s-%s' \
% (zdat[0].stats.station, zdat[0].stats.channel))
plt.xlabel('Time since %s' % zdat[0].stats.starttime)
plt.ylabel('Displacement [mm]')
if plotflag == 1:
plt.subplot(2, 1, 2)
p1, = plt.loglog(f, Y.real, 'k')
p2, = plt.loglog(F, YY.real)
p3, = plt.loglog(F, YYcor, 'r')
p4, = plt.loglog(F, fit, 'g')
plt.loglog([fc, fc], [w0 / 100, w0], 'g')
plt.legend([p1, p2, p3, p4], ['Raw Spectrum', \
'Used Raw Spectrum', \
'Q-Corrected Spectrum', \
'Fit to Spectrum'])
plt.title('Source Spectrum from P Pulse, w0=%e m/Hz, fc=%6.2f Hz' \
% (w0, fc))
plt.xlabel('Frequency [Hz]')
plt.ylabel('Amplitude [m/Hz]')
plt.grid()
return w0, fc
def synthsourcespec(f, omega0, fcorner):
'''
Calculates synthetic source spectrum from given plateau and corner
frequency assuming Akis omega-square model.
:param: f, frequencies
:type: array
:param: omega0, DC-value (plateau) of source spectrum
:type: float
:param: fcorner, corner frequency of source spectrum
:type: float
'''
# ssp = omega0 / (pow(2, (1 + f / fcorner)))
ssp = omega0 / (1 + pow(2, (f / fcorner)))
return ssp
def fitSourceModel(f, S, fc0, iplot, verbosity=False):
'''
Calculates synthetic source spectrum by varying corner frequency fc.
Returns best approximated plateau omega0 and corner frequency, i.e. with least
common standard deviations.
:param: f, frequencies
:type: array
:param: S, observed source spectrum
:type: array
:param: fc0, initial corner frequency
:type: float
'''
try:
iplot = int(iplot)
except:
if iplot == True or iplot == 'True':
iplot = 2
else:
iplot = 0
w0 = []
stdw0 = []
fc = []
stdfc = []
STD = []
# get window around initial corner frequency for trials
# left side of initial corner frequency
fcstopl = max(f[0], fc0 - max(1, fc0 / 2))
il = np.where(f <= fcstopl)
il = il[0][np.size(il) - 1]
# right side of initial corner frequency
fcstopr = min(fc0 + (fc0 / 2), f[len(f) - 1])
ir = np.where(f >= fcstopr)
# check, if fcstopr is available
if np.size(ir) == 0:
fcstopr = fc0
ir = len(f) - 1
else:
ir = ir[0][0]
# vary corner frequency around initial point
print("fitSourceModel: Varying corner frequency "
"around initial corner frequency ...")
# check difference of il and ir in order to
# keep calculation time acceptable
idiff = ir - il
if idiff > 10000:
increment = 100
elif idiff <= 20:
increment = 1
else:
increment = 10
for i in range(il, ir, increment):
FC = f[i]
indexdc = np.where((f > 0) & (f <= FC))
dc = np.mean(S[indexdc])
stddc = np.std(dc - S[indexdc])
w0.append(dc)
stdw0.append(stddc)
fc.append(FC)
# slope
indexfc = np.where((f >= FC) & (f <= fcstopr))
yi = dc / (1 + (f[indexfc] / FC) ** 2)
stdFC = np.std(yi - S[indexfc])
stdfc.append(stdFC)
STD.append(stddc + stdFC)
# get best found w0 anf fc from minimum
if len(STD) > 0:
fc = fc[np.argmin(STD)]
w0 = w0[np.argmin(STD)]
elif len(STD) == 0:
fc = fc0
w0 = max(S)
if verbosity:
print(
"fitSourceModel: best fc: {0} Hz, best w0: {1} m/Hz".format(fc, w0))
if iplot > 1:
plt.figure() # iplot)
plt.loglog(f, S, 'k')
plt.loglog([f[0], fc], [w0, w0], 'g')
plt.loglog([fc, fc], [w0 / 100, w0], 'g')
plt.title('Calculated Source Spectrum, Omega0=%e m/Hz, fc=%6.2f Hz' \
% (w0, fc))
plt.xlabel('Frequency [Hz]')
plt.ylabel('Amplitude [m/Hz]')
plt.grid()
plt.figure() # iplot + 1)
plt.subplot(311)
plt.plot(f[il:ir], STD, '*')
plt.title('Common Standard Deviations')
plt.xticks([])
plt.subplot(312)
plt.plot(f[il:ir], stdw0, '*')
plt.title('Standard Deviations of w0-Values')
plt.xticks([])
plt.subplot(313)
plt.plot(f[il:ir], stdfc, '*')
plt.title('Standard Deviations of Corner Frequencies')
plt.xlabel('Corner Frequencies [Hz]')
return w0, fc

View File

@@ -0,0 +1,240 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created August/September 2015.
:author: Ludger Küperkoch / MAGS2 EP3 working group
"""
import matplotlib.pyplot as plt
import numpy as np
from obspy.core import Stream
from pylot.core.pick.utils import getsignalwin
from scipy.optimize import curve_fit
class Magnitude(object):
'''
Superclass for calculating Wood-Anderson peak-to-peak
amplitudes, local magnitudes and moment magnitudes.
'''
def __init__(self, wfstream, To, pwin, iplot):
'''
:param: wfstream
:type: `~obspy.core.stream.Stream
:param: To, onset time, P- or S phase
:type: float
:param: pwin, pick window [To To+pwin] to get maximum
peak-to-peak amplitude (WApp) or to calculate
source spectrum (DCfc)
:type: float
:param: iplot, no. of figure window for plotting interims results
:type: integer
'''
assert isinstance(wfstream, Stream), "%s is not a stream object" % str(wfstream)
self.setwfstream(wfstream)
self.setTo(To)
self.setpwin(pwin)
self.setiplot(iplot)
self.calcwapp()
self.calcsourcespec()
def getwfstream(self):
return self.wfstream
def setwfstream(self, wfstream):
self.wfstream = wfstream
def getTo(self):
return self.To
def setTo(self, To):
self.To = To
def getpwin(self):
return self.pwin
def setpwin(self, pwin):
self.pwin = pwin
def getiplot(self):
return self.iplot
def setiplot(self, iplot):
self.iplot = iplot
def getwapp(self):
return self.wapp
def getw0(self):
return self.w0
def getfc(self):
return self.fc
def calcwapp(self):
self.wapp = None
def calcsourcespec(self):
self.sourcespek = None
class WApp(Magnitude):
'''
Method to derive peak-to-peak amplitude as seen on a Wood-Anderson-
seismograph. Has to be derived from instrument corrected traces!
'''
def calcwapp(self):
print("Getting Wood-Anderson peak-to-peak amplitude ...")
print("Simulating Wood-Anderson seismograph ...")
self.wapp = None
stream = self.getwfstream()
# poles, zeros and sensitivity of WA seismograph
# (see Uhrhammer & Collins, 1990, BSSA, pp. 702-716)
paz_wa = {
'poles': [5.6089 - 5.4978j, -5.6089 - 5.4978j],
'zeros': [0j, 0j],
'gain': 2080,
'sensitivity': 1}
stream.simulate(paz_remove=None, paz_simulate=paz_wa)
trH1 = stream[0].data
trH2 = stream[1].data
ilen = min([len(trH1), len(trH2)])
# get RMS of both horizontal components
sqH = np.sqrt(np.power(trH1[0:ilen], 2) + np.power(trH2[0:ilen], 2))
# get time array
th = np.arange(0, len(sqH) * stream[0].stats.delta, stream[0].stats.delta)
# get maximum peak within pick window
iwin = getsignalwin(th, self.getTo(), self.getpwin())
self.wapp = np.max(sqH[iwin])
print("Determined Wood-Anderson peak-to-peak amplitude: %f mm") % self.wapp
if self.getiplot() > 1:
stream.plot()
f = plt.figure(2)
plt.plot(th, sqH)
plt.plot(th[iwin], sqH[iwin], 'g')
plt.plot([self.getTo(), self.getTo()], [0, max(sqH)], 'r', linewidth=2)
plt.title('Station %s, RMS Horizontal Traces, WA-peak-to-peak=%4.1f mm' \
% (stream[0].stats.station, self.wapp))
plt.xlabel('Time [s]')
plt.ylabel('Displacement [mm]')
plt.show()
raw_input()
plt.close(f)
class DCfc(Magnitude):
'''
Method to calculate the source spectrum and to derive from that the plateau
(so-called DC-value) and the corner frequency assuming Aki's omega-square
source model. Has to be derived from instrument corrected displacement traces!
'''
def calcsourcespec(self):
print("Calculating source spectrum ....")
self.w0 = None # DC-value
self.fc = None # corner frequency
stream = self.getwfstream()
tr = stream[0]
# get time array
t = np.arange(0, len(tr) * tr.stats.delta, tr.stats.delta)
iwin = getsignalwin(t, self.getTo(), self.getpwin())
xdat = tr.data[iwin]
# fft
fny = tr.stats.sampling_rate / 2
l = len(xdat) / tr.stats.sampling_rate
n = tr.stats.sampling_rate * l # number of fft bins after Bath
# find next power of 2 of data length
m = pow(2, np.ceil(np.log(len(xdat)) / np.log(2)))
N = int(np.power(m, 2))
y = tr.stats.delta * np.fft.fft(xdat, N)
Y = abs(y[: N / 2])
L = (N - 1) / tr.stats.sampling_rate
f = np.arange(0, fny, 1 / L)
# remove zero-frequency and frequencies above
# corner frequency of seismometer (assumed
# to be 100 Hz)
fi = np.where((f >= 1) & (f < 100))
F = f[fi]
YY = Y[fi]
# get plateau (DC value) and corner frequency
# initial guess of plateau
DCin = np.mean(YY[0:100])
# initial guess of corner frequency
# where spectral level reached 50% of flat level
iin = np.where(YY >= 0.5 * DCin)
Fcin = F[iin[0][np.size(iin) - 1]]
fit = synthsourcespec(F, DCin, Fcin)
[optspecfit, pcov] = curve_fit(synthsourcespec, F, YY.real, [DCin, Fcin])
self.w0 = optspecfit[0]
self.fc = optspecfit[1]
print("DCfc: Determined DC-value: %e m/Hz, \n" \
"Determined corner frequency: %f Hz" % (self.w0, self.fc))
# if self.getiplot() > 1:
iplot = 2
if iplot > 1:
print("DCfc: Determined DC-value: %e m/Hz, \n"
"Determined corner frequency: %f Hz" % (self.w0, self.fc))
if self.getiplot() > 1:
f1 = plt.figure()
plt.subplot(2, 1, 1)
# show displacement in mm
plt.plot(t, np.multiply(tr, 1000), 'k')
plt.plot(t[iwin], np.multiply(xdat, 1000), 'g')
plt.title('Seismogram and P pulse, station %s' % tr.stats.station)
plt.xlabel('Time since %s' % tr.stats.starttime)
plt.ylabel('Displacement [mm]')
plt.subplot(2, 1, 2)
plt.loglog(f, Y.real, 'k')
plt.loglog(F, YY.real)
plt.loglog(F, fit, 'g')
plt.title('Source Spectrum from P Pulse, DC=%e m/Hz, fc=%4.1f Hz' \
% (self.w0, self.fc))
plt.xlabel('Frequency [Hz]')
plt.ylabel('Amplitude [m/Hz]')
plt.grid()
plt.show()
raw_input()
plt.close(f1)
def synthsourcespec(f, omega0, fcorner):
'''
Calculates synthetic source spectrum from given plateau and corner
frequency assuming Akis omega-square model.
:param: f, frequencies
:type: array
:param: omega0, DC-value (plateau) of source spectrum
:type: float
:param: fcorner, corner frequency of source spectrum
:type: float
'''
# ssp = omega0 / (pow(2, (1 + f / fcorner)))
ssp = omega0 / (1 + pow(2, (f / fcorner)))
return ssp

View File

@@ -0,0 +1 @@
# -*- coding: utf-8 -*-

751
pylot/core/io/data.py Normal file
View File

@@ -0,0 +1,751 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import copy
import os
from obspy import read_events
from obspy.core import read, Stream, UTCDateTime
from obspy.core.event import Event as ObsPyEvent
from obspy.io.sac import SacIOError
from pylot.core.io.phases import readPILOTEvent, picks_from_picksdict, \
picksdict_from_pilot, merge_picks
from pylot.core.util.errors import FormatError, OverwriteError
from pylot.core.util.event import Event
from pylot.core.util.utils import fnConstructor, full_range
import pylot.core.loc.velest as velest
class Data(object):
"""
Data container with attributes wfdata holding ~obspy.core.stream.
:type parent: PySide.QtGui.QWidget object, optional
:param parent: A PySide.QtGui.QWidget object utilized when
called by a GUI to display a PySide.QtGui.QMessageBox instead of printing
to standard out.
:type evtdata: ~obspy.core.event.Event object, optional
:param evtdata ~obspy.core.event.Event object containing all derived or
loaded event. Container object holding, e.g. phase arrivals, etc.
"""
def __init__(self, parent=None, evtdata=None):
self._parent = parent
if self.getParent():
self.comp = parent.getComponent()
else:
self.comp = 'Z'
self.wfdata = Stream()
self._new = False
if isinstance(evtdata, ObsPyEvent) or isinstance(evtdata, Event):
pass
elif isinstance(evtdata, dict):
evt = readPILOTEvent(**evtdata)
evtdata = evt
elif isinstance(evtdata, str):
try:
cat = read_events(evtdata)
if len(cat) is not 1:
raise ValueError('ambiguous event information for file: '
'{file}'.format(file=evtdata))
evtdata = cat[0]
except TypeError as e:
if 'Unknown format for file' in e.message:
if 'PHASES' in evtdata:
picks = picksdict_from_pilot(evtdata)
evtdata = ObsPyEvent()
evtdata.picks = picks_from_picksdict(picks)
elif 'LOC' in evtdata:
raise NotImplementedError('PILOT location information '
'read support not yet '
'implemeted.')
else:
raise e
else:
raise e
else: # create an empty Event object
self.setNew()
evtdata = ObsPyEvent()
evtdata.picks = []
self.evtdata = evtdata
self.wforiginal = None
self.cuttimes = None
self.dirty = False
def __str__(self):
return str(self.wfdata)
def __add__(self, other):
assert isinstance(other, Data), "operands must be of same type 'Data'"
rs_id = self.get_evt_data().get('resource_id')
rs_id_other = other.get_evt_data().get('resource_id')
if other.isNew() and not self.isNew():
picks_to_add = other.get_evt_data().picks
old_picks = self.get_evt_data().picks
for pick in picks_to_add:
if pick not in old_picks:
old_picks.append(pick)
elif not other.isNew() and self.isNew():
new = other + self
self.evtdata = new.get_evt_data()
elif self.isNew() and other.isNew():
pass
elif rs_id == rs_id_other:
other.setNew()
return self + other
else:
raise ValueError("both Data objects have differing "
"unique Event identifiers")
return self
def getPicksStr(self):
picks_str = ''
for pick in self.get_evt_data().picks:
picks_str += str(pick) + '\n'
return picks_str
def getParent(self):
"""
:return:
"""
return self._parent
def isNew(self):
"""
:return:
"""
return self._new
def setNew(self):
self._new = True
def getCutTimes(self):
"""
:return:
"""
if self.cuttimes is None:
self.updateCutTimes()
return self.cuttimes
def updateCutTimes(self):
"""
"""
self.cuttimes = full_range(self.getWFData())
def getEventFileName(self):
"""
:return:
"""
ID = self.getID()
# handle forbidden filenames especially on windows systems
return fnConstructor(str(ID))
def checkEvent(self, event, fcheck, forceOverwrite=False):
if 'origin' in fcheck:
self.replaceOrigin(event, forceOverwrite)
if 'magnitude' in fcheck:
self.replaceMagnitude(event, forceOverwrite)
if 'auto' in fcheck:
self.replacePicks(event, 'auto')
if 'manual' in fcheck:
self.replacePicks(event, 'manual')
def replaceOrigin(self, event, forceOverwrite=False):
if self.get_evt_data().origins or forceOverwrite:
if event.origins:
print("Found origin, replace it by new origin.")
event.origins = self.get_evt_data().origins
def replaceMagnitude(self, event, forceOverwrite=False):
if self.get_evt_data().magnitudes or forceOverwrite:
if event.magnitudes:
print("Found magnitude, replace it by new magnitude")
event.magnitudes = self.get_evt_data().magnitudes
def replacePicks(self, event, picktype):
checkflag = 0
picks = event.picks
# remove existing picks
for j, pick in reversed(list(enumerate(picks))):
if picktype in str(pick.method_id.id):
picks.pop(j)
checkflag = 1
if checkflag:
print("Found %s pick(s), remove them and append new picks to catalog." % picktype)
# append new picks
for pick in self.get_evt_data().picks:
if picktype in str(pick.method_id.id):
picks.append(pick)
def exportEvent(self, fnout, fnext='.xml', fcheck='auto', upperErrors=None):
"""
:param fnout: basename of file
:param fnext: file extension
:param fcheck: check and delete existing information
can be a str or a list of strings of ['manual', 'auto', 'origin', 'magnitude']
"""
from pylot.core.util.defaults import OUTPUTFORMATS
if not type(fcheck) == list:
fcheck = [fcheck]
try:
evtformat = OUTPUTFORMATS[fnext]
except KeyError as e:
errmsg = '{0}; selected file extension {1} not ' \
'supported'.format(e, fnext)
raise FormatError(errmsg)
# check for already existing xml-file
if fnext == '.xml':
if os.path.isfile(fnout + fnext):
print("xml-file already exists! Check content ...")
cat = read_events(fnout + fnext)
if len(cat) > 1:
raise IOError('Ambigious event information in file {}'.format(fnout + fnext))
if len(cat) < 1:
raise IOError('No event information in file {}'.format(fnout + fnext))
event = cat[0]
if not event.resource_id == self.get_evt_data().resource_id:
raise IOError("Missmatching event resource id's: {} and {}".format(event.resource_id,
self.get_evt_data().resource_id))
self.checkEvent(event, fcheck)
self.setEvtData(event)
self.get_evt_data().write(fnout + fnext, format=evtformat)
# try exporting event
else:
evtdata_org = self.get_evt_data()
picks = evtdata_org.picks
eventpath = evtdata_org.path
picks_copy = copy.deepcopy(picks)
evtdata_copy = Event(eventpath)
evtdata_copy.picks = picks_copy
# check for stations picked automatically as well as manually
# Prefer manual picks!
for i in range(len(picks)):
if picks[i].method_id == 'manual':
mstation = picks[i].waveform_id.station_code
mstation_ext = mstation + '_'
for k in range(len(picks_copy)):
if ((picks_copy[k].waveform_id.station_code == mstation) or \
(picks_copy[k].waveform_id.station_code == mstation_ext)) and \
(picks_copy[k].method_id == 'auto'):
del picks_copy[k]
break
lendiff = len(picks) - len(picks_copy)
if lendiff is not 0:
print("Manual as well as automatic picks available. Prefered the {} manual ones!".format(lendiff))
if upperErrors:
# check for pick uncertainties exceeding adjusted upper errors
# Picks with larger uncertainties will not be saved in output file!
for j in range(len(picks)):
for i in range(len(picks_copy)):
if picks_copy[i].phase_hint[0] == 'P':
if (picks_copy[i].time_errors['upper_uncertainty'] >= upperErrors[0]) or \
(picks_copy[i].time_errors['uncertainty'] == None):
print("Uncertainty exceeds or equal adjusted upper time error!")
print("Adjusted uncertainty: {}".format(upperErrors[0]))
print("Pick uncertainty: {}".format(picks_copy[i].time_errors['uncertainty']))
print("{1} P-Pick of station {0} will not be saved in outputfile".format(
picks_copy[i].waveform_id.station_code,
picks_copy[i].method_id))
print("#")
del picks_copy[i]
break
if picks_copy[i].phase_hint[0] == 'S':
if (picks_copy[i].time_errors['upper_uncertainty'] >= upperErrors[1]) or \
(picks_copy[i].time_errors['uncertainty'] == None):
print("Uncertainty exceeds or equal adjusted upper time error!")
print("Adjusted uncertainty: {}".format(upperErrors[1]))
print("Pick uncertainty: {}".format(picks_copy[i].time_errors['uncertainty']))
print("{1} S-Pick of station {0} will not be saved in outputfile".format(
picks_copy[i].waveform_id.station_code,
picks_copy[i].method_id))
print("#")
del picks_copy[i]
break
if fnext == '.obs':
try:
evtdata_copy.write(fnout + fnext, format=evtformat)
# write header afterwards
evid = str(evtdata_org.resource_id).split('/')[1]
header = '# EQEVENT: Label: EQ%s Loc: X 0.00 Y 0.00 Z 10.00 OT 0.00 \n' % evid
nllocfile = open(fnout + fnext)
l = nllocfile.readlines()
nllocfile.close()
l.insert(0, header)
nllocfile = open(fnout + fnext, 'w')
nllocfile.write("".join(l))
nllocfile.close()
except KeyError as e:
raise KeyError('''{0} export format
not implemented: {1}'''.format(evtformat, e))
if fnext == '.cnv':
try:
velest.export(picks_copy, fnout + fnext, eventinfo=self.get_evt_data())
except KeyError as e:
raise KeyError('''{0} export format
not implemented: {1}'''.format(evtformat, e))
def getComp(self):
"""
:return:
"""
return self.comp
def getID(self):
"""
:return:
"""
try:
return self.evtdata.get('resource_id').id
except:
return None
def filterWFData(self, kwargs):
"""
:param kwargs:
"""
self.getWFData().filter(**kwargs)
self.dirty = True
def setWFData(self, fnames):
"""
:param fnames:
"""
self.wfdata = Stream()
self.wforiginal = None
if fnames is not None:
self.appendWFData(fnames)
else:
return False
self.wforiginal = self.getWFData().copy()
self.dirty = False
return True
def appendWFData(self, fnames):
"""
:param fnames:
"""
assert isinstance(fnames, list), "input parameter 'fnames' is " \
"supposed to be of type 'list' " \
"but is actually" \
" {0}".format(type(fnames))
if self.dirty:
self.resetWFData()
warnmsg = ''
for fname in fnames:
try:
self.wfdata += read(fname)
except TypeError:
try:
self.wfdata += read(fname, format='GSE2')
except Exception as e:
warnmsg += '{0}\n{1}\n'.format(fname, e)
except SacIOError as se:
warnmsg += '{0}\n{1}\n'.format(fname, se)
if warnmsg:
warnmsg = 'WARNING: unable to read\n' + warnmsg
print(warnmsg)
def getWFData(self):
"""
:return:
"""
return self.wfdata
def getOriginalWFData(self):
"""
:return:
"""
return self.wforiginal
def resetWFData(self):
"""
"""
self.wfdata = self.getOriginalWFData().copy()
self.dirty = False
def resetPicks(self):
"""
"""
self.get_evt_data().picks = []
def get_evt_data(self):
"""
:return:
"""
return self.evtdata
def setEvtData(self, event):
self.evtdata = event
def applyEVTData(self, data, typ='pick', authority_id='rub'):
"""
:param data:
:param typ:
:param authority_id:
:raise OverwriteError:
"""
def applyPicks(picks):
"""
Creates ObsPy pick objects and append it to the picks list from the
PyLoT dictionary contain all picks.
:param picks:
:raise OverwriteError: raises an OverwriteError if the picks list is
not empty. The GUI will then ask for a decision.
"""
# firstonset = find_firstonset(picks)
# check for automatic picks
print("Writing phases to ObsPy-quakeml file")
for key in picks:
if picks[key]['P']['picker'] == 'auto':
print("Existing picks will be overwritten!")
picks = picks_from_picksdict(picks)
break
else:
if self.get_evt_data().picks:
raise OverwriteError('Existing picks would be overwritten!')
break
else:
picks = picks_from_picksdict(picks)
break
self.get_evt_data().picks = picks
# if 'smi:local' in self.getID() and firstonset:
# fonset_str = firstonset.strftime('%Y_%m_%d_%H_%M_%S')
# ID = ResourceIdentifier('event/' + fonset_str)
# ID.convertIDToQuakeMLURI(authority_id=authority_id)
# self.get_evt_data().resource_id = ID
def applyEvent(event):
"""
takes an `obspy.core.event.Event` object and applies all new
information on the event to the actual data
:param event:
"""
if self.isNew():
self.setEvtData(event)
else:
# prevent overwriting original pick information
event_old = self.get_evt_data()
if not event_old.resource_id == event.resource_id:
print("WARNING: Missmatch in event resource id's: {} and {}".format(
event_old.resource_id,
event.resource_id))
else:
picks = copy.deepcopy(event_old.picks)
event = merge_picks(event, picks)
# apply event information from location
event_old.update(event)
applydata = {'pick': applyPicks,
'event': applyEvent}
applydata[typ](data)
self._new = False
class GenericDataStructure(object):
"""
GenericDataBase type holds all information about the current data-
base working on.
"""
def __init__(self, **kwargs):
self.allowedFields = []
self.expandFields = ['root']
self.dsFields = {}
self.modifyFields(**kwargs)
def modifyFields(self, **kwargs):
"""
:param kwargs:
"""
assert isinstance(kwargs, dict), 'dictionary type object expected'
if not self.extraAllowed():
kwargs = self.updateNotAllowed(kwargs)
for key, value in kwargs.items():
key = str(key).lower()
if value is not None:
if type(value) not in (str, int, float):
for n, val in enumerate(value):
value[n] = str(val)
else:
value = str(value)
try:
self.setFieldValue(key, value)
except KeyError as e:
errmsg = ''
errmsg += 'WARNING:\n'
errmsg += 'unable to set values for datastructure fields\n'
errmsg += '%s; desired value was: %s\n' % (e, value)
print(errmsg)
def isField(self, key):
"""
:param key:
:return:
"""
return key in self.getFields().keys()
def getFieldValue(self, key):
"""
:param key:
:return:
"""
if self.isField(key):
return self.getFields()[key]
else:
return
def setFieldValue(self, key, value):
"""
:param key:
:param value:
:raise KeyError:
"""
if not self.extraAllowed() and key not in self.getAllowed():
raise KeyError
else:
if not self.isField(key):
print('creating new field "%s"' % key)
self.getFields()[key] = value
def getFields(self):
"""
:return:
"""
return self.dsFields
def getExpandFields(self):
"""
:return:
"""
return self.expandFields
def setExpandFields(self, keys):
"""
:param keys:
"""
expandFields = []
for key in keys:
if self.isField(key):
expandFields.append(key)
self.expandFields = expandFields
def getAllowed(self):
"""
:return:
"""
return self.allowedFields
def extraAllowed(self):
"""
:return:
"""
return not self.allowedFields
def updateNotAllowed(self, kwargs):
"""
:param kwargs:
:return:
"""
for key in kwargs:
if key not in self.getAllowed():
kwargs.__delitem__(key)
return kwargs
def hasSuffix(self):
"""
:return:
"""
try:
self.getFieldValue('suffix')
except KeyError:
return False
else:
if self.getFieldValue('suffix'):
return True
return False
def expandDataPath(self):
"""
:return:
"""
expandList = []
for item in self.getExpandFields():
expandList.append(self.getFieldValue(item))
if self.hasSuffix():
expandList.append('*%s' % self.getFieldValue('suffix'))
return os.path.join(*expandList)
def getCatalogName(self):
"""
:return:
"""
return os.path.join(self.getFieldValue('root'), 'catalog.qml')
class PilotDataStructure(GenericDataStructure):
"""
Object containing the data access information for the old PILOT data
structure.
"""
def __init__(self, **fields):
if not fields:
fields = {'database': '2006.01',
'root': '/data/Egelados/EVENT_DATA/LOCAL'}
GenericDataStructure.__init__(self, **fields)
self.setExpandFields(['root', 'database'])
class SeiscompDataStructure(GenericDataStructure):
"""
Dictionary containing the data access information for an SDS data archive:
:param str dataType: Desired data type. Default: ``'waveform'``
:param sdate, edate: Either date string or an instance of
:class:`obspy.core.utcdatetime.UTCDateTime. Default: ``None``
:type sdate, edate: str or UTCDateTime or None
"""
def __init__(self, rootpath='/data/SDS', dataformat='MSEED',
filesuffix=None, **kwargs):
super(GenericDataStructure, self).__init__()
edate = UTCDateTime()
halfyear = UTCDateTime('1970-07-01')
sdate = UTCDateTime(edate - halfyear)
del halfyear
year = ''
if not edate.year == sdate.year:
nyears = edate.year - sdate.year
for yr in range(nyears):
year += '{0:04d},'.format(sdate.year + yr)
year = '{' + year[:-1] + '}'
else:
year = '{0:04d}'.format(sdate.year)
# SDS fields' default values
# definitions from
# http://www.seiscomp3.org/wiki/doc/applications/slarchive/SDS
self.dsFields = {'root': '/data/SDS', 'YEAR': year, 'NET': '??',
'STA': '????', 'CHAN': 'HH?', 'TYPE': 'D', 'LOC': '',
'DAY': '{0:03d}'.format(sdate.julday)
}
self.modifiyFields(**kwargs)
def modifiyFields(self, **kwargs):
"""
:param kwargs:
"""
if kwargs and isinstance(kwargs, dict):
for key, value in kwargs.iteritems():
key = str(key)
if type(value) not in (str, int, float):
for n, val in enumerate(value):
value[n] = str(val)
else:
value = str(value)
try:
self.setFieldValue(key, value)
except KeyError as e:
errmsg = ''
errmsg += 'WARNING:\n'
errmsg += 'unable to set values for SDS fields\n'
errmsg += '%s; desired value was: %s\n' % (e, value)
print(errmsg)
def setFieldValue(self, key, value):
"""
:param key:
:param value:
"""
if self.isField(key):
self.getFields()[key] = value
else:
print('Warning: trying to set value of non-existent field '
'{field}'.format(field=key))
def expandDataPath(self):
"""
:return:
"""
fullChan = '{0}.{1}'.format(self.getFields()['CHAN'], self.getType())
dataPath = os.path.join(self.getFields()['SDSdir'],
self.getFields()['YEAR'],
self.getFields()['NET'],
self.getFields()['STA'],
fullChan,
'*{0}'.format(self.getFields()['DAY']))
return dataPath

View File

@@ -0,0 +1,515 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
defaults = {'rootpath': {'type': str,
'tooltip': 'project path',
'value': '',
'namestring': 'Root path'},
'datapath': {'type': str,
'tooltip': 'data path',
'value': '',
'namestring': 'Data path'},
'database': {'type': str,
'tooltip': 'name of data base',
'value': '',
'namestring': 'Database path'},
'eventID': {'type': str,
'tooltip': 'event ID for single event processing (* for all events found in database)',
'value': '',
'namestring': 'Event ID'},
'extent': {'type': str,
'tooltip': 'extent of array ("local", "regional" or "global")',
'value': 'local',
'namestring': 'Array extent'},
'invdir': {'type': str,
'tooltip': 'full path to inventory or dataless-seed file',
'value': '',
'namestring': 'Inversion dir'},
'datastructure': {'type': str,
'tooltip': 'choose data structure',
'value': 'PILOT',
'namestring': 'Datastructure'},
'apverbose': {'type': bool,
'tooltip': "choose 'True' or 'False' for terminal output",
'value': True,
'namestring': 'App. verbosity'},
'nllocbin': {'type': str,
'tooltip': 'path to NLLoc executable',
'value': '',
'namestring': 'NLLoc bin path'},
'nllocroot': {'type': str,
'tooltip': 'root of NLLoc-processing directory',
'value': '',
'namestring': 'NLLoc root path'},
'phasefile': {'type': str,
'tooltip': 'name of autoPyLoT-output phase file for NLLoc',
'value': 'AUTOPHASES.obs',
'namestring': 'Phase filename'},
'ctrfile': {'type': str,
'tooltip': 'name of autoPyLoT-output control file for NLLoc',
'value': 'Insheim_min1d2015_auto.in',
'namestring': 'Control filename'},
'ttpatter': {'type': str,
'tooltip': 'pattern of NLLoc ttimes from grid',
'value': 'ttime',
'namestring': 'Traveltime pattern'},
'outpatter': {'type': str,
'tooltip': 'pattern of NLLoc-output file',
'value': 'AUTOLOC_nlloc',
'namestring': 'NLLoc output pattern'},
'vp': {'type': float,
'tooltip': 'average P-wave velocity',
'value': 3530.,
'namestring': 'P-velocity'},
'rho': {'type': float,
'tooltip': 'average rock density [kg/m^3]',
'value': 2500.,
'namestring': 'Density'},
'Qp': {'type': (float, float),
'tooltip': 'quality factor for P waves (Qp*f^a); list(Qp, a)',
'value': (300., 0.8),
'namestring': ('Quality factor', 'Qp1', 'Qp2')},
'pstart': {'type': float,
'tooltip': 'start time [s] for calculating CF for P-picking (if TauPy:'
' seconds relative to estimated onset)',
'value': 15.0,
'namestring': 'P start'},
'pstop': {'type': float,
'tooltip': 'end time [s] for calculating CF for P-picking (if TauPy:'
' seconds relative to estimated onset)',
'value': 60.0,
'namestring': 'P stop'},
'sstart': {'type': float,
'tooltip': 'start time [s] relative to P-onset for calculating CF for S-picking',
'value': -1.0,
'namestring': 'S start'},
'sstop': {'type': float,
'tooltip': 'end time [s] after P-onset for calculating CF for S-picking',
'value': 10.0,
'namestring': 'S stop'},
'bpz1': {'type': (float, float),
'tooltip': 'lower/upper corner freq. of first band pass filter Z-comp. [Hz]',
'value': (2, 20),
'namestring': ('Z-bandpass 1', 'Lower', 'Upper')},
'bpz2': {'type': (float, float),
'tooltip': 'lower/upper corner freq. of second band pass filter Z-comp. [Hz]',
'value': (2, 30),
'namestring': ('Z-bandpass 2', 'Lower', 'Upper')},
'bph1': {'type': (float, float),
'tooltip': 'lower/upper corner freq. of first band pass filter H-comp. [Hz]',
'value': (2, 15),
'namestring': ('H-bandpass 1', 'Lower', 'Upper')},
'bph2': {'type': (float, float),
'tooltip': 'lower/upper corner freq. of second band pass filter z-comp. [Hz]',
'value': (2, 20),
'namestring': ('H-bandpass 2', 'Lower', 'Upper')},
'algoP': {'type': str,
'tooltip': 'choose algorithm for P-onset determination (HOS, ARZ, or AR3)',
'value': 'HOS',
'namestring': 'P algorithm'},
'tlta': {'type': float,
'tooltip': 'for HOS-/AR-AIC-picker, length of LTA window [s]',
'value': 7.0,
'namestring': 'LTA window'},
'hosorder': {'type': int,
'tooltip': 'for HOS-picker, order of Higher Order Statistics',
'value': 4,
'namestring': 'HOS order'},
'Parorder': {'type': int,
'tooltip': 'for AR-picker, order of AR process of Z-component',
'value': 2,
'namestring': 'AR order P'},
'tdet1z': {'type': float,
'tooltip': 'for AR-picker, length of AR determination window [s] for Z-component, 1st pick',
'value': 1.2,
'namestring': 'AR det. window Z 1'},
'tpred1z': {'type': float,
'tooltip': 'for AR-picker, length of AR prediction window [s] for Z-component, 1st pick',
'value': 0.4,
'namestring': 'AR pred. window Z 1'},
'tdet2z': {'type': float,
'tooltip': 'for AR-picker, length of AR determination window [s] for Z-component, 2nd pick',
'value': 0.6,
'namestring': 'AR det. window Z 2'},
'tpred2z': {'type': float,
'tooltip': 'for AR-picker, length of AR prediction window [s] for Z-component, 2nd pick',
'value': 0.2,
'namestring': 'AR pred. window Z 2'},
'addnoise': {'type': float,
'tooltip': 'add noise to seismogram for stable AR prediction',
'value': 0.001,
'namestring': 'Add noise'},
'tsnrz': {'type': (float, float, float, float),
'tooltip': 'for HOS/AR, window lengths for SNR-and slope estimation [tnoise, tsafetey, tsignal, tslope] [s]',
'value': (3, 0.1, 0.5, 1.0),
'namestring': ('SNR windows P', 'Noise', 'Safety', 'Signal', 'Slope')},
'pickwinP': {'type': float,
'tooltip': 'for initial AIC pick, length of P-pick window [s]',
'value': 3.0,
'namestring': 'AIC window P'},
'Precalcwin': {'type': float,
'tooltip': 'for HOS/AR, window length [s] for recalculation of CF (relative to 1st pick)',
'value': 6.0,
'namestring': 'Recal. window P'},
'aictsmooth': {'type': float,
'tooltip': 'for HOS/AR, take average of samples for smoothing of AIC-function [s]',
'value': 0.2,
'namestring': 'AIC smooth P'},
'tsmoothP': {'type': float,
'tooltip': 'for HOS/AR, take average of samples for smoothing CF [s]',
'value': 0.1,
'namestring': 'CF smooth P'},
'ausP': {'type': float,
'tooltip': 'for HOS/AR, artificial uplift of samples (aus) of CF (P)',
'value': 0.001,
'namestring': 'Artificial uplift P'},
'nfacP': {'type': float,
'tooltip': 'for HOS/AR, noise factor for noise level determination (P)',
'value': 1.3,
'namestring': 'Noise factor P'},
'algoS': {'type': str,
'tooltip': 'choose algorithm for S-onset determination (ARH or AR3)',
'value': 'ARH',
'namestring': 'S algorithm'},
'tdet1h': {'type': float,
'tooltip': 'for HOS/AR, length of AR-determination window [s], H-components, 1st pick',
'value': 0.8,
'namestring': 'AR det. window H 1'},
'tpred1h': {'type': float,
'tooltip': 'for HOS/AR, length of AR-prediction window [s], H-components, 1st pick',
'value': 0.4,
'namestring': 'AR pred. window H 1'},
'tdet2h': {'type': float,
'tooltip': 'for HOS/AR, length of AR-determinaton window [s], H-components, 2nd pick',
'value': 0.6,
'namestring': 'AR det. window H 2'},
'tpred2h': {'type': float,
'tooltip': 'for HOS/AR, length of AR-prediction window [s], H-components, 2nd pick',
'value': 0.3,
'namestring': 'AR pred. window H 2'},
'Sarorder': {'type': int,
'tooltip': 'for AR-picker, order of AR process of H-components',
'value': 4,
'namestring': 'AR order S'},
'Srecalcwin': {'type': float,
'tooltip': 'for AR-picker, window length [s] for recalculation of CF (2nd pick) (H)',
'value': 5.0,
'namestring': 'Recal. window S'},
'pickwinS': {'type': float,
'tooltip': 'for initial AIC pick, length of S-pick window [s]',
'value': 3.0,
'namestring': 'AIC window S'},
'tsnrh': {'type': (float, float, float, float),
'tooltip': 'for ARH/AR3, window lengths for SNR-and slope estimation [tnoise, tsafetey, tsignal, tslope] [s]',
'value': (2, 0.2, 1.5, 0.5),
'namestring': ('SNR windows S', 'Noise', 'Safety', 'Signal', 'Slope')},
'aictsmoothS': {'type': float,
'tooltip': 'for AIC-picker, take average of samples for smoothing of AIC-function [s]',
'value': 0.5,
'namestring': 'AIC smooth S'},
'tsmoothS': {'type': float,
'tooltip': 'for AR-picker, take average of samples for smoothing CF [s] (S)',
'value': 0.7,
'namestring': 'CF smooth S'},
'ausS': {'type': float,
'tooltip': 'for HOS/AR, artificial uplift of samples (aus) of CF (S)',
'value': 0.9,
'namestring': 'Artificial uplift S'},
'nfacS': {'type': float,
'tooltip': 'for AR-picker, noise factor for noise level determination (S)',
'value': 1.5,
'namestring': 'Noise factor S'},
'checkwindowP': {'type': float,
'tooltip': 'time window before HOS/AR-maximum to check for smaller maxima [s]',
'value': 10.0,
'namestring': 'Check Window P'},
'minfactorP': {'type': float,
'tooltip': 'Second maximum must be at least minfactor * first maximum [-]',
'value': 0.7,
'namestring': 'Minimum Factor P'},
'checkwindowS': {'type': float,
'tooltip': 'time window before AR-maximum to check for smaller maxima [s]',
'value': 10.0,
'namestring': 'Check Window S'},
'minfactorS': {'type': float,
'tooltip': 'Second maximum must be at least minfactor * first maximum [-]',
'value': 0.7,
'namestring': 'Minimum Factor S'},
'minfmweight': {'type': int,
'tooltip': 'minimum required P weight for first-motion determination',
'value': 1,
'namestring': 'Min. P weight'},
'minFMSNR': {'type': float,
'tooltip': 'miniumum required SNR for first-motion determination',
'value': 2.,
'namestring': 'Min SNR'},
'fmpickwin': {'type': float,
'tooltip': 'pick window around P onset for calculating zero crossings',
'value': 0.2,
'namestring': 'Zero crossings window'},
'timeerrorsP': {'type': (float, float, float, float),
'tooltip': 'discrete time errors [s] corresponding to picking weights [0 1 2 3] for P',
'value': (0.01, 0.02, 0.04, 0.08),
'namestring': ('Time errors P', '0', '1', '2', '3')},
'timeerrorsS': {'type': (float, float, float, float),
'tooltip': 'discrete time errors [s] corresponding to picking weights [0 1 2 3] for S',
'value': (0.04, 0.08, 0.16, 0.32),
'namestring': ('Time errors S', '0', '1', '2', '3')},
'minAICPslope': {'type': float,
'tooltip': 'below this slope [counts/s] the initial P pick is rejected',
'value': 0.8,
'namestring': 'Min. slope P'},
'minAICPSNR': {'type': float,
'tooltip': 'below this SNR the initial P pick is rejected',
'value': 1.1,
'namestring': 'Min. SNR P'},
'minAICSslope': {'type': float,
'tooltip': 'below this slope [counts/s] the initial S pick is rejected',
'value': 1.,
'namestring': 'Min. slope S'},
'minAICSSNR': {'type': float,
'tooltip': 'below this SNR the initial S pick is rejected',
'value': 1.5,
'namestring': 'Min. SNR S'},
'minsiglength': {'type': float,
'tooltip': 'length of signal part for which amplitudes must exceed noiselevel [s]',
'value': 1.,
'namestring': 'Min. signal length'},
'noisefactor': {'type': float,
'tooltip': 'noiselevel*noisefactor=threshold',
'value': 1.0,
'namestring': 'Noise factor'},
'minpercent': {'type': float,
'tooltip': 'required percentage of amplitudes exceeding threshold',
'value': 10.,
'namestring': 'Min amplitude [%]'},
'zfac': {'type': float,
'tooltip': 'P-amplitude must exceed at least zfac times RMS-S amplitude',
'value': 1.5,
'namestring': 'Z factor'},
'mdttolerance': {'type': float,
'tooltip': 'maximum allowed deviation of P picks from median [s]',
'value': 6.0,
'namestring': 'Median tolerance'},
'wdttolerance': {'type': float,
'tooltip': 'maximum allowed deviation from Wadati-diagram',
'value': 1.0,
'namestring': 'Wadati tolerance'},
'jackfactor': {'type': float,
'tooltip': 'pick is removed if the variance of the subgroup with the pick removed is larger than the mean variance of all subgroups times safety factor',
'value': 5.0,
'namestring': 'Jackknife safety factor'},
'WAscaling': {'type': (float, float, float),
'tooltip': 'Scaling relation (log(Ao)+Alog(r)+Br+C) of Wood-Anderson amplitude Ao [nm] \
If zeros are set, original Richter magnitude is calculated!',
'value': (0., 0., 0.),
'namestring': ('Wood-Anderson scaling', '', '', '')},
'magscaling': {'type': (float, float),
'tooltip': 'Scaling relation for derived local magnitude [a*Ml+b]. \
If zeros are set, no scaling of network magnitude is applied!',
'value': (0., 0.),
'namestring': ('Local mag. scaling', '', '')},
'minfreq': {'type': (float, float),
'tooltip': 'Lower filter frequency [P, S]',
'value': (1.0, 1.0),
'namestring': ('Lower freq.', 'P', 'S')},
'maxfreq': {'type': (float, float),
'tooltip': 'Upper filter frequency [P, S]',
'value': (10.0, 10.0),
'namestring': ('Upper freq.', 'P', 'S')},
'filter_order': {'type': (int, int),
'tooltip': 'filter order [P, S]',
'value': (2, 2),
'namestring': ('Order', 'P', 'S')},
'filter_type': {'type': (str, str),
'tooltip': 'filter type (bandpass, bandstop, lowpass, highpass) [P, S]',
'value': ('bandpass', 'bandpass'),
'namestring': ('Type', 'P', 'S')},
'use_taup': {'type': bool,
'tooltip': 'use estimated traveltimes from TauPy for calculating windows for CF',
'value': True,
'namestring': 'Use TauPy'},
'taup_model': {'type': str,
'tooltip': 'define TauPy model for traveltime estimation. Possible values: 1066a, 1066b, ak135, ak135f, herrin, iasp91, jb, prem, pwdk, sp6',
'value': 'iasp91',
'namestring': 'TauPy model'}
}
settings_main = {
'dirs': [
'rootpath',
'datapath',
'database',
'eventID',
'invdir',
'datastructure',
'apverbose'],
'nlloc': [
'nllocbin',
'nllocroot',
'phasefile',
'ctrfile',
'ttpatter',
'outpatter'],
'smoment': [
'vp',
'rho',
'Qp'],
'localmag': [
'WAscaling',
'magscaling'],
'filter': [
'minfreq',
'maxfreq',
'filter_order',
'filter_type'],
'pick': [
'extent',
'pstart',
'pstop',
'sstart',
'sstop',
'use_taup',
'taup_model',
'bpz1',
'bpz2',
'bph1',
'bph2']
}
settings_special_pick = {
'z': [
'algoP',
'tlta',
'hosorder',
'Parorder',
'tdet1z',
'tpred1z',
'tdet2z',
'tpred2z',
'addnoise',
'tsnrz',
'pickwinP',
'Precalcwin',
'aictsmooth',
'tsmoothP',
'ausP',
'nfacP',
'checkwindowP',
'minfactorP'],
'h': [
'algoS',
'tdet1h',
'tpred1h',
'tdet2h',
'tpred2h',
'Sarorder',
'Srecalcwin',
'pickwinS',
'tsnrh',
'aictsmoothS',
'tsmoothS',
'ausS',
'nfacS',
'checkwindowS',
'minfactorS'],
'fm': [
'minfmweight',
'minFMSNR',
'fmpickwin'],
'quality': [
'timeerrorsP',
'timeerrorsS',
'minAICPslope',
'minAICPSNR',
'minAICSslope',
'minAICSSNR',
'minsiglength',
'noisefactor',
'minpercent',
'zfac',
'mdttolerance',
'wdttolerance',
'jackfactor'],
}

371
pylot/core/io/inputs.py Normal file
View File

@@ -0,0 +1,371 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pylot.core.io import default_parameters
from pylot.core.util.errors import ParameterError
class PylotParameter(object):
'''
PylotParameter is a parameter type object capable to read and/or write
parameter ASCII.
:param fn str: Filename of the input file
Parameters are given for example as follows:
========== ========== =======================================
Name Value Comment
========== ========== =======================================
phl S # phaselabel
ff1 0.1 # freqmin
ff2 0.5 # freqmax
tdet 6.875 # det-window_(s)_for_ar
tpred 2.5 # pred-window_(s)_for_ar
order 4 # order_of_ar
fnoise 0 # noise_level_for_ar
suppp 7 # envelopecoeff
tolt 300 # (s)time around arrival time
f1tpwt 4 # propfact_minfreq_secondtaper
pickwindow 9 # length_of_pick_window
w1 1 # length_of_smoothing_window
w2 0.37 # cf(i-1)*(1+peps)_for_local_min
w3 0.25 # cf(i-1)*(1+peps)_for_local_min
tslope 0.8;2 # slope_det_window_loc_glob
aerr 30;60 # adjusted_error_slope_fitting_loc_glob
tsn 20;5;20;10 # length_signal_window_S/N
proPh Sn # nextprominentphase
========== ========== =======================================
'''
def __init__(self, fnin=None, fnout=None, verbosity=0, **kwargs):
'''
Initialize parameter object:
io content of an ASCII file an form a type consistent dictionary
contain all parameters.
'''
self.__init_default_paras()
self.__init_subsettings()
self.__filename = fnin
self._verbosity = verbosity
self._parFileCont = {}
# io from parsed arguments alternatively
for key, val in kwargs.items():
self._parFileCont[key] = val
self.from_file()
if fnout:
self.export2File(fnout)
# Human-readable string representation of the object
def __str__(self):
string = ''
string += 'Automated picking parameter:\n\n'
if self.__parameter:
for key, value in self.iteritems():
string += '%s:\t\t%s\n' % (key, value)
else:
string += 'Empty parameter dictionary.'
return string
# Set default values of parameter names
def __init_default_paras(self):
parameters = default_parameters.defaults
self.__defaults = parameters
def __init_subsettings(self):
self._settings_main = default_parameters.settings_main
self._settings_special_pick = default_parameters.settings_special_pick
# String representation of the object
def __repr__(self):
return "PylotParameter('%s')" % self.__filename
# Boolean test
def __nonzero__(self):
return bool(self.__parameter)
def __getitem__(self, key):
try:
return self.__parameter[key]
except:
return None
def __setitem__(self, key, value):
self.__parameter[key] = value
def __delitem__(self, key):
del self.__parameter[key]
def __iter__(self):
return iter(self.__parameter)
def __len__(self):
return len(self.__parameter.keys())
def iteritems(self):
for key, value in self.__parameter.items():
yield key, value
def hasParam(self, parameter):
if parameter in self.__parameter.keys():
return True
return False
def get(self, *args):
try:
for param in args:
try:
return self.__getitem__(param)
except KeyError as e:
self._printParameterError(e)
raise ParameterError(e)
except TypeError:
try:
return self.__getitem__(args)
except KeyError as e:
self._printParameterError(e)
raise ParameterError(e)
def get_defaults(self):
return self.__defaults
def get_main_para_names(self):
return self._settings_main
def get_special_para_names(self):
return self._settings_special_pick
def get_all_para_names(self):
all_names = []
all_names += self.get_main_para_names()['dirs']
all_names += self.get_main_para_names()['nlloc']
all_names += self.get_main_para_names()['smoment']
all_names += self.get_main_para_names()['localmag']
all_names += self.get_main_para_names()['pick']
all_names += self.get_main_para_names()['filter']
all_names += self.get_special_para_names()['z']
all_names += self.get_special_para_names()['h']
all_names += self.get_special_para_names()['fm']
all_names += self.get_special_para_names()['quality']
return all_names
def checkValue(self, param, value):
is_type = type(value)
expect_type = self.get_defaults()[param]['type']
if not is_type == expect_type and not is_type == tuple:
message = 'Type check failed for param: {}, is type: {}, expected type:{}'
message = message.format(param, is_type, expect_type)
print(Warning(message))
def setParamKV(self, param, value):
self.__setitem__(param, value)
def setParam(self, **kwargs):
for key in kwargs:
self.__setitem__(key, kwargs[key])
@staticmethod
def _printParameterError(errmsg):
print('ParameterError:\n non-existent parameter %s' % errmsg)
def reset_defaults(self):
defaults = self.get_defaults()
for param in defaults:
self.setParamKV(param, defaults[param]['value'])
def from_file(self, fnin=None):
if not fnin:
if self.__filename is not None:
fnin = self.__filename
else:
return
if isinstance(fnin, (list, tuple)):
fnin = fnin[0]
inputFile = open(fnin, 'r')
try:
lines = inputFile.readlines()
for line in lines:
parspl = line.split('\t')[:2]
self._parFileCont[parspl[0].strip()] = parspl[1]
except IndexError as e:
if self._verbosity > 0:
self._printParameterError(e)
inputFile.seek(0)
lines = inputFile.readlines()
for line in lines:
if not line.startswith(('#', '%', '\n', ' ')):
parspl = line.split('#')[:2]
self._parFileCont[parspl[1].strip()] = parspl[0].strip()
for key, value in self._parFileCont.items():
try:
val = int(value)
except:
try:
val = float(value)
except:
if len(value.split(' ')) > 1:
vallist = value.strip().split(' ')
val = []
for val0 in vallist:
try:
val0 = float(val0)
except:
pass
val.append(val0)
else:
val = str(value.strip())
self._parFileCont[key] = val
self.__parameter = self._parFileCont
def export2File(self, fnout):
fid_out = open(fnout, 'w')
lines = []
# for key, value in self.iteritems():
# lines.append('{key}\t{value}\n'.format(key=key, value=value))
# fid_out.writelines(lines)
header = ('%This is a parameter input file for PyLoT/autoPyLoT.\n' +
'%All main and special settings regarding data handling\n' +
'%and picking are to be set here!\n' +
'%Parameters are optimized for %{} data sets!\n'.format(self.get_main_para_names()['pick'][0]))
separator = '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n'
fid_out.write(header)
self.write_section(fid_out, self.get_main_para_names()['dirs'],
'main settings', separator)
self.write_section(fid_out, self.get_main_para_names()['nlloc'],
'NLLoc settings', separator)
self.write_section(fid_out, self.get_main_para_names()['smoment'],
'parameters for seismic moment estimation', separator)
self.write_section(fid_out, self.get_main_para_names()['localmag'],
'settings local magnitude', separator)
self.write_section(fid_out, self.get_main_para_names()['filter'],
'filter settings', separator)
self.write_section(fid_out, self.get_main_para_names()['pick'],
'common settings picker', separator)
fid_out.write(('#special settings for calculating CF#\n' +
'%!!Edit the following only if you know what you are doing!!%\n'))
self.write_section(fid_out, self.get_special_para_names()['z'],
'Z-component', None)
self.write_section(fid_out, self.get_special_para_names()['h'],
'H-components', None)
self.write_section(fid_out, self.get_special_para_names()['fm'],
'first-motion picker', None)
self.write_section(fid_out, self.get_special_para_names()['quality'],
'quality assessment', None)
def write_section(self, fid, names, title, separator):
if separator:
fid.write(separator)
fid.write('#{}#\n'.format(title))
l_val = 50
l_name = 15
l_ttip = 100
for name in names:
value = self[name]
if type(value) == list or type(value) == tuple:
value_tmp = ''
for vl in value:
value_tmp += '{} '.format(vl)
value = value_tmp
tooltip = self.get_defaults()[name]['tooltip']
if not len(str(value)) > l_val:
value = '{:<{}} '.format(str(value), l_val)
else:
value = '{} '.format(str(value))
name += '#'
if not len(name) > l_name:
name = '#{:<{}} '.format(name, l_name)
else:
name = '#{} '.format(name)
if not len(tooltip) > l_ttip:
ttip = '%{:<{}}\n'.format(tooltip, l_ttip)
else:
ttip = '%{}\n'.format(tooltip)
line = value + name + ttip
fid.write(line)
class FilterOptions(object):
'''
FilterOptions is a parameter object type providing Butterworth filter
option parameter for PyLoT. Its easy to access properties helps to manage
file based as well as parameter manipulation within the GUI.
:type filtertype: str, optional
:param filtertype: String containing the desired filtertype For information
about the supported filter types see _`Supported Filter` section .
:type freq: list, optional
:param freq: list of float(s) describing the cutoff limits of the filter
:type order: int, optional
:param order: Integer value describing the order of the desired Butterworth
filter.
.. rubric:: _`Supported Filter`
``'bandpass'``
Butterworth-Bandpass
``'bandstop'``
Butterworth-Bandstop
``'lowpass'``
Butterworth-Lowpass
``'highpass'``
Butterworth-Highpass
'''
def __init__(self, filtertype='bandpass', freq=[2., 5.], order=3,
**kwargs):
self._order = order
self._filtertype = filtertype
self._freq = freq
def __str__(self):
hrs = '''\n\tFilter parameter:\n
Type:\t\t{ftype}\n
Frequencies:\t{freq}\n
Order:\t\t{order}\n
'''.format(ftype=self.getFilterType(),
freq=self.getFreq(),
order=self.getOrder())
return hrs
def __nonzero__(self):
return bool(self.getFilterType())
def parseFilterOptions(self):
if self:
robject = {'type': self.getFilterType(), 'corners': self.getOrder()}
if not self.getFilterType() in ['highpass', 'lowpass']:
robject['freqmin'] = self.getFreq()[0]
robject['freqmax'] = self.getFreq()[1]
elif self.getFilterType() == 'highpass':
robject['freq'] = self.getFreq()[0]
elif self.getFilterType() == 'lowpass':
robject['freq'] = self.getFreq()[1]
return robject
return None
def getFreq(self):
return self.__getattribute__('_freq')
def setFreq(self, freq):
self.__setattr__('_freq', freq)
def getOrder(self):
return self.__getattribute__('_order')
def setOrder(self, order):
self.__setattr__('_order', order)
def getFilterType(self):
return self.__getattribute__('_filtertype')
def setFilterType(self, filtertype):
self.__setattr__('_filtertype', filtertype)

220
pylot/core/io/location.py Normal file
View File

@@ -0,0 +1,220 @@
from obspy import UTCDateTime
from obspy.core import event as ope
from pylot.core.util.utils import getLogin, getHash
def create_amplitude(pickID, amp, unit, category, cinfo):
'''
:param pickID:
:param amp:
:param unit:
:param category:
:param cinfo:
:return:
'''
amplitude = ope.Amplitude()
amplitude.creation_info = cinfo
amplitude.generic_amplitude = amp
amplitude.unit = ope.AmplitudeUnit(unit)
amplitude.type = ope.AmplitudeCategory(category)
amplitude.pick_id = pickID
return amplitude
def create_arrival(pickresID, cinfo, phase, azimuth=None, dist=None):
'''
create_arrival - function to create an Obspy Arrival
:param pickresID: Resource identifier of the created pick
:type pickresID: :class: `~obspy.core.event.ResourceIdentifier` object
:param cinfo: An ObsPy :class: `~obspy.core.event.CreationInfo` object
holding information on the creation of the returned object
:type cinfo: :class: `~obspy.core.event.CreationInfo` object
:param phase: name of the arrivals seismic phase
:type phase: str
:param azimuth: azimuth between source and receiver
:type azimuth: float or int, optional
:param dist: distance between source and receiver
:type dist: float or int, optional
:return: An ObsPy :class: `~obspy.core.event.Arrival` object
'''
arrival = ope.Arrival()
arrival.creation_info = cinfo
arrival.pick_id = pickresID
arrival.phase = phase
if azimuth is not None:
arrival.azimuth = float(azimuth) if azimuth > -180 else azimuth + 360.
else:
arrival.azimuth = azimuth
arrival.distance = dist
return arrival
def create_creation_info(agency_id=None, creation_time=None, author=None):
'''
:param agency_id:
:param creation_time:
:param author:
:return:
'''
if author is None:
author = getLogin()
if creation_time is None:
creation_time = UTCDateTime()
return ope.CreationInfo(agency_id=agency_id, author=author,
creation_time=creation_time)
def create_event(origintime, cinfo, originloc=None, etype='earthquake',
resID=None, authority_id=None):
'''
create_event - funtion to create an ObsPy Event
:param origintime: the events origintime
:type origintime: :class: `~obspy.core.utcdatetime.UTCDateTime` object
:param cinfo: An ObsPy :class: `~obspy.core.event.CreationInfo` object
holding information on the creation of the returned object
:type cinfo: :class: `~obspy.core.event.CreationInfo` object
:param originloc: tuple containing the location of the origin
(LAT, LON, DEP) affiliated with the event which is created
:type originloc: tuple, list
:param etype: Event type str object. converted via ObsPy to a valid event
type string.
:type etype: str
:param resID: Resource identifier of the created event
:type resID: :class: `~obspy.core.event.ResourceIdentifier` object, str
:param authority_id: name of the institution carrying out the processing
:type authority_id: str
:return: An ObsPy :class: `~obspy.core.event.Event` object
'''
if originloc is not None:
o = create_origin(origintime, cinfo,
originloc[0], originloc[1], originloc[2])
else:
o = None
if not resID:
resID = create_resourceID(origintime, etype, authority_id)
elif isinstance(resID, str):
resID = create_resourceID(origintime, etype, authority_id, resID)
elif not isinstance(resID, ope.ResourceIdentifier):
raise TypeError("unsupported type(resID) for resource identifier "
"generation: %s" % type(resID))
event = ope.Event(resource_id=resID)
event.creation_info = cinfo
event.event_type = etype
if o:
event.origins = [o]
return event
def create_magnitude(originID, cinfo):
'''
create_magnitude - function to create an ObsPy Magnitude object
:param originID:
:type originID:
:param cinfo:
:type cinfo:
:return:
'''
magnitude = ope.Magnitude()
magnitude.creation_info = cinfo
magnitude.origin_id = originID
return magnitude
def create_origin(origintime, cinfo, latitude, longitude, depth):
'''
create_origin - function to create an ObsPy Origin
:param origintime: the origins time of occurence
:type origintime: :class: `~obspy.core.utcdatetime.UTCDateTime` object
:param cinfo:
:type cinfo:
:param latitude: latitude in decimal degree of the origins location
:type latitude: float
:param longitude: longitude in decimal degree of the origins location
:type longitude: float
:param depth: hypocentral depth of the origin
:type depth: float
:return: An ObsPy :class: `~obspy.core.event.Origin` object
'''
assert isinstance(origintime, UTCDateTime), "origintime has to be " \
"a UTCDateTime object, but " \
"actually is of type " \
"'%s'" % type(origintime)
origin = ope.Origin()
origin.time = origintime
origin.creation_info = cinfo
origin.latitude = latitude
origin.longitude = longitude
origin.depth = depth
return origin
def create_pick(origintime, picknum, picktime, eventnum, cinfo, phase, station,
wfseedstr, authority_id):
'''
create_pick - function to create an ObsPy Pick
:param origintime:
:type origintime:
:param picknum: number of the created pick
:type picknum: int
:param picktime:
:type picktime:
:param eventnum: human-readable event identifier
:type eventnum: str
:param cinfo: An ObsPy :class: `~obspy.core.event.CreationInfo` object
holding information on the creation of the returned object
:type cinfo: :class: `~obspy.core.event.CreationInfo` object
:param phase: name of the arrivals seismic phase
:type phase: str
:param station: name of the station at which the seismic phase has been
picked
:type station: str
:param wfseedstr: A SEED formatted string of the form
network.station.location.channel in order to set a referenced waveform
:type wfseedstr: str, SEED formatted
:param authority_id: name of the institution carrying out the processing
:type authority_id: str
:return: An ObsPy :class: `~obspy.core.event.Pick` object
'''
pickID = eventnum + '_' + station.strip() + '/{0:03d}'.format(picknum)
pickresID = create_resourceID(origintime, 'pick', authority_id, pickID)
pick = ope.Pick()
pick.resource_id = pickresID
pick.time = picktime
pick.creation_info = cinfo
pick.phase_hint = phase
pick.waveform_id = ope.ResourceIdentifier(id=wfseedstr, prefix='file:/')
return pick
def create_resourceID(timetohash, restype, authority_id=None, hrstr=None):
'''
:param timetohash:
:type timetohash
:param restype: type of the resource, e.g. 'orig', 'earthquake' ...
:type restype: str
:param authority_id: name of the institution carrying out the processing
:type authority_id: str, optional
:param hrstr:
:type hrstr:
:return:
'''
assert isinstance(timetohash, UTCDateTime), "'timetohash' is not an ObsPy" \
"UTCDateTime object"
hid = getHash(timetohash)
if hrstr is None:
resID = ope.ResourceIdentifier(restype + '/' + hid[0:6])
else:
resID = ope.ResourceIdentifier(restype + '/' + hrstr)
if authority_id is not None:
resID.convertIDToQuakeMLURI(authority_id=authority_id)
return resID

1016
pylot/core/io/phases.py Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

28
pylot/core/loc/focmec.py Normal file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pylot.core.io.phases import writephases
from pylot.core.util.version import get_git_version as _getVersionString
__version__ = _getVersionString()
def export(picks, fnout, parameter, eventinfo):
'''
Take <picks> dictionary and exports picking data to a focmec
<phasefile> without creating an ObsPy event object.
:param picks: picking data dictionary
:type picks: dict
:param fnout: complete path to the exporting obs file
:type fnout: str
:param: parameter, all input information
:type: object
:param: eventinfo, source information needed for focmec format
:type: list object
'''
# write phases to FOCMEC-phase file
writephases(picks, 'FOCMEC', fnout, parameter, eventinfo)

28
pylot/core/loc/hash.py Normal file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pylot.core.io.phases import writephases
from pylot.core.util.version import get_git_version as _getVersionString
__version__ = _getVersionString()
def export(picks, fnout, parameter, eventinfo):
'''
Take <picks> dictionary and exports picking data to a HASH
<phasefile> without creating an ObsPy event object.
:param picks: picking data dictionary
:type picks: dict
:param fnout: complete path to the exporting obs file
:type fnout: str
:param: parameter, all input information
:type: object
:param: eventinfo, source information needed for HASH format
:type: list object
'''
# write phases to HASH-phase file
writephases(picks, 'HASH', fnout, parameter, eventinfo)

25
pylot/core/loc/hypo71.py Normal file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pylot.core.io.phases import writephases
from pylot.core.util.version import get_git_version as _getVersionString
__version__ = _getVersionString()
def export(picks, fnout, parameter):
'''
Take <picks> dictionary and exports picking data to a HYPO71
<phasefile> without creating an ObsPy event object.
:param picks: picking data dictionary
:type picks: dict
:param fnout: complete path to the exporting obs file
:type fnout: str
:param: parameter, all input information
:type: object
'''
# write phases to HYPO71-phase file
writephases(picks, 'HYPO71', fnout, parameter)

28
pylot/core/loc/hypodd.py Normal file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pylot.core.io.phases import writephases
from pylot.core.util.version import get_git_version as _getVersionString
__version__ = _getVersionString()
def export(picks, fnout, parameter, eventinfo):
'''
Take <picks> dictionary and exports picking data to a hypoDD
<phasefile> without creating an ObsPy event object.
:param picks: picking data dictionary
:type picks: dict
:param fnout: complete path to the exporting obs file
:type fnout: str
:param: parameter, all input information
:type: object
:param: eventinfo, source information needed for hypoDD format
:type: list object
'''
# write phases to hypoDD-phase file
writephases(picks, 'hypoDD', fnout, parameter, eventinfo)

25
pylot/core/loc/hyposat.py Normal file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pylot.core.io.phases import writephases
from pylot.core.util.version import get_git_version as _getVersionString
__version__ = _getVersionString()
def export(picks, fnout, parameter):
'''
Take <picks> dictionary and exports picking data to a HYPOSAT
<phasefile> without creating an ObsPy event object.
:param picks: picking data dictionary
:type picks: dict
:param fnout: complete path to the exporting obs file
:type fnout: str
:param: parameter, all input information
:type: object
'''
# write phases to HYPOSAT-phase file
writephases(picks, 'HYPOSAT', fnout, parameter)

108
pylot/core/loc/nll.py Normal file
View File

@@ -0,0 +1,108 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import glob
import os
import subprocess
from obspy import read_events
from pylot.core.io.phases import writephases
from pylot.core.util.utils import getPatternLine, runProgram, which
from pylot.core.util.version import get_git_version as _getVersionString
__version__ = _getVersionString()
class NLLocError(EnvironmentError):
pass
def export(picks, fnout, parameter):
'''
Take <picks> dictionary and exports picking data to a NLLOC-obs
<phasefile> without creating an ObsPy event object.
:param picks: picking data dictionary
:type picks: dict
:param fnout: complete path to the exporting obs file
:type fnout: str
:param: parameter, all input information
:type: object
'''
# write phases to NLLoc-phase file
writephases(picks, 'NLLoc', fnout, parameter)
def modify_inputs(ctrfn, root, nllocoutn, phasefn, tttn):
'''
:param ctrfn: name of NLLoc-control file
:type: str
:param root: root path to NLLoc working directory
:type: str
:param nllocoutn: name of NLLoc-location output file
:type: str
:param phasefn: name of NLLoc-input phase file
:type: str
:param tttn: pattern of precalculated NLLoc traveltime tables
:type: str
'''
# For locating the event the NLLoc-control file has to be modified!
# create comment line for NLLoc-control file NLLoc-output file
ctrfile = os.path.join(root, 'run', ctrfn)
nllocout = os.path.join(root, 'loc', nllocoutn)
phasefile = os.path.join(root, 'obs', phasefn)
tttable = os.path.join(root, 'time', tttn)
locfiles = 'LOCFILES %s NLLOC_OBS %s %s 0\n' % (phasefile, tttable, nllocout)
# modification of NLLoc-control file
print("Modifying NLLoc-control file %s ..." % ctrfile)
curlocfiles = getPatternLine(ctrfile, 'LOCFILES')
nllfile = open(ctrfile, 'r')
filedata = nllfile.read()
if filedata.find(locfiles) < 0:
# replace old command
filedata = filedata.replace(curlocfiles, locfiles)
nllfile = open(ctrfile, 'w')
nllfile.write(filedata)
nllfile.close()
def locate(fnin, infile=None):
"""
takes an external program name
:param fnin:
:return:
"""
if infile is None:
exe_path = which('NLLoc')
else:
exe_path = which('NLLoc', infile)
if exe_path is None:
raise NLLocError('NonLinLoc executable not found; check your '
'environment variables')
# locate the event utilizing external NonLinLoc installation
try:
runProgram(exe_path, fnin)
except subprocess.CalledProcessError as e:
raise RuntimeError(e.output)
def read_location(fn):
path, file = os.path.split(fn)
file = glob.glob1(path, file + '.[0-9]*.grid0.loc.hyp')
if len(file) > 1:
raise IOError('ambiguous location name {0}'.format(file))
fn = os.path.join(path, file[0])
return read_events(fn)[0]
if __name__ == '__main__':
pass

28
pylot/core/loc/velest.py Normal file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pylot.core.io.phases import writephases
from pylot.core.util.version import get_git_version as _getVersionString
__version__ = _getVersionString()
def export(picks, fnout, eventinfo, parameter=None):
'''
Take <picks> dictionary and exports picking data to a VELEST-cnv
<phasefile> without creating an ObsPy event object.
:param picks: picking data dictionary
:type picks: dict
:param fnout: complete path to the exporting obs file
:type fnout: str
:param: eventinfo, source time needed for VELEST-cnv format
:type: list object
:param: parameter, all input information
:type: object
'''
# write phases to VELEST-phase file
writephases(picks, 'VELEST', fnout, parameter, eventinfo)

View File

@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
#

1143
pylot/core/pick/autopick.py Normal file

File diff suppressed because it is too large Load Diff

712
pylot/core/pick/charfuns.py Normal file
View File

@@ -0,0 +1,712 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created Oct/Nov 2014
Implementation of the Characteristic Functions (CF) published and described in:
Kueperkoch, L., Meier, T., Lee, J., Friederich, W., & EGELADOS Working Group, 2010:
Automated determination of P-phase arrival times at regional and local distances
using higher order statistics, Geophys. J. Int., 181, 1159-1170
Kueperkoch, L., Meier, T., Bruestle, A., Lee, J., Friederich, W., & EGELADOS
Working Group, 2012: Automated determination of S-phase arrival times using
autoregressive prediction: application ot local and regional distances, Geophys. J. Int.,
188, 687-702.
:author: MAGS2 EP3 working group
"""
import numpy as np
from obspy.core import Stream
class CharacteristicFunction(object):
'''
SuperClass for different types of characteristic functions.
'''
def __init__(self, data, cut, t2=None, order=None, t1=None, fnoise=None, stealthMode=False):
'''
Initialize data type object with information from the original
Seismogram.
:param: data
:type: `~obspy.core.stream.Stream`
:param: cut
:type: tuple
:param: t2
:type: float
:param: order
:type: int
:param: t1
:type: float (optional, only for AR)
:param: fnoise
:type: float (optional, only for AR)
'''
assert isinstance(data, Stream), "%s is not a stream object" % str(data)
self.orig_data = data
self.dt = self.orig_data[0].stats.delta
self.setCut(cut)
self.setTime1(t1)
self.setTime2(t2)
self.setOrder(order)
self.setFnoise(fnoise)
self.setARdetStep(t2)
self.calcCF(self.getDataArray())
self.arpara = np.array([])
self.xpred = np.array([])
self._stealthMode = stealthMode
def __str__(self):
return '''\n\t{name} object:\n
Cut:\t\t{cut}\n
t1:\t{t1}\n
t2:\t{t2}\n
Order:\t\t{order}\n
Fnoise:\t{fnoise}\n
ARdetStep:\t{ardetstep}\n
'''.format(name=type(self).__name__,
cut=self.getCut(),
t1=self.getTime1(),
t2=self.getTime2(),
order=self.getOrder(),
fnoise=self.getFnoise(),
ardetstep=self.getARdetStep[0]())
def getCut(self):
return self.cut
def setCut(self, cut):
self.cut = cut
def getTime1(self):
return self.t1
def setTime1(self, t1):
self.t1 = t1
def getTime2(self):
return self.t2
def setTime2(self, t2):
self.t2 = t2
def getARdetStep(self):
return self.ARdetStep
def setARdetStep(self, t1):
if t1:
self.ARdetStep = []
self.ARdetStep.append(t1 / 4)
self.ARdetStep.append(int(np.ceil(self.getTime2() / self.getIncrement()) / 4))
def getOrder(self):
return self.order
def setOrder(self, order):
self.order = order
def getIncrement(self):
"""
:rtype : int
"""
return self.dt
def getTimeArray(self):
incr = self.getIncrement()
self.TimeArray = np.arange(0, len(self.getCF()) * incr, incr) + self.getCut()[0]
return self.TimeArray
def getFnoise(self):
return self.fnoise
def setFnoise(self, fnoise):
self.fnoise = fnoise
def getCF(self):
return self.cf
def getXCF(self):
return self.xcf
def _getStealthMode(self):
return self._stealthMode()
def getDataArray(self, cut=None):
'''
If cut times are given, time series is cut from cut[0] (start time)
till cut[1] (stop time) in order to calculate CF for certain part
only where you expect the signal!
input: cut (tuple) ()
cutting window
'''
if cut is not None:
if len(self.orig_data) == 1:
if self.cut[0] == 0 and self.cut[1] == 0:
start = 0
stop = len(self.orig_data[0])
elif self.cut[0] == 0 and self.cut[1] is not 0:
start = 0
stop = self.cut[1] / self.dt
else:
start = self.cut[0] / self.dt
stop = self.cut[1] / self.dt
zz = self.orig_data.copy()
z1 = zz[0].copy()
zz[0].data = z1.data[int(start):int(stop)]
data = zz
return data
elif len(self.orig_data) == 2:
if self.cut[0] == 0 and self.cut[1] == 0:
start = 0
stop = min([len(self.orig_data[0]), len(self.orig_data[1])])
elif self.cut[0] == 0 and self.cut[1] is not 0:
start = 0
stop = min([self.cut[1] / self.dt, len(self.orig_data[0]),
len(self.orig_data[1])])
else:
start = max([0, self.cut[0] / self.dt])
stop = min([self.cut[1] / self.dt, len(self.orig_data[0]),
len(self.orig_data[1])])
hh = self.orig_data.copy()
h1 = hh[0].copy()
h2 = hh[1].copy()
hh[0].data = h1.data[int(start):int(stop)]
hh[1].data = h2.data[int(start):int(stop)]
data = hh
return data
elif len(self.orig_data) == 3:
if self.cut[0] == 0 and self.cut[1] == 0:
start = 0
stop = min([self.cut[1] / self.dt, len(self.orig_data[0]),
len(self.orig_data[1]), len(self.orig_data[2])])
elif self.cut[0] == 0 and self.cut[1] is not 0:
start = 0
stop = self.cut[1] / self.dt
else:
start = max([0, self.cut[0] / self.dt])
stop = min([self.cut[1] / self.dt, len(self.orig_data[0]),
len(self.orig_data[1]), len(self.orig_data[2])])
hh = self.orig_data.copy()
h1 = hh[0].copy()
h2 = hh[1].copy()
h3 = hh[2].copy()
hh[0].data = h1.data[int(start):int(stop)]
hh[1].data = h2.data[int(start):int(stop)]
hh[2].data = h3.data[int(start):int(stop)]
data = hh
return data
else:
data = self.orig_data.copy()
return data
def calcCF(self, data=None):
self.cf = data
class AICcf(CharacteristicFunction):
'''
Function to calculate the Akaike Information Criterion (AIC) after
Maeda (1985).
:param: data, time series (whether seismogram or CF)
:type: tuple
Output: AIC function
'''
def calcCF(self, data):
# if self._getStealthMode() is False:
# print 'Calculating AIC ...'
x = self.getDataArray()
xnp = x[0].data
nn = np.isnan(xnp)
if len(nn) > 1:
xnp[nn] = 0
datlen = len(xnp)
k = np.arange(1, datlen)
cf = np.zeros(datlen)
cumsumcf = np.cumsum(np.power(xnp, 2))
i = np.where(cumsumcf == 0)
cumsumcf[i] = np.finfo(np.float64).eps
cf[k] = ((k - 1) * np.log(cumsumcf[k] / k) + (datlen - k + 1) *
np.log((cumsumcf[datlen - 1] - cumsumcf[k - 1]) / (datlen - k + 1)))
cf[0] = cf[1]
inf = np.isinf(cf)
ff = np.where(inf == True)
if len(ff) >= 1:
cf[ff] = 0
self.cf = cf - np.mean(cf)
self.xcf = x
class HOScf(CharacteristicFunction):
'''
Function to calculate skewness (statistics of order 3) or kurtosis
(statistics of order 4), using one long moving window, as published
in Kueperkoch et al. (2010).
'''
def calcCF(self, data):
x = self.getDataArray(self.getCut())
xnp = x[0].data
nn = np.isnan(xnp)
if len(nn) > 1:
xnp[nn] = 0
if self.getOrder() == 3: # this is skewness
# if self._getStealthMode() is False:
# print 'Calculating skewness ...'
y = np.power(xnp, 3)
y1 = np.power(xnp, 2)
elif self.getOrder() == 4: # this is kurtosis
# if self._getStealthMode() is False:
# print 'Calculating kurtosis ...'
y = np.power(xnp, 4)
y1 = np.power(xnp, 2)
# Initialisation
# t2: long term moving window
ilta = int(round(self.getTime2() / self.getIncrement()))
lta = y[0]
lta1 = y1[0]
# moving windows
LTA = np.zeros(len(xnp))
for j in range(0, len(xnp)):
if j < 4:
LTA[j] = 0
elif j <= ilta:
lta = (y[j] + lta * (j - 1)) / j
lta1 = (y1[j] + lta1 * (j - 1)) / j
else:
lta = (y[j] - y[j - ilta]) / ilta + lta
lta1 = (y1[j] - y1[j - ilta]) / ilta + lta1
# define LTA
if self.getOrder() == 3:
LTA[j] = lta / np.power(lta1, 1.5)
elif self.getOrder() == 4:
LTA[j] = lta / np.power(lta1, 2)
# remove NaN's with first not-NaN-value,
# so autopicker doesnt pick discontinuity at start of the trace
ind = np.where(~np.isnan(LTA))[0]
if ind.size:
first = ind[0]
LTA[:first] = LTA[first]
self.cf = LTA
self.xcf = x
class ARZcf(CharacteristicFunction):
def calcCF(self, data):
print('Calculating AR-prediction error from single trace ...')
x = self.getDataArray(self.getCut())
xnp = x[0].data
nn = np.isnan(xnp)
if len(nn) > 1:
xnp[nn] = 0
# some parameters needed
# add noise to time series
xnoise = xnp + np.random.normal(0.0, 1.0, len(xnp)) * self.getFnoise() * max(abs(xnp))
tend = len(xnp)
# Time1: length of AR-determination window [sec]
# Time2: length of AR-prediction window [sec]
ldet = int(round(self.getTime1() / self.getIncrement())) # length of AR-determination window [samples]
lpred = int(np.ceil(self.getTime2() / self.getIncrement())) # length of AR-prediction window [samples]
cf = np.zeros(len(xnp))
loopstep = self.getARdetStep()
arcalci = ldet + self.getOrder() # AR-calculation index
for i in range(ldet + self.getOrder(), tend - lpred - 1):
if i == arcalci:
# determination of AR coefficients
# to speed up calculation, AR-coefficients are calculated only every i+loopstep[1]!
self.arDetZ(xnoise, self.getOrder(), i - ldet, i)
arcalci = arcalci + loopstep[1]
# AR prediction of waveform using calculated AR coefficients
self.arPredZ(xnp, self.arpara, i + 1, lpred)
# prediction error = CF
cf[i + lpred - 1] = np.sqrt(np.sum(np.power(self.xpred[i:i + lpred - 1] - xnp[i:i + lpred - 1], 2)) / lpred)
nn = np.isnan(cf)
if len(nn) > 1:
cf[nn] = 0
# remove zeros and artefacts
tap = np.hanning(len(cf))
cf = tap * cf
io = np.where(cf == 0)
ino = np.where(cf > 0)
cf[io] = cf[ino[0][0]]
self.cf = cf
self.xcf = x
def arDetZ(self, data, order, rind, ldet):
'''
Function to calculate AR parameters arpara after Thomas Meier (CAU), published
in Kueperkoch et al. (2012). This function solves SLE using the Moore-
Penrose inverse, i.e. the least-squares approach.
:param: data, time series to calculate AR parameters from
:type: array
:param: order, order of AR process
:type: int
:param: rind, first running summation index
:type: int
:param: ldet, length of AR-determination window (=end of summation index)
:type: int
Output: AR parameters arpara
'''
# recursive calculation of data vector (right part of eq. 6.5 in Kueperkoch et al. (2012)
rhs = np.zeros(self.getOrder())
for k in range(0, self.getOrder()):
for i in range(rind, ldet + 1):
ki = k + 1
rhs[k] = rhs[k] + data[i] * data[i - ki]
# recursive calculation of data array (second sum at left part of eq. 6.5 in Kueperkoch et al. 2012)
A = np.zeros((self.getOrder(), self.getOrder()))
for k in range(1, self.getOrder() + 1):
for j in range(1, k + 1):
for i in range(rind, ldet + 1):
ki = k - 1
ji = j - 1
A[ki, ji] = A[ki, ji] + data[i - j] * data[i - k]
A[ji, ki] = A[ki, ji]
# apply Moore-Penrose inverse for SVD yielding the AR-parameters
self.arpara = np.dot(np.linalg.pinv(A), rhs)
def arPredZ(self, data, arpara, rind, lpred):
'''
Function to predict waveform, assuming an autoregressive process of order
p (=size(arpara)), with AR parameters arpara calculated in arDet. After
Thomas Meier (CAU), published in Kueperkoch et al. (2012).
:param: data, time series to be predicted
:type: array
:param: arpara, AR parameters
:type: float
:param: rind, first running summation index
:type: int
:param: lpred, length of prediction window (=end of summation index)
:type: int
Output: predicted waveform z
'''
# be sure of the summation indeces
if rind < len(arpara):
rind = len(arpara)
if rind > len(data) - lpred:
rind = len(data) - lpred
if lpred < 1:
lpred = 1
if lpred > len(data) - 2:
lpred = len(data) - 2
z = np.append(data[0:rind], np.zeros(lpred))
for i in range(rind, rind + lpred):
for j in range(1, len(arpara) + 1):
ji = j - 1
z[i] = z[i] + arpara[ji] * z[i - j]
self.xpred = z
class ARHcf(CharacteristicFunction):
def calcCF(self, data):
print('Calculating AR-prediction error from both horizontal traces ...')
xnp = self.getDataArray(self.getCut())
n0 = np.isnan(xnp[0].data)
if len(n0) > 1:
xnp[0].data[n0] = 0
n1 = np.isnan(xnp[1].data)
if len(n1) > 1:
xnp[1].data[n1] = 0
# some parameters needed
# add noise to time series
xenoise = xnp[0].data + np.random.normal(0.0, 1.0, len(xnp[0].data)) * self.getFnoise() * max(abs(xnp[0].data))
xnnoise = xnp[1].data + np.random.normal(0.0, 1.0, len(xnp[1].data)) * self.getFnoise() * max(abs(xnp[1].data))
Xnoise = np.array([xenoise.tolist(), xnnoise.tolist()])
tend = len(xnp[0].data)
# Time1: length of AR-determination window [sec]
# Time2: length of AR-prediction window [sec]
ldet = int(round(self.getTime1() / self.getIncrement())) # length of AR-determination window [samples]
lpred = int(np.ceil(self.getTime2() / self.getIncrement())) # length of AR-prediction window [samples]
cf = np.zeros(len(xenoise))
loopstep = self.getARdetStep()
arcalci = lpred + self.getOrder() - 1 # AR-calculation index
# arcalci = ldet + self.getOrder() - 1 #AR-calculation index
for i in range(lpred + self.getOrder() - 1, tend - 2 * lpred + 1):
if i == arcalci:
# determination of AR coefficients
# to speed up calculation, AR-coefficients are calculated only every i+loopstep[1]!
self.arDetH(Xnoise, self.getOrder(), i - ldet, i)
arcalci = arcalci + loopstep[1]
# AR prediction of waveform using calculated AR coefficients
self.arPredH(xnp, self.arpara, i + 1, lpred)
# prediction error = CF
cf[i + lpred] = np.sqrt(np.sum(np.power(self.xpred[0][i:i + lpred] - xnp[0][i:i + lpred], 2) \
+ np.power(self.xpred[1][i:i + lpred] - xnp[1][i:i + lpred], 2)) / (
2 * lpred))
nn = np.isnan(cf)
if len(nn) > 1:
cf[nn] = 0
# remove zeros and artefacts
tap = np.hanning(len(cf))
cf = tap * cf
io = np.where(cf == 0)
ino = np.where(cf > 0)
cf[io] = cf[ino[0][0]]
self.cf = cf
self.xcf = xnp
def arDetH(self, data, order, rind, ldet):
'''
Function to calculate AR parameters arpara after Thomas Meier (CAU), published
in Kueperkoch et al. (2012). This function solves SLE using the Moore-
Penrose inverse, i.e. the least-squares approach. "data" is a structured array.
AR parameters are calculated based on both horizontal components in order
to account for polarization.
:param: data, horizontal component seismograms to calculate AR parameters from
:type: structured array
:param: order, order of AR process
:type: int
:param: rind, first running summation index
:type: int
:param: ldet, length of AR-determination window (=end of summation index)
:type: int
Output: AR parameters arpara
'''
# recursive calculation of data vector (right part of eq. 6.5 in Kueperkoch et al. (2012)
rhs = np.zeros(self.getOrder())
for k in range(0, self.getOrder()):
for i in range(rind, ldet):
rhs[k] = rhs[k] + data[0, i] * data[0, i - k] + data[1, i] * data[1, i - k]
# recursive calculation of data array (second sum at left part of eq. 6.5 in Kueperkoch et al. 2012)
A = np.zeros((4, 4))
for k in range(1, self.getOrder() + 1):
for j in range(1, k + 1):
for i in range(rind, ldet):
ki = k - 1
ji = j - 1
A[ki, ji] = A[ki, ji] + data[0, i - ji] * data[0, i - ki] + data[1, i - ji] * data[1, i - ki]
A[ji, ki] = A[ki, ji]
# apply Moore-Penrose inverse for SVD yielding the AR-parameters
self.arpara = np.dot(np.linalg.pinv(A), rhs)
def arPredH(self, data, arpara, rind, lpred):
'''
Function to predict waveform, assuming an autoregressive process of order
p (=size(arpara)), with AR parameters arpara calculated in arDet. After
Thomas Meier (CAU), published in Kueperkoch et al. (2012).
:param: data, horizontal component seismograms to be predicted
:type: structured array
:param: arpara, AR parameters
:type: float
:param: rind, first running summation index
:type: int
:param: lpred, length of prediction window (=end of summation index)
:type: int
Output: predicted waveform z
:type: structured array
'''
# be sure of the summation indeces
if rind < len(arpara) + 1:
rind = len(arpara) + 1
if rind > len(data[0]) - lpred + 1:
rind = len(data[0]) - lpred + 1
if lpred < 1:
lpred = 1
if lpred > len(data[0]) - 1:
lpred = len(data[0]) - 1
z1 = np.append(data[0][0:rind], np.zeros(lpred))
z2 = np.append(data[1][0:rind], np.zeros(lpred))
for i in range(rind, rind + lpred):
for j in range(1, len(arpara) + 1):
ji = j - 1
z1[i] = z1[i] + arpara[ji] * z1[i - ji]
z2[i] = z2[i] + arpara[ji] * z2[i - ji]
z = np.array([z1.tolist(), z2.tolist()])
self.xpred = z
class AR3Ccf(CharacteristicFunction):
def calcCF(self, data):
print('Calculating AR-prediction error from all 3 components ...')
xnp = self.getDataArray(self.getCut())
n0 = np.isnan(xnp[0].data)
if len(n0) > 1:
xnp[0].data[n0] = 0
n1 = np.isnan(xnp[1].data)
if len(n1) > 1:
xnp[1].data[n1] = 0
n2 = np.isnan(xnp[2].data)
if len(n2) > 1:
xnp[2].data[n2] = 0
# some parameters needed
# add noise to time series
xenoise = xnp[0].data + np.random.normal(0.0, 1.0, len(xnp[0].data)) * self.getFnoise() * max(abs(xnp[0].data))
xnnoise = xnp[1].data + np.random.normal(0.0, 1.0, len(xnp[1].data)) * self.getFnoise() * max(abs(xnp[1].data))
xznoise = xnp[2].data + np.random.normal(0.0, 1.0, len(xnp[2].data)) * self.getFnoise() * max(abs(xnp[2].data))
Xnoise = np.array([xenoise.tolist(), xnnoise.tolist(), xznoise.tolist()])
tend = len(xnp[0].data)
# Time1: length of AR-determination window [sec]
# Time2: length of AR-prediction window [sec]
ldet = int(round(self.getTime1() / self.getIncrement())) # length of AR-determination window [samples]
lpred = int(np.ceil(self.getTime2() / self.getIncrement())) # length of AR-prediction window [samples]
cf = np.zeros(len(xenoise))
loopstep = self.getARdetStep()
arcalci = ldet + self.getOrder() - 1 # AR-calculation index
for i in range(ldet + self.getOrder() - 1, tend - 2 * lpred + 1):
if i == arcalci:
# determination of AR coefficients
# to speed up calculation, AR-coefficients are calculated only every i+loopstep[1]!
self.arDet3C(Xnoise, self.getOrder(), i - ldet, i)
arcalci = arcalci + loopstep[1]
# AR prediction of waveform using calculated AR coefficients
self.arPred3C(xnp, self.arpara, i + 1, lpred)
# prediction error = CF
cf[i + lpred] = np.sqrt(np.sum(np.power(self.xpred[0][i:i + lpred] - xnp[0][i:i + lpred], 2) \
+ np.power(self.xpred[1][i:i + lpred] - xnp[1][i:i + lpred], 2) \
+ np.power(self.xpred[2][i:i + lpred] - xnp[2][i:i + lpred], 2)) / (
3 * lpred))
nn = np.isnan(cf)
if len(nn) > 1:
cf[nn] = 0
# remove zeros and artefacts
tap = np.hanning(len(cf))
cf = tap * cf
io = np.where(cf == 0)
ino = np.where(cf > 0)
cf[io] = cf[ino[0][0]]
self.cf = cf
self.xcf = xnp
def arDet3C(self, data, order, rind, ldet):
'''
Function to calculate AR parameters arpara after Thomas Meier (CAU), published
in Kueperkoch et al. (2012). This function solves SLE using the Moore-
Penrose inverse, i.e. the least-squares approach. "data" is a structured array.
AR parameters are calculated based on both horizontal components and vertical
componant.
:param: data, horizontal component seismograms to calculate AR parameters from
:type: structured array
:param: order, order of AR process
:type: int
:param: rind, first running summation index
:type: int
:param: ldet, length of AR-determination window (=end of summation index)
:type: int
Output: AR parameters arpara
'''
# recursive calculation of data vector (right part of eq. 6.5 in Kueperkoch et al. (2012)
rhs = np.zeros(self.getOrder())
for k in range(0, self.getOrder()):
for i in range(rind, ldet):
rhs[k] = rhs[k] + data[0, i] * data[0, i - k] + data[1, i] * data[1, i - k] \
+ data[2, i] * data[2, i - k]
# recursive calculation of data array (second sum at left part of eq. 6.5 in Kueperkoch et al. 2012)
A = np.zeros((4, 4))
for k in range(1, self.getOrder() + 1):
for j in range(1, k + 1):
for i in range(rind, ldet):
ki = k - 1
ji = j - 1
A[ki, ji] = A[ki, ji] + data[0, i - ji] * data[0, i - ki] + data[1, i - ji] * data[1, i - ki] \
+ data[2, i - ji] * data[2, i - ki]
A[ji, ki] = A[ki, ji]
# apply Moore-Penrose inverse for SVD yielding the AR-parameters
self.arpara = np.dot(np.linalg.pinv(A), rhs)
def arPred3C(self, data, arpara, rind, lpred):
'''
Function to predict waveform, assuming an autoregressive process of order
p (=size(arpara)), with AR parameters arpara calculated in arDet3C. After
Thomas Meier (CAU), published in Kueperkoch et al. (2012).
:param: data, horizontal and vertical component seismograms to be predicted
:type: structured array
:param: arpara, AR parameters
:type: float
:param: rind, first running summation index
:type: int
:param: lpred, length of prediction window (=end of summation index)
:type: int
Output: predicted waveform z
:type: structured array
'''
# be sure of the summation indeces
if rind < len(arpara) + 1:
rind = len(arpara) + 1
if rind > len(data[0]) - lpred + 1:
rind = len(data[0]) - lpred + 1
if lpred < 1:
lpred = 1
if lpred > len(data[0]) - 1:
lpred = len(data[0]) - 1
z1 = np.append(data[0][0:rind], np.zeros(lpred))
z2 = np.append(data[1][0:rind], np.zeros(lpred))
z3 = np.append(data[2][0:rind], np.zeros(lpred))
for i in range(rind, rind + lpred):
for j in range(1, len(arpara) + 1):
ji = j - 1
z1[i] = z1[i] + arpara[ji] * z1[i - ji]
z2[i] = z2[i] + arpara[ji] * z2[i - ji]
z3[i] = z3[i] + arpara[ji] * z3[i - ji]
z = np.array([z1.tolist(), z2.tolist(), z3.tolist()])
self.xpred = z

515
pylot/core/pick/compare.py Normal file
View File

@@ -0,0 +1,515 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import copy
import operator
import os
import matplotlib.pyplot as plt
import numpy as np
from obspy import read_events
from obspy.core import AttribDict
from pylot.core.io.phases import picksdict_from_picks
from pylot.core.util.pdf import ProbabilityDensityFunction
from pylot.core.util.utils import find_in_list
from pylot.core.util.version import get_git_version as _getVersionString
__version__ = _getVersionString()
__author__ = 'sebastianw'
class Comparison(object):
"""
A Comparison object contains information on the evaluated picks' probability
density function and compares these in terms of building the difference of
compared pick sets. The results can be displayed as histograms showing its
properties.
"""
def __init__(self, **kwargs):
self._pdfs = dict()
names = self.iter_kwargs(kwargs)
if len(names) > 2:
raise ValueError('Comparison is only defined for two '
'arguments!')
self._names = names
self._compare = self.compare_picksets()
def __nonzero__(self):
if not len(self.names) == 2 or not self._pdfs:
return False
return True
def iter_kwargs(self, kwargs):
names = list()
for name, fn in kwargs.items():
if name == 'eventlist':
names = self.init_by_eventlist(fn)
break
if isinstance(fn, PDFDictionary):
self._pdfs[name] = fn
elif isinstance(fn, dict) or isinstance(fn, AttribDict):
self._pdfs[name] = PDFDictionary(fn)
else:
self._pdfs[name] = PDFDictionary.from_quakeml(fn)
names.append(name)
return names
def init_by_eventlist(self, eventlist):
# create one dictionary containing all picks for all events (therefore modify station key)
global_picksdict = {}
for event in eventlist:
automanu = {'manu': event.pylot_picks,
'auto': event.pylot_autopicks}
for method, picksdict in automanu.items():
if not method in global_picksdict.keys():
global_picksdict[method] = {}
for station, picks in picksdict.items():
new_picksdict = global_picksdict[method]
# new id combining event and station in one dictionary for all events
id = '{}_{}'.format(event.pylot_id, station)
new_picksdict[id] = picks
for method, picksdict in global_picksdict.items():
self._pdfs[method] = PDFDictionary(picksdict)
names = list(global_picksdict.keys())
return names
def get(self, name):
return self._pdfs[name]
@property
def names(self):
return self._names
@names.setter
def names(self, names):
assert isinstance(names, list) and len(names) == 2, 'variable "names"' \
' is either not a' \
' list or its ' \
'length is not 2:' \
'names : {names}'.format(
names=names)
self._names = names
@property
def comparison(self):
return self._compare
@property
def stations(self):
return self.comparison.keys()
@property
def nstations(self):
return len(self.stations)
def compare_picksets(self, type='exp'):
"""
Compare two picksets A and B and return a dictionary compiling the results.
Comparison is carried out with the help of pdf representation of the picks
and a probabilistic approach to the time difference of two onset
measurements.
:param a: filename for pickset A
:type a: str
:param b: filename for pickset B
:type b: str
:return: dictionary containing the resulting comparison pdfs for all picks
:rtype: dict
"""
compare_pdfs = dict()
pdf_a = self.get(self.names[0]).generate_pdf_data(type)
pdf_b = self.get(self.names[1]).generate_pdf_data(type)
for station, phases in pdf_a.items():
if station in pdf_b.keys():
compare_pdf = dict()
for phase in phases:
if phase in pdf_b[station].keys():
compare_pdf[phase] = phases[phase] - pdf_b[station][
phase]
if compare_pdf is not None:
compare_pdfs[station] = compare_pdf
return compare_pdfs
def plot(self, stations=None):
if stations is None:
nstations = self.nstations
stations = self.stations
else:
nstations = len(stations)
istations = range(nstations)
fig, axarr = plt.subplots(nstations, 2, sharex='col', sharey='row')
for n in istations:
station = stations[n]
if station not in self.comparison.keys():
continue
compare_pdf = self.comparison[station]
for l, phase in enumerate(compare_pdf.keys()):
axarr[n, l].plot(compare_pdf[phase].axis,
compare_pdf[phase].data)
if n is 0:
axarr[n, l].set_title(phase)
if l is 0:
axann = axarr[n, l].annotate(station, xy=(.05, .5),
xycoords='axes fraction')
bbox_props = dict(boxstyle='round', facecolor='lightgrey',
alpha=.7)
axann.set_bbox(bbox_props)
if n == int(np.median(istations)) and l is 0:
label = 'probability density (qualitative)'
axarr[n, l].set_ylabel(label)
plt.setp([a.get_xticklabels() for a in axarr[0, :]], visible=False)
plt.setp([a.get_yticklabels() for a in axarr[:, 1]], visible=False)
plt.setp([a.get_yticklabels() for a in axarr[:, 0]], visible=False)
plt.show()
def get_all(self, phasename):
pdf_dict = self.comparison
rlist = list()
for phases in pdf_dict.values():
try:
rlist.append(phases[phasename])
except KeyError:
continue
return rlist
def get_array(self, phase, method_name):
method = operator.methodcaller(method_name)
pdf_list = self.get_all(phase)
rarray = list(map(method, pdf_list))
return np.array(rarray)
def get_expectation_array(self, phase):
return self.get_array(phase, 'expectation')
def get_std_array(self, phase):
return self.get_array(phase, 'standard_deviation')
def hist_expectation(self, phases='all', bins=20, normed=False):
phases.strip()
if phases.find('all') is 0:
phases = 'ps'
phases = phases.upper()
nsp = len(phases)
fig, axarray = plt.subplots(1, nsp, sharey=True)
for n, phase in enumerate(phases):
ax = axarray[n]
data = self.get_expectation_array(phase)
xlims = [min(data), max(data)]
ax.hist(data, range=xlims, bins=bins, normed=normed)
title_str = 'phase: {0}, samples: {1}'.format(phase, len(data))
ax.set_title(title_str)
ax.set_xlabel('expectation [s]')
if n is 0:
ax.set_ylabel('abundance [-]')
plt.setp([a.get_yticklabels() for a in axarray[1:]], visible=False)
plt.show()
def hist_standard_deviation(self, phases='all', bins=20, normed=False):
phases.strip()
if phases.find('all') == 0:
phases = 'ps'
phases = phases.upper()
nsp = len(phases)
fig, axarray = plt.subplots(1, nsp, sharey=True)
for n, phase in enumerate(phases):
ax = axarray[n]
data = self.get_std_array(phase)
xlims = [min(data), max(data)]
ax.hist(data, range=xlims, bins=bins, normed=normed)
title_str = 'phase: {0}, samples: {1}'.format(phase, len(data))
ax.set_title(title_str)
ax.set_xlabel('standard deviation [s]')
if n is 0:
ax.set_ylabel('abundance [-]')
plt.setp([a.get_yticklabels() for a in axarray[1:]], visible=False)
plt.show()
def hist(self, type='std'):
pass
class PDFDictionary(object):
"""
A PDFDictionary is a dictionary like object containing structured data on
the probability density function of seismic phase onsets.
"""
def __init__(self, data):
self._pickdata = data
self._pdfdata = self.generate_pdf_data()
def __nonzero__(self):
if len(self.pick_data) < 1:
return False
else:
return True
def __getitem__(self, item):
return self.pdf_data[item]
@property
def pdf_data(self):
return self._pdfdata
@pdf_data.setter
def pdf_data(self, data):
self._pdfdata = data
@property
def pick_data(self):
return self._pickdata
@pick_data.setter
def pick_data(self, data):
self._pickdata = data
@property
def stations(self):
return self.pick_data.keys()
@property
def nstations(self):
return len(self.stations)
@classmethod
def from_quakeml(self, fn):
return PDFDictionary(fn)
def get_all(self, phase):
rlist = list()
for phases in self.pdf_data.values():
try:
rlist.append(phases[phase])
except KeyError:
continue
return rlist
def generate_pdf_data(self, type='exp'):
"""
Returns probabiliy density function dictionary containing the
representation of the actual pick_data.
:param type: type of the returned
`~pylot.core.util.pdf.ProbabilityDensityFunction` object
:type type: str
:return: a dictionary containing the picks represented as pdfs
"""
pdf_picks = copy.deepcopy(self.pick_data)
for station, phases in pdf_picks.items():
for phase, values in phases.items():
if phase not in 'PS':
continue
phases[phase] = ProbabilityDensityFunction.from_pick(
values['epp'],
values['mpp'],
values['lpp'],
type=type)
return pdf_picks
def plot(self, stations=None):
'''
plots the all probability density function for either desired STATIONS
or all available date
:param stations: list of stations to be plotted
:type stations: list
:return: matplotlib figure object containing the plot
'''
assert stations is not None or not isinstance(stations, list), \
'parameter stations should be a list not {0}'.format(type(stations))
if not stations:
nstations = self.nstations
stations = self.stations
else:
nstations = len(stations)
istations = range(nstations)
fig, axarr = plt.subplots(nstations, 2, sharex='col', sharey='row')
hide_labels = True
for n in istations:
station = stations[n]
pdfs = self.pdf_data[station]
for l, phase in enumerate(pdfs.keys()):
try:
axarr[n, l].plot(pdfs[phase].axis, pdfs[phase].data())
if n is 0:
axarr[n, l].set_title(phase)
if l is 0:
axann = axarr[n, l].annotate(station, xy=(.05, .5),
xycoords='axes fraction')
bbox_props = dict(boxstyle='round', facecolor='lightgrey',
alpha=.7)
axann.set_bbox(bbox_props)
if n == int(np.median(istations)) and l is 0:
label = 'probability density (qualitative)'
axarr[n, l].set_ylabel(label)
except IndexError as e:
print('trying aligned plotting\n{0}'.format(e))
hide_labels = False
axarr[l].plot(pdfs[phase].axis, pdfs[phase].data())
axarr[l].set_title(phase)
if l is 0:
axann = axarr[l].annotate(station, xy=(.05, .5),
xycoords='axes fraction')
bbox_props = dict(boxstyle='round', facecolor='lightgrey',
alpha=.7)
axann.set_bbox(bbox_props)
if hide_labels:
plt.setp([a.get_xticklabels() for a in axarr[0, :]], visible=False)
plt.setp([a.get_yticklabels() for a in axarr[:, 1]], visible=False)
plt.setp([a.get_yticklabels() for a in axarr[:, 0]], visible=False)
return fig
class PDFstatistics(object):
"""
This object can be used to get various statistic values from probabillity density functions.
Takes a path as argument.
"""
def __init__(self, directory):
"""Initiates some values needed when dealing with pdfs later"""
self._rootdir = directory
self._evtlist = list()
self._rphase = None
self.make_fnlist()
def make_fnlist(self, fn_pattern='*.xml'):
"""
Takes a file pattern and searches for that recursively in the set path for the object.
:param fn_pattern: A pattern that can identify all datafiles. Default Value = '*.xml'
:type fn_pattern: string
:return: creates a list of events saved in the PDFstatistics object.
"""
evtlist = list()
for root, _, files in os.walk(self.root):
for file in files:
if file.endswith(fn_pattern[1:]):
evtlist.append(os.path.join(root, file))
self._evtlist = evtlist
def __iter__(self):
for evt in self._evtlist:
yield PDFDictionary.from_quakeml(evt)
def __getitem__(self, item):
evt = find_in_list(self._evtlist, item)
if evt:
return PDFDictionary.from_quakeml(evt)
return None
@property
def root(self):
return self._rootdir
@root.setter
def root(self, value):
if os.path.exists(value):
self._rootdir = value
else:
raise ValueError("path doesn't exist: %s" % value)
@property
def curphase(self):
"""
return the current phase type of interest
:return: current phase
"""
return self._rphase
@curphase.setter
def curphase(self, type):
"""
setter method for property curphase
:param type: specify the phase type of interest
:type type: string ('p' or 's')
:return: -
"""
if type.upper() not in 'PS':
raise ValueError("phase type must be either 'P' or 'S'!")
else:
self._rphase = type.upper()
def get(self, property='std', value=None):
"""
takes a property str and a probability value and returns all
property's values for the current phase of interest
:func:`self.curphase`
:param property: property name (default: 'std')
:type property: str
:param value: probability value :math:\alpha
:type value: float
:return: list containing all property's values
"""
assert isinstance(self.curphase,
str), 'phase has to be set before being ' \
'able to iterate over items...'
rlist = []
method_options = dict(STD='standard_deviation',
Q='quantile',
QD='quantile_distance',
QDF='quantile_dist_frac')
# create method caller for easy mapping
if property.upper() == 'STD':
method = operator.methodcaller(method_options[property.upper()])
elif value is not None:
try:
method = operator.methodcaller(method_options[property.upper()],
value)
except KeyError:
raise KeyError('unknwon property: {0}'.format(property.upper()))
else:
raise ValueError("for call to method {0} value has to be "
"defined but is 'None' ".format(method_options[
property.upper()]))
for pdf_dict in self:
# create worklist
wlist = pdf_dict.get_all(self.curphase)
# map method calls to object in worklist
rlist += map(method, wlist)
return rlist
def writeThetaToFile(self, array, out_dir):
"""
Method to write array like data to file. Useful since acquiring can take
serious amount of time when dealing with large databases.
:param array: List of values.
:type array: list
:param out_dir: Path to save file to including file name.
:type out_dir: str
:return: Saves a file at given output directory.
"""
fid = open(os.path.join(out_dir), 'w')
for val in array:
fid.write(str(val) + '\n')
fid.close()
def main():
root_dir = '/home/sebastianp/Codetesting/xmls/'
Insheim = PDFstatistics(root_dir)
Insheim.curphase = 'p'
qdlist = Insheim.get('qdf', 0.2)
print(qdlist)
if __name__ == "__main__":
import cProfile
pr = cProfile.Profile()
pr.enable()
main()
pr.disable()
# after your program ends
pr.print_stats(sort="calls")

501
pylot/core/pick/picker.py Normal file
View File

@@ -0,0 +1,501 @@
# -*- coding: utf-8 -*-
"""
Created Dec 2014 to Feb 2015
Implementation of the automated picking algorithms published and described in:
Kueperkoch, L., Meier, T., Lee, J., Friederich, W., & Egelados Working Group, 2010:
Automated determination of P-phase arrival times at regional and local distances
using higher order statistics, Geophys. J. Int., 181, 1159-1170
Kueperkoch, L., Meier, T., Bruestle, A., Lee, J., Friederich, W., & Egelados
Working Group, 2012: Automated determination of S-phase arrival times using
autoregressive prediction: application ot local and regional distances, Geophys. J. Int.,
188, 687-702.
The picks with the above described algorithms are assumed to be the most likely picks.
For each most likely pick the corresponding earliest and latest possible picks are
calculated after Diehl & Kissling (2009).
:author: MAGS2 EP3 working group / Ludger Kueperkoch
"""
import warnings
import matplotlib.pyplot as plt
import numpy as np
from pylot.core.pick.charfuns import CharacteristicFunction
from pylot.core.pick.utils import getnoisewin, getsignalwin, get_maximum_index
class AutoPicker(object):
'''
Superclass of different, automated picking algorithms applied on a CF determined
using AIC, HOS, or AR prediction.
'''
warnings.simplefilter('ignore')
def __init__(self, cf, TSNR, PickWindow, checkwindow=None, minfactor=None, iplot=0, aus=None, Tsmooth=None, Pick1=None, fig=None):
'''
:param: cf, characteristic function, on which the picking algorithm is applied
:type: `~pylot.core.pick.CharFuns.CharacteristicFunction` object
:param: TSNR, length of time windows around pick used to determine SNR [s]
:type: tuple (T_noise, T_gap, T_signal)
:param: PickWindow, length of pick window [s]
:type: float
:param: iplot, no. of figure window for plotting interims results
:type: integer
:param: aus ("artificial uplift of samples"), find local minimum at i if aic(i-1)*(1+aus) >= aic(i)
:type: float
:param: Tsmooth, length of moving smoothing window to calculate smoothed CF [s]
:type: float
:param: Pick1, initial (prelimenary) onset time, starting point for PragPicker and
EarlLatePicker
:type: float
'''
assert isinstance(cf, CharacteristicFunction), "%s is not a CharacteristicFunction object" % str(cf)
self.cf = cf.getCF()
self.Tcf = cf.getTimeArray()
self.Data = cf.getXCF()
self.dt = cf.getIncrement()
self.setTSNR(TSNR)
self.setPickWindow(PickWindow)
self.setiplot(iplot)
self.setaus(aus)
self.setTsmooth(Tsmooth)
self.setpick1(Pick1)
self.fig = fig
self.setCheckWindow(checkwindow)
self.minfactor = minfactor
self.calcPick()
def __str__(self):
return '''\n\t{name} object:\n
TSNR:\t\t\t{TSNR}\n
PickWindow:\t{PickWindow}\n
aus:\t{aus}\n
Tsmooth:\t{Tsmooth}\n
Pick1:\t{Pick1}\n
'''.format(name=type(self).__name__,
TSNR=self.getTSNR(),
PickWindow=self.getPickWindow(),
aus=self.getaus(),
Tsmooth=self.getTsmooth(),
Pick1=self.getpick1())
def setCheckWindow(self, checkwindow):
'''convert checkwindow to samples'''
if checkwindow:
self.checkwindow = int(checkwindow / self.Data[0].stats.delta)
def getTSNR(self):
return self.TSNR
def setTSNR(self, TSNR):
self.TSNR = TSNR
def getPickWindow(self):
return self.PickWindow
def setPickWindow(self, PickWindow):
self.PickWindow = PickWindow
def getaus(self):
return self.aus
def setaus(self, aus):
self.aus = aus
def setTsmooth(self, Tsmooth):
self.Tsmooth = Tsmooth
def getTsmooth(self):
return self.Tsmooth
def getpick(self):
return self.Pick
def getSNR(self):
return self.SNR
def getSlope(self):
return self.slope
def getiplot(self):
return self.iplot
def setiplot(self, iplot):
self.iplot = iplot
def getpick1(self):
return self.Pick1
def setpick1(self, Pick1):
self.Pick1 = Pick1
def calcPick(self):
self.Pick = None
class AICPicker(AutoPicker):
'''
Method to derive the onset time of an arriving phase based on CF
derived from AIC. In order to get an impression of the quality of this inital pick,
a quality assessment is applied based on SNR and slope determination derived from the CF,
from which the AIC has been calculated.
'''
def calcPick(self):
print('AICPicker: Get initial onset time (pick) from AIC-CF ...')
self.Pick = None
self.slope = None
self.SNR = None
plt_flag = 0
try:
iplot = int(self.iplot)
except:
if self.iplot == True or self.iplot == 'True':
iplot = 2
else:
iplot = 0
# find NaN's
nn = np.isnan(self.cf)
if len(nn) > 1:
self.cf[nn] = 0
# taper AIC-CF to get rid off side maxima
tap = np.hanning(len(self.cf))
aic = tap * self.cf + max(abs(self.cf))
# smooth AIC-CF
ismooth = int(round(self.Tsmooth / self.dt))
aicsmooth = np.zeros(len(aic))
if len(aic) < ismooth:
print('AICPicker: Tsmooth larger than CF!')
return
else:
for i in range(1, len(aic)):
if i > ismooth:
ii1 = i - ismooth
aicsmooth[i] = aicsmooth[i - 1] + (aic[i] - aic[ii1]) / ismooth
else:
aicsmooth[i] = np.mean(aic[1: i])
# remove offset in AIC function
offset = abs(min(aic) - min(aicsmooth))
aicsmooth = aicsmooth - offset
# get maximum of HOS/AR-CF as startimg point for searching
# minimum in AIC function
icfmax = get_maximum_index(self.Data[0].data, self.checkwindow, self.minfactor,
int(self.TSNR[1]/self.Data[0].stats.delta))
# find minimum in AIC-CF front of maximum of HOS/AR-CF
lpickwindow = int(round(self.PickWindow / self.dt))
for i in range(icfmax - 1, max([icfmax - lpickwindow, 2]), -1):
if aicsmooth[i - 1] >= aicsmooth[i]:
self.Pick = self.Tcf[i]
break
# if no minimum could be found:
# search in 1st derivative of AIC-CF
if self.Pick is None:
diffcf = np.diff(aicsmooth)
# find NaN's
nn = np.isnan(diffcf)
if len(nn) > 1:
diffcf[nn] = 0
# taper CF to get rid off side maxima
tap = np.hanning(len(diffcf))
diffcf = tap * diffcf * max(abs(aicsmooth))
for i in range(icfmax - 1, max([icfmax - lpickwindow, 2]), -1):
if diffcf[i - 1] >= diffcf[i]:
self.Pick = self.Tcf[i]
break
# quality assessment using SNR and slope from CF
if self.Pick is not None:
# get noise window
inoise = getnoisewin(self.Tcf, self.Pick, self.TSNR[0], self.TSNR[1])
# check, if these are counts or m/s, important for slope estimation!
# this is quick and dirty, better solution?
if max(self.Data[0].data < 1e-3) and max(self.Data[0].data >= 1e-6):
self.Data[0].data = self.Data[0].data * 1000000.
elif max(self.Data[0].data < 1e-6):
self.Data[0].data = self.Data[0].data * 1e13
# get signal window
isignal = getsignalwin(self.Tcf, self.Pick, self.TSNR[2])
if len(isignal) == 0:
return
ii = min([isignal[len(isignal) - 1], len(self.Tcf)])
isignal = isignal[0:ii]
try:
self.Data[0].data[isignal]
except IndexError as e:
msg = "Time series out of bounds! {}".format(e)
print(msg)
return
# calculate SNR from CF
self.SNR = max(abs(self.Data[0].data[isignal] - np.mean(self.Data[0].data[isignal]))) / \
max(abs(self.Data[0].data[inoise] - np.mean(self.Data[0].data[inoise])))
# calculate slope from CF after initial pick
# get slope window
tslope = self.TSNR[3] # slope determination window
islope = np.where((self.Tcf <= min([self.Pick + tslope, self.Tcf[-1]])) \
& (self.Tcf >= self.Pick)) # TODO: put this in a seperate function like getsignalwin
# find maximum within slope determination window
# 'cause slope should be calculated up to first local minimum only!
try:
dataslope = self.Data[0].data[islope[0][0:-1]]
except IndexError:
print("Slope Calculation: empty array islope, check signal window")
return
if len(dataslope) < 1:
print('No data in slope window found!')
return
imax = np.argmax(dataslope)
iislope = islope[0][0:imax+1]
if len(iislope) < 2:
# calculate slope from initial onset to maximum of AIC function
print("AICPicker: Not enough data samples left for slope calculation!")
print("Calculating slope from initial onset to maximum of AIC function ...")
imax = np.argmax(aicsmooth[islope[0][0:-1]])
if imax == 0:
print("AICPicker: Maximum for slope determination right at the beginning of the window!")
print("Choose longer slope determination window!")
if self.iplot > 1:
if self.fig == None or self.fig == 'None':
fig = plt.figure() # self.iplot) ### WHY? MP MP
plt_flag = 1
else:
fig = self.fig
ax = fig.add_subplot(111)
x = self.Data[0].data
ax.plot(self.Tcf, x / max(x), 'k', label='(HOS-/AR-) Data')
ax.plot(self.Tcf, aicsmooth / max(aicsmooth), 'r', label='Smoothed AIC-CF')
ax.legend(loc=1)
ax.set_xlabel('Time [s] since %s' % self.Data[0].stats.starttime)
ax.set_yticks([])
ax.set_title(self.Data[0].stats.station)
if plt_flag == 1:
fig.show()
try: input()
except SyntaxError: pass
plt.close(fig)
return
iislope = islope[0][0:imax+1]
dataslope = self.Data[0].data[iislope]
# calculate slope as polynomal fit of order 1
xslope = np.arange(0, len(dataslope), 1)
P = np.polyfit(xslope, dataslope, 1)
datafit = np.polyval(P, xslope)
if datafit[0] >= datafit[-1]:
print('AICPicker: Negative slope, bad onset skipped!')
return
self.slope = 1 / (len(dataslope) * self.Data[0].stats.delta) * (datafit[-1] - datafit[0])
else:
self.SNR = None
self.slope = None
if iplot > 1:
if self.fig == None or self.fig == 'None':
fig = plt.figure() # self.iplot)
plt_flag = 1
else:
fig = self.fig
ax1 = fig.add_subplot(211)
x = self.Data[0].data
if len(self.Tcf) > len(self.Data[0].data): # why? LK
self.Tcf = self.Tcf[0:len(self.Tcf)-1]
ax1.plot(self.Tcf, x / max(x), 'k', label='(HOS-/AR-) Data')
ax1.plot(self.Tcf, aicsmooth / max(aicsmooth), 'r', label='Smoothed AIC-CF')
if self.Pick is not None:
ax1.plot([self.Pick, self.Pick], [-0.1, 0.5], 'b', linewidth=2, label='AIC-Pick')
ax1.set_xlabel('Time [s] since %s' % self.Data[0].stats.starttime)
ax1.set_yticks([])
ax1.legend(loc=1)
if self.Pick is not None:
ax2 = fig.add_subplot(2, 1, 2, sharex=ax1)
ax2.plot(self.Tcf, x, 'k', label='Data')
ax1.axvspan(self.Tcf[inoise[0]], self.Tcf[inoise[-1]], color='y', alpha=0.2, lw=0, label='Noise Window')
ax1.axvspan(self.Tcf[isignal[0]], self.Tcf[isignal[-1]], color='b', alpha=0.2, lw=0,
label='Signal Window')
ax1.axvspan(self.Tcf[iislope[0]], self.Tcf[iislope[-1]], color='g', alpha=0.2, lw=0,
label='Slope Window')
ax2.axvspan(self.Tcf[inoise[0]], self.Tcf[inoise[-1]], color='y', alpha=0.2, lw=0, label='Noise Window')
ax2.axvspan(self.Tcf[isignal[0]], self.Tcf[isignal[-1]], color='b', alpha=0.2, lw=0,
label='Signal Window')
ax2.axvspan(self.Tcf[iislope[0]], self.Tcf[iislope[-1]], color='g', alpha=0.2, lw=0,
label='Slope Window')
ax2.plot(self.Tcf[iislope], datafit, 'g', linewidth=2, label='Slope')
ax1.set_title('Station %s, SNR=%7.2f, Slope= %12.2f counts/s' % (self.Data[0].stats.station,
self.SNR, self.slope))
ax2.set_xlabel('Time [s] since %s' % self.Data[0].stats.starttime)
ax2.set_ylabel('Counts')
ax2.set_yticks([])
ax2.legend(loc=1)
if plt_flag == 1:
fig.show()
try: input()
except SyntaxError: pass
plt.close(fig)
else:
ax1.set_title(self.Data[0].stats.station)
if plt_flag == 1:
fig.show()
try: input()
except SyntaxError: pass
plt.close(fig)
if self.Pick == None:
print('AICPicker: Could not find minimum, picking window too short?')
return
class PragPicker(AutoPicker):
'''
Method of pragmatic picking exploiting information given by CF.
'''
def calcPick(self):
try:
iplot = int(self.getiplot())
except:
if self.getiplot() == True or self.getiplot() == 'True':
iplot = 2
else:
iplot = 0
if self.getpick1() is not None:
print('PragPicker: Get most likely pick from HOS- or AR-CF using pragmatic picking algorithm ...')
self.Pick = None
self.SNR = None
self.slope = None
pickflag = 0
plt_flag = 0
# smooth CF
ismooth = int(round(self.Tsmooth / self.dt))
cfsmooth = np.zeros(len(self.cf))
if len(self.cf) < ismooth:
print('PragPicker: Tsmooth larger than CF!')
return
else:
for i in range(1, len(self.cf)):
if i > ismooth:
ii1 = i - ismooth
cfsmooth[i] = cfsmooth[i - 1] + (self.cf[i] - self.cf[ii1]) / ismooth
else:
cfsmooth[i] = np.mean(self.cf[1: i])
# select picking window
# which is centered around tpick1
ipick = np.where((self.Tcf >= self.getpick1() - self.PickWindow / 2) \
& (self.Tcf <= self.getpick1() + self.PickWindow / 2))
cfipick = self.cf[ipick] - np.mean(self.cf[ipick])
Tcfpick = self.Tcf[ipick]
cfsmoothipick = cfsmooth[ipick] - np.mean(self.cf[ipick])
ipick1 = np.argmin(abs(self.Tcf - self.getpick1()))
cfpick1 = 2 * self.cf[ipick1]
# check trend of CF, i.e. differences of CF and adjust aus ("artificial uplift
# of picks") regarding this trend
# prominent trend: decrease aus
# flat: use given aus
cfdiff = np.diff(cfipick)
if len(cfdiff)<20:
print('PragPicker: Very few samples for CF. Check LTA window dimensions!')
i0diff = np.where(cfdiff > 0)
cfdiff = cfdiff[i0diff]
if len(cfdiff)<1:
print('PragPicker: Negative slope for CF. Check LTA window dimensions! STOP')
self.Pick = None
return
minaus = min(cfdiff * (1 + self.aus))
aus1 = max([minaus, self.aus])
# at first we look to the right until the end of the pick window is reached
flagpick_r = 0
flagpick_l = 0
cfpick_r = 0
cfpick_l = 0
lpickwindow = int(round(self.PickWindow / self.dt))
for i in range(max(np.insert(ipick, 0, 2)), min([ipick1 + lpickwindow + 1, len(self.cf) - 1])):
if self.cf[i + 1] > self.cf[i] and self.cf[i - 1] >= self.cf[i]:
if cfsmooth[i - 1] * (1 + aus1) >= cfsmooth[i]:
if cfpick1 >= self.cf[i]:
pick_r = self.Tcf[i]
self.Pick = pick_r
flagpick_l = 1
cfpick_r = self.cf[i]
break
# now we look to the left
if len(self.cf) > ipick1 +1:
for i in range(ipick1, max([ipick1 - lpickwindow + 1, 2]), -1):
if self.cf[i + 1] > self.cf[i] and self.cf[i - 1] >= self.cf[i]:
if cfsmooth[i - 1] * (1 + aus1) >= cfsmooth[i]:
if cfpick1 >= self.cf[i]:
pick_l = self.Tcf[i]
self.Pick = pick_l
flagpick_r = 1
cfpick_l = self.cf[i]
break
else:
msg ='PragPicker: Initial onset too close to start of CF! \
Stop finalizing pick to the left.'
print(msg)
# now decide which pick: left or right?
if flagpick_l > 0 and flagpick_r > 0 and cfpick_l <= 3 * cfpick_r:
self.Pick = pick_l
pickflag = 1
elif flagpick_l > 0 and flagpick_r > 0 and cfpick_l >= cfpick_r:
self.Pick = pick_r
pickflag = 1
elif flagpick_l == 0 and flagpick_r > 0 and cfpick_l >= cfpick_r:
self.Pick = pick_l
pickflag = 1
else:
print("PragPicker: Could not find reliable onset!")
self.Pick = None
pickflag = 0
if iplot > 1:
if self.fig == None or self.fig == 'None':
fig = plt.figure() # self.getiplot())
plt_flag = 1
else:
fig = self.fig
ax = fig.add_subplot(111)
ax.plot(Tcfpick, cfipick, 'k', label='CF')
ax.plot(Tcfpick, cfsmoothipick, 'r', label='Smoothed CF')
if pickflag > 0:
ax.plot([self.Pick, self.Pick], [min(cfipick), max(cfipick)], 'b', linewidth=2, label='Pick')
ax.set_xlabel('Time [s] since %s' % self.Data[0].stats.starttime)
ax.set_yticks([])
ax.set_title(self.Data[0].stats.station)
ax.legend(loc=1)
if plt_flag == 1:
fig.show()
try: input()
except SyntaxError: pass
plt.close(fig)
return
else:
print("PragPicker: No initial onset time given! Check input!")
self.Pick = None
return

1209
pylot/core/pick/utils.py Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,998 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# -*- coding: utf-8 -*-
"""
Created Mar/Apr 2015
Collection of helpful functions for manual and automatic picking.
:author: Ludger Kueperkoch / MAGS2 EP3 working group
"""
import warnings
import matplotlib.pyplot as plt
import numpy as np
from obspy.core import Stream, UTCDateTime
def earllatepicker(X, nfac, TSNR, Pick1, iplot=0, stealthMode=False):
'''
Function to derive earliest and latest possible pick after Diehl & Kissling (2009)
as reasonable uncertainties. Latest possible pick is based on noise level,
earliest possible pick is half a signal wavelength in front of most likely
pick given by PragPicker or manually set by analyst. Most likely pick
(initial pick Pick1) must be given.
:param: X, time series (seismogram)
:type: `~obspy.core.stream.Stream`
:param: nfac (noise factor), nfac times noise level to calculate latest possible pick
:type: int
:param: TSNR, length of time windows around pick used to determine SNR [s]
:type: tuple (T_noise, T_gap, T_signal)
:param: Pick1, initial (most likely) onset time, starting point for earllatepicker
:type: float
:param: iplot, if given, results are plotted in figure(iplot)
:type: int
'''
assert isinstance(X, Stream), "%s is not a stream object" % str(X)
LPick = None
EPick = None
PickError = None
if stealthMode is False:
print
'earllatepicker: Get earliest and latest possible pick relative to most likely pick ...'
x = X[0].data
t = np.arange(0, X[0].stats.npts / X[0].stats.sampling_rate,
X[0].stats.delta)
inoise = getnoisewin(t, Pick1, TSNR[0], TSNR[1])
# get signal window
isignal = getsignalwin(t, Pick1, TSNR[2])
# remove mean
x = x - np.mean(x[inoise])
# calculate noise level
nlevel = np.sqrt(np.mean(np.square(x[inoise]))) * nfac
# get time where signal exceeds nlevel
ilup, = np.where(x[isignal] > nlevel)
ildown, = np.where(x[isignal] < -nlevel)
if not ilup.size and not ildown.size:
print("earllatepicker: Signal lower than noise level!")
print("Skip this trace!")
return LPick, EPick, PickError
il = min(np.min(ilup) if ilup.size else float('inf'),
np.min(ildown) if ildown.size else float('inf'))
LPick = t[isignal][il]
# get earliest possible pick
EPick = np.nan;
count = 0
pis = isignal
# if EPick stays NaN the signal window size will be doubled
while np.isnan(EPick):
if count > 0:
print("earllatepicker: Doubled signal window size %s time(s) "
"because of NaN for earliest pick." % count)
if stealthMode is False:
print("\nearllatepicker: Doubled signal window size %s time(s) "
"because of NaN for earliest pick." % count)
isigDoubleWinStart = pis[-1] + 1
isignalDoubleWin = np.arange(isigDoubleWinStart,
isigDoubleWinStart + len(pis))
if (isigDoubleWinStart + len(pis)) < X[0].data.size:
pis = np.concatenate((pis, isignalDoubleWin))
else:
print("Could not double signal window. Index out of bounds.")
break
count += 1
# determine all zero crossings in signal window (demeaned)
zc = crossings_nonzero_all(x[pis] - x[pis].mean())
# calculate mean half period T0 of signal as the average of the
T0 = np.mean(np.diff(zc)) * X[0].stats.delta # this is half wave length
# T0/4 is assumed as time difference between most likely and earliest possible pick!
EPick = Pick1 - T0 / 2
# get symmetric pick error as mean from earliest and latest possible pick
# by weighting latest possible pick two times earliest possible pick
diffti_tl = LPick - Pick1
diffti_te = Pick1 - EPick
PickError = (diffti_te + 2 * diffti_tl) / 3
if iplot > 1:
p = plt.figure(iplot)
p1, = plt.plot(t, x, 'k')
p2, = plt.plot(t[inoise], x[inoise])
p3, = plt.plot(t[isignal], x[isignal], 'r')
p4, = plt.plot([t[0], t[int(len(t)) - 1]], [nlevel, nlevel], '--k')
p5, = plt.plot(t[isignal[zc]], np.zeros(len(zc)), '*g',
markersize=14)
plt.legend([p1, p2, p3, p4, p5],
['Data', 'Noise Window', 'Signal Window', 'Noise Level',
'Zero Crossings'],
loc='best')
plt.plot([t[0], t[int(len(t)) - 1]], [-nlevel, -nlevel], '--k')
plt.plot([Pick1, Pick1], [max(x), -max(x)], 'b', linewidth=2)
plt.plot([LPick, LPick], [max(x) / 2, -max(x) / 2], '--k')
plt.plot([EPick, EPick], [max(x) / 2, -max(x) / 2], '--k')
plt.plot([Pick1 + PickError, Pick1 + PickError],
[max(x) / 2, -max(x) / 2], 'r--')
plt.plot([Pick1 - PickError, Pick1 - PickError],
[max(x) / 2, -max(x) / 2], 'r--')
plt.xlabel('Time [s] since %s' % X[0].stats.starttime)
plt.yticks([])
plt.title(
'Earliest-/Latest Possible/Most Likely Pick & Symmetric Pick Error, %s' %
X[0].stats.station)
plt.show()
raw_input()
plt.close(p)
return EPick, LPick, PickError
def fmpicker(Xraw, Xfilt, pickwin, Pick, iplot=0):
'''
Function to derive first motion (polarity) of given phase onset Pick.
Calculation is based on zero crossings determined within time window pickwin
after given onset time.
:param: Xraw, unfiltered time series (seismogram)
:type: `~obspy.core.stream.Stream`
:param: Xfilt, filtered time series (seismogram)
:type: `~obspy.core.stream.Stream`
:param: pickwin, time window after onset Pick within zero crossings are calculated
:type: float
:param: Pick, initial (most likely) onset time, starting point for fmpicker
:type: float
:param: iplot, if given, results are plotted in figure(iplot)
:type: int
'''
warnings.simplefilter('ignore', np.RankWarning)
assert isinstance(Xraw, Stream), "%s is not a stream object" % str(Xraw)
assert isinstance(Xfilt, Stream), "%s is not a stream object" % str(Xfilt)
FM = None
if Pick is not None:
print("fmpicker: Get first motion (polarity) of onset using unfiltered seismogram...")
xraw = Xraw[0].data
xfilt = Xfilt[0].data
t = np.arange(0, Xraw[0].stats.npts / Xraw[0].stats.sampling_rate,
Xraw[0].stats.delta)
# get pick window
ipick = np.where(
(t <= min([Pick + pickwin, len(Xraw[0])])) & (t >= Pick))
# remove mean
xraw[ipick] = xraw[ipick] - np.mean(xraw[ipick])
xfilt[ipick] = xfilt[ipick] - np.mean(xfilt[ipick])
# get zero crossings after most likely pick
# initial onset is assumed to be the first zero crossing
# first from unfiltered trace
zc1 = []
zc1.append(Pick)
index1 = []
i = 0
for j in range(ipick[0][1], ipick[0][len(t[ipick]) - 1]):
i = i + 1
if xraw[j - 1] <= 0 <= xraw[j]:
zc1.append(t[ipick][i])
index1.append(i)
elif xraw[j - 1] > 0 >= xraw[j]:
zc1.append(t[ipick][i])
index1.append(i)
if len(zc1) == 3:
break
# if time difference betweeen 1st and 2cnd zero crossing
# is too short, get time difference between 1st and 3rd
# to derive maximum
if zc1[1] - zc1[0] <= Xraw[0].stats.delta:
li1 = index1[1]
else:
li1 = index1[0]
if np.size(xraw[ipick[0][1]:ipick[0][li1]]) == 0:
print("fmpicker: Onset on unfiltered trace too emergent for first motion determination!")
P1 = None
else:
imax1 = np.argmax(abs(xraw[ipick[0][1]:ipick[0][li1]]))
if imax1 == 0:
imax1 = np.argmax(abs(xraw[ipick[0][1]:ipick[0][index1[1]]]))
if imax1 == 0:
print("fmpicker: Zero crossings too close!")
print("Skip first motion determination!")
return FM
islope1 = np.where((t >= Pick) & (t <= Pick + t[imax1]))
# calculate slope as polynomal fit of order 1
xslope1 = np.arange(0, len(xraw[islope1]), 1)
P1 = np.polyfit(xslope1, xraw[islope1], 1)
datafit1 = np.polyval(P1, xslope1)
# now using filterd trace
# next zero crossings after most likely pick
zc2 = []
zc2.append(Pick)
index2 = []
i = 0
for j in range(ipick[0][1], ipick[0][len(t[ipick]) - 1]):
i = i + 1
if xfilt[j - 1] <= 0 <= xfilt[j]:
zc2.append(t[ipick][i])
index2.append(i)
elif xfilt[j - 1] > 0 >= xfilt[j]:
zc2.append(t[ipick][i])
index2.append(i)
if len(zc2) == 3:
break
# if time difference betweeen 1st and 2cnd zero crossing
# is too short, get time difference between 1st and 3rd
# to derive maximum
if zc2[1] - zc2[0] <= Xfilt[0].stats.delta:
li2 = index2[1]
else:
li2 = index2[0]
if np.size(xfilt[ipick[0][1]:ipick[0][li2]]) == 0:
print("fmpicker: Onset on filtered trace too emergent for first motion determination!")
P2 = None
else:
imax2 = np.argmax(abs(xfilt[ipick[0][1]:ipick[0][li2]]))
if imax2 == 0:
imax2 = np.argmax(abs(xfilt[ipick[0][1]:ipick[0][index2[1]]]))
if imax2 == 0:
print("fmpicker: Zero crossings too close!")
print("Skip first motion determination!")
return FM
islope2 = np.where((t >= Pick) & (t <= Pick + t[imax2]))
# calculate slope as polynomal fit of order 1
xslope2 = np.arange(0, len(xfilt[islope2]), 1)
P2 = np.polyfit(xslope2, xfilt[islope2], 1)
datafit2 = np.polyval(P2, xslope2)
# compare results
if P1 is not None and P2 is not None:
if P1[0] < 0 and P2[0] < 0:
FM = 'D'
elif P1[0] >= 0 > P2[0]:
FM = '-'
elif P1[0] < 0 <= P2[0]:
FM = '-'
elif P1[0] > 0 and P2[0] > 0:
FM = 'U'
elif P1[0] <= 0 < P2[0]:
FM = '+'
elif P1[0] > 0 >= P2[0]:
FM = '+'
print("fmpicker: Found polarity %s" % FM)
if iplot > 1:
plt.figure(iplot)
plt.subplot(2, 1, 1)
plt.plot(t, xraw, 'k')
p1, = plt.plot([Pick, Pick], [max(xraw), -max(xraw)], 'b', linewidth=2)
if P1 is not None:
p2, = plt.plot(t[islope1], xraw[islope1])
p3, = plt.plot(zc1, np.zeros(len(zc1)), '*g', markersize=14)
p4, = plt.plot(t[islope1], datafit1, '--g', linewidth=2)
plt.legend([p1, p2, p3, p4],
['Pick', 'Slope Window', 'Zero Crossings', 'Slope'],
loc='best')
plt.text(Pick + 0.02, max(xraw) / 2, '%s' % FM, fontsize=14)
ax = plt.gca()
plt.yticks([])
plt.title('First-Motion Determination, %s, Unfiltered Data' % Xraw[
0].stats.station)
plt.subplot(2, 1, 2)
plt.title('First-Motion Determination, Filtered Data')
plt.plot(t, xfilt, 'k')
p1, = plt.plot([Pick, Pick], [max(xfilt), -max(xfilt)], 'b',
linewidth=2)
if P2 is not None:
p2, = plt.plot(t[islope2], xfilt[islope2])
p3, = plt.plot(zc2, np.zeros(len(zc2)), '*g', markersize=14)
p4, = plt.plot(t[islope2], datafit2, '--g', linewidth=2)
plt.text(Pick + 0.02, max(xraw) / 2, '%s' % FM, fontsize=14)
ax = plt.gca()
plt.xlabel('Time [s] since %s' % Xraw[0].stats.starttime)
plt.yticks([])
plt.show()
raw_input()
plt.close(iplot)
return FM
def crossings_nonzero_all(data):
pos = data > 0
npos = ~pos
return ((pos[:-1] & npos[1:]) | (npos[:-1] & pos[1:])).nonzero()[0]
def getSNR(X, TSNR, t1):
'''
Function to calculate SNR of certain part of seismogram relative to
given time (onset) out of given noise and signal windows. A safety gap
between noise and signal part can be set. Returns SNR and SNR [dB] and
noiselevel.
:param: X, time series (seismogram)
:type: `~obspy.core.stream.Stream`
:param: TSNR, length of time windows [s] around t1 (onset) used to determine SNR
:type: tuple (T_noise, T_gap, T_signal)
:param: t1, initial time (onset) from which noise and signal windows are calculated
:type: float
'''
assert isinstance(X, Stream), "%s is not a stream object" % str(X)
x = X[0].data
t = np.arange(0, X[0].stats.npts / X[0].stats.sampling_rate,
X[0].stats.delta)
# get noise window
inoise = getnoisewin(t, t1, TSNR[0], TSNR[1])
# get signal window
isignal = getsignalwin(t, t1, TSNR[2])
if np.size(inoise) < 1:
print("getSNR: Empty array inoise, check noise window!")
return
elif np.size(isignal) < 1:
print("getSNR: Empty array isignal, check signal window!")
return
# demean over entire waveform
x = x - np.mean(x[inoise])
# calculate ratios
noiselevel = np.sqrt(np.mean(np.square(x[inoise])))
signallevel = np.sqrt(np.mean(np.square(x[isignal])))
SNR = signallevel / noiselevel
SNRdB = 10 * np.log10(SNR)
return SNR, SNRdB, noiselevel
def getnoisewin(t, t1, tnoise, tgap):
'''
Function to extract indeces of data out of time series for noise calculation.
Returns an array of indeces.
:param: t, array of time stamps
:type: numpy array
:param: t1, time from which relativ to it noise window is extracted
:type: float
:param: tnoise, length of time window [s] for noise part extraction
:type: float
:param: tgap, safety gap between t1 (onset) and noise window to
ensure, that noise window contains no signal
:type: float
'''
# get noise window
inoise, = np.where((t <= max([t1 - tgap, 0])) \
& (t >= max([t1 - tnoise - tgap, 0])))
if np.size(inoise) < 1:
print("getnoisewin: Empty array inoise, check noise window!")
return inoise
def getsignalwin(t, t1, tsignal):
'''
Function to extract data out of time series for signal level calculation.
Returns an array of indeces.
:param: t, array of time stamps
:type: numpy array
:param: t1, time from which relativ to it signal window is extracted
:type: float
:param: tsignal, length of time window [s] for signal level calculation
:type: float
'''
# get signal window
isignal, = np.where((t <= min([t1 + tsignal, len(t)])) \
& (t >= t1))
if np.size(isignal) < 1:
print("getsignalwin: Empty array isignal, check signal window!")
return isignal
def getResolutionWindow(snr):
"""
Number -> Float
produce the half of the time resolution window width from given SNR
value
SNR >= 3 -> 2 sec HRW
3 > SNR >= 2 -> 5 sec MRW
2 > SNR >= 1.5 -> 10 sec LRW
1.5 > SNR -> 15 sec VLRW
see also Diehl et al. 2009
>>> getResolutionWindow(0.5)
7.5
>>> getResolutionWindow(1.8)
5.0
>>> getResolutionWindow(2.3)
2.5
>>> getResolutionWindow(4)
1.0
>>> getResolutionWindow(2)
2.5
"""
res_wins = {'HRW': 2., 'MRW': 5., 'LRW': 10., 'VLRW': 15.}
if snr < 1.5:
time_resolution = res_wins['VLRW']
elif snr < 2.:
time_resolution = res_wins['LRW']
elif snr < 3.:
time_resolution = res_wins['MRW']
else:
time_resolution = res_wins['HRW']
return time_resolution / 2
def wadaticheck(pickdic, dttolerance, iplot):
'''
Function to calculate Wadati-diagram from given P and S onsets in order
to detect S pick outliers. If a certain S-P time deviates by dttolerance
from regression of S-P time the S pick is marked and down graded.
: param: pickdic, dictionary containing picks and quality parameters
: type: dictionary
: param: dttolerance, maximum adjusted deviation of S-P time from
S-P time regression
: type: float
: param: iplot, if iplot > 1, Wadati diagram is shown
: type: int
'''
checkedonsets = pickdic
# search for good quality picks and calculate S-P time
Ppicks = []
Spicks = []
SPtimes = []
for key in pickdic:
if pickdic[key]['P']['weight'] < 4 and pickdic[key]['S']['weight'] < 4:
# calculate S-P time
spt = pickdic[key]['S']['mpp'] - pickdic[key]['P']['mpp']
# add S-P time to dictionary
pickdic[key]['SPt'] = spt
# add P onsets and corresponding S-P times to list
UTCPpick = UTCDateTime(pickdic[key]['P']['mpp'])
UTCSpick = UTCDateTime(pickdic[key]['S']['mpp'])
Ppicks.append(UTCPpick.timestamp)
Spicks.append(UTCSpick.timestamp)
SPtimes.append(spt)
if len(SPtimes) >= 3:
# calculate slope
p1 = np.polyfit(Ppicks, SPtimes, 1)
wdfit = np.polyval(p1, Ppicks)
wfitflag = 0
# calculate vp/vs ratio before check
vpvsr = p1[0] + 1
print("###############################################")
print("wadaticheck: Average Vp/Vs ratio before check: %f" % vpvsr)
checkedPpicks = []
checkedSpicks = []
checkedSPtimes = []
# calculate deviations from Wadati regression
ii = 0
ibad = 0
for key in pickdic:
if pickdic[key].has_key('SPt'):
wddiff = abs(pickdic[key]['SPt'] - wdfit[ii])
ii += 1
# check, if deviation is larger than adjusted
if wddiff > dttolerance:
# mark onset and downgrade S-weight to 9
# (not used anymore)
marker = 'badWadatiCheck'
pickdic[key]['S']['weight'] = 9
ibad += 1
else:
marker = 'goodWadatiCheck'
checkedPpick = UTCDateTime(pickdic[key]['P']['mpp'])
checkedPpicks.append(checkedPpick.timestamp)
checkedSpick = UTCDateTime(pickdic[key]['S']['mpp'])
checkedSpicks.append(checkedSpick.timestamp)
checkedSPtime = pickdic[key]['S']['mpp'] - pickdic[key]['P']['mpp']
checkedSPtimes.append(checkedSPtime)
pickdic[key]['S']['marked'] = marker
if len(checkedPpicks) >= 3:
# calculate new slope
p2 = np.polyfit(checkedPpicks, checkedSPtimes, 1)
wdfit2 = np.polyval(p2, checkedPpicks)
# calculate vp/vs ratio after check
cvpvsr = p2[0] + 1
print("wadaticheck: Average Vp/Vs ratio after check: %f" % cvpvsr)
print("wadatacheck: Skipped %d S pick(s)" % ibad)
else:
print("###############################################")
print("wadatacheck: Not enough checked S-P times available!")
print("Skip Wadati check!")
checkedonsets = pickdic
else:
print("wadaticheck: Not enough S-P times available for reliable regression!")
print("Skip wadati check!")
wfitflag = 1
# plot results
if iplot > 1:
plt.figure(iplot)
f1, = plt.plot(Ppicks, SPtimes, 'ro')
if wfitflag == 0:
f2, = plt.plot(Ppicks, wdfit, 'k')
f3, = plt.plot(checkedPpicks, checkedSPtimes, 'ko')
f4, = plt.plot(checkedPpicks, wdfit2, 'g')
plt.title('Wadati-Diagram, %d S-P Times, Vp/Vs(raw)=%5.2f,' \
'Vp/Vs(checked)=%5.2f' % (len(SPtimes), vpvsr, cvpvsr))
plt.legend([f1, f2, f3, f4], ['Skipped S-Picks', 'Wadati 1',
'Reliable S-Picks', 'Wadati 2'], loc='best')
else:
plt.title('Wadati-Diagram, %d S-P Times' % len(SPtimes))
plt.ylabel('S-P Times [s]')
plt.xlabel('P Times [s]')
plt.show()
raw_input()
plt.close(iplot)
return checkedonsets
def checksignallength(X, pick, TSNR, minsiglength, nfac, minpercent, iplot):
'''
Function to detect spuriously picked noise peaks.
Uses RMS trace of all 3 components (if available) to determine,
how many samples [per cent] after P onset are below certain
threshold, calculated from noise level times noise factor.
: param: X, time series (seismogram)
: type: `~obspy.core.stream.Stream`
: param: pick, initial (AIC) P onset time
: type: float
: param: TSNR, length of time windows around initial pick [s]
: type: tuple (T_noise, T_gap, T_signal)
: param: minsiglength, minium required signal length [s] to
declare pick as P onset
: type: float
: param: nfac, noise factor (nfac * noise level = threshold)
: type: float
: param: minpercent, minimum required percentage of samples
above calculated threshold
: type: float
: param: iplot, if iplot > 1, results are shown in figure
: type: int
'''
assert isinstance(X, Stream), "%s is not a stream object" % str(X)
print("Checking signal length ...")
if len(X) > 1:
# all three components available
# make sure, all components have equal lengths
ilen = min([len(X[0].data), len(X[1].data), len(X[2].data)])
x1 = X[0][0:ilen]
x2 = X[1][0:ilen]
x3 = X[2][0:ilen]
# get RMS trace
rms = np.sqrt((np.power(x1, 2) + np.power(x2, 2) + np.power(x3, 2)) / 3)
else:
x1 = X[0].data
rms = np.sqrt(np.power(2, x1))
t = np.arange(0, ilen / X[0].stats.sampling_rate,
X[0].stats.delta)
# get noise window in front of pick plus saftey gap
inoise = getnoisewin(t, pick - 0.5, TSNR[0], TSNR[1])
# get signal window
isignal = getsignalwin(t, pick, minsiglength)
# calculate minimum adjusted signal level
minsiglevel = max(rms[inoise]) * nfac
# minimum adjusted number of samples over minimum signal level
minnum = len(isignal) * minpercent / 100
# get number of samples above minimum adjusted signal level
numoverthr = len(np.where(rms[isignal] >= minsiglevel)[0])
if numoverthr >= minnum:
print("checksignallength: Signal reached required length.")
returnflag = 1
else:
print("checksignallength: Signal shorter than required minimum signal length!")
print("Presumably picked noise peak, pick is rejected!")
print("(min. signal length required: %s s)" % minsiglength)
returnflag = 0
if iplot == 2:
plt.figure(iplot)
p1, = plt.plot(t, rms, 'k')
p2, = plt.plot(t[inoise], rms[inoise], 'c')
p3, = plt.plot(t[isignal], rms[isignal], 'r')
p4, = plt.plot([t[isignal[0]], t[isignal[len(isignal) - 1]]],
[minsiglevel, minsiglevel], 'g', linewidth=2)
p5, = plt.plot([pick, pick], [min(rms), max(rms)], 'b', linewidth=2)
plt.legend([p1, p2, p3, p4, p5], ['RMS Data', 'RMS Noise Window',
'RMS Signal Window', 'Minimum Signal Level',
'Onset'], loc='best')
plt.xlabel('Time [s] since %s' % X[0].stats.starttime)
plt.ylabel('Counts')
plt.title('Check for Signal Length, Station %s' % X[0].stats.station)
plt.yticks([])
plt.show()
raw_input()
plt.close(iplot)
return returnflag
def checkPonsets(pickdic, dttolerance, iplot):
'''
Function to check statistics of P-onset times: Control deviation from
median (maximum adjusted deviation = dttolerance) and apply pseudo-
bootstrapping jackknife.
: param: pickdic, dictionary containing picks and quality parameters
: type: dictionary
: param: dttolerance, maximum adjusted deviation of P-onset time from
median of all P onsets
: type: float
: param: iplot, if iplot > 1, Wadati diagram is shown
: type: int
'''
checkedonsets = pickdic
# search for good quality P picks
Ppicks = []
stations = []
for key in pickdic:
if pickdic[key]['P']['weight'] < 4:
# add P onsets to list
UTCPpick = UTCDateTime(pickdic[key]['P']['mpp'])
Ppicks.append(UTCPpick.timestamp)
stations.append(key)
# apply jackknife bootstrapping on variance of P onsets
print("###############################################")
print("checkPonsets: Apply jackknife bootstrapping on P-onset times ...")
[xjack, PHI_pseudo, PHI_sub] = jackknife(Ppicks, 'VAR', 1)
# get pseudo variances smaller than average variances
# (times safety factor), these picks passed jackknife test
ij = np.where(PHI_pseudo <= 2 * xjack)
# these picks did not pass jackknife test
badjk = np.where(PHI_pseudo > 2 * xjack)
badjkstations = np.array(stations)[badjk]
print("checkPonsets: %d pick(s) did not pass jackknife test!" % len(badjkstations))
# calculate median from these picks
pmedian = np.median(np.array(Ppicks)[ij])
# find picks that deviate less than dttolerance from median
ii = np.where(abs(np.array(Ppicks)[ij] - pmedian) <= dttolerance)
jj = np.where(abs(np.array(Ppicks)[ij] - pmedian) > dttolerance)
igood = ij[0][ii]
ibad = ij[0][jj]
goodstations = np.array(stations)[igood]
badstations = np.array(stations)[ibad]
print("checkPonsets: %d pick(s) deviate too much from median!" % len(ibad))
print("checkPonsets: Skipped %d P pick(s) out of %d" % (len(badstations) \
+ len(badjkstations), len(stations)))
goodmarker = 'goodPonsetcheck'
badmarker = 'badPonsetcheck'
badjkmarker = 'badjkcheck'
for i in range(0, len(goodstations)):
# mark P onset as checked and keep P weight
pickdic[goodstations[i]]['P']['marked'] = goodmarker
for i in range(0, len(badstations)):
# mark P onset and downgrade P weight to 9
# (not used anymore)
pickdic[badstations[i]]['P']['marked'] = badmarker
pickdic[badstations[i]]['P']['weight'] = 9
for i in range(0, len(badjkstations)):
# mark P onset and downgrade P weight to 9
# (not used anymore)
pickdic[badjkstations[i]]['P']['marked'] = badjkmarker
pickdic[badjkstations[i]]['P']['weight'] = 9
checkedonsets = pickdic
if iplot > 1:
p1, = plt.plot(np.arange(0, len(Ppicks)), Ppicks, 'r+', markersize=14)
p2, = plt.plot(igood, np.array(Ppicks)[igood], 'g*', markersize=14)
p3, = plt.plot([0, len(Ppicks) - 1], [pmedian, pmedian], 'g',
linewidth=2)
for i in range(0, len(Ppicks)):
plt.text(i, Ppicks[i] + 0.2, stations[i])
plt.xlabel('Number of P Picks')
plt.ylabel('Onset Time [s] from 1.1.1970')
plt.legend([p1, p2, p3], ['Skipped P Picks', 'Good P Picks', 'Median'],
loc='best')
plt.title('Check P Onsets')
plt.show()
raw_input()
return checkedonsets
def jackknife(X, phi, h):
'''
Function to calculate the Jackknife Estimator for a given quantity,
special type of boot strapping. Returns the jackknife estimator PHI_jack
the pseudo values PHI_pseudo and the subgroup parameters PHI_sub.
: param: X, given quantity
: type: list
: param: phi, chosen estimator, choose between:
"MED" for median
"MEA" for arithmetic mean
"VAR" for variance
: type: string
: param: h, size of subgroups, optinal, default = 1
: type: integer
'''
PHI_jack = None
PHI_pseudo = None
PHI_sub = None
# determine number of subgroups
g = len(X) / h
if type(g) is not int:
print("jackknife: Cannot divide quantity X in equal sized subgroups!")
print("Choose another size for subgroups!")
return PHI_jack, PHI_pseudo, PHI_sub
else:
# estimator of undisturbed spot check
if phi == 'MEA':
phi_sc = np.mean(X)
elif phi == 'VAR':
phi_sc = np.var(X)
elif phi == 'MED':
phi_sc = np.median(X)
# estimators of subgroups
PHI_pseudo = []
PHI_sub = []
for i in range(0, g - 1):
# subgroup i, remove i-th sample
xx = X[:]
del xx[i]
# calculate estimators of disturbed spot check
if phi == 'MEA':
phi_sub = np.mean(xx)
elif phi == 'VAR':
phi_sub = np.var(xx)
elif phi == 'MED':
phi_sub = np.median(xx)
PHI_sub.append(phi_sub)
# pseudo values
phi_pseudo = g * phi_sc - ((g - 1) * phi_sub)
PHI_pseudo.append(phi_pseudo)
# jackknife estimator
PHI_jack = np.mean(PHI_pseudo)
return PHI_jack, PHI_pseudo, PHI_sub
def checkZ4S(X, pick, zfac, checkwin, iplot):
'''
Function to compare energy content of vertical trace with
energy content of horizontal traces to detect spuriously
picked S onsets instead of P onsets. Usually, P coda shows
larger longitudal energy on vertical trace than on horizontal
traces, where the transversal energy is larger within S coda.
Be careful: there are special circumstances, where this is not
the case!
: param: X, fitered(!) time series, three traces
: type: `~obspy.core.stream.Stream`
: param: pick, initial (AIC) P onset time
: type: float
: param: zfac, factor for threshold determination,
vertical energy must exceed coda level times zfac
to declare a pick as P onset
: type: float
: param: checkwin, window length [s] for calculating P-coda
energy content
: type: float
: param: iplot, if iplot > 1, energy content and threshold
are shown
: type: int
'''
assert isinstance(X, Stream), "%s is not a stream object" % str(X)
print("Check for spuriously picked S onset instead of P onset ...")
returnflag = 0
# split components
zdat = X.select(component="Z")
edat = X.select(component="E")
if len(edat) == 0: # check for other components
edat = X.select(component="2")
ndat = X.select(component="N")
if len(ndat) == 0: # check for other components
ndat = X.select(component="1")
z = zdat[0].data
tz = np.arange(0, zdat[0].stats.npts / zdat[0].stats.sampling_rate,
zdat[0].stats.delta)
# calculate RMS trace from vertical component
absz = np.sqrt(np.power(z, 2))
# calculate RMS trace from both horizontal traces
# make sure, both traces have equal lengths
lene = len(edat[0].data)
lenn = len(ndat[0].data)
minlen = min([lene, lenn])
absen = np.sqrt(np.power(edat[0].data[0:minlen - 1], 2) \
+ np.power(ndat[0].data[0:minlen - 1], 2))
# get signal window
isignal = getsignalwin(tz, pick, checkwin)
# calculate energy levels
zcodalevel = max(absz[isignal])
encodalevel = max(absen[isignal])
# calculate threshold
minsiglevel = encodalevel * zfac
# vertical P-coda level must exceed horizontal P-coda level
# zfac times encodalevel
if zcodalevel < minsiglevel:
print("checkZ4S: Maybe S onset? Skip this P pick!")
else:
print("checkZ4S: P onset passes checkZ4S test!")
returnflag = 1
if iplot > 1:
te = np.arange(0, edat[0].stats.npts / edat[0].stats.sampling_rate,
edat[0].stats.delta)
tn = np.arange(0, ndat[0].stats.npts / ndat[0].stats.sampling_rate,
ndat[0].stats.delta)
plt.plot(tz, z / max(z), 'k')
plt.plot(tz[isignal], z[isignal] / max(z), 'r')
plt.plot(te, edat[0].data / max(edat[0].data) + 1, 'k')
plt.plot(te[isignal], edat[0].data[isignal] / max(edat[0].data) + 1, 'r')
plt.plot(tn, ndat[0].data / max(ndat[0].data) + 2, 'k')
plt.plot(tn[isignal], ndat[0].data[isignal] / max(ndat[0].data) + 2, 'r')
plt.plot([tz[isignal[0]], tz[isignal[len(isignal) - 1]]],
[minsiglevel / max(z), minsiglevel / max(z)], 'g',
linewidth=2)
plt.xlabel('Time [s] since %s' % zdat[0].stats.starttime)
plt.ylabel('Normalized Counts')
plt.yticks([0, 1, 2], [zdat[0].stats.channel, edat[0].stats.channel,
ndat[0].stats.channel])
plt.title('CheckZ4S, Station %s' % zdat[0].stats.station)
plt.show()
raw_input()
return returnflag
def writephases(arrivals, fformat, filename):
'''
Function of methods to write phases to the following standard file
formats used for locating earthquakes:
HYPO71, NLLoc, VELEST, HYPOSAT, HYPOINVERSE and hypoDD
:param: arrivals
:type: dictionary containing all phase information including
station ID, phase, first motion, weight (uncertainty),
....
:param: fformat
:type: string, chosen file format (location routine),
choose between NLLoc, HYPO71, HYPOSAT, VELEST,
HYPOINVERSE, and hypoDD
:param: filename, full path and name of phase file
:type: string
'''
if fformat == 'NLLoc':
print("Writing phases to %s for NLLoc" % filename)
fid = open("%s" % filename, 'w')
# write header
fid.write('# EQEVENT: Label: EQ001 Loc: X 0.00 Y 0.00 Z 10.00 OT 0.00 \n')
for key in arrivals:
if arrivals[key]['P']['weight'] < 4:
# write phase information to NLLoc-phase file
# see the NLLoc tutorial at www.alomax.free.fr/nlloc/
fm = arrivals[key]['P']['fm']
onset = arrivals[key]['P']['mpp']
year = onset.year
month = onset.month
day = onset.day
hh = onset.hour
mm = onset.minute
ss = onset.second
ms = onset.microsecond
ss_ms = ss + (ms / 1E06)
fid.write('%s ? ? ? P %s %d%02d%02d %02d%02d %7.4f GAU 0 0 0 0 1 \n' \
% (key, fm, year, month, day, hh, mm, ss_ms))
if arrivals[key]['S']['weight'] < 4:
fm = '?'
onset = arrivals[key]['S']['mpp']
year = onset.year
month = onset.month
day = onset.day
hh = onset.hour
mm = onset.minute
ss = onset.second
ms = onset.microsecond
ss_ms = ss + (ms / 1E06)
fid.write('%s ? ? ? S %s %d%02d%02d %02d%02d %7.4f GAU 0 0 0 0 1 \n' \
% (key, fm, year, month, day, hh, mm, ss_ms))
fid.close()
if __name__ == '__main__':
import doctest
doctest.testmod()

View File

@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from pylot.core.util.version import get_git_version as _getVersionString

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from urllib2 import urlopen
except:
from urllib.request import urlopen
def checkurl(url='https://ariadne.geophysik.rub.de/trac/PyLoT'):
try:
urlopen(url, timeout=1)
return True
except:
pass
return False

View File

@@ -0,0 +1,353 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import glob
import os
import sys
import numpy as np
from obspy import UTCDateTime, read_inventory, read
from obspy.io.xseed import Parser
from pylot.core.util.utils import key_for_set_value, find_in_list, \
remove_underscores, gen_Pool
def time_from_header(header):
"""
Function takes in the second line from a .gse file and takes out the date and time from that line.
:param header: second line from .gse file
:type header: string
:return: a list of integers of form [year, month, day, hour, minute, second, microsecond]
"""
timeline = header.split(' ')
time = timeline[1].split('/') + timeline[2].split(':')
time = time[:-1] + time[-1].split('.')
return [int(t) for t in time]
def check_time(datetime):
"""
Function takes in date and time as list and validates it's values by trying to make an UTCDateTime object from it
:param datetime: list of integers [year, month, day, hour, minute, second, microsecond]
:type datetime: list
:return: returns True if Values are in supposed range, returns False otherwise
>>> check_time([1999, 01, 01, 23, 59, 59, 999000])
True
>>> check_time([1999, 01, 01, 23, 59, 60, 999000])
False
>>> check_time([1999, 01, 01, 23, 59, 59, 1000000])
False
>>> check_time([1999, 01, 01, 23, 60, 59, 999000])
False
>>> check_time([1999, 01, 01, 23, 60, 59, 999000])
False
>>> check_time([1999, 01, 01, 24, 59, 59, 999000])
False
>>> check_time([1999, 01, 31, 23, 59, 59, 999000])
True
>>> check_time([1999, 02, 30, 23, 59, 59, 999000])
False
>>> check_time([1999, 02, 29, 23, 59, 59, 999000])
False
>>> check_time([2000, 02, 29, 23, 59, 59, 999000])
True
>>> check_time([2000, 13, 29, 23, 59, 59, 999000])
False
"""
try:
UTCDateTime(*datetime)
return True
except ValueError:
return False
def get_file_list(root_dir):
"""
Function uses a directorie to get all the *.gse files from it.
:param root_dir: a directorie leading to the .gse files
:type root_dir: string
:return: returns a list of filenames (without path to them)
"""
file_list = glob.glob1(root_dir, '*.gse')
return file_list
def checks_station_second(datetime, file):
"""
Function uses the given list to check if the parameter 'second' is set to 60 by mistake
and sets the time correctly if so. Can only correct time if no date change would be necessary.
:param datetime: [year, month, day, hour, minute, second, microsecond]
:return: returns the input with the correct value for second
"""
if datetime[5] == 60:
if datetime[4] == 59:
if datetime[3] == 23:
err_msg = 'Date should be next day. ' \
'File not changed: {0}'.format(file)
raise ValueError(err_msg)
else:
datetime[3] += 1
datetime[4] = 0
datetime[5] = 0
else:
datetime[4] += 1
datetime[5] = 0
return datetime
def make_time_line(line, datetime):
"""
Function takes in the original line from a .gse file and a list of date and
time values to make a new line with corrected date and time.
:param line: second line from .gse file.
:type line: string
:param datetime: list of integers [year, month, day, hour, minute, second, microsecond]
:type datetime: list
:return: returns a string to write it into a file.
"""
ins_form = '{0:02d}:{1:02d}:{2:02d}.{3:03d}'
insertion = ins_form.format(int(datetime[3]),
int(datetime[4]),
int(datetime[5]),
int(datetime[6] * 1e-3))
newline = line[:16] + insertion + line[28:]
return newline
def evt_head_check(root_dir, out_dir=None):
"""
A function to make sure that an arbitrary number of .gse files have correct values in their header.
:param root_dir: a directory leading to the .gse files.
:type root_dir: string
:param out_dir: a directory to store the new files somwhere els.
:return: returns nothing
"""
if not out_dir:
print('WARNING files are going to be overwritten!')
inp = str(raw_input('Continue? [y/N]'))
if not inp == 'y':
sys.exit()
filelist = get_file_list(root_dir)
nfiles = 0
for file in filelist:
infile = open(os.path.join(root_dir, file), 'r')
lines = infile.readlines()
infile.close()
datetime = time_from_header(lines[1])
if check_time(datetime):
continue
else:
nfiles += 1
datetime = checks_station_second(datetime, file)
print('writing ' + file)
# write File
lines[1] = make_time_line(lines[1], datetime)
if not out_dir:
out = open(os.path.join(root_dir, file), 'w')
out.writelines(lines)
out.close()
else:
out = open(os.path.join(out_dir, file), 'w')
out.writelines(lines)
out.close()
print(nfiles)
def read_metadata(path_to_inventory):
"""
take path_to_inventory and return either the corresponding list of files
found or the Parser object for a network dataless seed volume to prevent
read overhead for large dataless seed volumes
:param path_to_inventory:
:return: tuple containing a either list of files or `obspy.io.xseed.Parser`
object and the inventory type found
:rtype: tuple
"""
dlfile = list()
invfile = list()
respfile = list()
# possible file extensions specified here:
inv = dict(dless=dlfile, xml=invfile, resp=respfile, dseed=dlfile[:])
if os.path.isfile(path_to_inventory):
ext = os.path.splitext(path_to_inventory)[1].split('.')[1]
inv[ext] += [path_to_inventory]
else:
for ext in inv.keys():
inv[ext] += glob.glob1(path_to_inventory, '*.{0}'.format(ext))
invtype = key_for_set_value(inv)
if invtype is None:
print("Neither dataless-SEED file, inventory-xml file nor "
"RESP-file found!")
print("!!WRONG CALCULATION OF SOURCE PARAMETERS!!")
robj = None,
elif invtype == 'dless': # prevent multiple read of large dlsv
print("Reading metadata information from dataless-SEED file ...")
if len(inv[invtype]) == 1:
fullpath_inv = os.path.join(path_to_inventory, inv[invtype][0])
robj = Parser(fullpath_inv)
else:
robj = inv[invtype]
else:
print("Reading metadata information from inventory-xml file ...")
robj = inv[invtype]
return invtype, robj
def restitute_trace(input_tuple):
tr, invtype, inobj, unit, force = input_tuple
remove_trace = False
seed_id = tr.get_id()
# check, whether this trace has already been corrected
if 'processing' in tr.stats.keys() \
and np.any(['remove' in p for p in tr.stats.processing]) \
and not force:
print("Trace {0} has already been corrected!".format(seed_id))
return tr, False
stime = tr.stats.starttime
prefilt = get_prefilt(tr)
if invtype == 'resp':
fresp = find_in_list(inobj, seed_id)
if not fresp:
raise IOError('no response file found '
'for trace {0}'.format(seed_id))
fname = fresp
seedresp = dict(filename=fname,
date=stime,
units=unit)
kwargs = dict(paz_remove=None, pre_filt=prefilt, seedresp=seedresp)
elif invtype == 'dless':
if type(inobj) is list:
fname = Parser(find_in_list(inobj, seed_id))
else:
fname = inobj
seedresp = dict(filename=fname,
date=stime,
units=unit)
kwargs = dict(pre_filt=prefilt, seedresp=seedresp)
elif invtype == 'xml':
invlist = inobj
if len(invlist) > 1:
finv = find_in_list(invlist, seed_id)
else:
finv = invlist[0]
inventory = read_inventory(finv, format='STATIONXML')
elif invtype == None:
print("No restitution possible, as there are no station-meta data available!")
return tr, True
else:
remove_trace = True
# apply restitution to data
print("Correcting instrument at station %s, channel %s" \
% (tr.stats.station, tr.stats.channel))
try:
if invtype in ['resp', 'dless']:
try:
tr.simulate(**kwargs)
except ValueError as e:
vmsg = '{0}'.format(e)
print(vmsg)
else:
tr.attach_response(inventory)
tr.remove_response(output=unit,
pre_filt=prefilt)
except ValueError as e:
msg0 = 'Response for {0} not found in Parser'.format(seed_id)
msg1 = 'evalresp failed to calculate response'
if msg0 not in e.message or msg1 not in e.message:
raise
else:
# restitution done to copies of data thus deleting traces
# that failed should not be a problem
remove_trace = True
return tr, remove_trace
def restitute_data(data, invtype, inobj, unit='VEL', force=False, ncores=0):
"""
takes a data stream and a path_to_inventory and returns the corrected
waveform data stream
:param data: seismic data stream
:param invtype: type of found metadata
:param inobj: either list of metadata files or `obspy.io.xseed.Parser`
object
:param unit: unit to correct for (default: 'VEL')
:param force: force restitution for already corrected traces (default:
False)
:return: corrected data stream
"""
restflag = list()
data = remove_underscores(data)
# loop over traces
input_tuples = []
for tr in data:
input_tuples.append((tr, invtype, inobj, unit, force))
data.remove(tr)
pool = gen_Pool(ncores)
result = pool.map(restitute_trace, input_tuples)
pool.close()
for tr, remove_trace in result:
if not remove_trace:
data.traces.append(tr)
# check if ALL traces could be restituted, take care of large datasets
# better try restitution for smaller subsets of data (e.g. station by
# station)
# if len(restflag) > 0:
# restflag = bool(np.all(restflag))
# else:
# restflag = False
return data
def get_prefilt(trace, tlow=(0.5, 0.9), thi=(5., 2.), verbosity=0):
"""
takes a `obspy.core.stream.Trace` object, taper parameters tlow and thi and
returns the pre-filtering corner frequencies for the cosine taper for
further processing
:param trace: seismic data trace
:type trace: `obspy.core.stream.Trace`
:param tlow: tuple or list containing the desired lower corner
frequenices for a cosine taper
:type tlow: tuple or list
:param thi: tuple or list containing the percentage values of the
Nyquist frequency for the desired upper corner frequencies of the cosine
taper
:type thi: tuple or list
:param verbosity: verbosity level
:type verbosity: int
:return: pre-filt cosine taper corner frequencies
:rtype: tuple
..example::
>>> st = read()
>>> get_prefilt(st[0])
(0.5, 0.9, 47.5, 49.0)
"""
if verbosity:
print("Calculating pre-filter values for %s, %s ..." % (
trace.stats.station, trace.stats.channel))
# get corner frequencies for pre-filtering
fny = trace.stats.sampling_rate / 2
fc21 = fny - (fny * thi[0] / 100.)
fc22 = fny - (fny * thi[1] / 100.)
return (tlow[0], tlow[1], fc21, fc22)
if __name__ == "__main__":
import doctest
doctest.testmod()

View File

@@ -0,0 +1,95 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 26 12:31:25 2014
@author: sebastianw
"""
import os
import platform
from pylot.core.util.utils import readDefaultFilterInformation
from pylot.core.loc import hypo71
from pylot.core.loc import hypodd
from pylot.core.loc import hyposat
from pylot.core.loc import nll
from pylot.core.loc import velest
# determine system dependent path separator
system_name = platform.system()
if system_name in ["Linux", "Darwin"]:
SEPARATOR = '/'
elif system_name == "Windows":
SEPARATOR = '\\'
# suffix for phase name if not phase identified by last letter (P, p, etc.)
ALTSUFFIX = ['diff', 'n', 'g', '1', '2', '3']
FILTERDEFAULTS = readDefaultFilterInformation(os.path.join(os.path.expanduser('~'),
'.pylot',
'pylot.in'))
TIMEERROR_DEFAULTS = os.path.join(os.path.expanduser('~'),
'.pylot',
'PILOT_TimeErrors.in')
OUTPUTFORMATS = {'.xml': 'QUAKEML',
'.cnv': 'CNV',
'.obs': 'NLLOC_OBS'}
LOCTOOLS = dict(nll=nll, hyposat=hyposat, velest=velest, hypo71=hypo71, hypodd=hypodd)
class SetChannelComponents(object):
def __init__(self):
self.setDefaultCompPosition()
def setDefaultCompPosition(self):
# default component order
self.compPosition_Map = dict(Z=2, N=1, E=0)
self.compName_Map = {'3': 'Z',
'1': 'N',
'2': 'E'}
def _getCurrentPosition(self, component):
for key, value in self.compName_Map.items():
if value == component:
return key, value
errMsg = 'getCurrentPosition: Could not find former position of component {}.'.format(component)
raise ValueError(errMsg)
def _switch(self, component, component_alter):
# Without switching, multiple definitions of the same alter_comp are possible
old_alter_comp, _ = self._getCurrentPosition(component)
old_comp = self.compName_Map[component_alter]
if not old_alter_comp == component_alter and not old_comp == component:
self.compName_Map[old_alter_comp] = old_comp
print('switch: Automatically switched component {} to {}'.format(old_alter_comp, old_comp))
def setCompPosition(self, component_alter, component, switch=True):
component_alter = str(component_alter)
if not component_alter in self.compName_Map.keys():
errMsg = 'setCompPosition: Unrecognized alternative component {}. Expecting one of {}.'
raise ValueError(errMsg.format(component_alter, self.compName_Map.keys()))
if not component in self.compPosition_Map.keys():
errMsg = 'setCompPosition: Unrecognized target component {}. Expecting one of {}.'
raise ValueError(errMsg.format(component, self.compPosition_Map.keys()))
print('setCompPosition: set component {} to {}'.format(component_alter, component))
if switch:
self._switch(component, component_alter)
self.compName_Map[component_alter] = component
def getCompPosition(self, component):
return self._getCurrentPosition(component)[0]
def getPlotPosition(self, component):
component = str(component)
if component in self.compPosition_Map.keys():
return self.compPosition_Map[component]
elif component in self.compName_Map.keys():
return self.compPosition_Map[self.compName_Map[component]]
else:
errMsg = 'getCompPosition: Unrecognized component {}. Expecting one of {} or {}.'
raise ValueError(errMsg.format(component, self.compPosition_Map.keys(), self.compName_Map.keys()))

30
pylot/core/util/errors.py Normal file
View File

@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 20 09:47:04 2014
@author: sebastianw
"""
class OptionsError(Exception):
pass
class FormatError(Exception):
pass
class DatastructureError(Exception):
pass
class OverwriteError(IOError):
pass
class ParameterError(Exception):
pass
class ProcessingError(RuntimeError):
pass

172
pylot/core/util/event.py Normal file
View File

@@ -0,0 +1,172 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from obspy import UTCDateTime
from obspy.core.event import Event as ObsPyEvent
from obspy.core.event import Origin, ResourceIdentifier
from pylot.core.io.phases import picks_from_picksdict
class Event(ObsPyEvent):
'''
Pickable class derived from ~obspy.core.event.Event containing information on a single event.
'''
def __init__(self, path):
self.pylot_id = path.split('/')[-1]
# initialize super class
super(Event, self).__init__(resource_id=ResourceIdentifier('smi:local/' + self.pylot_id))
self.path = path
self.database = path.split('/')[-2]
self.datapath = path.split('/')[-3]
self.rootpath = '/' + os.path.join(*path.split('/')[:-3])
self.pylot_autopicks = {}
self.pylot_picks = {}
self.notes = ''
self._testEvent = False
self._refEvent = False
self.get_notes()
def get_notes_path(self):
notesfile = os.path.join(self.path, 'notes.txt')
return notesfile
def get_notes(self):
notesfile = self.get_notes_path()
if os.path.isfile(notesfile):
with open(notesfile) as infile:
path = str(infile.readlines()[0].split('\n')[0])
text = '[eventInfo: ' + path + ']'
self.addNotes(text)
try:
datetime = UTCDateTime(path.split('/')[-1])
origin = Origin(resource_id=self.resource_id, time=datetime, latitude=0, longitude=0, depth=0)
self.origins.append(origin)
except:
pass
def addNotes(self, notes):
self.notes = str(notes)
def clearNotes(self):
self.notes = None
def isRefEvent(self):
return self._refEvent
def isTestEvent(self):
return self._testEvent
def setRefEvent(self, bool):
self._refEvent = bool
if bool: self._testEvent = False
def setTestEvent(self, bool):
self._testEvent = bool
if bool: self._refEvent = False
def clearObsPyPicks(self, picktype):
for index, pick in reversed(list(enumerate(self.picks))):
if picktype in str(pick.method_id):
self.picks.pop(index)
def addPicks(self, picks):
'''
add pylot picks and overwrite existing ones
'''
for station in picks:
self.pylot_picks[station] = picks[station]
# add ObsPy picks (clear old manual and copy all new manual from pylot)
self.clearObsPyPicks('manual')
self.picks += picks_from_picksdict(self.pylot_picks)
def addAutopicks(self, autopicks):
for station in autopicks:
self.pylot_autopicks[station] = autopicks[station]
# add ObsPy picks (clear old auto and copy all new auto from pylot)
self.clearObsPyPicks('auto')
self.picks += picks_from_picksdict(self.pylot_autopicks)
def setPick(self, station, pick):
if pick:
self.pylot_picks[station] = pick
else:
try:
self.pylot_picks.pop(station)
except Exception as e:
print('Could not remove pick {} from station {}: {}'.format(pick, station, e))
self.clearObsPyPicks('manual')
self.picks += picks_from_picksdict(self.pylot_picks)
def setPicks(self, picks):
'''
set pylot picks and delete and overwrite all existing
'''
self.pylot_picks = picks
self.clearObsPyPicks('manual')
self.picks += picks_from_picksdict(self.pylot_picks)
def getPick(self, station):
if station in self.pylot_picks.keys():
return self.pylot_picks[station]
def getPicks(self):
return self.pylot_picks
def setAutopick(self, station, pick):
if pick:
self.pylot_autopicks[station] = pick
else:
try:
self.pylot_autopicks.pop(station)
except Exception as e:
print('Could not remove pick {} from station {}: {}'.format(pick, station, e))
self.clearObsPyPicks('auto')
self.picks += picks_from_picksdict(self.pylot_autopicks)
def setAutopicks(self, picks):
'''
set pylot picks and delete and overwrite all existing
'''
self.pylot_autopicks = picks
self.clearObsPyPicks('auto')
self.picks += picks_from_picksdict(self.pylot_autopicks)
def getAutopick(self, station):
if station in self.pylot_autopicks.keys():
return self.pylot_autopicks[station]
def getAutopicks(self):
return self.pylot_autopicks
def save(self, filename):
'''
Save PyLoT Event to a file.
Can be loaded by using event.load(filename).
'''
try:
import cPickle
except ImportError:
import _pickle as cPickle
try:
outfile = open(filename, 'wb')
cPickle.dump(self, outfile, -1)
except Exception as e:
print('Could not pickle PyLoT event. Reason: {}'.format(e))
@staticmethod
def load(filename):
'''
Load project from filename.
'''
try:
import cPickle
except ImportError:
import _pickle as cPickle
infile = open(filename, 'rb')
event = cPickle.load(infile)
print('Loaded %s' % filename)
return event

View File

@@ -0,0 +1,376 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
import obspy
from PySide import QtGui
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
from mpl_toolkits.basemap import Basemap
from pylot.core.util.widgets import PickDlg
from scipy.interpolate import griddata
plt.interactive(False)
class map_projection(QtGui.QWidget):
def __init__(self, parent, figure=None):
'''
:param: picked, can be False, auto, manual
:value: str
'''
QtGui.QWidget.__init__(self)
self._parent = parent
self.metadata = parent.metadata
self.parser = parent.metadata[1]
self.picks = None
self.picks_dict = None
self.eventLoc = None
self.figure = figure
self.init_graphics()
self.init_stations()
self.init_basemap(resolution='l')
self.init_map()
# self.show()
def init_map(self):
self.init_lat_lon_dimensions()
self.init_lat_lon_grid()
self.init_x_y_dimensions()
self.connectSignals()
self.draw_everything()
def onpick(self, event):
ind = event.ind
button = event.mouseevent.button
if ind == [] or not button == 1:
return
data = self._parent.get_data().getWFData()
for index in ind:
station = str(self.station_names[index].split('.')[-1])
try:
pickDlg = PickDlg(self, parameter=self._parent._inputs,
data=data.select(station=station),
station=station,
picks=self._parent.get_current_event().getPick(station),
autopicks=self._parent.get_current_event().getAutopick(station))
except Exception as e:
message = 'Could not generate Plot for station {st}.\n {er}'.format(st=station, er=e)
self._warn(message)
print(message, e)
return
pyl_mw = self._parent
try:
if pickDlg.exec_():
pyl_mw.setDirty(True)
pyl_mw.update_status('picks accepted ({0})'.format(station))
replot = pyl_mw.get_current_event().setPick(station, pickDlg.getPicks())
self._refresh_drawings()
if replot:
pyl_mw.plotWaveformData()
pyl_mw.drawPicks()
pyl_mw.draw()
else:
pyl_mw.drawPicks(station)
pyl_mw.draw()
else:
pyl_mw.update_status('picks discarded ({0})'.format(station))
except Exception as e:
message = 'Could not save picks for station {st}.\n{er}'.format(st=station, er=e)
self._warn(message)
print(message, e)
def connectSignals(self):
self.comboBox_phase.currentIndexChanged.connect(self._refresh_drawings)
self.zoom_id = self.basemap.ax.figure.canvas.mpl_connect('scroll_event', self.zoom)
def init_graphics(self):
if not self.figure:
if not hasattr(self._parent, 'am_figure'):
self.figure = plt.figure()
self.toolbar = NavigationToolbar(self.figure.canvas, self)
else:
self.figure = self._parent.am_figure
self.toolbar = self._parent.am_toolbar
self.main_ax = self.figure.add_subplot(111)
self.canvas = self.figure.canvas
self.main_box = QtGui.QVBoxLayout()
self.setLayout(self.main_box)
self.top_row = QtGui.QHBoxLayout()
self.main_box.addLayout(self.top_row)
self.comboBox_phase = QtGui.QComboBox()
self.comboBox_phase.insertItem(0, 'P')
self.comboBox_phase.insertItem(1, 'S')
self.comboBox_am = QtGui.QComboBox()
self.comboBox_am.insertItem(0, 'auto')
self.comboBox_am.insertItem(1, 'manual')
self.top_row.addWidget(QtGui.QLabel('Select a phase: '))
self.top_row.addWidget(self.comboBox_phase)
self.top_row.setStretch(1, 1) # set stretch of item 1 to 1
self.main_box.addWidget(self.canvas)
self.main_box.addWidget(self.toolbar)
def init_stations(self):
def get_station_names_lat_lon(parser):
station_names = []
lat = []
lon = []
for station in parser.stations:
station_name = station[0].station_call_letters
network = station[0].network_code
if not station_name in station_names:
station_names.append(network + '.' + station_name)
lat.append(station[0].latitude)
lon.append(station[0].longitude)
return station_names, lat, lon
station_names, lat, lon = get_station_names_lat_lon(self.parser)
self.station_names = station_names
self.lat = lat
self.lon = lon
def init_picks(self):
phase = self.comboBox_phase.currentText()
def get_picks(station_names):
picks = []
for station in station_names:
try:
station = station.split('.')[-1]
picks.append(self.picks_dict[station][phase]['mpp'])
except:
picks.append(np.nan)
return picks
def get_picks_rel(picks):
picks_rel = []
picks_utc = []
for pick in picks:
if type(pick) is obspy.core.utcdatetime.UTCDateTime:
picks_utc.append(pick)
minp = min(picks_utc)
for pick in picks:
if type(pick) is obspy.core.utcdatetime.UTCDateTime:
pick -= minp
picks_rel.append(pick)
return picks_rel
self.picks = get_picks(self.station_names)
self.picks_rel = get_picks_rel(self.picks)
def init_picks_active(self):
def remove_nan_picks(picks):
picks_no_nan = []
for pick in picks:
if not np.isnan(pick):
picks_no_nan.append(pick)
return picks_no_nan
self.picks_no_nan = remove_nan_picks(self.picks_rel)
def init_stations_active(self):
def remove_nan_lat_lon(picks, lat, lon):
lat_no_nan = []
lon_no_nan = []
for index, pick in enumerate(picks):
if not np.isnan(pick):
lat_no_nan.append(lat[index])
lon_no_nan.append(lon[index])
return lat_no_nan, lon_no_nan
self.lat_no_nan, self.lon_no_nan = remove_nan_lat_lon(self.picks_rel, self.lat, self.lon)
def init_lat_lon_dimensions(self):
def get_lon_lat_dim(lon, lat):
londim = max(lon) - min(lon)
latdim = max(lat) - min(lat)
return londim, latdim
self.londim, self.latdim = get_lon_lat_dim(self.lon, self.lat)
def init_x_y_dimensions(self):
def get_x_y_dim(x, y):
xdim = max(x) - min(x)
ydim = max(y) - min(y)
return xdim, ydim
self.x, self.y = self.basemap(self.lon, self.lat)
self.xdim, self.ydim = get_x_y_dim(self.x, self.y)
def init_basemap(self, resolution='l'):
# basemap = Basemap(projection=projection, resolution = resolution, ax=self.main_ax)
basemap = Basemap(projection='lcc', resolution=resolution, ax=self.main_ax,
width=5e6, height=2e6,
lat_0=(min(self.lat) + max(self.lat)) / 2.,
lon_0=(min(self.lon) + max(self.lon)) / 2.)
# basemap.fillcontinents(color=None, lake_color='aqua',zorder=1)
basemap.drawmapboundary(zorder=2) # fill_color='darkblue')
basemap.shadedrelief(zorder=3)
basemap.drawcountries(zorder=4)
basemap.drawstates(zorder=5)
basemap.drawcoastlines(zorder=6)
self.basemap = basemap
self.figure.tight_layout()
def init_lat_lon_grid(self):
def get_lat_lon_axis(lat, lon):
steplat = (max(lat) - min(lat)) / 250
steplon = (max(lon) - min(lon)) / 250
lataxis = np.arange(min(lat), max(lat), steplat)
lonaxis = np.arange(min(lon), max(lon), steplon)
return lataxis, lonaxis
def get_lat_lon_grid(lataxis, lonaxis):
longrid, latgrid = np.meshgrid(lonaxis, lataxis)
return latgrid, longrid
self.lataxis, self.lonaxis = get_lat_lon_axis(self.lat, self.lon)
self.latgrid, self.longrid = get_lat_lon_grid(self.lataxis, self.lonaxis)
def init_picksgrid(self):
self.picksgrid_no_nan = griddata((self.lat_no_nan, self.lon_no_nan),
self.picks_no_nan, (self.latgrid, self.longrid),
method='linear') ##################
def draw_contour_filled(self, nlevel='50'):
levels = np.linspace(min(self.picks_no_nan), max(self.picks_no_nan), nlevel)
self.contourf = self.basemap.contourf(self.longrid, self.latgrid, self.picksgrid_no_nan,
levels, latlon=True, zorder=9, alpha=0.5)
def scatter_all_stations(self):
self.sc = self.basemap.scatter(self.lon, self.lat, s=50, facecolor='none', latlon=True,
zorder=10, picker=True, edgecolor='m', label='Not Picked')
self.cid = self.canvas.mpl_connect('pick_event', self.onpick)
if self.eventLoc:
lat, lon = self.eventLoc
self.sc_event = self.basemap.scatter(lon, lat, s=100, facecolor='red',
latlon=True, zorder=11, label='Event (might be outside map region)')
def scatter_picked_stations(self):
lon = self.lon_no_nan
lat = self.lat_no_nan
# workaround because of an issue with latlon transformation of arrays with len <3
if len(lon) <= 2 and len(lat) <= 2:
self.sc_picked = self.basemap.scatter(lon[0], lat[0], s=50, facecolor='white',
c=self.picks_no_nan[0], latlon=True, zorder=11, label='Picked')
if len(lon) == 2 and len(lat) == 2:
self.sc_picked = self.basemap.scatter(lon[1], lat[1], s=50, facecolor='white',
c=self.picks_no_nan[1], latlon=True, zorder=11)
else:
self.sc_picked = self.basemap.scatter(lon, lat, s=50, facecolor='white',
c=self.picks_no_nan, latlon=True, zorder=11, label='Picked')
def annotate_ax(self):
self.annotations = []
for index, name in enumerate(self.station_names):
self.annotations.append(self.main_ax.annotate(' %s' % name, xy=(self.x[index], self.y[index]),
fontsize='x-small', color='white', zorder=12))
self.legend = self.main_ax.legend(loc=1)
def add_cbar(self, label):
cbar = self.main_ax.figure.colorbar(self.sc_picked, fraction=0.025)
cbar.set_label(label)
return cbar
def refresh_drawings(self, picks=None):
self.picks_dict = picks
self._refresh_drawings()
def _refresh_drawings(self):
self.remove_drawings()
self.draw_everything()
def draw_everything(self):
if self.picks_dict:
self.init_picks()
self.init_picks_active()
self.init_stations_active()
if len(self.picks_no_nan) >= 3:
self.init_picksgrid()
self.draw_contour_filled()
self.scatter_all_stations()
if self.picks_dict:
self.scatter_picked_stations()
self.cbar = self.add_cbar(label='Time relative to first onset [s]')
self.comboBox_phase.setEnabled(True)
else:
self.comboBox_phase.setEnabled(False)
self.annotate_ax()
self.canvas.draw()
def remove_drawings(self):
if hasattr(self, 'sc_picked'):
self.sc_picked.remove()
del (self.sc_picked)
if hasattr(self, 'sc_event'):
self.sc_event.remove()
del (self.sc_event)
if hasattr(self, 'cbar'):
self.cbar.remove()
del (self.cbar)
if hasattr(self, 'contourf'):
self.remove_contourf()
del (self.contourf)
if hasattr(self, 'cid'):
self.canvas.mpl_disconnect(self.cid)
del (self.cid)
try:
self.sc.remove()
except Exception as e:
print('Warning: could not remove station scatter plot.\nReason: {}'.format(e))
try:
self.legend.remove()
except Exception as e:
print('Warning: could not remove legend. Reason: {}'.format(e))
self.canvas.draw()
def remove_contourf(self):
for item in self.contourf.collections:
item.remove()
def remove_annotations(self):
for annotation in self.annotations:
annotation.remove()
def zoom(self, event):
map = self.basemap
xlim = map.ax.get_xlim()
ylim = map.ax.get_ylim()
x, y = event.xdata, event.ydata
zoom = {'up': 1. / 2.,
'down': 2.}
if not event.xdata or not event.ydata:
return
if event.button in zoom:
factor = zoom[event.button]
xdiff = (xlim[1] - xlim[0]) * factor
xl = x - 0.5 * xdiff
xr = x + 0.5 * xdiff
ydiff = (ylim[1] - ylim[0]) * factor
yb = y - 0.5 * ydiff
yt = y + 0.5 * ydiff
if xl < map.xmin or yb < map.ymin or xr > map.xmax or yt > map.ymax:
xl, xr = map.xmin, map.xmax
yb, yt = map.ymin, map.ymax
map.ax.set_xlim(xl, xr)
map.ax.set_ylim(yb, yt)
map.ax.figure.canvas.draw()
def _warn(self, message):
self.qmb = QtGui.QMessageBox(QtGui.QMessageBox.Icon.Warning,
'Warning', message)
self.qmb.show()

489
pylot/core/util/pdf.py Normal file
View File

@@ -0,0 +1,489 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import warnings
import numpy as np
from obspy import UTCDateTime
from pylot.core.util.utils import fit_curve, clims
from pylot.core.util.version import get_git_version as _getVersionString
__version__ = _getVersionString()
__author__ = 'sebastianw'
def create_axis(x0, incr, npts):
ax = np.zeros(npts)
for i in range(npts):
ax[i] = x0 + incr * i
return ax
def gauss_parameter(te, tm, tl, eta):
'''
takes three onset times and returns the parameters sig1, sig2, a1 and a2
to represent the pick as a probability density funtion (PDF) with two
Gauss branches
:param te:
:param tm:
:param tl:
:param eta:
:return:
'''
sig1 = (tm - te) / np.sqrt(2 * np.log(1 / eta))
sig2 = (tl - tm) / np.sqrt(2 * np.log(1 / eta))
a1 = 2 / (1 + sig2 / sig1)
a2 = 2 / (1 + sig1 / sig2)
return tm, sig1, sig2, a1, a2
def exp_parameter(te, tm, tl, eta):
'''
takes three onset times te, tm and tl and returns the parameters sig1,
sig2 and a to represent the pick as a probability density function (PDF)
with two exponential decay branches
:param te:
:param tm:
:param tl:
:param eta:
:return:
'''
sig1 = np.log(eta) / (te - tm)
sig2 = np.log(eta) / (tm - tl)
if np.isinf(sig1) == True:
sig1 = np.log(eta) / (tm - tl)
if np.isinf(sig2) == True:
sig2 = np.log(eta) / (te - tm)
a = 1 / (1 / sig1 + 1 / sig2)
return tm, sig1, sig2, a
def gauss_branches(k, param_tuple):
'''
function gauss_branches takes an axes x, a center value mu, two sigma
values sig1 and sig2 and two scaling factors a1 and a2 and return a
list containing the values of a probability density function (PDF)
consisting of gauss branches
:param x:
:type x:
:param mu:
:type mu:
:param sig1:
:type sig1:
:param sig2:
:type sig2:
:param a1:
:type a1:
:param a2:
:returns fun_vals: list with function values along axes x
'''
# python 3 workaround
mu, sig1, sig2, a1, a2 = param_tuple
def _func(k, mu, sig1, sig2, a1, a2):
if k < mu:
rval = a1 * 1 / (np.sqrt(2 * np.pi) * sig1) * np.exp(-((k - mu) / sig1) ** 2 / 2)
else:
rval = a2 * 1 / (np.sqrt(2 * np.pi) * sig2) * np.exp(-((k - mu) /
sig2) ** 2 / 2)
return rval
try:
return [_func(x, mu, sig1, sig2, a1, a2) for x in iter(k)]
except TypeError:
return _func(k, mu, sig1, sig2, a1, a2)
def exp_branches(k, param_tuple):
'''
function exp_branches takes an axes x, a center value mu, two sigma
values sig1 and sig2 and a scaling factor a and return a
list containing the values of a probability density function (PDF)
consisting of exponential decay branches
:param x:
:param mu:
:param sig1:
:param sig2:
:param a:
:returns fun_vals: list with function values along axes x:
'''
# python 3 workaround
mu, sig1, sig2, a = param_tuple
def _func(k, mu, sig1, sig2, a):
mu = float(mu)
if k < mu:
rval = a * np.exp(sig1 * (k - mu))
else:
rval = a * np.exp(-sig2 * (k - mu))
return rval
try:
return [_func(x, mu, sig1, sig2, a) for x in iter(k)]
except TypeError:
return _func(k, mu, sig1, sig2, a)
# define container dictionaries for different types of pdfs
parameter = dict(gauss=gauss_parameter, exp=exp_parameter)
branches = dict(gauss=gauss_branches, exp=exp_branches)
class ProbabilityDensityFunction(object):
'''
A probability density function toolkit.
'''
version = __version__
def __init__(self, x0, incr, npts, pdf, mu, params, eta=0.01):
self.x0 = x0
self.incr = incr
self.npts = npts
self.axis = create_axis(x0, incr, npts)
self.mu = mu
self.eta = eta
self._pdf = pdf
self.params = params
def __add__(self, other):
assert self.eta == other.eta, 'decline factors differ please use equally defined pdfs for comparison'
eta = self.eta
x0, incr, npts = self.commonparameter(other)
axis = create_axis(x0, incr, npts)
pdf_self = np.array(self.data(axis))
pdf_other = np.array(other.data(axis))
pdf = np.convolve(pdf_self, pdf_other, 'full') * incr
# shift axis values for correct plotting
npts = pdf.size
x0 *= 2
axis = create_axis(x0, incr, npts)
mu = axis[np.where(pdf == max(pdf))][0]
func, params = fit_curve(axis, pdf)
return ProbabilityDensityFunction(x0, incr, npts, func, mu,
params, eta)
def __sub__(self, other):
assert self.eta == other.eta, 'decline factors differ please use equally defined pdfs for comparison'
eta = self.eta
x0, incr, npts = self.commonparameter(other)
axis = create_axis(x0, incr, npts)
pdf_self = np.array(self.data(axis))
pdf_other = np.array(other.data(axis))
pdf = np.correlate(pdf_self, pdf_other, 'full') * incr
# shift axis values for correct plotting
npts = len(pdf)
midpoint = npts / 2
x0 = -incr * midpoint
axis = create_axis(x0, incr, npts)
mu = axis[np.where(pdf == max(pdf))][0]
func, params = fit_curve(axis, pdf)
return ProbabilityDensityFunction(x0, incr, npts, func, mu,
params, eta)
def __nonzero__(self):
prec = self.precision(self.incr)
data = np.array(self.data())
gtzero = np.all(data >= 0)
probone = bool(np.round(self.prob_gt_val(self.axis[0]), prec) == 1.)
return bool(gtzero and probone)
def __str__(self):
return str([self.data()])
@staticmethod
def precision(incr):
prec = int(np.ceil(np.abs(np.log10(incr)))) - 2
return prec if prec >= 0 else 0
def data(self, value=None):
if value is None:
return self._pdf(self.axis, self.params)
return self._pdf(value, self.params)
@property
def eta(self):
return self._eta
@eta.setter
def eta(self, value):
self._eta = value
@property
def mu(self):
return self._mu
@mu.setter
def mu(self, mu):
self._mu = mu
@property
def axis(self):
return self._x
@axis.setter
def axis(self, x):
self._x = np.array(x)
@classmethod
def from_pick(self, lbound, barycentre, rbound, incr=0.1, decfact=0.01,
type='exp'):
'''
Initialize a new ProbabilityDensityFunction object.
Takes incr, lbound, barycentre and rbound to derive x0 and the number
of points npts for the axis vector.
Maximum density
is given at the barycentre and on the boundaries the function has
declined to decfact times the maximum value. Integration of the
function over a particular interval gives the probability for the
variable value to be in that interval.
'''
# derive adequate window of definition
margin = 2. * np.max([barycentre - lbound, rbound - barycentre])
# find midpoint accounting also for `~obspy.UTCDateTime` object usage
try:
midpoint = (rbound + lbound) / 2
except TypeError:
try:
midpoint = (rbound + float(lbound)) / 2
except TypeError:
midpoint = float(rbound + float(lbound)) / 2
# find x0 on a grid point and sufficient npts
was_datetime = None
if isinstance(barycentre, UTCDateTime):
barycentre = float(barycentre)
was_datetime = True
n = int(np.ceil((barycentre - midpoint) / incr))
m = int(np.ceil((margin / incr)))
midpoint = barycentre - n * incr
margin = m * incr
x0 = midpoint - margin
npts = 2 * m
if was_datetime:
barycentre = UTCDateTime(barycentre)
# calculate parameter for pdf representing function
params = parameter[type](lbound, barycentre, rbound, decfact)
# select pdf type
pdf = branches[type]
# return the object
return ProbabilityDensityFunction(x0, incr, npts, pdf, barycentre,
params, decfact)
def broadcast(self, pdf, si, ei, data):
try:
pdf[si:ei] = data
except ValueError as e:
warnings.warn(str(e), Warning)
return self.broadcast(pdf, si, ei, data[:-1])
return pdf
def expectation(self):
'''
returns the expectation value of the actual pdf object
..formula::
mu_{\Delta t} = \int\limits_{-\infty}^\infty x \cdot f(x)dx
:return float: rval
'''
# rval = 0
# for x in self.axis:
# rval += x * self.data(x)
rval = self.mu
# Not sure about this! That might not be the barycentre.
# However, for std calculation (next function)
# self.mu is also used!! (LK, 02/2017)
return rval
def standard_deviation(self):
mu = self.mu
rval = 0
for x in self.axis:
rval += (x - float(mu)) ** 2 * self.data(x)
return rval * self.incr
def prob_lt_val(self, value):
if value <= self.axis[0] or value > self.axis[-1]:
raise ValueError('value out of bounds: {0}'.format(value))
return self.prob_limits((self.axis[0], value))
def prob_gt_val(self, value):
if value < self.axis[0] or value >= self.axis[-1]:
raise ValueError('value out of bounds: {0}'.format(value))
return self.prob_limits((value, self.axis[-1]))
def prob_limits(self, limits, oversampling=1.):
sampling = self.incr / oversampling
lim = np.arange(limits[0], limits[1], sampling)
data = self.data(lim)
min_est, max_est = 0., 0.
for n in range(len(data) - 1):
min_est += min(data[n], data[n + 1])
max_est += max(data[n], data[n + 1])
return (min_est + max_est) / 2. * sampling
def prob_val(self, value):
if not (self.axis[0] <= value <= self.axis[-1]):
Warning('{0} not on axis'.format(value))
return None
return self.data(value) * self.incr
def quantile(self, prob_value, eps=0.01):
'''
:param prob_value:
:param eps:
:return:
'''
l = self.axis[0]
r = self.axis[-1]
m = (r + l) / 2
diff = prob_value - self.prob_lt_val(m)
while abs(diff) > eps and ((r - l) > self.incr):
if diff > 0:
l = m
else:
r = m
m = (r + l) / 2
diff = prob_value - self.prob_lt_val(m)
return m
def quantile_distance(self, prob_value):
"""
takes a probability value and and returns the distance
between two complementary quantiles
.. math::
QA_\alpha = Q(1 - \alpha) - Q(\alpha)
:param value: probability value :math:\alpha
:type value: float
:return: quantile distance
"""
if 0 >= prob_value or prob_value >= 0.5:
raise ValueError('Value out of range.')
ql = self.quantile(prob_value)
qu = self.quantile(1 - prob_value)
return qu - ql
def quantile_dist_frac(self, x):
"""
takes a probability value and returns the fraction of two
corresponding quantile distances (
:func:`pylot.core.util.pdf.ProbabilityDensityFunction
#quantile_distance`)
.. math::
Q\Theta_\alpha = \frac{QA(0.5 - \alpha)}{QA(\alpha)}
:param value: probability value :math:\alpha
:return: quantile distance fraction
"""
if x <= 0 or x >= 0.25:
raise ValueError('Value out of range.')
return self.quantile_distance(0.5 - x) / self.quantile_distance(x)
def plot(self, label=None):
import matplotlib.pyplot as plt
plt.plot(self.axis, self.data())
plt.xlabel('x')
plt.ylabel('f(x)')
plt.autoscale(axis='x', tight=True)
if self:
title_str = 'Probability density function '
if label:
title_str += label
title_str.strip()
else:
title_str = 'Function not suitable as probability density function'
plt.title(title_str)
plt.show()
def limits(self):
l1 = self.x0
r1 = l1 + self.incr * self.npts
return l1, r1
def cincr(self, other):
if not self.incr == other.incr:
raise NotImplementedError(
'Upsampling of the lower sampled PDF not implemented yet!')
else:
return self.incr
def commonlimits(self, incr, other, max_npts=1e5):
'''
Takes an increment incr and two left and two right limits and returns
the left most limit and the minimum number of points needed to cover
the whole given interval.
:param incr:
:param l1:
:param l2:
:param r1:
:param r2:
:param max_npts:
:return:
'''
x0, r = clims(self.limits(), other.limits())
# calculate index for rounding
ri = self.precision(incr)
npts = int(round(r - x0, ri) // incr)
if npts > max_npts:
raise ValueError('Maximum number of points exceeded:\n'
'max_npts - %d\n'
'npts - %d\n' % (max_npts, npts))
npts = np.max([npts, self.npts, other.npts])
if npts < self.npts or npts < other.npts:
raise ValueError('new npts is to small')
return x0, npts
def commonparameter(self, other):
assert isinstance(other, ProbabilityDensityFunction), \
'both operands must be of type ProbabilityDensityFunction'
incr = self.cincr(other)
x0, npts = self.commonlimits(incr, other)
return x0, incr, npts

Some files were not shown because too many files have changed in this diff Show More