From d954c3bbe8010eba3069f0264aba048712d4fc2d Mon Sep 17 00:00:00 2001 From: Sebastianw Wehling-Benatelli Date: Mon, 21 Mar 2016 11:14:16 +0100 Subject: [PATCH] [edit] restructuring autopicking module renamed several function and classes, moved script files to scripts --- pylot/core/active/seismicshot.py | 4 ++-- pylot/core/pick/autopick.py | 4 ++-- pylot/core/pick/{CharFuns.py => charfuns.py} | 0 pylot/core/pick/{Picker.py => picker.py} | 8 ++++---- pylot/core/pick/run_makeCF.py | 4 ++-- .../{pick/getnoisewin.py => scripts/pylot-noisewindow.py} | 2 +- .../pylot-pick-earliest-latest.py} | 0 .../fmpicker.py => scripts/pylot-pick-firstmotion.py} | 4 ++-- .../getsignalwin.py => scripts/pylot-signalwindow.py} | 2 +- pylot/core/{pick/getSNR.py => scripts/pylot-snr.py} | 2 +- test_autopick.py | 4 ++-- 11 files changed, 17 insertions(+), 17 deletions(-) rename pylot/core/pick/{CharFuns.py => charfuns.py} (100%) rename pylot/core/pick/{Picker.py => picker.py} (99%) rename pylot/core/{pick/getnoisewin.py => scripts/pylot-noisewindow.py} (87%) rename pylot/core/{pick/earllatepicker.py => scripts/pylot-pick-earliest-latest.py} (100%) rename pylot/core/{pick/fmpicker.py => scripts/pylot-pick-firstmotion.py} (74%) rename pylot/core/{pick/getsignalwin.py => scripts/pylot-signalwindow.py} (85%) rename pylot/core/{pick/getSNR.py => scripts/pylot-snr.py} (93%) diff --git a/pylot/core/active/seismicshot.py b/pylot/core/active/seismicshot.py index 8fbdbfb8..23fd6022 100644 --- a/pylot/core/active/seismicshot.py +++ b/pylot/core/active/seismicshot.py @@ -6,8 +6,8 @@ import numpy as np from obspy.core import read from obspy import Stream from obspy import Trace -from pylot.core.pick.CharFuns import HOScf -from pylot.core.pick.CharFuns import AICcf +from pylot.core.pick.charfuns import HOScf +from pylot.core.pick.charfuns import AICcf from pylot.core.pick.utils import getSNR from pylot.core.pick.utils import earllatepicker import matplotlib.pyplot as plt diff --git a/pylot/core/pick/autopick.py b/pylot/core/pick/autopick.py index fd86f600..8d81f144 100755 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -12,8 +12,8 @@ function conglomerate utils. import matplotlib.pyplot as plt import numpy as np from scipy import integrate -from pylot.core.pick.Picker import AICPicker, PragPicker -from pylot.core.pick.CharFuns import HOScf, AICcf, ARZcf, ARHcf, AR3Ccf +from pylot.core.pick.picker import AICPicker, PragPicker +from pylot.core.pick.charfuns import HOScf, AICcf, ARZcf, ARHcf, AR3Ccf from pylot.core.pick.utils import checksignallength, checkZ4S, earllatepicker,\ getSNR, fmpicker, checkPonsets, wadaticheck from pylot.core.util.utils import getPatternLine diff --git a/pylot/core/pick/CharFuns.py b/pylot/core/pick/charfuns.py similarity index 100% rename from pylot/core/pick/CharFuns.py rename to pylot/core/pick/charfuns.py diff --git a/pylot/core/pick/Picker.py b/pylot/core/pick/picker.py similarity index 99% rename from pylot/core/pick/Picker.py rename to pylot/core/pick/picker.py index b7d57481..da91d833 100644 --- a/pylot/core/pick/Picker.py +++ b/pylot/core/pick/picker.py @@ -22,10 +22,10 @@ calculated after Diehl & Kissling (2009). import numpy as np import matplotlib.pyplot as plt from pylot.core.pick.utils import getnoisewin, getsignalwin -from pylot.core.pick.CharFuns import CharacteristicFunction +from pylot.core.pick.charfuns import CharacteristicFunction import warnings -class AutoPicking(object): +class AutoPicker(object): ''' Superclass of different, automated picking algorithms applied on a CF determined using AIC, HOS, or AR prediction. @@ -137,7 +137,7 @@ class AutoPicking(object): self.Pick = None -class AICPicker(AutoPicking): +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, @@ -289,7 +289,7 @@ class AICPicker(AutoPicking): print('AICPicker: Could not find minimum, picking window too short?') -class PragPicker(AutoPicking): +class PragPicker(AutoPicker): ''' Method of pragmatic picking exploiting information given by CF. ''' diff --git a/pylot/core/pick/run_makeCF.py b/pylot/core/pick/run_makeCF.py index 2ecd636f..b57172a6 100755 --- a/pylot/core/pick/run_makeCF.py +++ b/pylot/core/pick/run_makeCF.py @@ -9,8 +9,8 @@ from obspy.core import read import matplotlib.pyplot as plt import numpy as np -from pylot.core.pick.CharFuns import CharacteristicFunction -from pylot.core.pick.Picker import AutoPicking +from pylot.core.pick.charfuns import CharacteristicFunction +from pylot.core.pick.picker import AutoPicker from pylot.core.pick.utils import * import glob import argparse diff --git a/pylot/core/pick/getnoisewin.py b/pylot/core/scripts/pylot-noisewindow.py similarity index 87% rename from pylot/core/pick/getnoisewin.py rename to pylot/core/scripts/pylot-noisewindow.py index 8c21913f..9a4cb00c 100644 --- a/pylot/core/pick/getnoisewin.py +++ b/pylot/core/scripts/pylot-noisewindow.py @@ -7,7 +7,7 @@ from pylot.core.pick.utils import getnoisewin if __name__ == "__main__": parser = argparse.ArgumentParser() - parser.add_argument('--t', type=~numpy.array, help='numpy array of time stamps') + parser.add_argument('--t', type=numpy.array, help='numpy array of time stamps') parser.add_argument('--t1', type=float, help='time from which relativ to it noise window is extracted') parser.add_argument('--tnoise', type=float, help='length of time window [s] for noise part extraction') parser.add_argument('--tgap', type=float, help='safety gap between signal (t1=onset) and noise') diff --git a/pylot/core/pick/earllatepicker.py b/pylot/core/scripts/pylot-pick-earliest-latest.py similarity index 100% rename from pylot/core/pick/earllatepicker.py rename to pylot/core/scripts/pylot-pick-earliest-latest.py diff --git a/pylot/core/pick/fmpicker.py b/pylot/core/scripts/pylot-pick-firstmotion.py similarity index 74% rename from pylot/core/pick/fmpicker.py rename to pylot/core/scripts/pylot-pick-firstmotion.py index 0ccbc1d1..2952480e 100755 --- a/pylot/core/pick/fmpicker.py +++ b/pylot/core/scripts/pylot-pick-firstmotion.py @@ -13,8 +13,8 @@ from pylot.core.pick.utils import fmpicker if __name__ == "__main__": parser = argparse.ArgumentParser() - parser.add_argument('--Xraw', type=~obspy.core.stream.Stream, help='unfiltered time series (seismogram) read with obspy module read') - parser.add_argument('--Xfilt', type=~obspy.core.stream.Stream, help='filtered time series (seismogram) read with obspy module read') + parser.add_argument('--Xraw', type=obspy.core.stream.Stream, help='unfiltered time series (seismogram) read with obspy module read') + parser.add_argument('--Xfilt', type=obspy.core.stream.Stream, help='filtered time series (seismogram) read with obspy module read') parser.add_argument('--pickwin', type=float, help='length of pick window [s] for first motion determination') parser.add_argument('--Pick', type=float, help='Onset time of most likely pick') parser.add_argument('--iplot', type=int, help='if set, figure no. iplot occurs') diff --git a/pylot/core/pick/getsignalwin.py b/pylot/core/scripts/pylot-signalwindow.py similarity index 85% rename from pylot/core/pick/getsignalwin.py rename to pylot/core/scripts/pylot-signalwindow.py index 4b3013b8..2655c6ea 100644 --- a/pylot/core/pick/getsignalwin.py +++ b/pylot/core/scripts/pylot-signalwindow.py @@ -7,7 +7,7 @@ from pylot.core.pick.utils import getsignalwin if __name__ == "__main__": parser = argparse.ArgumentParser() - parser.add_argument('--t', type=~numpy.array, help='numpy array of time stamps') + parser.add_argument('--t', type=numpy.array, help='numpy array of time stamps') parser.add_argument('--t1', type=float, help='time from which relativ to it signal window is extracted') parser.add_argument('--tsignal', type=float, help='length of time window [s] for signal part extraction') args = parser.parse_args() diff --git a/pylot/core/pick/getSNR.py b/pylot/core/scripts/pylot-snr.py similarity index 93% rename from pylot/core/pick/getSNR.py rename to pylot/core/scripts/pylot-snr.py index bbfbdba5..5c932e87 100644 --- a/pylot/core/pick/getSNR.py +++ b/pylot/core/scripts/pylot-snr.py @@ -14,7 +14,7 @@ from pylot.core.pick.utils import getSNR if __name__ == "__main__": parser = argparse.ArgumentParser() - parser.add_argument('--data', '-d', type=~obspy.core.stream.Stream, + parser.add_argument('--data', '-d', type=obspy.core.stream.Stream, help='time series (seismogram) read with obspy module ' 'read', dest='data') diff --git a/test_autopick.py b/test_autopick.py index bc942eab..1b668cf7 100755 --- a/test_autopick.py +++ b/test_autopick.py @@ -9,8 +9,8 @@ from obspy.core import read import matplotlib.pyplot as plt import numpy as np -from pylot.core.pick.CharFuns import * -from pylot.core.pick.Picker import * +from pylot.core.pick.charfuns import * +from pylot.core.pick.picker import * import glob import argparse