Here, PMT gain for science run 1 is summarized. All the PMT-related information (gain, occupancy, AP) can be seen in the following PMT database. https://xe1t-mysql.lngs.infn.it/xe1tpmt/?Home
In [101]:
from sympy.parsing.sympy_parser import parse_expr
from sympy import *
import sympy
from sympy.functions.elementary.piecewise import ExprCondPair
from sympy.interactive import printing
printing.init_printing(use_latex=True)
In [102]:
gain_vs_time_model_string = "Piecewise(ExprCondPair(797646.212300/(1. + exp((t-1590000000)/43698725) ) + 1714027.877000, Equality(Integer(0), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(1), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((317850.209300/(1. + exp((t-1482644659)/173535) ) + 2059331.500000, t<1484731748), (0, t>=1484731748)), Equality(Integer(2), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((2108073.026, t<=1477656000), (2108073.026, t>=1479749714), (1185630, True)), Equality(Integer(3), Symbol('pmt', integer=True))),ExprCondPair(Float(3906492.83, prec=15), Equality(Integer(4), Symbol('pmt', integer=True))), ExprCondPair(Float(2169538.32, prec=15), Equality(Integer(5), Symbol('pmt', integer=True))), ExprCondPair(Float(4793368.823, prec=15), Equality(Integer(6), Symbol('pmt', integer=True))), ExprCondPair(Float(2276829.432, prec=15), Equality(Integer(7), Symbol('pmt', integer=True))), ExprCondPair(Float(2306699.959, prec=15), Equality(Integer(8), Symbol('pmt', integer=True))), ExprCondPair(Float(3543829.123, prec=15), Equality(Integer(9), Symbol('pmt', integer=True))), ExprCondPair(Float(2424804.431, prec=15), Equality(Integer(10), Symbol('pmt', integer=True))), ExprCondPair(171636.777600/(1. + exp((t-1490436000)/7252570) ) + 2920853.476000, Equality(Integer(11), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((0, t<=1525132799), (4066835.51, t>1525132799)), Equality(Integer(12), Symbol('pmt', integer=True))), ExprCondPair(Float(3081934.186, prec=15), Equality(Integer(13), Symbol('pmt', integer=True))), ExprCondPair(Float(2149864.314, prec=15), Equality(Integer(14), Symbol('pmt', integer=True))), ExprCondPair(Float(2434483.342, prec=15), Equality(Integer(15), Symbol('pmt', integer=True))), ExprCondPair(Float(2674694.941, prec=15), Equality(Integer(16), Symbol('pmt', integer=True))), ExprCondPair(117373.840100/(1. + exp((t-1511611440)/5469333) ) + 2005079.645000, Equality(Integer(17), Symbol('pmt', integer=True))), ExprCondPair(Float(2399218.685, prec=15), Equality(Integer(18), Symbol('pmt', integer=True))), ExprCondPair(Float(2307426.844, prec=15), Equality(Integer(19), Symbol('pmt', integer=True))), ExprCondPair(Float(2397515.075, prec=15), Equality(Integer(20), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((2244990.483, t<=1498766880), (1678221.071, t<=1498979340), (373681.120100/(1. + exp((t-1530000000)/4698795) ) + 1131844.061000, t<=1533081600), (771128.304100/(1. + exp((t-1537227122)/6263237) ) + 737464.448900, t>1533081600)), Equality(Integer(21), Symbol('pmt', integer=True))), ExprCondPair(Float(4315607.987, prec=15), Equality(Integer(22), Symbol('pmt', integer=True))), ExprCondPair(1306643.596000/(1. + exp((t-1597768592)/34536583) ) + 1104350.008000, Equality(Integer(23), Symbol('pmt', integer=True))), ExprCondPair(Float(3168789.533, prec=15), Equality(Integer(24), Symbol('pmt', integer=True))), ExprCondPair(74240.293260/(1. + exp((t-1512784632)/3609826) ) + 2242440.468000, Equality(Integer(25), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(26), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((0, t<=1525132799), (3604726.986, t>1525132799)), Equality(Integer(27), Symbol('pmt', integer=True))), ExprCondPair(361534.405700/(1. + exp((1491816617-t)/11161454) ) + 2257870.253000, Equality(Integer(28), Symbol('pmt', integer=True))), ExprCondPair(Float(2355224.429, prec=15), Equality(Integer(29), Symbol('pmt', integer=True))), ExprCondPair(Float(4053470.485, prec=15), Equality(Integer(30), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((76233.246090/(1. + exp((t-1483002843)/7488) ) + 2249473.921000, t<1490535931), (1643037.866, t<1493721839), (1200110.914, t<1497013200), (483717.007800/(1. + exp((t-1514878911)/3894893) ) + 548217.280300, t<1518134400), (0, t>=1518134400)), Equality(Integer(31), Symbol('pmt', integer=True))), ExprCondPair(Float(4147334.143, prec=15), Equality(Integer(32), Symbol('pmt', integer=True))), ExprCondPair(Float(2430605.789, prec=15), Equality(Integer(33), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((0, t<=1525132799), (3143172.157, t>1525132799)), Equality(Integer(34), Symbol('pmt', integer=True))), ExprCondPair(Float(3194465.751, prec=15), Equality(Integer(35), Symbol('pmt', integer=True))), ExprCondPair(Float(2307221.005, prec=15), Equality(Integer(36), Symbol('pmt', integer=True))), ExprCondPair(Float(2432222.521, prec=15), Equality(Integer(37), Symbol('pmt', integer=True))), ExprCondPair(Float(3758949.915, prec=15), Equality(Integer(38), Symbol('pmt', integer=True))), ExprCondPair(113423.846700/(1. + exp((t-1483104436)/2100) ) + 3307217.976000, Equality(Integer(39), Symbol('pmt', integer=True))), ExprCondPair(1532302.424000/(1. + exp((t-1577050236)/32658184) ) + 1000000.002000, Equality(Integer(40), Symbol('pmt', integer=True))), ExprCondPair(1002077.984000/(1. + exp((t-1450000001)/20059304) ) + 3014243.369000, Equality(Integer(41), Symbol('pmt', integer=True))), ExprCondPair(Float(3733756.098, prec=15), Equality(Integer(42), Symbol('pmt', integer=True))), ExprCondPair(Float(2334933.956, prec=15), Equality(Integer(43), Symbol('pmt', integer=True))), ExprCondPair(Float(2797670.353, prec=15), Equality(Integer(44), Symbol('pmt', integer=True))), ExprCondPair(508015.232700/(1. + exp((t-1542625467)/5777563) ) + 2128962.377000, Equality(Integer(45), Symbol('pmt', integer=True))), ExprCondPair(Float(2256016.531, prec=15), Equality(Integer(46), Symbol('pmt', integer=True))), ExprCondPair(Float(3598286.69, prec=15), Equality(Integer(47), Symbol('pmt', integer=True))), ExprCondPair(460703.138800/(1. + exp((t-1530000000)/18433105) ) + 1870756.586000, Equality(Integer(48), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((4355169.472, t<=1482418401), (2255339.162, t>1482418401)), Equality(Integer(49), Symbol('pmt', integer=True))), ExprCondPair(Float(3734082.592, prec=15), Equality(Integer(50), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((0, t<=1484731748), (3721240.718, t>1484731748)), Equality(Integer(51), Symbol('pmt', integer=True))), ExprCondPair(Float(2398371.665, prec=15), Equality(Integer(52), Symbol('pmt', integer=True))), ExprCondPair(Float(2140911.526, prec=15), Equality(Integer(53), Symbol('pmt', integer=True))), ExprCondPair(Float(3649038.502, prec=15), Equality(Integer(54), Symbol('pmt', integer=True))), ExprCondPair(Float(1978568.903, prec=15), Equality(Integer(55), Symbol('pmt', integer=True))), ExprCondPair(Float(4582119.188, prec=15), Equality(Integer(56), Symbol('pmt', integer=True))), ExprCondPair(Float(3453002.356, prec=15), Equality(Integer(57), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((2168250.61, t<=1484064477), (1655819.208, t>1484064477)), Equality(Integer(58), Symbol('pmt', integer=True))),ExprCondPair(Float(2260358.363, prec=15), Equality(Integer(59), Symbol('pmt', integer=True))), ExprCondPair(Float(2841592.911, prec=15), Equality(Integer(60), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((148647.951400/(1. + exp((t-1482902728)/89166) ) + 2041636.826000, t<1490325004), (2705439.559000/(1. + exp((t-1495550143)/65539536) ) + 85.519023 + 77198.068530/(1. + exp((t-1522304593)/11688) ) , t>=1490325004)), Equality(Integer(61), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(62), Symbol('pmt', integer=True))), ExprCondPair(Float(3802967.819, prec=15), Equality(Integer(63), Symbol('pmt', integer=True))), ExprCondPair(Float(3546341.962, prec=15), Equality(Integer(64), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(65), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((84771.849380/(1. + exp((t-1483005457)/6743) ) + 2104605.165000 + 140276.039300/(1. + exp((t-1492905600)/2539903) ), t<1502383532), (3536840.952000/(1. + exp((t-1495640921)/84983692) ) + 125203.752500 + 106262.107700/(1. + exp((t-1521397168)/239570) ) + 149781.783500/(1. + exp((t-1530937381)/3782) ), t<=1533081600), (170423.791300/(1. + exp((t-1538237093)/437360) ) + 1377446.717000, t>1533081600)), Equality(Integer(66), Symbol('pmt', integer=True))), ExprCondPair(34555.504220/(1. + exp((t-1483029945)/1000) ) + 1874444.371000 + 575399.854600/(1. + exp((t-1530000000)/23486773) ), Equality(Integer(67), Symbol('pmt', integer=True))), ExprCondPair(Float(4796244.91, prec=15), Equality(Integer(68), Symbol('pmt', integer=True))), ExprCondPair(89338.661500/(1. + exp((t-1483065484)/2899) ) + 3030420.839000, Equality(Integer(69), Symbol('pmt', integer=True))), ExprCondPair(Float(3757072.998, prec=15), Equality(Integer(70), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((87016.068290/(1. + exp((t-1482958556)/77172)) + 1984868.520000 + 89326.868770/(1. + exp((t-1490186525)/70491)) + 101240.533800/(1. + exp((t-1495703286)/147315)), t<1502383532), (2668850.715000/(1. + exp((t-1496186874)/26604898)) + 367392.474900 + 216512.880400/(1. + exp((t-1521852784)/96415)) + 218402.934600/(1. + exp((t-1530893094)/11783)), t<1518134400), (0, t>=1518134400)), Equality(Integer(71), Symbol('pmt', integer=True))), ExprCondPair(119387.726600/(1. + exp((t-1489968000)/5124177) ) + 2133684.740000, Equality(Integer(72), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((0, t<=1525132799), (2009767.722, t>1525132799)), Equality(Integer(73), Symbol('pmt', integer=True))), ExprCondPair(Float(4777318.338, prec=15), Equality(Integer(74), Symbol('pmt', integer=True))), ExprCondPair(Float(4653947.413, prec=15), Equality(Integer(75), Symbol('pmt', integer=True))), ExprCondPair(Float(2914012.071, prec=15), Equality(Integer(76), Symbol('pmt', integer=True))), ExprCondPair(Float(3340091.8, prec=15), Equality(Integer(77), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((92819.160530/(1. + exp((t-1483005314)/4506) ) + 1360050.787000 + 463614.062400/(1. + exp((t-1505901173)/14081201) ) + 106805.413300/(1. + exp((t-1520637397)/539552) ), t<1533081600), (287950.700000/(1. + exp((t-1534998565)/4795091) ) + 1222242.127000, t>=1533081600)), Equality(Integer(78), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(79), Symbol('pmt', integer=True))), ExprCondPair(Float(3370919.575, prec=15), Equality(Integer(80), Symbol('pmt', integer=True))), ExprCondPair(Float(4190274.325, prec=15), Equality(Integer(81), Symbol('pmt', integer=True))), ExprCondPair(Float(4434909.453, prec=15), Equality(Integer(82), Symbol('pmt', integer=True))), ExprCondPair(Float(2100428.37, prec=15), Equality(Integer(83), Symbol('pmt', integer=True))), ExprCondPair(Float(2539602.158, prec=15), Equality(Integer(84), Symbol('pmt', integer=True))), ExprCondPair(99865.358070/(1. + exp((t-1482897574)/71943) ) + 1253660.771000 + 353802.422100/(1. + exp((t-1496099888)/4453667) ) + 547761.098400/(1. + exp((t-1520629686)/4762424) ), Equality(Integer(85), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((0, t<=1525132799), (2172221.034, t>1525132799)), Equality(Integer(86), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((2472595.99, t<=1502323200), (2012985.678000/(1. + exp((t-1519456010)/1420212) ) + 409968.672500, t<=1518134400), (0, t>1518134400)), Equality(Integer(87), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(88), Symbol('pmt', integer=True))), ExprCondPair(Float(2632179.497, prec=15), Equality(Integer(89), Symbol('pmt', integer=True))), ExprCondPair(Float(2309712.974, prec=15), Equality(Integer(90), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(91), Symbol('pmt', integer=True))), ExprCondPair(Float(3486930.869, prec=15), Equality(Integer(92), Symbol('pmt', integer=True))), ExprCondPair(944915.413600/(1. + exp((t-1587683364)/31718246) ) + 1395226.088000, Equality(Integer(93), Symbol('pmt', integer=True))), ExprCondPair(Float(2941363.127, prec=15), Equality(Integer(94), Symbol('pmt', integer=True))), ExprCondPair(Float(4217942.833, prec=15), Equality(Integer(95), Symbol('pmt', integer=True))), ExprCondPair(455856.579900/(1. + exp((t-1480000000)/19608134) ) + 4240658.656000, Equality(Integer(96), Symbol('pmt', integer=True))), ExprCondPair(Float(2967280.974, prec=15), Equality(Integer(97), Symbol('pmt', integer=True))), ExprCondPair(Float(2105643.729, prec=15), Equality(Integer(98), Symbol('pmt', integer=True))), ExprCondPair(Float(2243880.14, prec=15), Equality(Integer(99), Symbol('pmt', integer=True))), ExprCondPair(Float(2250975.637, prec=15), Equality(Integer(100), Symbol('pmt', integer=True))), ExprCondPair(Float(3091882.564, prec=15), Equality(Integer(101), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(102), Symbol('pmt', integer=True))), ExprCondPair(Float(2396562.54, prec=15), Equality(Integer(103), Symbol('pmt', integer=True))), ExprCondPair(Float(3406503.078, prec=15), Equality(Integer(104), Symbol('pmt', integer=True))), ExprCondPair(Float(3728457.015, prec=15), Equality(Integer(105), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((3859086.519, t<=1504773960), (3482197.908, t>1504773960)), Equality(Integer(106), Symbol('pmt', integer=True))), ExprCondPair(Float(2298016.716, prec=15), Equality(Integer(107), Symbol('pmt', integer=True))), ExprCondPair(Float(4801878.611, prec=15), Equality(Integer(108), Symbol('pmt', integer=True))), ExprCondPair(Float(2256062.546, prec=15), Equality(Integer(109), Symbol('pmt', integer=True))), ExprCondPair(Float(2390907.524, prec=15), Equality(Integer(110), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((233101.871200/(1. + exp((t-1483500000)/10000000) ) + 2052237.358000 + 211762.631700/(1. + exp((t-1518090261)/4693996) ), t<1533081600), (113608.837700/(1. + exp((t-1540409881)/1442754) ) + 1914861.566000, t>=1533081600)), Equality(Integer(111), Symbol('pmt', integer=True))), ExprCondPair(Float(2232155.847, prec=15), Equality(Integer(112), Symbol('pmt', integer=True))), ExprCondPair(Float(2836239.095, prec=15), Equality(Integer(113), Symbol('pmt', integer=True))), ExprCondPair(Float(2920173.821, prec=15), Equality(Integer(114), Symbol('pmt', integer=True))), ExprCondPair(Float(1777485.673, prec=15), Equality(Integer(115), Symbol('pmt', integer=True))), ExprCondPair(Float(3660373.054, prec=15), Equality(Integer(116), Symbol('pmt', integer=True))), ExprCondPair(959244.963700/(1. + exp((t-1557614478)/18688783) ) + 1246509.686000, Equality(Integer(117), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(118), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((74907.898330/(1. + exp((t-1483001278)/6074) ) + 2097681.030000 + 129338.698900/(1. + exp((t-1493813664)/1841541) ), t<1499232274), (260559.024500/(1. + exp((t-1519101990)/8772264) ) + 1343738.198000, t<1533081600), (83384.479180/(1. + exp((t-1537249848)/462257) ) + 1287175.787000, t>=1533081600)), Equality(Integer(119), Symbol('pmt', integer=True))), ExprCondPair(Float(2453235.125, prec=15), Equality(Integer(120), Symbol('pmt', integer=True))), ExprCondPair(Float(4719088.805, prec=15), Equality(Integer(121), Symbol('pmt', integer=True))), ExprCondPair(Float(2280034.828, prec=15), Equality(Integer(122), Symbol('pmt', integer=True))), ExprCondPair(Float(2299095.99, prec=15), Equality(Integer(123), Symbol('pmt', integer=True))), ExprCondPair(622591.023900/(1. + exp((1569258658-t)/28338652) ) + 2063649.734000 + 129922.811400/(1. + exp((t-1532341580)/207) ), Equality(Integer(124), Symbol('pmt', integer=True))), ExprCondPair(Float(2227676.818, prec=15), Equality(Integer(125), Symbol('pmt', integer=True))), ExprCondPair(Float(4924723.748, prec=15), Equality(Integer(126), Symbol('pmt', integer=True))), ExprCondPair(Float(4725393.92, prec=15), Equality(Integer(127), Symbol('pmt', integer=True))), ExprCondPair(Float(2295241.692, prec=15), Equality(Integer(128), Symbol('pmt', integer=True))), ExprCondPair(Float(2685006.003, prec=15), Equality(Integer(129), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(130), Symbol('pmt', integer=True))), ExprCondPair(Float(3343318.854, prec=15), Equality(Integer(131), Symbol('pmt', integer=True))), ExprCondPair(Float(4597067.763, prec=15), Equality(Integer(132), Symbol('pmt', integer=True))), ExprCondPair(Float(3274954.171, prec=15), Equality(Integer(133), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(134), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(135), Symbol('pmt', integer=True))), ExprCondPair(Float(3858071.688, prec=15), Equality(Integer(136), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(137), Symbol('pmt', integer=True))), ExprCondPair(Float(4409522.197, prec=15), Equality(Integer(138), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(139), Symbol('pmt', integer=True))), ExprCondPair(Float(4768175.891, prec=15), Equality(Integer(140), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((3204981.427, t<1502383532), (450200.399800/(1. + exp((t-1495806328)/92089034) ) + 2747905.214000 + 76412.583160/(1. + exp((t-1522035413)/4372) ) + 182349.207300/(1. + exp((t-1531354144)/382262) ), t<1518134400), (0, t>=1518134400)), Equality(Integer(141), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((65793.361980/(1. + exp((t-1483018883)/17332) ) + 2037599.726000 + 163613.753300/(1. + exp((t-1493813419)/2159883) ), t<1502383532), (721744.336400/(1. + exp((t-1498000000)/11294600) ) + 1402569.355000 + 192167.612700/(1. + exp((t-1521061510)/428161) ) + 144850.106100/(1. + exp((t-1531268460)/5427) ), t<1533081600), (258368.954900/(1. + exp((t-1538364994)/1528951) ) + 1221035.912000, t>=1533081600)), Equality(Integer(142), Symbol('pmt', integer=True))), ExprCondPair(Float(3359338.796, prec=15), Equality(Integer(143), Symbol('pmt', integer=True))), ExprCondPair(Float(2650455.689, prec=15), Equality(Integer(144), Symbol('pmt', integer=True))), ExprCondPair(Float(3371579.392, prec=15), Equality(Integer(145), Symbol('pmt', integer=True))), ExprCondPair(Float(4002782.652, prec=15), Equality(Integer(146), Symbol('pmt', integer=True))), ExprCondPair(Float(4885684.577, prec=15), Equality(Integer(147), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((0, t<=1518134400), (0, t>1518134400)), Equality(Integer(148), Symbol('pmt', integer=True))), ExprCondPair(Float(2351943.057, prec=15), Equality(Integer(149), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(150), Symbol('pmt', integer=True))), ExprCondPair(Float(4025304.45, prec=15), Equality(Integer(151), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(152), Symbol('pmt', integer=True))), ExprCondPair(Float(3633838.351, prec=15), Equality(Integer(153), Symbol('pmt', integer=True))), ExprCondPair(Float(2734039.119, prec=15), Equality(Integer(154), Symbol('pmt', integer=True))), ExprCondPair(Float(2351581.176, prec=15), Equality(Integer(155), Symbol('pmt', integer=True))), ExprCondPair(Float(3191698.479, prec=15), Equality(Integer(156), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((2270820.279, t<1502383532), (862976.774400/(1. + exp((t-1548248917)/27403449) ) + 1345240.504000 + 92873.549870/(1. + exp((t-1521043256)/4397) ) + 66727.575480/(1. + exp((t-1531425141)/4445) ), t>=1502383532)), Equality(Integer(157), Symbol('pmt', integer=True))), ExprCondPair(Float(4441270.964, prec=15), Equality(Integer(158), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((4114239.21, t<=1489337078), (3079481.616, t>1489337078)), Equality(Integer(159), Symbol('pmt', integer=True))),ExprCondPair(Float(2282652.048, prec=15), Equality(Integer(160), Symbol('pmt', integer=True))), ExprCondPair(Float(2344607.156, prec=15), Equality(Integer(161), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(162), Symbol('pmt', integer=True))), ExprCondPair(Float(2200383.107, prec=15), Equality(Integer(163), Symbol('pmt', integer=True))), ExprCondPair(Float(2254706.95, prec=15), Equality(Integer(164), Symbol('pmt', integer=True))), ExprCondPair(Float(2569335.225, prec=15), Equality(Integer(165), Symbol('pmt', integer=True))), ExprCondPair(Float(2342175.891, prec=15), Equality(Integer(166), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((0, t<=1518134400), (0, t>1518134400)), Equality(Integer(167), Symbol('pmt', integer=True))), ExprCondPair(34805.401790/(1. + exp((t-1483050146)/2921) ) + 2257235.257000, Equality(Integer(168), Symbol('pmt', integer=True))), ExprCondPair(Float(4498696.848, prec=15), Equality(Integer(169), Symbol('pmt', integer=True))), ExprCondPair(Float(4764518.761, prec=15), Equality(Integer(170), Symbol('pmt', integer=True))), ExprCondPair(Float(3287625.187, prec=15), Equality(Integer(171), Symbol('pmt', integer=True))), ExprCondPair(Float(3993467.959, prec=15), Equality(Integer(172), Symbol('pmt', integer=True))), ExprCondPair(Float(2331720.033, prec=15), Equality(Integer(173), Symbol('pmt', integer=True))), ExprCondPair(29981.636050/(1. + exp((t-1483013392)/3904) ) + 2206350.929000, Equality(Integer(174), Symbol('pmt', integer=True))), ExprCondPair(69696.934420/(1. + exp((t-1483011669)/7749) ) + 4289612.039000, Equality(Integer(175), Symbol('pmt', integer=True))), ExprCondPair(Float(2753375.091, prec=15), Equality(Integer(176), Symbol('pmt', integer=True))), ExprCondPair(Float(2925465.607, prec=15), Equality(Integer(177), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(178), Symbol('pmt', integer=True))), ExprCondPair(Float(2328997.923, prec=15), Equality(Integer(179), Symbol('pmt', integer=True))), ExprCondPair(Float(4787351.923, prec=15), Equality(Integer(180), Symbol('pmt', integer=True))), ExprCondPair(Float(4780198.333, prec=15), Equality(Integer(181), Symbol('pmt', integer=True))), ExprCondPair(Float(3253493.08, prec=15), Equality(Integer(182), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(183), Symbol('pmt', integer=True))), ExprCondPair(Float(2225037.609, prec=15), Equality(Integer(184), Symbol('pmt', integer=True))), ExprCondPair(Float(4223150.444, prec=15), Equality(Integer(185), Symbol('pmt', integer=True))), ExprCondPair(Float(3983099.352, prec=15), Equality(Integer(186), Symbol('pmt', integer=True))), ExprCondPair(Float(4065490.436, prec=15), Equality(Integer(187), Symbol('pmt', integer=True))), ExprCondPair(Float(2250984.024, prec=15), Equality(Integer(188), Symbol('pmt', integer=True))), ExprCondPair(Float(2242190.605, prec=15), Equality(Integer(189), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((4770523.746, t<=1484731748), (0, t<=1525132799), (4539537.353, t>1525132799)), Equality(Integer(190), Symbol('pmt', integer=True))),ExprCondPair(Float(2670024.246, prec=15), Equality(Integer(191), Symbol('pmt', integer=True))), ExprCondPair(Float(3525294.623, prec=15), Equality(Integer(192), Symbol('pmt', integer=True))), ExprCondPair(61042.211050/(1. + exp((t-1483043344)/1004) ) + 4599985.851000, Equality(Integer(193), Symbol('pmt', integer=True))), ExprCondPair(Float(3358916.438, prec=15), Equality(Integer(194), Symbol('pmt', integer=True))), ExprCondPair(Float(2251338.143, prec=15), Equality(Integer(195), Symbol('pmt', integer=True))), ExprCondPair(Float(2239489.678, prec=15), Equality(Integer(196), Symbol('pmt', integer=True))), ExprCondPair(Float(2223583.1, prec=15), Equality(Integer(197), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(198), Symbol('pmt', integer=True))), ExprCondPair(Float(3258467.446, prec=15), Equality(Integer(199), Symbol('pmt', integer=True))), ExprCondPair(Float(2134300.427, prec=15), Equality(Integer(200), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((138563.309600/(1. + exp((t-1482919016)/78757) ) + 2950000.000000 + 153984.885300/(1. + exp((t-1490900000)/2135928) ) + 267541.326300/(1. + exp((t-1518000000)/4320454) ), t<1518134400), (0, t>=1518134400)), Equality(Integer(201), Symbol('pmt', integer=True))), ExprCondPair(Float(2163510.781, prec=15), Equality(Integer(202), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(203), Symbol('pmt', integer=True))), ExprCondPair(Float(3895303.117, prec=15), Equality(Integer(204), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((1910643.005, t<=1490173263), (1466462.331, t>1490173263)), Equality(Integer(205), Symbol('pmt', integer=True))),ExprCondPair(Float('0.0', prec=15), Equality(Integer(206), Symbol('pmt', integer=True))), ExprCondPair(Float(3790142.05, prec=15), Equality(Integer(207), Symbol('pmt', integer=True))), ExprCondPair(Float(2434603.758, prec=15), Equality(Integer(208), Symbol('pmt', integer=True))), ExprCondPair(1000.451642/(1. + exp((t-1483799466)/99992087) ) + 1605334.425000 + 715228.201700/(1. + exp((t-1510000022)/99999562) ), Equality(Integer(209), Symbol('pmt', integer=True))), ExprCondPair(Float(3339186.4, prec=15), Equality(Integer(210), Symbol('pmt', integer=True))), ExprCondPair(Float(3849608.613, prec=15), Equality(Integer(211), Symbol('pmt', integer=True))), ExprCondPair(Float(4236512.797, prec=15), Equality(Integer(212), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(213), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(214), Symbol('pmt', integer=True))), ExprCondPair(Float(4835971.062, prec=15), Equality(Integer(215), Symbol('pmt', integer=True))), ExprCondPair(Float(4106573.165, prec=15), Equality(Integer(216), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((121957.708700/(1. + exp((t-1482881883)/59649) ) + 1802625.906000 + 170985.267400/(1. + exp((t-1491829602)/2230938) ), t<1502383532), (3400435.076000/(1. + exp((t-1495964899)/96575292) ) + 6904.355259 + 61269.844320/(1. + exp((t-1520771851)/1379) ) + 48463.241480/(1. + exp((t-1530939693)/7193) ), t>=1502383532)), Equality(Integer(217), Symbol('pmt', integer=True))), ExprCondPair(Float(4679001.297, prec=15), Equality(Integer(218), Symbol('pmt', integer=True))), ExprCondPair(Float(4653648.597, prec=15), Equality(Integer(219), Symbol('pmt', integer=True))), ExprCondPair(Float(2358067.304, prec=15), Equality(Integer(220), Symbol('pmt', integer=True))), ExprCondPair(Float(4782835.131, prec=15), Equality(Integer(221), Symbol('pmt', integer=True))), ExprCondPair(Float(3405370.309, prec=15), Equality(Integer(222), Symbol('pmt', integer=True))), ExprCondPair(Float(4754123.446, prec=15), Equality(Integer(223), Symbol('pmt', integer=True))), ExprCondPair(Float(3164347.734, prec=15), Equality(Integer(224), Symbol('pmt', integer=True))), ExprCondPair(40705.313950/(1. + exp((t-1521205807)/236044) ) + 2230759.630000 + 115581.801400/(1. + exp((t-1529452800)/6607498) ), Equality(Integer(225), Symbol('pmt', integer=True))), ExprCondPair(Float(4579837.178, prec=15), Equality(Integer(226), Symbol('pmt', integer=True))), ExprCondPair(Float(2756946.41, prec=15), Equality(Integer(227), Symbol('pmt', integer=True))), ExprCondPair(Float(2646467.923, prec=15), Equality(Integer(228), Symbol('pmt', integer=True))), ExprCondPair(Float(4632895.951, prec=15), Equality(Integer(229), Symbol('pmt', integer=True))), ExprCondPair(Float(2222139.262, prec=15), Equality(Integer(230), Symbol('pmt', integer=True))), ExprCondPair(Float(3743934.453, prec=15), Equality(Integer(231), Symbol('pmt', integer=True))), ExprCondPair(Float(2296652.338, prec=15), Equality(Integer(232), Symbol('pmt', integer=True))), ExprCondPair(Float(2540343.948, prec=15), Equality(Integer(233), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(234), Symbol('pmt', integer=True))), ExprCondPair(Float(4680863.222, prec=15), Equality(Integer(235), Symbol('pmt', integer=True))), ExprCondPair(Float(2287420.15, prec=15), Equality(Integer(236), Symbol('pmt', integer=True))), ExprCondPair(Float(2267100.992, prec=15), Equality(Integer(237), Symbol('pmt', integer=True))), ExprCondPair(Float(4686892.203, prec=15), Equality(Integer(238), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(239), Symbol('pmt', integer=True))), ExprCondPair(Float(2338349.664, prec=15), Equality(Integer(240), Symbol('pmt', integer=True))), ExprCondPair(Float(4228337.203, prec=15), Equality(Integer(241), Symbol('pmt', integer=True))), ExprCondPair(Float(4562713.449, prec=15), Equality(Integer(242), Symbol('pmt', integer=True))), ExprCondPair(288003.850900/(1. + exp((t-1523985209)/8315793) ) + 4037543.373000, Equality(Integer(243), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(244), Symbol('pmt', integer=True))), ExprCondPair(Float(3991267.981, prec=15), Equality(Integer(245), Symbol('pmt', integer=True))), ExprCondPair(Float(3463853.357, prec=15), Equality(Integer(246), Symbol('pmt', integer=True))), ExprCondPair(Float(4525820.812, prec=15), Equality(Integer(247), Symbol('pmt', integer=True))), ExprCondPair(Float('3999740', prec=15), Equality(Integer(248), Symbol('pmt', integer=True))), ExprCondPair(Float('4744290', prec=15), Equality(Integer(250), Symbol('pmt', integer=True))), ExprCondPair(Float('4664750', prec=15), Equality(Integer(252), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), S.true))"
In [103]:
gain_vs_time_model = parse_expr(gain_vs_time_model_string)
gain_vs_time_model
Out[103]:
In [104]:
import copy
off_PMTs = [1, 2, 26, 62, 65, 79, 88, 102, 118, 130, 134,
135, 137, 139, 150, 152, 162, 178, 183, 198,
206, 213, 214, 234, 239, 244 ] # some of them are ON during SR0 or SR1
low_SPE_PMTs = [31, 71, 87, 91, 148, 167, 203]
off_PMTs_in_SR2 = [31, 87, 91, 141, 201] # 203 is already in the low-SPE PMT list
on_PMTs_in_SR2 = [12, 27, 34, 73, 86, 190] # 148 & 167 will be excluded, so not listed here
PMTs_change_SR2 = copy.deepcopy(off_PMTs)
PMTs_change_SR2 += low_SPE_PMTs
PMTs_change_SR2 += off_PMTs_in_SR2
PMTs_change_SR2 += on_PMTs_in_SR2
print('# of PMTs already off before SR2 =', len(off_PMTs))
print('# of PMTs with low SPE acceptance =', len(low_SPE_PMTs))
print('# of PMTs turned off during SR2 =', len(off_PMTs_in_SR2))
print('# of PMTs turned on during SR2 =', len(on_PMTs_in_SR2))
print(len(PMTs_change_SR2))
In [105]:
gain_decrease_PMTs = [0, 11, 17, 21, 23, 25, 27, 28, 31, 34, 39, 40,
41, 45, 48, 49, 58, 61, 66, 67, 69, 71, 72, 73, 78,
85, 86, 87, 91, 93, 96, 106, 111, 117, 119, 124, 134,
141, 142, 148, 157, 159, 168, 174, 175, 190, 193, 201,
203, 205, 209, 217, 225, 243]
print('# of PMTs showed gain decrease = ', len(gain_decrease_PMTs))
PMT_list = PMTs_change_SR2 + gain_decrease_PMTs
PMT_list = list(set(PMT_list))
PMT_list.sort()
PMT_list
Out[105]:
In [106]:
import pandas as pd
time_idx = pd.date_range('2016/10/29',periods=27,freq='MS')
for ipmt in PMT_list:
for i, time in enumerate(time_idx):
utc_t = time_idx[i].timestamp()
t = sympy.symbols('t')
pmt = sympy.symbols('pmt', integer=True)
print("Computed gain for PMT%d @ %s is %g" % (ipmt,
time_idx[i],
float(gain_vs_time_model.evalf(subs={t: int(utc_t), pmt: ipmt}))))
print(" ")
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: