{"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":"import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n%matplotlib inline","metadata":{"execution":{"iopub.status.busy":"2023-01-20T06:40:19.363624Z","iopub.execute_input":"2023-01-20T06:40:19.364081Z","iopub.status.idle":"2023-01-20T06:40:19.391799Z","shell.execute_reply.started":"2023-01-20T06:40:19.363992Z","shell.execute_reply":"2023-01-20T06:40:19.390161Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sensor_geometry = pd.read_csv('/kaggle/input/icecube-neutrinos-in-deep-ice/sensor_geometry.csv', index_col='sensor_id')\nsensor_geometry","metadata":{"execution":{"iopub.status.busy":"2023-01-20T06:40:19.394195Z","iopub.execute_input":"2023-01-20T06:40:19.395208Z","iopub.status.idle":"2023-01-20T06:40:19.424866Z","shell.execute_reply.started":"2023-01-20T06:40:19.395122Z","shell.execute_reply":"2023-01-20T06:40:19.423899Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"meta_df = pd.read_parquet('/kaggle/input/icecube-neutrinos-in-deep-ice/train_meta.parquet')\nmeta_df","metadata":{"execution":{"iopub.status.busy":"2023-01-20T06:40:19.426224Z","iopub.execute_input":"2023-01-20T06:40:19.427659Z","iopub.status.idle":"2023-01-20T06:40:44.086188Z","shell.execute_reply.started":"2023-01-20T06:40:19.427597Z","shell.execute_reply":"2023-01-20T06:40:44.084486Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"batch_id = meta_df.batch_id.unique()[0]\n\nbatch_df = meta_df[meta_df.batch_id == batch_id].set_index('event_id', drop=True)\nbatch_df","metadata":{"execution":{"iopub.status.busy":"2023-01-20T06:40:44.089846Z","iopub.execute_input":"2023-01-20T06:40:44.090397Z","iopub.status.idle":"2023-01-20T06:40:45.023801Z","shell.execute_reply.started":"2023-01-20T06:40:44.090344Z","shell.execute_reply":"2023-01-20T06:40:45.022133Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"batch_features = pd.read_parquet(f'/kaggle/input/icecube-neutrinos-in-deep-ice/train/batch_{batch_id}.parquet')\nbatch_features","metadata":{"execution":{"iopub.status.busy":"2023-01-20T06:40:45.025450Z","iopub.execute_input":"2023-01-20T06:40:45.025843Z","iopub.status.idle":"2023-01-20T06:40:45.918690Z","shell.execute_reply.started":"2023-01-20T06:40:45.025795Z","shell.execute_reply":"2023-01-20T06:40:45.917379Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"event_id = batch_df.index[6]\n\nevent_features = batch_features.loc[event_id]\nazimuth = batch_df.loc[event_id, 'azimuth']\nzenith = batch_df.loc[event_id, 'zenith']","metadata":{"execution":{"iopub.status.busy":"2023-01-20T06:42:40.181136Z","iopub.execute_input":"2023-01-20T06:42:40.181660Z","iopub.status.idle":"2023-01-20T06:42:40.190083Z","shell.execute_reply.started":"2023-01-20T06:42:40.181613Z","shell.execute_reply":"2023-01-20T06:42:40.188273Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"position = sensor_geometry.loc[event_features.sensor_id].values\ntime = event_features.time.values\ncharge = event_features.charge.values\nauxiliary = event_features.auxiliary.values","metadata":{"execution":{"iopub.status.busy":"2023-01-20T06:42:48.319673Z","iopub.execute_input":"2023-01-20T06:42:48.320111Z","iopub.status.idle":"2023-01-20T06:42:48.328039Z","shell.execute_reply.started":"2023-01-20T06:42:48.320071Z","shell.execute_reply":"2023-01-20T06:42:48.326892Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ax = plt.figure(figsize=(16, 12)).add_subplot(projection='3d')\n\nax.set_xlabel('x')\nax.set_ylabel('y')\nax.set_zlabel('z')\nax.set_box_aspect([1,1,1])\nax.view_init(azim=-30, elev=30)\nax.scatter(sensor_geometry.x, sensor_geometry.y, sensor_geometry.z, s=0.3, color='black', alpha=0.3)\n\nax.set_title('Time Plot')\nim = ax.scatter(position[~auxiliary, 0], position[~auxiliary, 1], position[~auxiliary, 2], c=time[~auxiliary], cmap='jet', s=100.0, alpha=0.5)\nplt.colorbar(im, label='time', shrink=0.8)","metadata":{"execution":{"iopub.status.busy":"2023-01-20T06:54:50.773099Z","iopub.execute_input":"2023-01-20T06:54:50.774283Z","iopub.status.idle":"2023-01-20T06:54:51.207190Z","shell.execute_reply.started":"2023-01-20T06:54:50.774236Z","shell.execute_reply":"2023-01-20T06:54:51.206243Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ax = plt.figure(figsize=(16, 12)).add_subplot(projection='3d')\n\nax.set_xlabel('x')\nax.set_ylabel('y')\nax.set_zlabel('z')\nax.set_box_aspect([1,1,1])\nax.view_init(azim=-30, elev=30)\nax.scatter(sensor_geometry.x, sensor_geometry.y, sensor_geometry.z, s=0.3, color='black', alpha=0.3)\n\nax.set_title('Charge Plot')\nim = ax.scatter(position[~auxiliary, 0], position[~auxiliary, 1], position[~auxiliary, 2], c=charge[~auxiliary], cmap='jet', s=100.0, alpha=0.5)\nplt.colorbar(im, label='charge', shrink=0.8)","metadata":{"execution":{"iopub.status.busy":"2023-01-20T07:01:05.625968Z","iopub.execute_input":"2023-01-20T07:01:05.627160Z","iopub.status.idle":"2023-01-20T07:01:06.117083Z","shell.execute_reply.started":"2023-01-20T07:01:05.627105Z","shell.execute_reply":"2023-01-20T07:01:06.116236Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}