Commit 3e793bea authored by Semih Demir's avatar Semih Demir
Browse files

delete non necesarry scripts

parent defa2c04
......@@ -7,7 +7,7 @@ import pyasdf
import numpy as np
import scipy
from obspy import read, Trace
from dug_seis.testpick.phasepick.Statelevels import statelevel
from dug_seis.processing.Pickers.P_Phase_Picker_USGS.Statelevels import statelevel
# from matplotlib import pyplot as plt
def pphasepicker(test):
......@@ -19,7 +19,7 @@ def pphasepicker(test):
Tn = 0.01
xi = 0.6
#
# # Construct a fixed-base viscously damped SDF oscillator
omegan = 2 * np.pi / Tn; # natural frequency in radian/second
C = 2 * xi * omegan # viscous damping term
......
from obspy import read
import logging
from obspy import Stream
import os
import time
import pyasdf
from dug_seis.processing.dug_trigger import dug_trigger
from dug_seis.processing.event_processing import event_processing
import re
from obspy.signal import PPSD
from obspy import read
from obspy.io.xseed import Parser
asdf_folder = '/Users/sem/Documents/dug-seis-test/raw/merge/merge13_single' # 'raw' # Location of .h5 file
stations = [i - 1 for i in [19]]
stations.sort()
new_files = sorted([f for f in os.listdir(asdf_folder) if f.endswith('.h5') ]) # generates a list of the .asdf files in asdf_folder
print(new_files)
current_file = new_files.pop(0)
sta = Stream()
ds = pyasdf.ASDFDataSet(asdf_folder + '/' + current_file, mode='r')
wf_list = ds.waveforms.list()
for k in stations:
sta += ds.waveforms[wf_list[k]].raw_recording
print(sta[0])
# sta[0].decimate(factor=16, strict_length=False)
sta[0].resample(500, window='hanning', no_filter=True, strict_length=False)
# sta[0].spectrogram(log=True,wlen=sta[0].stats.sampling_rate/90,per_lap=0.99,show=True,dbscale=False)
st = read("https://examples.obspy.org/BW.KW1..EHZ.D.2011.037")
koek=1
inv = ['1']
ppsd = PPSD(sta[0].stats, metadata=inv)
ppsd.add(sta)
# ppsd.plot()
ppsd.plot_spectrogram()
# x=[1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 17, 25, 18, 26, 18, 26, 19, 27, 20, 28, 21, 29, 23, 31, 24, 32]
# y=sorted(x)
# print(y)
#channel_naming : [0,2,4,6,8,10,12,14,1,3,5,7,9,11,13,15,16,18,20,22,24,26,28,30,17,19,21,23,25,27,29,31]
#
# c_nam = 1 9 2 10 ... 16 17 25 18 26 .. 32
# c_nam = 1 9 2 10 3 11 4 12 5 13 6 14 7 15 8 16 17 25 18 26 19 27 20 28 21 29 22 30 23 31 24 32
c_nam = [1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 17, 25, 18, 26, 19, 27, 20, 28, 21, 29, 22, 30, 23, 31, 24, 32]
# print(sorted(c_nam))
cnam_cor=[i-1 for i in c_nam]
print(c_nam)
channel_naming=[0,2,4,6,8,10,12,14,1,3,5,7,9,11,13,15,16,18,20,22,24,26,28,30,17,19,21,23,25,27,29,31]
channel_naming1=[i+1 for i in channel_naming]
# print(channel_naming1)
# for i in range(0,len(channel_naming1)):
# find channel_naming(i) in c_nam and give the index
# teller=1
channelnaming1invers=[]
channelnaming1=[1,3,5,7,9,11,13,15,2,4,6,8,10,12,14,16,17,19,21,23,25,27,29,31,18,20,22,24,26,28,30,32]
# for i in range(0,len(channel_naming1)):
# if channel_naming1[i]==teller:
# channelnaming1invers.append(i)
# teller=teller+1
#
# print(channelnaming1invers)
for i in range(1,33):
channelnaming1invers.append(channelnaming1.index(i)+1)
print(channelnaming1invers)
# 18.655, 72.337, 13.381,
# 14.503, 78.192, 13.470,
# 12.605, 74.466, 13.441,
# 21.792, 67.946, 13.360,
# 17.638, 73.809, 13.397,
# 13.547, 79.520, 13.496,
# 13.574, 72.967, 13.427,
# 20.838, 69.465, 13.369,
# 16.641, 75.305, 13.428,
# 10.478, 77.285, 13.496,
# 14.598, 71.448, 13.410,
# 19.781, 70.950, 13.383,
# 15.495, 76.710, 13.424,
# 11.507, 75.913, 13.445,
# 15.745, 70.015, 13.400,
# 16.707, 68.573, 13.384,
# 21.792 67.946 13.360
# 20.838 69.465 13.369
# 19.781 70.950 13.383
# 18.655 72.337 13.381
# 17.638 73.809 13.397
# 16.641 75.305 13.428
# 15.495 76.710 13.424
# 14.503 78.192 13.470
# 13.547 79.520 13.496
# 10.478 77.285 13.496
# 11.507 75.913 13.445
# 12.605 74.466 13.441
# 13.574 72.967 13.427
# 14.598 71.448 13.410
# 15.745 70.015 13.400
# 16.707 68.573 13.384
#
#
# 17.676 67.099 13.375
# 18.790 65.669 13.363
# 21.792, 67.946, 13.360,
# 20.838,69.465,13.369,
# 19.781,70.950,13.383,
# 18.655,72.337,13.381,
# 17.638,73.809,13.397,
# 16.641,75.305,13.428,
# 15.495,76.710,13.424,
# 14.503,78.192,13.470,
# 13.547,79.520,13.496,
# 10.478,77.285,13.496,
# 11.507,75.913,13.445,
# 12.605,74.466,13.441,
# 13.574,72.967,13.427,
# 14.598,71.448,13.410,
# 15.745,70.015,13.400,
# 16.707,68.573,13.384,
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment