Skip to content

Instantly share code, notes, and snippets.

@iphysresearch
Last active June 2, 2020 06:30
Show Gist options
  • Save iphysresearch/0f9dbfe49e9ff2c43f85a253c9976fcb to your computer and use it in GitHub Desktop.
Save iphysresearch/0f9dbfe49e9ff2c43f85a253c9976fcb to your computer and use it in GitHub Desktop.
Chapter 4 - Waveform example
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(context='paper',
style='ticks',
font_scale=1,
rc={'figure.figsize': (8, 5),
'figure.dpi': 100, # need fixed
'xtick.direction': 'in',
'ytick.direction': 'in',
'axes.linewidth': '1.3',
'axes.labelsize': 12,
'xtick.labelsize': 12,
'ytick.labelsize': 12,
'savefig.dpi': 300,
'legend.fontsize': 10,
# 'text.usetex':True,
})
# 链接:https://pan.baidu.com/s/1D-Djfo0ve81lRJ3jUpwhKg 密码:wo9r
data_train = np.load('./GWaveform/data_T2_fs8192_1.81.8_train.npy')[:,1]
print(data_train.shape)
plt.figure(figsize=(8, 5), dpi=100)
plt.plot(np.linspace(0,1,data_train.shape[-1]), data_train[1133,0,-data_train.shape[-1]:],
label='$70M_\odot+70M_\odot$')
plt.xlabel('Time [sec]')
plt.ylabel('Strain')
plt.legend()
plt.savefig('C4_imags/C4_Waveform.png', dpi=300, bbox_inches='tight')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment