Awk notes

1 Remove repeated lines Sometimes we want to remove these repeated lines according to some column(s). 1 awk '!a[$2,$3]++' pushLog.log Above command will print the unique lines after removing repeated in columns 2 and 3. For instance, there are some SAC files with same header gcarc, and can use the following command to achieve that. 1 saclst gcarc f *.SAC | sort -k2 -n -r | awk '!

Basemap in Python

1 Installation Here, the platforms are windows 10 and Anaconda-3.5.3.0 (Python 3.7). Open anaconda prompt type pip install geos to install library geos; Go https://www.lfd.uci.edu/~gohlke/pythonlibs/ to download two libraries: pyproj‑2.6.1.post1‑cp37‑cp37m‑win_amd64.whl and basemap‑1.2.2‑cp37‑cp37m‑win_amd64.whl Type commands: pip install pyproj‑2.6.1.post1‑cp37‑cp37m‑win_amd64.whl and pip install basemap‑1.2.2‑cp37‑cp37m‑win_amd64.whl Now, we’ve installed Basemap and enjoy it! 2 The First Basemap 2.1 Satellite map 1 2 3 4 5 6 7 8 9 10 11 12 13 from mpl_toolkits.

Hello, there. Hope you have a nice journey. 1 1 2 3 4 5 2 2 3 4 5 6 3 3 4 5 6 7

The Journey to Digital Filter Design: Low-pass Filter

Butterworth filters $$ |H(w)|^2=\frac{1}{1+( \frac{tan\frac{\omega}{2}} {tan\frac{\omega_c}{2}})^{2N}} \tag{1} $$ Low-pass filter Given the attenuation values $A_c$ and $A_r$ at cut-off frequencies $\omega_c$ and $\omega_r$, respectively, we first calculate the orders $N$ of filter. We know, $$ \begin{aligned} A_r &= -20lg|H(\omega_s)|\\ &= -20lg\frac{1}{\sqrt{1+(\frac{tan\frac{\omega _r}{2}}{\frac{\omega_c}{2}})^{2N}}} \end{aligned} \tag{2}, $$ and the orders $N$ is given by $$ N = \frac{1}{2}\frac{lg(10^{\frac{A_r}{10}}-1)}{lg(\frac{tan\frac{\omega_r}{2}}{tan\frac{\omega_c}{2}})} \tag{3}. $$ However, if you give the filter orders $N$, it can control the width of transition band of the filter.

Cross-correlations From Seismic Ambient Noise

New responses between station pairs can be extracted from diffuse wave field by cross-correlating ambient seismic noise or coda (Campillo & Paul, 2003; Bensen et al., 2007). However, some processing techniques should be taken into consideration to retrieve clear emperical green’s functions (EGFs). Here we show these steps in detail. $\boxed{\text{Data processing steps}}$ 1. Cut data 2. Removing mean, trend and tapering 3. Removing instrument response 4. Band-pass filtering 5. Temperal normalization $\boxed{\text{One-bit}}$ $$ \tilde{d_j}=sign(d_j) \tag{1} $$ $\boxed{\text{run absolute mean}}$ $$ \begin{aligned} w_j &= \frac{1}{2N+1}\sum_{n=j-N}^{j+N}|d_n| \\