Compare commits
31 Commits
9cc301e2c6
...
e434bda993
Author | SHA1 | Date | |
---|---|---|---|
|
e434bda993 | ||
c0c3cbbd7b | |||
76d4ec290c | |||
63dac0fff6 | |||
b15cfe2e1d | |||
29a1e4ebe6 | |||
50cabb0038 | |||
8dd5789b0c | |||
c4aeab0d89 | |||
ef69fc429f | |||
c8f9c1c33a | |||
59f2c4b46f | |||
8eb958c91b | |||
6b7f297d7a | |||
70d5c2d621 | |||
7393201b90 | |||
d02f74ab10 | |||
0a5f5f0817 | |||
db976e5ea9 | |||
c021ca19d7 | |||
356988e71d | |||
ad62284e0e | |||
0fb0b0f11c | |||
e3dd4a4e28 | |||
2bbb84190c | |||
fb32d5e0c5 | |||
f043401cc0 | |||
eb15382b5f | |||
7fbc3bc5ae | |||
221743fe20 | |||
554afc5a81 |
6
PyLoT.py
6
PyLoT.py
@ -59,7 +59,7 @@ except ImportError:
|
|||||||
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
||||||
from matplotlib.figure import Figure
|
from matplotlib.figure import Figure
|
||||||
|
|
||||||
from pylot.core.analysis.magnitude import LocalMagnitude, MomentMagnitude
|
from pylot.core.analysis.magnitude import LocalMagnitude, MomentMagnitude, calcsourcespec
|
||||||
from pylot.core.io.data import Data
|
from pylot.core.io.data import Data
|
||||||
from pylot.core.io.inputs import FilterOptions, PylotParameter
|
from pylot.core.io.inputs import FilterOptions, PylotParameter
|
||||||
from autoPyLoT import autoPyLoT
|
from autoPyLoT import autoPyLoT
|
||||||
@ -76,12 +76,12 @@ from pylot.core.util.utils import fnConstructor, get_login, \
|
|||||||
full_range, readFilterInformation, pick_color_plt, \
|
full_range, readFilterInformation, pick_color_plt, \
|
||||||
pick_linestyle_plt, identifyPhaseID, excludeQualityClasses, \
|
pick_linestyle_plt, identifyPhaseID, excludeQualityClasses, \
|
||||||
transform_colors_mpl, transform_colors_mpl_str, getAutoFilteroptions, check_all_obspy, \
|
transform_colors_mpl, transform_colors_mpl_str, getAutoFilteroptions, check_all_obspy, \
|
||||||
check_all_pylot, get_bool, get_none
|
check_all_pylot, get_bool, get_None, get_pylot_eventfile_with_extension
|
||||||
from pylot.core.util.gui import make_pen
|
from pylot.core.util.gui import make_pen
|
||||||
from pylot.core.util.widgets import FilterOptionsDialog, PylotCanvas, WaveformWidgetPG, PropertiesDlg, HelpForm, createAction, PickDlg, \
|
from pylot.core.util.widgets import FilterOptionsDialog, PylotCanvas, WaveformWidgetPG, PropertiesDlg, HelpForm, createAction, PickDlg, \
|
||||||
ComparisonWidget, TuneAutopicker, PylotParaBox, AutoPickDlg, CanvasWidget, AutoPickWidget, \
|
ComparisonWidget, TuneAutopicker, PylotParaBox, AutoPickDlg, CanvasWidget, AutoPickWidget, \
|
||||||
CompareEventsWidget, ProgressBarWidget, AddMetadataWidget, SingleTextLineDialog, LogWidget, PickQualitiesFromXml, \
|
CompareEventsWidget, ProgressBarWidget, AddMetadataWidget, SingleTextLineDialog, LogWidget, PickQualitiesFromXml, \
|
||||||
SpectrogramTab, SearchFileByExtensionDialog
|
SourceSpecWindow, ChooseWaveFormWindow, SpectrogramTab, SearchFileByExtensionDialog
|
||||||
from pylot.core.util.array_map import Array_map
|
from pylot.core.util.array_map import Array_map
|
||||||
from pylot.core.util.structure import DATASTRUCTURE
|
from pylot.core.util.structure import DATASTRUCTURE
|
||||||
from pylot.core.util.thread import Thread, Worker
|
from pylot.core.util.thread import Thread, Worker
|
||||||
|
@ -8,7 +8,6 @@ import platform
|
|||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import warnings
|
import warnings
|
||||||
from typing import Literal, Tuple, Type
|
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -107,7 +106,7 @@ def gen_Pool(ncores=0):
|
|||||||
|
|
||||||
print('gen_Pool: Generated multiprocessing Pool with {} cores\n'.format(ncores))
|
print('gen_Pool: Generated multiprocessing Pool with {} cores\n'.format(ncores))
|
||||||
|
|
||||||
pool = multiprocessing.Pool(ncores, maxtasksperchild=100)
|
pool = multiprocessing.Pool(ncores)
|
||||||
return pool
|
return pool
|
||||||
|
|
||||||
|
|
||||||
@ -361,7 +360,7 @@ def get_bool(value):
|
|||||||
>>> get_bool('Stream')
|
>>> get_bool('Stream')
|
||||||
'Stream'
|
'Stream'
|
||||||
"""
|
"""
|
||||||
if type(value) is bool:
|
if type(value) == bool:
|
||||||
return value
|
return value
|
||||||
elif value in ['True', 'true']:
|
elif value in ['True', 'true']:
|
||||||
return True
|
return True
|
||||||
@ -902,6 +901,19 @@ def trim_station_components(data, trim_start=True, trim_end=True):
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
def merge_stream(stream):
|
||||||
|
gaps = stream.get_gaps()
|
||||||
|
if gaps:
|
||||||
|
# list of merged stations (seed_ids)
|
||||||
|
merged = ['{}.{}.{}.{}'.format(*gap[:4]) for gap in gaps]
|
||||||
|
stream.merge(method=1)
|
||||||
|
print('Merged the following stations because of gaps:')
|
||||||
|
for merged_station in merged:
|
||||||
|
print(merged_station)
|
||||||
|
|
||||||
|
return stream, gaps
|
||||||
|
|
||||||
|
|
||||||
def check4gapsAndRemove(data):
|
def check4gapsAndRemove(data):
|
||||||
"""
|
"""
|
||||||
check for gaps in Stream and remove them
|
check for gaps in Stream and remove them
|
||||||
@ -922,12 +934,12 @@ def check4gapsAndRemove(data):
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
def check_for_gaps_and_merge(data):
|
def check4gapsAndMerge(data):
|
||||||
"""
|
"""
|
||||||
check for gaps in Stream and merge if gaps are found
|
check for gaps in Stream and merge if gaps are found
|
||||||
:param data: stream of seismic data
|
:param data: stream of seismic data
|
||||||
:type data: `~obspy.core.stream.Stream`
|
:type data: `~obspy.core.stream.Stream`
|
||||||
:return: data stream, gaps returned from obspy get_gaps
|
:return: data stream
|
||||||
:rtype: `~obspy.core.stream.Stream`
|
:rtype: `~obspy.core.stream.Stream`
|
||||||
"""
|
"""
|
||||||
gaps = data.get_gaps()
|
gaps = data.get_gaps()
|
||||||
@ -938,7 +950,7 @@ def check_for_gaps_and_merge(data):
|
|||||||
for merged_station in merged:
|
for merged_station in merged:
|
||||||
print(merged_station)
|
print(merged_station)
|
||||||
|
|
||||||
return data, gaps
|
return data
|
||||||
|
|
||||||
|
|
||||||
def check4doubled(data):
|
def check4doubled(data):
|
||||||
@ -1206,7 +1218,6 @@ def identifyPhase(phase):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
@lru_cache
|
|
||||||
def identifyPhaseID(phase):
|
def identifyPhaseID(phase):
|
||||||
"""
|
"""
|
||||||
Returns phase id (capital P or S)
|
Returns phase id (capital P or S)
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
# This file may be used to create an environment using:
|
# This file may be used to create an environment using:
|
||||||
# $ conda create --name <env> --file <this file>
|
# $ conda create --name <env> --file <this file>
|
||||||
# platform: win-64
|
# platform: win-64
|
||||||
cartopy=0.20.2
|
cartopy>=0.20.2
|
||||||
matplotlib-base=3.3.4
|
numpy<2
|
||||||
numpy=1.22.3
|
obspy>=1.3.0
|
||||||
obspy=1.3.0
|
pyqtgraph>=0.12.4
|
||||||
pyqtgraph=0.12.4
|
pyside2>=5.13.2
|
||||||
pyside2=5.13.2
|
scipy>=1.8.0
|
||||||
python=3.8.12
|
|
||||||
qt=5.12.9
|
|
||||||
scipy=1.8.0
|
|
Loading…
x
Reference in New Issue
Block a user