{"cells":[{"metadata":{"_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","collapsed":true,"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","trusted":true},"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)\nimport matplotlib.pyplot as plt\nimport os\n\nimport_path = \"../input/\"","execution_count":1,"outputs":[]},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":true},"cell_type":"code","source":"detectors_df = pd.read_csv(import_path + 'detectors.csv')\ndetectors_df.head()","execution_count":2,"outputs":[]},{"metadata":{"_cell_guid":"14032399-aa06-4525-a52d-eabfb2e02648","_uuid":"93d96e4ee024fd94aefb138742c29a8c4a5926f2","trusted":true},"cell_type":"code","source":"train_1_files = os.listdir(import_path + 'train_1')\n# Get files names by blocks of 4: cells/hits/particles/truth\nsorted(train_1_files)[:4]","execution_count":3,"outputs":[]},{"metadata":{"_cell_guid":"40124742-0016-4a6b-a357-e0aba146a235","collapsed":true,"_uuid":"0d60592e416725174473c618e1dfa67ee69071fb","trusted":true},"cell_type":"code","source":"cells_df = pd.read_csv(import_path + 'train_1/' + 'event000001000-{}.csv'.format('cells'))\nhits_df = pd.read_csv(import_path + 'train_1/' + 'event000001000-{}.csv'.format('hits'))\nparticles_df = pd.read_csv(import_path + 'train_1/' + 'event000001000-{}.csv'.format('particles'))\ntruth_df = pd.read_csv(import_path + 'train_1/' + 'event000001000-{}.csv'.format('truth'))","execution_count":4,"outputs":[]},{"metadata":{"_cell_guid":"0e9c799d-8b45-43f3-9fde-d9f3ce10abe4","_uuid":"906ddd8f420944445c92610d785556b01ef3984f","trusted":true},"cell_type":"code","source":"cells_df.head()","execution_count":5,"outputs":[]},{"metadata":{"_cell_guid":"25f1a856-aab6-4c45-9b72-e12fe5b1bf09","_uuid":"ab5e817282e253423d6309f3c7d976dd1119ef8e","trusted":true},"cell_type":"code","source":"particles_df.head()","execution_count":6,"outputs":[]},{"metadata":{"_cell_guid":"27513797-d75a-4c82-a5ad-be582eb5b757","_uuid":"8a1f65c2e793f88c32dce651f7635c2f42aba0f1","trusted":true},"cell_type":"code","source":"truth_df.head()","execution_count":7,"outputs":[]},{"metadata":{"_cell_guid":"0d5e5395-3061-4865-ba91-28c76c396c34","_uuid":"deddb69481b7df5f026e5be82b30f43f74b113ef","trusted":true},"cell_type":"code","source":"hits_df.head()","execution_count":8,"outputs":[]},{"metadata":{"_cell_guid":"60842103-eff0-417f-bab6-a6f04ce14a74","_uuid":"96ad626f5d9d37ce7c3c4af87a9a8c42a965e7c2","trusted":true},"cell_type":"code","source":"from mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nsub_table = hits_df[hits_df['volume_id']==8]\n\nfig = plt.figure(figsize=(10, 10))\nax = fig.add_subplot(111, projection='3d')\nax.set_title('Layer Id')\nfor i in np.unique(sub_table['layer_id']):\n    ax.scatter( sub_table[sub_table['layer_id']==i]['x'],\\\n                sub_table[sub_table['layer_id']==i]['y'],\\\n                sub_table[sub_table['layer_id']==i]['z'], 'o', edgecolor='k', label='Layer id: ' + str(i))\nax.view_init(elev=45)\nplt.legend()\nplt.show()","execution_count":9,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"7ddc3b3dcaa10e566b6b843a2afa1020022bdf07"},"cell_type":"code","source":"from mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nsub_table = hits_df[hits_df['volume_id']==8]\n\nfig = plt.figure(figsize=(10, 10))\nax = fig.add_subplot(111, projection='3d')\nax.set_title('Layer Id')\nfor i in np.unique(sub_table['layer_id']):\n    ax.scatter( sub_table[sub_table['layer_id']==i]['x'],\\\n                sub_table[sub_table['layer_id']==i]['y'],\\\n                sub_table[sub_table['layer_id']==i]['z'], 'o', edgecolor='k', label='Layer id: ' + str(i))\nax.view_init(elev=85)\nplt.legend()\nplt.show()","execution_count":13,"outputs":[]},{"metadata":{"_cell_guid":"fb2f0011-27f6-406c-9e2a-560735289392","_uuid":"029f9eeeaa1dc4c5b1af0c0074cbae749a6097a7","trusted":true},"cell_type":"code","source":"sub_table = hits_df[hits_df['volume_id']==8]\n\nfig = plt.figure(figsize=(15, 15))\n\nn = len(np.unique(sub_table['layer_id']))\nfor i, layer_id_ in enumerate(np.unique(sub_table['layer_id'])):\n    ax = fig.add_subplot( 221 + i, projection='3d')\n    ax.set_title('Layer Id:'+str(layer_id_))\n    ax.scatter( sub_table[sub_table['layer_id']==layer_id_]['x'],\\\n                sub_table[sub_table['layer_id']==layer_id_]['y'],\\\n                sub_table[sub_table['layer_id']==layer_id_]['z'], 'o', edgecolor='k', label='Layer id: ' + str(layer_id_))\n    ax.set_xlim([-200, 200])\n    ax.set_ylim([-200, 200])\n    ax.view_init(elev=60)\n    plt.legend()\nplt.show()","execution_count":10,"outputs":[]},{"metadata":{"_cell_guid":"ea906cca-9fd7-4254-a8a3-d535c0a272f0","_uuid":"602d2567a8bf4de2631ff66f9acd6c95bba9a3e4","trusted":true},"cell_type":"code","source":"sub_table = hits_df[hits_df['volume_id']==8]\n\nfig = plt.figure(figsize=(15, 15))\n\nn = len(np.unique(sub_table['layer_id']))\nfor i, layer_id_ in enumerate(np.unique(sub_table['layer_id'])):\n    ax = fig.add_subplot( 221 + i, projection='3d')\n    ax.set_title('Layer Id:'+str(layer_id_))\n    ax.scatter( sub_table[sub_table['layer_id']==layer_id_]['x'],\\\n                sub_table[sub_table['layer_id']==layer_id_]['y'],\\\n                sub_table[sub_table['layer_id']==layer_id_]['z'], 'o', edgecolor='k', label='Layer id: ' + str(layer_id_))\n    ax.set_xlabel('x')\n    ax.set_ylabel('y')\n    ax.set_zlabel('z')\n    ax.set_xlim([-200, 200])\n    ax.set_ylim([-200, 200])\n    ax.view_init(elev=90)\n    plt.legend()\nplt.show()","execution_count":11,"outputs":[]},{"metadata":{"_cell_guid":"af93375e-dff3-4045-bcec-c12b8903f24a","_uuid":"6db21dfe0838ea5901402772390f10776fcc1f1d","trusted":true},"cell_type":"code","source":"from mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nsub_table = hits_df[hits_df['volume_id']==8]\nlayer_ids = np.unique(sub_table['layer_id'])\n\nfig = plt.figure(figsize=(10,10))\nax = fig.add_subplot(111, projection='3d')\n\nfor i, layer_id_ in enumerate(layer_ids):\n    ax.scatter(sub_table[sub_table['layer_id']==layer_id_]['x'],\\\n               sub_table[sub_table['layer_id']==layer_id_]['layer_id'],\\\n                sub_table[sub_table['layer_id']==layer_id_]['z'], 'o', edgecolor='k', label='Layer id: ' + str(i))\nax.set_xlabel('x')\nax.set_ylabel('y')\nax.set_zlabel('z')\nax.view_init(elev=45)\nplt.title('Projection (x, z)')\nplt.legend()\nplt.show()","execution_count":12,"outputs":[]}],"metadata":{"language_info":{"name":"python","version":"3.6.5","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"}},"nbformat":4,"nbformat_minor":1}