{"id":29,"date":"2017-10-11T15:52:21","date_gmt":"2017-10-11T19:52:21","guid":{"rendered":"http:\/\/sites.nd.edu\/attpc\/?p=29"},"modified":"2017-10-11T15:52:21","modified_gmt":"2017-10-11T19:52:21","slug":"datafactory-py","status":"publish","type":"post","link":"https:\/\/sites.nd.edu\/attpc\/2017\/10\/11\/datafactory-py\/","title":{"rendered":"DataFactory.py"},"content":{"rendered":"<p>The file read in two SQLite databases, the data file and the map file.<\/p>\n<p>In the ADCdf table, each of the entry is the signal trace for each of the 253 channel of the chamber.<\/p>\n<p>The first preliminary filter is that for each signal trace, there are two threshold, 1. must be larger than the 20% of the larget amplitude; 2 must be larger than 20. Each of the time bin must be larger than both of the threshold.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1368\" src=\"http:\/\/www.jianping-lai.com\/wp-content\/uploads\/Physics\/ATTPC\/DataFactory\/threshold.png\" alt=\"\" width=\"528\" height=\"500\" \/><\/p>\n<p>A list of positions are extract from the traces (R,z), R is radial of the centroid of the pad , z is the number of the time bin.<\/p>\n<p>The four quadrants are used to construct two images using each opposite pairs. The overlapping score (a overlapping on the edge (y=0 or 300) yield larger score than a overlapping in the center (y=150) ) is calculated to determine the direction of aligning the two images.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1376\" src=\"http:\/\/www.jianping-lai.com\/wp-content\/uploads\/Physics\/ATTPC\/DataFactory\/reconstruction.png\" alt=\"\" width=\"842\" height=\"550\" \/><\/p>\n<p>A enlarged reconstructed image is presented below<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1370\" src=\"http:\/\/www.jianping-lai.com\/wp-content\/uploads\/Physics\/ATTPC\/DataFactory\/raw.png\" alt=\"\" width=\"799\" height=\"500\" \/><\/p>\n<p>Besides that, as the image is fully contaminated by noisy data and disconnected points. The prepossessing steps consist GaussianBlur,\u00a0threshold,\u00a0erode and\u00a0dilate.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1374\" src=\"http:\/\/www.jianping-lai.com\/wp-content\/uploads\/Physics\/ATTPC\/DataFactory\/smooth.png\" alt=\"\" width=\"799\" height=\"500\" \/><\/p>\n<p><strong>__init__(self,data_path,map_path):\u00a0<\/strong>initialization of DataFactory<\/p>\n<p>data_path (str): the relative path to the data file<br \/>\nmap_path (str): the relative path to the ATTPC map file<\/p>\n<p>this module loads the ADC table into pandas spreadsheet. Then the function iterate through all channels to see at which time bin the signal amplitude is above threshold and store all the filtered signals into t3.<\/p>\n<p><strong>ConstructImage(self,EID):<\/strong><\/p>\n<p>EID (int): the EventID of the event for constructing the image<\/p>\n<p>This function takes the spreadsheet t3 from __init__ function, and then produce an image using the positions for each &#8220;EventID&#8221;.<\/p>\n<h2><\/h2>\n","protected":false},"excerpt":{"rendered":"<p>The file read in two SQLite databases, the data file and the map file. In the ADCdf table, each of the entry is the signal trace for each of the 253 channel of the chamber. The first preliminary filter is &hellip; <a href=\"https:\/\/sites.nd.edu\/attpc\/2017\/10\/11\/datafactory-py\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2309,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[264463],"tags":[],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-attpcanalysis"],"_links":{"self":[{"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/users\/2309"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/comments?post=29"}],"version-history":[{"count":1,"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/posts\/29\/revisions"}],"predecessor-version":[{"id":30,"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/posts\/29\/revisions\/30"}],"wp:attachment":[{"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/media?parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/categories?post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/tags?post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}