{"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":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport matplotlib.pyplot as plt\nimport time\nimport h5py\nimport torch\nimport torch.nn as nn ","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-11-10T06:54:27.605767Z","iopub.execute_input":"2022-11-10T06:54:27.606362Z","iopub.status.idle":"2022-11-10T06:54:29.811817Z","shell.execute_reply.started":"2022-11-10T06:54:27.606263Z","shell.execute_reply":"2022-11-10T06:54:29.810511Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Context is this discussion  https://www.kaggle.com/competitions/g2net-detecting-continuous-gravitational-waves/discussion/363734","metadata":{}},{"cell_type":"markdown","source":"## H1 + L1","metadata":{}},{"cell_type":"code","source":"import numpy as np \nimport matplotlib.pyplot as plt\n\nfilename = \"../input/g2net-detecting-continuous-gravitational-waves/train/b7666b451.hdf5\"\nwith h5py.File(filename, \"r\") as f:\n#     print(f['b7666b451'].keys())\n\n    frequency = np.array(f['b7666b451'][\"frequency_Hz\"])\n    data_H1 = np.array(f['b7666b451'][\"H1\"][\"SFTs\"])\n    time_H1 = np.array(f['b7666b451'][\"H1\"][\"timestamps_GPS\"])\n    \n    data_L1 = np.array(f['b7666b451'][\"L1\"][\"SFTs\"])\n    time_L1 = np.array(f['b7666b451'][\"L1\"][\"timestamps_GPS\"])\n\n    H = np.absolute(data_H1) + np.absolute(data_L1)\n    \n    f = plt.figure()\n    f.set_figwidth(16)\n    f.set_figheight(20)\n\n    plt.imshow(H, interpolation='none')\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2022-11-10T06:59:47.686044Z","iopub.execute_input":"2022-11-10T06:59:47.686447Z","iopub.status.idle":"2022-11-10T06:59:48.422023Z","shell.execute_reply.started":"2022-11-10T06:59:47.686416Z","shell.execute_reply":"2022-11-10T06:59:48.420668Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## H1","metadata":{}},{"cell_type":"code","source":"filename = \"../input/g2net-detecting-continuous-gravitational-waves/train/b7666b451.hdf5\"\nwith h5py.File(filename, \"r\") as f:\n#     print(f['b7666b451'].keys())\n\n    frequency = np.array(f['b7666b451'][\"frequency_Hz\"])\n    data_H1 = np.array(f['b7666b451'][\"H1\"][\"SFTs\"])\n    time_H1 = np.array(f['b7666b451'][\"H1\"][\"timestamps_GPS\"])\n    \n    data_L1 = np.array(f['b7666b451'][\"L1\"][\"SFTs\"])\n    time_L1 = np.array(f['b7666b451'][\"L1\"][\"timestamps_GPS\"])\n\n    H = np.absolute(data_H1) \n    \n    f = plt.figure()\n    f.set_figwidth(16)\n    f.set_figheight(20)\n\n    plt.imshow(H, interpolation='none')\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2022-11-10T07:04:19.56189Z","iopub.execute_input":"2022-11-10T07:04:19.562316Z","iopub.status.idle":"2022-11-10T07:04:20.311792Z","shell.execute_reply.started":"2022-11-10T07:04:19.562285Z","shell.execute_reply":"2022-11-10T07:04:20.31086Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## L1","metadata":{}},{"cell_type":"code","source":"filename = \"../input/g2net-detecting-continuous-gravitational-waves/train/b7666b451.hdf5\"\nwith h5py.File(filename, \"r\") as f:\n#     print(f['b7666b451'].keys())\n\n    frequency = np.array(f['b7666b451'][\"frequency_Hz\"])\n    data_H1 = np.array(f['b7666b451'][\"H1\"][\"SFTs\"])\n    time_H1 = np.array(f['b7666b451'][\"H1\"][\"timestamps_GPS\"])\n    \n    data_L1 = np.array(f['b7666b451'][\"L1\"][\"SFTs\"])\n    time_L1 = np.array(f['b7666b451'][\"L1\"][\"timestamps_GPS\"])\n\n    H = np.absolute(data_H1) \n    \n    f = plt.figure()\n    f.set_figwidth(16)\n    f.set_figheight(20)\n\n    plt.imshow(H, interpolation='none')\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2022-11-10T07:04:24.820447Z","iopub.execute_input":"2022-11-10T07:04:24.82165Z","iopub.status.idle":"2022-11-10T07:04:25.397012Z","shell.execute_reply.started":"2022-11-10T07:04:24.821571Z","shell.execute_reply":"2022-11-10T07:04:25.396082Z"},"trusted":true},"execution_count":null,"outputs":[]}]}