{"action":"created","issue":{"url":"https://api.github.com/repos/nextic/IC/issues/183","repository_url":"https://api.github.com/repos/nextic/IC","labels_url":"https://api.github.com/repos/nextic/IC/issues/183/labels{/name}","comments_url":"https://api.github.com/repos/nextic/IC/issues/183/comments","events_url":"https://api.github.com/repos/nextic/IC/issues/183/events","html_url":"https://github.com/nextic/IC/pull/183","id":216032752,"number":183,"title":"Add read-only user to DB & Change query to deal with missing PMTs","user":{"login":"jmbenlloch","id":12936714,"avatar_url":"https://avatars2.githubusercontent.com/u/12936714?v=3","gravatar_id":"","url":"https://api.github.com/users/jmbenlloch","html_url":"https://github.com/jmbenlloch","followers_url":"https://api.github.com/users/jmbenlloch/followers","following_url":"https://api.github.com/users/jmbenlloch/following{/other_user}","gists_url":"https://api.github.com/users/jmbenlloch/gists{/gist_id}","starred_url":"https://api.github.com/users/jmbenlloch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmbenlloch/subscriptions","organizations_url":"https://api.github.com/users/jmbenlloch/orgs","repos_url":"https://api.github.com/users/jmbenlloch/repos","events_url":"https://api.github.com/users/jmbenlloch/events{/privacy}","received_events_url":"https://api.github.com/users/jmbenlloch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-03-22T11:35:58Z","updated_at":"2017-03-22T15:09:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nextic/IC/pulls/183","html_url":"https://github.com/nextic/IC/pull/183","diff_url":"https://github.com/nextic/IC/pull/183.diff","patch_url":"https://github.com/nextic/IC/pull/183.patch"},"body":"This PR changes db user to one with read-only permissions (nextreader) and includes the changes needed to deal with missing PMTs.\r\n\r\nDataPMT will return a dataframe with 12 PMTs, including an 'active' flag. Inactive PMTs will have 0 gain, coeff_c, coeff_blr, etc.\r\n\r\n```\r\n    SensorID  ChannelID PmtID  Active         X         Y  coeff_blr  \\\r\n0          0         22  PMT1       1  -23.9414   65.7785    0.00080   \r\n1          1         18  PMT3       1  -44.9951  -53.6231    0.00080   \r\n2          2         23  PMT2       1   68.9365  -12.1554    0.00080   \r\n3          3          0  PMT4       1    0.0000  185.0000    0.00161   \r\n4          4         31  PMTC       1 -118.9160  141.7180    0.00160   \r\n5          5          8  PMTB       1 -182.1890   32.1249    0.00161   \r\n6          6          5  PMTA       1 -160.2150  -92.5000    0.00161   \r\n7          7          4  PMT9       1  -63.2737 -173.8430    0.00161   \r\n8          8          1  PMT8       1   63.2737 -173.8430    0.00162   \r\n9          9         30  PMT7       0  160.2150  -92.5000    0.00000   \r\n10        10         27  PMT6       1  182.1890   32.1249    0.00080   \r\n11        11         26  PMT5       1  118.9160  141.7180    0.00080   \r\n\r\n     coeff_c  adc_to_pes  noise_rms   Sigma  \r\n0   0.000001      -25.39     0.7160   9.474  \r\n1   0.000001      -26.49     0.8744  10.510  \r\n2   0.000001      -27.74     0.7303   9.031  \r\n3   0.000003      -25.17     0.7060   8.720  \r\n4   0.000003      -26.56     0.7000   8.910  \r\n5   0.000003      -21.55     0.7278   6.900  \r\n6   0.000003      -23.86     0.7323   7.860  \r\n7   0.000003      -33.57     0.7206  11.750  \r\n8   0.000003      -22.15     0.7213   7.070  \r\n9   0.000000        0.00     0.0000   0.000  \r\n10  0.000001      -20.83     0.7921   6.780  \r\n11  0.000001      -23.78     0.8660   8.050 \r\n```\r\n\r\nI guess more changes will be needed to actually read the flag and use only active PMTs. Now tests are failing due to ZeroDivisionError. This is related to PR #182."},"comment":{"url":"https://api.github.com/repos/nextic/IC/issues/comments/288429226","html_url":"https://github.com/nextic/IC/pull/183#issuecomment-288429226","issue_url":"https://api.github.com/repos/nextic/IC/issues/183","id":288429226,"user":{"login":"jjgomezcadenas","id":8070159,"avatar_url":"https://avatars2.githubusercontent.com/u/8070159?v=3","gravatar_id":"","url":"https://api.github.com/users/jjgomezcadenas","html_url":"https://github.com/jjgomezcadenas","followers_url":"https://api.github.com/users/jjgomezcadenas/followers","following_url":"https://api.github.com/users/jjgomezcadenas/following{/other_user}","gists_url":"https://api.github.com/users/jjgomezcadenas/gists{/gist_id}","starred_url":"https://api.github.com/users/jjgomezcadenas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjgomezcadenas/subscriptions","organizations_url":"https://api.github.com/users/jjgomezcadenas/orgs","repos_url":"https://api.github.com/users/jjgomezcadenas/repos","events_url":"https://api.github.com/users/jjgomezcadenas/events{/privacy}","received_events_url":"https://api.github.com/users/jjgomezcadenas/received_events","type":"User","site_admin":false},"created_at":"2017-03-22T15:09:16Z","updated_at":"2017-03-22T15:09:16Z","body":">I have fixed some of the failing tests. The ones remaining are related with the BLR/CWF algorithm. np.isclose returns False in many cases. Maybe is related to the new gain values from last calibration.\r\n\r\nBe careful. The tests are using MC data, and they expect the same deconvolution coefficients that were used to generate de MC data. MC data should have its own run number (negative or zero in any case) and use always nominal deconvolution coefficients, the same that were used to generate the data. If you are trying to deconvolute with current coefficients, of course it will fail. \r\n\r\n>We should decide what do we want to do with MC. Use the last calibration (including the missing PMT) or keep using an older one with 12 PMTs (the one we used when we generated the files).\r\n\r\nFor MC we *always* use a nominal *perfect* detector (e.g, \"nominal\" calibration) unless we need, for specific reasons do otherwise. Let me explain:\r\n\r\ni) Calibration constants are irrelevant. Diomira normalises them away. But is best to have just a nominal set (always the same), for tracking reasons.\r\nii) Deconvolution coefficients must be the same that were used to generate the waveforms! Therefore we need to stick to them.\r\n\r\nFor specific studies we can decide to switch a PMT off etc. But this is done \"post-processing\", the data. base should assume happy life for MC.\r\n"}}
{"actor":{"display_login":"jjgomezcadenas"}}