Compare commits
34 Commits
e434bda993
...
9cc301e2c6
Author | SHA1 | Date | |
---|---|---|---|
9cc301e2c6 | |||
65b456b8ab | |||
0709fb04a5 | |||
2515715193 | |||
a2add3034a | |||
090bfb47d1 | |||
72f021cdc1 | |||
e5c7404bb6 | |||
1a148a8a72 | |||
8623cc3dd3 | |||
cb457fc7ec | |||
eb077e4bd6 | |||
2b01e8207e | |||
6cce05b035 | |||
7326f061e5 | |||
1a18401fe3 | |||
ec930dbc12 | |||
b991f771af | |||
2c3b1876ab | |||
0acd23d4d0 | |||
f349c8bc7e | |||
6688ef845d | |||
5b18e9ab71 | |||
65dbaad446 | |||
5b97d51517 | |||
b3fdbc811e | |||
9fce4998d3 | |||
c468bfbe84 | |||
4861d33e9a | |||
f5f4635c3d | |||
b12d92eebb | |||
e9da81376e | |||
e68fc849f0 | |||
efb117177c |
6
PyLoT.py
6
PyLoT.py
@ -59,7 +59,7 @@ except ImportError:
|
||||
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
||||
from matplotlib.figure import Figure
|
||||
|
||||
from pylot.core.analysis.magnitude import LocalMagnitude, MomentMagnitude, calcsourcespec
|
||||
from pylot.core.analysis.magnitude import LocalMagnitude, MomentMagnitude
|
||||
from pylot.core.io.data import Data
|
||||
from pylot.core.io.inputs import FilterOptions, PylotParameter
|
||||
from autoPyLoT import autoPyLoT
|
||||
@ -76,12 +76,12 @@ from pylot.core.util.utils import fnConstructor, get_login, \
|
||||
full_range, readFilterInformation, pick_color_plt, \
|
||||
pick_linestyle_plt, identifyPhaseID, excludeQualityClasses, \
|
||||
transform_colors_mpl, transform_colors_mpl_str, getAutoFilteroptions, check_all_obspy, \
|
||||
check_all_pylot, get_bool, get_None, get_pylot_eventfile_with_extension
|
||||
check_all_pylot, get_bool, get_none
|
||||
from pylot.core.util.gui import make_pen
|
||||
from pylot.core.util.widgets import FilterOptionsDialog, PylotCanvas, WaveformWidgetPG, PropertiesDlg, HelpForm, createAction, PickDlg, \
|
||||
ComparisonWidget, TuneAutopicker, PylotParaBox, AutoPickDlg, CanvasWidget, AutoPickWidget, \
|
||||
CompareEventsWidget, ProgressBarWidget, AddMetadataWidget, SingleTextLineDialog, LogWidget, PickQualitiesFromXml, \
|
||||
SourceSpecWindow, ChooseWaveFormWindow, SpectrogramTab, SearchFileByExtensionDialog
|
||||
SpectrogramTab, SearchFileByExtensionDialog
|
||||
from pylot.core.util.array_map import Array_map
|
||||
from pylot.core.util.structure import DATASTRUCTURE
|
||||
from pylot.core.util.thread import Thread, Worker
|
||||
|
@ -8,6 +8,7 @@ import platform
|
||||
import re
|
||||
import subprocess
|
||||
import warnings
|
||||
from typing import Literal, Tuple, Type
|
||||
from functools import lru_cache
|
||||
|
||||
import numpy as np
|
||||
@ -106,7 +107,7 @@ def gen_Pool(ncores=0):
|
||||
|
||||
print('gen_Pool: Generated multiprocessing Pool with {} cores\n'.format(ncores))
|
||||
|
||||
pool = multiprocessing.Pool(ncores)
|
||||
pool = multiprocessing.Pool(ncores, maxtasksperchild=100)
|
||||
return pool
|
||||
|
||||
|
||||
@ -360,7 +361,7 @@ def get_bool(value):
|
||||
>>> get_bool('Stream')
|
||||
'Stream'
|
||||
"""
|
||||
if type(value) == bool:
|
||||
if type(value) is bool:
|
||||
return value
|
||||
elif value in ['True', 'true']:
|
||||
return True
|
||||
@ -901,19 +902,6 @@ def trim_station_components(data, trim_start=True, trim_end=True):
|
||||
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):
|
||||
"""
|
||||
check for gaps in Stream and remove them
|
||||
@ -934,12 +922,12 @@ def check4gapsAndRemove(data):
|
||||
return data
|
||||
|
||||
|
||||
def check4gapsAndMerge(data):
|
||||
def check_for_gaps_and_merge(data):
|
||||
"""
|
||||
check for gaps in Stream and merge if gaps are found
|
||||
:param data: stream of seismic data
|
||||
:type data: `~obspy.core.stream.Stream`
|
||||
:return: data stream
|
||||
:return: data stream, gaps returned from obspy get_gaps
|
||||
:rtype: `~obspy.core.stream.Stream`
|
||||
"""
|
||||
gaps = data.get_gaps()
|
||||
@ -950,7 +938,7 @@ def check4gapsAndMerge(data):
|
||||
for merged_station in merged:
|
||||
print(merged_station)
|
||||
|
||||
return data
|
||||
return data, gaps
|
||||
|
||||
|
||||
def check4doubled(data):
|
||||
@ -1218,6 +1206,7 @@ def identifyPhase(phase):
|
||||
return False
|
||||
|
||||
|
||||
@lru_cache
|
||||
def identifyPhaseID(phase):
|
||||
"""
|
||||
Returns phase id (capital P or S)
|
||||
|
@ -1,9 +1,12 @@
|
||||
# This file may be used to create an environment using:
|
||||
# $ conda create --name <env> --file <this file>
|
||||
# platform: win-64
|
||||
cartopy>=0.20.2
|
||||
numpy<2
|
||||
obspy>=1.3.0
|
||||
pyqtgraph>=0.12.4
|
||||
pyside2>=5.13.2
|
||||
scipy>=1.8.0
|
||||
cartopy=0.20.2
|
||||
matplotlib-base=3.3.4
|
||||
numpy=1.22.3
|
||||
obspy=1.3.0
|
||||
pyqtgraph=0.12.4
|
||||
pyside2=5.13.2
|
||||
python=3.8.12
|
||||
qt=5.12.9
|
||||
scipy=1.8.0
|
Loading…
x
Reference in New Issue
Block a user