{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"## Easy way to plot the different gravitational waves","metadata":{}},{"cell_type":"code","source":"import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nfrom PIL import Image\nimport matplotlib.pyplot as plt","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2021-08-26T14:56:26.769928Z","iopub.execute_input":"2021-08-26T14:56:26.770398Z","iopub.status.idle":"2021-08-26T14:56:26.775819Z","shell.execute_reply.started":"2021-08-26T14:56:26.770359Z","shell.execute_reply":"2021-08-26T14:56:26.774485Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def plot_series(path):\n    labels = pd.read_csv(\"../input/g2net-gravitational-wave-detection/training_labels.csv\")\n    data = np.load(path)\n    name = (path.split(\"/\")[-1]).split(\".\")[0]\n    color = ['red','blue','green']\n    signal_names = [\"LIGO Hanford\", \"LIGO Livingston\", \"Virgo\"]\n    fig, axs = plt.subplots(3,1,figsize=(13,11))\n    plt.suptitle(\"Target : {}\".format(labels[labels[\"id\"] == name].iloc[0][1]), size=16)\n    for i in range(3):\n        axs[i].plot(data[i], color = color[i])\n        axs[i].title.set_text(signal_names[i])","metadata":{"execution":{"iopub.status.busy":"2021-08-26T14:56:28.822373Z","iopub.execute_input":"2021-08-26T14:56:28.822766Z","iopub.status.idle":"2021-08-26T14:56:28.831266Z","shell.execute_reply.started":"2021-08-26T14:56:28.822734Z","shell.execute_reply":"2021-08-26T14:56:28.829928Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plot_series(\"../input/g2net-gravitational-wave-detection/train/4/3/0/4302103bb1.npy\")","metadata":{"execution":{"iopub.status.busy":"2021-08-26T15:08:01.532696Z","iopub.execute_input":"2021-08-26T15:08:01.533072Z","iopub.status.idle":"2021-08-26T15:08:02.544876Z","shell.execute_reply.started":"2021-08-26T15:08:01.533041Z","shell.execute_reply":"2021-08-26T15:08:02.543985Z"},"trusted":true},"execution_count":null,"outputs":[]}]}