Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 10 additions & 161 deletions examples/MapPixelIDToUniqueID_FSD.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "478b8b65-d1d8-44e1-b5c4-6d6906219e6f",
"metadata": {},
"outputs": [],
Expand All @@ -24,13 +24,13 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "28c4f9ba-ab0e-4970-903f-4e57194a412d",
"metadata": {},
"outputs": [],
"source": [
"def unique_channel_id(d):\n",
" return ((d['io_group'].astype(int)*1000+d['io_channel'].astype(int))*1000 \\\n",
" return ((d['io_group'].astype(int)*10000+d['io_channel'].astype(int))*1000 \\\n",
" + d['chip_id'].astype(int))*100 + d['channel_id'].astype(int)\n",
"\n",
"def unique_to_channel_id(unique):\n",
Expand All @@ -46,18 +46,18 @@
" return ( (unique_to_io_channel(unique)-1) // 4) + 1\n",
"\n",
"def unique_to_io_group(unique):\n",
" return(unique // (100*1000*1000)) % 1000\n",
" return(unique // (100*1000*10000)) % 10000\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"id": "d8203da9-f296-4598-a4da-873bdc3ee8c1",
"metadata": {},
"outputs": [],
"source": [
"_default_geometry_yaml = '../larndsim/pixel_layouts/multi_tile_layout-3.0.40_NDLArModule_v3.yaml'\n",
"_default_geometry_yaml = '../larndsim/pixel_layouts/multi_tile_layout-3.0.40_fsd_v3.yaml'\n",
"\n",
"def _default_pxy():\n",
" return (0., 0.)\n",
Expand Down Expand Up @@ -139,7 +139,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": null,
"id": "98f48b43-86f1-4cc9-94e4-9c93f124e630",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -185,20 +185,12 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": null,
"id": "e4672705-1f56-4c88-a4c6-3e8e72f714dd",
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 4/4 [00:04<00:00, 1.21s/it]\n"
]
}
],
"outputs": [],
"source": [
"pixelid_to_uniqueid = dict()\n",
"uniqueid_to_pixelid = dict()\n",
Expand All @@ -208,7 +200,7 @@
" for chip_id in range(11, 171):\n",
" for channel_id in range(64):\n",
"\n",
" unique_id = ((io_group*1000+tile)*1000 + chip_id)*100 + channel_id\n",
" unique_id = ((io_group*10000+tile)*1000 + chip_id)*100 + channel_id\n",
" pixel_id = unique_id_to_pixel_id(unique_id)\n",
"\n",
" if pixel_id in pixelid_to_uniqueid.keys():\n",
Expand All @@ -225,149 +217,6 @@
"with open(\"uniqueid_to_pixelid_fsd.json\", \"w\") as f:\n",
" json.dump(uniqueid_to_pixelid, f)\n"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "770ef0e7-38f3-4045-8e2f-69cb3a7d8c48",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(-1.8600000000000136, 1471.26)"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"geometry[(1, 1, 11, 0)]"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "191b7d04-4d2c-48fb-8524-1a9948c367cf",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(-474.3, 1471.26)"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"geometry[(3, 21, 11, 0)]"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "f698aa52-7fb0-47fc-9852-eee4a479dbbe",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Here\n",
"(4, 31, 11, 0)\n"
]
}
],
"source": [
"for k in geometry.keys():\n",
" if k[0] == 4:\n",
" print('Here')\n",
" print(k)\n",
" break"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "5f8d999b-3759-4a88-ab10-97786f25bbc0",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"301007332"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pixelid_to_uniqueid[220215]"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "f82e9e0f-c54c-43c4-a411-793ad34afac9",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"307200"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"64*10*16*30"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "50ead493-57ff-4417-b628-35b18568075b",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"5"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"unique_id_to_pixel_id(301002021)"
]
},
{
"cell_type": "markdown",
"id": "b0e8e763-ae24-4eb4-9bb9-e144dc57e898",
"metadata": {},
"source": [
"**\n",
"238389\n",
"3-35-74\n",
"20\n",
"**\n",
"220215\n",
"3-39-73\n",
"32"
]
}
],
"metadata": {
Expand Down
Loading
Loading