In [1]:
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 [2]:
new_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((2114948.631, t<=1477656000), (2114948.631, t>=1479749714),  (1185630, True)), Equality(Integer(3), Symbol('pmt', integer=True))),ExprCondPair(Float(3911403.114, prec=15), Equality(Integer(4), Symbol('pmt', integer=True))), ExprCondPair(Float(2174952.395, prec=15), Equality(Integer(5), Symbol('pmt', integer=True))), ExprCondPair(Float(4787662.301, prec=15), Equality(Integer(6), Symbol('pmt', integer=True))), ExprCondPair(Float(2282290.134, prec=15), Equality(Integer(7), Symbol('pmt', integer=True))), ExprCondPair(Float(2306758.899, prec=15), Equality(Integer(8), Symbol('pmt', integer=True))), ExprCondPair(Float(3547885.388, prec=15), Equality(Integer(9), Symbol('pmt', integer=True))), ExprCondPair(Float(2424047.23, 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<=1525132800), (4095444.65, t>1525132800)), Equality(Integer(12), Symbol('pmt', integer=True))), ExprCondPair(Float(3083532.044, prec=15), Equality(Integer(13), Symbol('pmt', integer=True))), ExprCondPair(Float(2153954.677, prec=15), Equality(Integer(14), Symbol('pmt', integer=True))), ExprCondPair(Float(2436135.098, prec=15), Equality(Integer(15), Symbol('pmt', integer=True))), ExprCondPair(Float(2676866.964, 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(2399631.928, prec=15), Equality(Integer(18), Symbol('pmt', integer=True))), ExprCondPair(Float(2305471.244, prec=15), Equality(Integer(19), Symbol('pmt', integer=True))), ExprCondPair(Float(2397076.584, 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>1498979340)), Equality(Integer(21), Symbol('pmt', integer=True))), ExprCondPair(Float(4320653.907, prec=15), Equality(Integer(22), Symbol('pmt', integer=True))), ExprCondPair(112326.137400/(1. + exp((t-1509676115)/7032150) ) + 2252282.630000, Equality(Integer(23), Symbol('pmt', integer=True))), ExprCondPair(Float(3169682.64, 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<=1525132800), (3575882.225, t>1525132800)), 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(2356935.656, prec=15), Equality(Integer(29), Symbol('pmt', integer=True))), ExprCondPair(Float(4056954.778, 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>=1497013200)), Equality(Integer(31), Symbol('pmt', integer=True))), ExprCondPair(Float(4145615.555, prec=15), Equality(Integer(32), Symbol('pmt', integer=True))), ExprCondPair(Float(2432879.693, prec=15), Equality(Integer(33), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((0, t<=1525132800), (3187867.318, t>1525132800)), Equality(Integer(34), Symbol('pmt', integer=True))), ExprCondPair(Float(3194599.443, prec=15), Equality(Integer(35), Symbol('pmt', integer=True))), ExprCondPair(Float(2309283.851, prec=15), Equality(Integer(36), Symbol('pmt', integer=True))), ExprCondPair(Float(2436856.367, prec=15), Equality(Integer(37), Symbol('pmt', integer=True))), ExprCondPair(Float(3773656.828, 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(810804.452300/(1. + exp((t-1545000000)/30617944) ) + 1737906.772000, 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(3731762.602, prec=15), Equality(Integer(42), Symbol('pmt', integer=True))), ExprCondPair(Float(2336041.01, prec=15), Equality(Integer(43), Symbol('pmt', integer=True))), ExprCondPair(Float(2794629.893, prec=15), Equality(Integer(44), Symbol('pmt', integer=True))), ExprCondPair(Float(2629846.598, prec=15), Equality(Integer(45), Symbol('pmt', integer=True))), ExprCondPair(Float(2258661.903, prec=15), Equality(Integer(46), Symbol('pmt', integer=True))), ExprCondPair(Float(3602584.962, 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), (2262950.226, t>1482418401)), Equality(Integer(49), Symbol('pmt', integer=True))), ExprCondPair(Float(3738675.745, prec=15), Equality(Integer(50), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((0, t<=1484731748), (3720655.479, t>1484731748)), Equality(Integer(51), Symbol('pmt', integer=True))), ExprCondPair(Float(2401290.798, prec=15), Equality(Integer(52), Symbol('pmt', integer=True))), ExprCondPair(Float(2139772.448, prec=15), Equality(Integer(53), Symbol('pmt', integer=True))), ExprCondPair(Float(3644871.352, prec=15), Equality(Integer(54), Symbol('pmt', integer=True))), ExprCondPair(Float(1976574.082, prec=15), Equality(Integer(55), Symbol('pmt', integer=True))), ExprCondPair(Float(4578696.252, prec=15), Equality(Integer(56), Symbol('pmt', integer=True))), ExprCondPair(Float(3446715.225, prec=15), Equality(Integer(57), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((2168250.61, t<=1484064477), (1654373.185, t>1484064477)), Equality(Integer(58), Symbol('pmt', integer=True))),ExprCondPair(Float(2272423.602, prec=15), Equality(Integer(59), Symbol('pmt', integer=True))), ExprCondPair(Float(2843760.336, 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(3812202.101, prec=15), Equality(Integer(63), Symbol('pmt', integer=True))), ExprCondPair(Float(3547512.523, 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>=1502383532)), 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(4814261.431, 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(3761517.64, 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>=1502383532)), 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<=1525132800), (2014523.739, t>1525132800)), Equality(Integer(73), Symbol('pmt', integer=True))), ExprCondPair(Float(4791546.883, prec=15), Equality(Integer(74), Symbol('pmt', integer=True))), ExprCondPair(Float(4652413.815, prec=15), Equality(Integer(75), Symbol('pmt', integer=True))), ExprCondPair(Float(2918239.34, prec=15), Equality(Integer(76), Symbol('pmt', integer=True))), ExprCondPair(Float(3340955.745, prec=15), Equality(Integer(77), Symbol('pmt', integer=True))), ExprCondPair(92819.160530/(1. + exp((t-1483005314)/4506) ) + 1360050.787000 + 463614.062400/(1. + exp((t-1505901173)/14081201) ) + 106805.413300/(1. + exp((t-1520637397)/539552) ), Equality(Integer(78), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(79), Symbol('pmt', integer=True))), ExprCondPair(Float(3371657.835, prec=15), Equality(Integer(80), Symbol('pmt', integer=True))), ExprCondPair(Float(4186750.529, prec=15), Equality(Integer(81), Symbol('pmt', integer=True))), ExprCondPair(Float(4431289.794, prec=15), Equality(Integer(82), Symbol('pmt', integer=True))), ExprCondPair(Float(2098635.285, prec=15), Equality(Integer(83), Symbol('pmt', integer=True))), ExprCondPair(Float(2544099.012, 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<=1525132800), (2210868.099, t>1525132800)), Equality(Integer(86), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((2472595.99, t<=1502323200), (2012985.678000/(1. + exp((t-1519456010)/1420212) ) + 409968.672500, t<=1525168124), (0, t>1525168124)), Equality(Integer(87), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(88), Symbol('pmt', integer=True))), ExprCondPair(Float(2630956.612, prec=15), Equality(Integer(89), Symbol('pmt', integer=True))), ExprCondPair(Float(2311313.473, prec=15), Equality(Integer(90), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(91), Symbol('pmt', integer=True))), ExprCondPair(Float(3485772.453, 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(2941925.972, prec=15), Equality(Integer(94), Symbol('pmt', integer=True))), ExprCondPair(Float(4220655.865, 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(2968317.033, prec=15), Equality(Integer(97), Symbol('pmt', integer=True))), ExprCondPair(Float(2105334.885, prec=15), Equality(Integer(98), Symbol('pmt', integer=True))), ExprCondPair(Float(2244610.005, prec=15), Equality(Integer(99), Symbol('pmt', integer=True))), ExprCondPair(Float(2251091.306, prec=15), Equality(Integer(100), Symbol('pmt', integer=True))), ExprCondPair(Float(3089195.242, prec=15), Equality(Integer(101), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(102), Symbol('pmt', integer=True))), ExprCondPair(Float(2403046.29, prec=15), Equality(Integer(103), Symbol('pmt', integer=True))), ExprCondPair(Float(3407642.678, prec=15), Equality(Integer(104), Symbol('pmt', integer=True))), ExprCondPair(Float(3742641.473, prec=15), Equality(Integer(105), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((3859086.519, t<=1504773960), (3479677.835, t>1504773960)), Equality(Integer(106), Symbol('pmt', integer=True))), ExprCondPair(Float(2301116.873, prec=15), Equality(Integer(107), Symbol('pmt', integer=True))), ExprCondPair(Float(4799718.446, prec=15), Equality(Integer(108), Symbol('pmt', integer=True))), ExprCondPair(Float(2257621.217, prec=15), Equality(Integer(109), Symbol('pmt', integer=True))), ExprCondPair(Float(2392671.93, prec=15), Equality(Integer(110), Symbol('pmt', integer=True))), ExprCondPair(233101.871200/(1. + exp((t-1483500000)/10000000) ) + 2052237.358000 + 211762.631700/(1. + exp((t-1518090261)/4693996) ), Equality(Integer(111), Symbol('pmt', integer=True))), ExprCondPair(Float(2231500.108, prec=15), Equality(Integer(112), Symbol('pmt', integer=True))), ExprCondPair(Float(2837813.272, prec=15), Equality(Integer(113), Symbol('pmt', integer=True))), ExprCondPair(Float(2921642.98, prec=15), Equality(Integer(114), Symbol('pmt', integer=True))), ExprCondPair(Float(1776538.307, prec=15), Equality(Integer(115), Symbol('pmt', integer=True))), ExprCondPair(Float(3662058.047, 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>=1499232274)), Equality(Integer(119), Symbol('pmt', integer=True))), ExprCondPair(Float(2450979.006, prec=15), Equality(Integer(120), Symbol('pmt', integer=True))), ExprCondPair(Float(4731755.778, prec=15), Equality(Integer(121), Symbol('pmt', integer=True))), ExprCondPair(Float(2283167.277, prec=15), Equality(Integer(122), Symbol('pmt', integer=True))), ExprCondPair(Float(2301250.175, prec=15), Equality(Integer(123), Symbol('pmt', integer=True))), ExprCondPair(344094.203000/(1. + exp((1529999934-t)/39671008) ) + 2137431.046000, Equality(Integer(124), Symbol('pmt', integer=True))), ExprCondPair(Float(2226097.981, prec=15), Equality(Integer(125), Symbol('pmt', integer=True))), ExprCondPair(Float(4920224.793, prec=15), Equality(Integer(126), Symbol('pmt', integer=True))), ExprCondPair(Float(4734429.18, prec=15), Equality(Integer(127), Symbol('pmt', integer=True))), ExprCondPair(Float(2300458.769, prec=15), Equality(Integer(128), Symbol('pmt', integer=True))), ExprCondPair(Float(2686355.283, prec=15), Equality(Integer(129), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(130), Symbol('pmt', integer=True))), ExprCondPair(Float(3348157.065, prec=15), Equality(Integer(131), Symbol('pmt', integer=True))), ExprCondPair(Float(4600822.549, prec=15), Equality(Integer(132), Symbol('pmt', integer=True))), ExprCondPair(Float(3278819.315, 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(3863358.341, prec=15), Equality(Integer(136), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(137), Symbol('pmt', integer=True))), ExprCondPair(Float(4416918.461, prec=15), Equality(Integer(138), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(139), Symbol('pmt', integer=True))), ExprCondPair(Float(4767612.085, 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>=1502383532)), 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>=1502383532)), Equality(Integer(142), Symbol('pmt', integer=True))), ExprCondPair(Float(3360784.193, prec=15), Equality(Integer(143), Symbol('pmt', integer=True))), ExprCondPair(Float(2654278.911, prec=15), Equality(Integer(144), Symbol('pmt', integer=True))), ExprCondPair(Float(3373660.172, prec=15), Equality(Integer(145), Symbol('pmt', integer=True))), ExprCondPair(Float(4004618.599, prec=15), Equality(Integer(146), Symbol('pmt', integer=True))), ExprCondPair(Float(4892346.136, prec=15), Equality(Integer(147), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((0, t<=1525132800), (3995369.667, t>1525132800)), Equality(Integer(148), Symbol('pmt', integer=True))), ExprCondPair(Float(2354770.044, prec=15), Equality(Integer(149), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(150), Symbol('pmt', integer=True))), ExprCondPair(Float(4028339.654, prec=15), Equality(Integer(151), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(152), Symbol('pmt', integer=True))), ExprCondPair(Float(3631411.86, prec=15), Equality(Integer(153), Symbol('pmt', integer=True))), ExprCondPair(Float(2735430.911, prec=15), Equality(Integer(154), Symbol('pmt', integer=True))), ExprCondPair(Float(2353102.059, prec=15), Equality(Integer(155), Symbol('pmt', integer=True))), ExprCondPair(Float(3200178.266, 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(4446703.885, prec=15), Equality(Integer(158), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((4114239.21, t<=1489337078), (3085148.615, t>1489337078)), Equality(Integer(159), Symbol('pmt', integer=True))),ExprCondPair(Float(2285591.61, prec=15), Equality(Integer(160), Symbol('pmt', integer=True))), ExprCondPair(Float(2344707.299, prec=15), Equality(Integer(161), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(162), Symbol('pmt', integer=True))), ExprCondPair(Float(2203878.513, prec=15), Equality(Integer(163), Symbol('pmt', integer=True))), ExprCondPair(Float(2259826.429, prec=15), Equality(Integer(164), Symbol('pmt', integer=True))), ExprCondPair(Float(2570436.9, prec=15), Equality(Integer(165), Symbol('pmt', integer=True))), ExprCondPair(Float(2345924.687, prec=15), Equality(Integer(166), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((0, t<=1525132800), (1636498.277, t>1525132800)), 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(4504589.162, prec=15), Equality(Integer(169), Symbol('pmt', integer=True))), ExprCondPair(Float(4776809.848, prec=15), Equality(Integer(170), Symbol('pmt', integer=True))), ExprCondPair(Float(3289174.689, prec=15), Equality(Integer(171), Symbol('pmt', integer=True))), ExprCondPair(Float(3997409.092, prec=15), Equality(Integer(172), Symbol('pmt', integer=True))), ExprCondPair(Float(2330777.639, 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(2751969.25, prec=15), Equality(Integer(176), Symbol('pmt', integer=True))), ExprCondPair(Float(2925574.82, prec=15), Equality(Integer(177), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(178), Symbol('pmt', integer=True))), ExprCondPair(Float(2331405.89, prec=15), Equality(Integer(179), Symbol('pmt', integer=True))), ExprCondPair(Float(4786799.474, prec=15), Equality(Integer(180), Symbol('pmt', integer=True))), ExprCondPair(Float(4791040.533, prec=15), Equality(Integer(181), Symbol('pmt', integer=True))), ExprCondPair(Float(3256479.601, prec=15), Equality(Integer(182), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(183), Symbol('pmt', integer=True))), ExprCondPair(Float(2230084.596, prec=15), Equality(Integer(184), Symbol('pmt', integer=True))), ExprCondPair(Float(4228180.348, prec=15), Equality(Integer(185), Symbol('pmt', integer=True))), ExprCondPair(Float(3983937.85, prec=15), Equality(Integer(186), Symbol('pmt', integer=True))), ExprCondPair(Float(4066102.367, prec=15), Equality(Integer(187), Symbol('pmt', integer=True))), ExprCondPair(Float(2253493.386, prec=15), Equality(Integer(188), Symbol('pmt', integer=True))), ExprCondPair(Float(2249075.814, prec=15), Equality(Integer(189), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((4770523.746, t<=1484731748), (0, t<=1525132800), (4539537.353, t>1525132800)), Equality(Integer(190), Symbol('pmt', integer=True))),ExprCondPair(Float(2672274.462, prec=15), Equality(Integer(191), Symbol('pmt', integer=True))), ExprCondPair(Float(3527164.467, 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(3360105.439, prec=15), Equality(Integer(194), Symbol('pmt', integer=True))), ExprCondPair(Float(2253339.027, prec=15), Equality(Integer(195), Symbol('pmt', integer=True))), ExprCondPair(Float(2241082.721, prec=15), Equality(Integer(196), Symbol('pmt', integer=True))), ExprCondPair(Float(2224387.69, prec=15), Equality(Integer(197), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(198), Symbol('pmt', integer=True))), ExprCondPair(Float(3263106.192, prec=15), Equality(Integer(199), Symbol('pmt', integer=True))), ExprCondPair(Float(2136224.656, prec=15), Equality(Integer(200), Symbol('pmt', integer=True))), ExprCondPair(138563.309600/(1. + exp((t-1482919016)/78757) ) + 2950000.000000 + 153984.885300/(1. + exp((t-1490900000)/2135928) ) + 267541.326300/(1. + exp((t-1518000000)/4320454) ), Equality(Integer(201), Symbol('pmt', integer=True))), ExprCondPair(Float(2165282.33, prec=15), Equality(Integer(202), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(203), Symbol('pmt', integer=True))), ExprCondPair(Float(3894267.276, prec=15), Equality(Integer(204), Symbol('pmt', integer=True))), ExprCondPair(Piecewise((1910643.005, t<=1490173263), (1460080.954, t>1490173263)), Equality(Integer(205), Symbol('pmt', integer=True))),ExprCondPair(Float('0.0', prec=15), Equality(Integer(206), Symbol('pmt', integer=True))), ExprCondPair(Float(3794553.86, prec=15), Equality(Integer(207), Symbol('pmt', integer=True))), ExprCondPair(Float(2433956.212, prec=15), Equality(Integer(208), Symbol('pmt', integer=True))), ExprCondPair(84837.821430/(1. + exp((t-1483800000)/1000000) ) + 1970121.067000, Equality(Integer(209), Symbol('pmt', integer=True))), ExprCondPair(Float(3343854.018, prec=15), Equality(Integer(210), Symbol('pmt', integer=True))), ExprCondPair(Float(3851690.466, prec=15), Equality(Integer(211), Symbol('pmt', integer=True))), ExprCondPair(Float(4242064.36, 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(4834082.954, prec=15), Equality(Integer(215), Symbol('pmt', integer=True))), ExprCondPair(Float(4104687.299, 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(4686745.044, prec=15), Equality(Integer(218), Symbol('pmt', integer=True))), ExprCondPair(Float(4661072.668, prec=15), Equality(Integer(219), Symbol('pmt', integer=True))), ExprCondPair(Float(2357301.334, prec=15), Equality(Integer(220), Symbol('pmt', integer=True))), ExprCondPair(Float(4781829.72, prec=15), Equality(Integer(221), Symbol('pmt', integer=True))), ExprCondPair(Float(3403911.445, prec=15), Equality(Integer(222), Symbol('pmt', integer=True))), ExprCondPair(Float(4762211.752, prec=15), Equality(Integer(223), Symbol('pmt', integer=True))), ExprCondPair(Float(3170752.993, prec=15), Equality(Integer(224), Symbol('pmt', integer=True))), ExprCondPair(Float(2374928.733, prec=15), Equality(Integer(225), Symbol('pmt', integer=True))), ExprCondPair(Float(4585408.392, prec=15), Equality(Integer(226), Symbol('pmt', integer=True))), ExprCondPair(Float(2758007.461, prec=15), Equality(Integer(227), Symbol('pmt', integer=True))), ExprCondPair(Float(2646862.902, prec=15), Equality(Integer(228), Symbol('pmt', integer=True))), ExprCondPair(Float(4639094.617, prec=15), Equality(Integer(229), Symbol('pmt', integer=True))), ExprCondPair(Float(2226133.115, prec=15), Equality(Integer(230), Symbol('pmt', integer=True))), ExprCondPair(Float(3744656.373, prec=15), Equality(Integer(231), Symbol('pmt', integer=True))), ExprCondPair(Float(2297378.692, prec=15), Equality(Integer(232), Symbol('pmt', integer=True))), ExprCondPair(Float(2540338.164, prec=15), Equality(Integer(233), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(234), Symbol('pmt', integer=True))), ExprCondPair(Float(4681585.178, prec=15), Equality(Integer(235), Symbol('pmt', integer=True))), ExprCondPair(Float(2288534.93, prec=15), Equality(Integer(236), Symbol('pmt', integer=True))), ExprCondPair(Float(2268280.583, prec=15), Equality(Integer(237), Symbol('pmt', integer=True))), ExprCondPair(Float(4692863.886, prec=15), Equality(Integer(238), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(239), Symbol('pmt', integer=True))), ExprCondPair(Float(2335985.492, prec=15), Equality(Integer(240), Symbol('pmt', integer=True))), ExprCondPair(Float(4223874.777, prec=15), Equality(Integer(241), Symbol('pmt', integer=True))), ExprCondPair(Float(4566435.895, prec=15), Equality(Integer(242), Symbol('pmt', integer=True))), ExprCondPair(Float(4286326.901, prec=15), Equality(Integer(243), Symbol('pmt', integer=True))), ExprCondPair(Float('0.0', prec=15), Equality(Integer(244), Symbol('pmt', integer=True))), ExprCondPair(Float(3995778.55, prec=15), Equality(Integer(245), Symbol('pmt', integer=True))), ExprCondPair(Float(3461287.708, prec=15), Equality(Integer(246), Symbol('pmt', integer=True))), ExprCondPair(Float(4526276.55, prec=15), Equality(Integer(247), Symbol('pmt', integer=True))), ExprCondPair(Float('80000.', prec=15), Equality(Integer(254), Symbol('pmt', integer=True))), ExprCondPair(Float('100000.', prec=15), Equality(Integer(255), Symbol('pmt', integer=True))), ExprCondPair(Float('100000.', prec=15), Equality(Integer(256), Symbol('pmt', integer=True))), ExprCondPair(Float('100000.', prec=15), Equality(Integer(257), Symbol('pmt', integer=True))), ExprCondPair(Float('100000.', prec=15), Equality(Integer(258), Symbol('pmt', integer=True))), ExprCondPair(Float('100000.', prec=15), Equality(Integer(259), Symbol('pmt', integer=True))), ExprCondPair(Float('2500000.0', prec=15), S.true))"

In [3]:
new_model = parse_expr(new_model_string)
new_model


/project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/sympy-1.1.1-py3.4.egg/sympy/core/numbers.py:948: SymPyDeprecationWarning: 

Using 'prec=XX' to denote decimal precision has been deprecated since
SymPy 1.1. Use 'dps=XX' for decimal precision and 'precision=XX' for
binary precision instead. See
https://github.com/sympy/sympy/issues/12820 for more info.

  deprecated_since_version="1.1").warn()
Out[3]:
$$\begin{cases} 1714027.877 + \frac{797646.2123}{e^{\frac{t}{43698725} - \frac{63600000}{1747949}} + 1.0} & \text{for}\: 0 = pmt \\0.0 & \text{for}\: 1 = pmt \\\begin{cases} 2059331.5 + \frac{317850.2093}{e^{\frac{t}{173535} - \frac{1482644659}{173535}} + 1.0} & \text{for}\: t < 1484731748 \\0 & \text{for}\: t \geq 1484731748 \end{cases} & \text{for}\: 2 = pmt \\\begin{cases} 2114948.631 & \text{for}\: t \geq 1479749714 \vee t \leq 1477656000 \\1185630 & \text{otherwise} \end{cases} & \text{for}\: 3 = pmt \\3911403.114 & \text{for}\: 4 = pmt \\2174952.395 & \text{for}\: 5 = pmt \\4787662.301 & \text{for}\: 6 = pmt \\2282290.134 & \text{for}\: 7 = pmt \\2306758.899 & \text{for}\: 8 = pmt \\3547885.388 & \text{for}\: 9 = pmt \\2424047.23 & \text{for}\: 10 = pmt \\2920853.476 + \frac{171636.7776}{e^{\frac{t}{7252570} - \frac{149043600}{725257}} + 1.0} & \text{for}\: 11 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1525132800 \\4095444.65 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 12 = pmt \\3083532.044 & \text{for}\: 13 = pmt \\2153954.677 & \text{for}\: 14 = pmt \\2436135.098 & \text{for}\: 15 = pmt \\2676866.964 & \text{for}\: 16 = pmt \\2005079.645 + \frac{117373.8401}{e^{\frac{t}{5469333} - \frac{503870480}{1823111}} + 1.0} & \text{for}\: 17 = pmt \\2399631.928 & \text{for}\: 18 = pmt \\2305471.244 & \text{for}\: 19 = pmt \\2397076.584 & \text{for}\: 20 = pmt \\\begin{cases} 2244990.483 & \text{for}\: t \leq 1498766880 \\1678221.071 & \text{for}\: t \leq 1498979340 \\1131844.061 + \frac{373681.1201}{e^{\frac{t}{4698795} - \frac{102000000}{313253}} + 1.0} & \text{for}\: t > 1498979340 \end{cases} & \text{for}\: 21 = pmt \\4320653.907 & \text{for}\: 22 = pmt \\2252282.63 + \frac{112326.1374}{e^{\frac{t}{7032150} - \frac{301935223}{1406430}} + 1.0} & \text{for}\: 23 = pmt \\3169682.64 & \text{for}\: 24 = pmt \\2242440.468 + \frac{74240.29326}{e^{\frac{t}{3609826} - \frac{756392316}{1804913}} + 1.0} & \text{for}\: 25 = pmt \\0.0 & \text{for}\: 26 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1525132800 \\3575882.225 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 27 = pmt \\2257870.253 + \frac{361534.4057}{e^{- \frac{t}{11161454} + \frac{1491816617}{11161454}} + 1.0} & \text{for}\: 28 = pmt \\2356935.656 & \text{for}\: 29 = pmt \\4056954.778 & \text{for}\: 30 = pmt \\\begin{cases} 2249473.921 + \frac{76233.24609}{e^{\frac{t}{7488} - \frac{494334281}{2496}} + 1.0} & \text{for}\: t < 1490535931 \\1643037.866 & \text{for}\: t < 1493721839 \\1200110.914 & \text{for}\: t < 1497013200 \\548217.2803 + \frac{483717.0078}{e^{\frac{t}{3894893} - \frac{1514878911}{3894893}} + 1.0} & \text{for}\: t \geq 1497013200 \end{cases} & \text{for}\: 31 = pmt \\4145615.555 & \text{for}\: 32 = pmt \\2432879.693 & \text{for}\: 33 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1525132800 \\3187867.318 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 34 = pmt \\3194599.443 & \text{for}\: 35 = pmt \\2309283.851 & \text{for}\: 36 = pmt \\2436856.367 & \text{for}\: 37 = pmt \\3773656.828 & \text{for}\: 38 = pmt \\3307217.976 + \frac{113423.8467}{e^{\frac{t}{2100} - \frac{370776109}{525}} + 1.0} & \text{for}\: 39 = pmt \\1737906.772 + \frac{810804.4523}{e^{\frac{t}{30617944} - \frac{193125000}{3827243}} + 1.0} & \text{for}\: 40 = pmt \\3014243.369 + \frac{1002077.984}{e^{\frac{t}{20059304} - \frac{1450000001}{20059304}} + 1.0} & \text{for}\: 41 = pmt \\3731762.602 & \text{for}\: 42 = pmt \\2336041.01 & \text{for}\: 43 = pmt \\2794629.893 & \text{for}\: 44 = pmt \\2629846.598 & \text{for}\: 45 = pmt \\2258661.903 & \text{for}\: 46 = pmt \\3602584.962 & \text{for}\: 47 = pmt \\1870756.586 + \frac{460703.1388}{e^{\frac{t}{18433105} - \frac{306000000}{3686621}} + 1.0} & \text{for}\: 48 = pmt \\\begin{cases} 4355169.472 & \text{for}\: t \leq 1482418401 \\2262950.226 & \text{for}\: t > 1482418401 \end{cases} & \text{for}\: 49 = pmt \\3738675.745 & \text{for}\: 50 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1484731748 \\3720655.479 & \text{for}\: t > 1484731748 \end{cases} & \text{for}\: 51 = pmt \\2401290.798 & \text{for}\: 52 = pmt \\2139772.448 & \text{for}\: 53 = pmt \\3644871.352 & \text{for}\: 54 = pmt \\1976574.082 & \text{for}\: 55 = pmt \\4578696.252 & \text{for}\: 56 = pmt \\3446715.225 & \text{for}\: 57 = pmt \\\begin{cases} 2168250.61 & \text{for}\: t \leq 1484064477 \\1654373.185 & \text{for}\: t > 1484064477 \end{cases} & \text{for}\: 58 = pmt \\2272423.602 & \text{for}\: 59 = pmt \\2843760.336 & \text{for}\: 60 = pmt \\\begin{cases} 2041636.826 + \frac{148647.9514}{e^{\frac{t}{89166} - \frac{741451364}{44583}} + 1.0} & \text{for}\: t < 1490325004 \\85.519023 + \frac{77198.06853}{e^{\frac{t}{11688} - \frac{1522304593}{11688}} + 1.0} + \frac{2705439.559}{e^{\frac{t}{65539536} - \frac{1495550143}{65539536}} + 1.0} & \text{for}\: t \geq 1490325004 \end{cases} & \text{for}\: 61 = pmt \\0.0 & \text{for}\: 62 = pmt \\3812202.101 & \text{for}\: 63 = pmt \\3547512.523 & \text{for}\: 64 = pmt \\0.0 & \text{for}\: 65 = pmt \\\begin{cases} 2104605.165 + \frac{84771.84938}{e^{\frac{t}{6743} - \frac{1483005457}{6743}} + 1.0} + \frac{140276.0393}{e^{\frac{t}{2539903} - \frac{1492905600}{2539903}} + 1.0} & \text{for}\: t < 1502383532 \\125203.7525 + \frac{149781.7835}{e^{\frac{t}{3782} - \frac{1530937381}{3782}} + 1.0} + \frac{106262.1077}{e^{\frac{t}{239570} - \frac{760698584}{119785}} + 1.0} + \frac{3536840.952}{e^{\frac{t}{84983692} - \frac{1495640921}{84983692}} + 1.0} & \text{for}\: t \geq 1502383532 \end{cases} & \text{for}\: 66 = pmt \\1874444.371 + \frac{34555.50422}{e^{\frac{t}{1000} - \frac{296605989}{200}} + 1.0} + \frac{575399.8546}{e^{\frac{t}{23486773} - \frac{1530000000}{23486773}} + 1.0} & \text{for}\: 67 = pmt \\4814261.431 & \text{for}\: 68 = pmt \\3030420.839 + \frac{89338.6615}{e^{\frac{t}{2899} - \frac{1483065484}{2899}} + 1.0} & \text{for}\: 69 = pmt \\3761517.64 & \text{for}\: 70 = pmt \\\begin{cases} 1984868.52 + \frac{89326.86877}{e^{\frac{t}{70491} - \frac{1490186525}{70491}} + 1.0} + \frac{87016.06829}{e^{\frac{t}{77172} - \frac{370739639}{19293}} + 1.0} + \frac{101240.5338}{e^{\frac{t}{147315} - \frac{1167606}{115}} + 1.0} & \text{for}\: t < 1502383532 \\367392.4749 + \frac{218402.9346}{e^{\frac{t}{11783} - \frac{1530893094}{11783}} + 1.0} + \frac{216512.8804}{e^{\frac{t}{96415} - \frac{1521852784}{96415}} + 1.0} + \frac{2668850.715}{e^{\frac{t}{26604898} - \frac{748093437}{13302449}} + 1.0} & \text{for}\: t \geq 1502383532 \end{cases} & \text{for}\: 71 = pmt \\2133684.74 + \frac{119387.7266}{e^{\frac{t}{5124177} - \frac{165552000}{569353}} + 1.0} & \text{for}\: 72 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1525132800 \\2014523.739 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 73 = pmt \\4791546.883 & \text{for}\: 74 = pmt \\4652413.815 & \text{for}\: 75 = pmt \\2918239.34 & \text{for}\: 76 = pmt \\3340955.745 & \text{for}\: 77 = pmt \\1360050.787 + \frac{92819.16053}{e^{\frac{t}{4506} - \frac{741502657}{2253}} + 1.0} + \frac{106805.4133}{e^{\frac{t}{539552} - \frac{1520637397}{539552}} + 1.0} + \frac{463614.0624}{e^{\frac{t}{14081201} - \frac{1505901173}{14081201}} + 1.0} & \text{for}\: 78 = pmt \\0.0 & \text{for}\: 79 = pmt \\3371657.835 & \text{for}\: 80 = pmt \\4186750.529 & \text{for}\: 81 = pmt \\4431289.794 & \text{for}\: 82 = pmt \\2098635.285 & \text{for}\: 83 = pmt \\2544099.012 & \text{for}\: 84 = pmt \\1253660.771 + \frac{99865.35807}{e^{\frac{t}{71943} - \frac{1482897574}{71943}} + 1.0} + \frac{353802.4221}{e^{\frac{t}{4453667} - \frac{1496099888}{4453667}} + 1.0} + \frac{547761.0984}{e^{\frac{t}{4762424} - \frac{760314843}{2381212}} + 1.0} & \text{for}\: 85 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1525132800 \\2210868.099 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 86 = pmt \\\begin{cases} 2472595.99 & \text{for}\: t \leq 1502323200 \\409968.6725 + \frac{2012985.678}{e^{\frac{t}{1420212} - \frac{759728005}{710106}} + 1.0} & \text{for}\: t \leq 1525168124 \\0 & \text{for}\: t > 1525168124 \end{cases} & \text{for}\: 87 = pmt \\0.0 & \text{for}\: 88 = pmt \\2630956.612 & \text{for}\: 89 = pmt \\2311313.473 & \text{for}\: 90 = pmt \\0.0 & \text{for}\: 91 = pmt \\3485772.453 & \text{for}\: 92 = pmt \\1395226.088 + \frac{944915.4136}{e^{\frac{t}{31718246} - \frac{793841682}{15859123}} + 1.0} & \text{for}\: 93 = pmt \\2941925.972 & \text{for}\: 94 = pmt \\4220655.865 & \text{for}\: 95 = pmt \\4240658.656 + \frac{455856.5799}{e^{\frac{t}{19608134} - \frac{740000000}{9804067}} + 1.0} & \text{for}\: 96 = pmt \\2968317.033 & \text{for}\: 97 = pmt \\2105334.885 & \text{for}\: 98 = pmt \\2244610.005 & \text{for}\: 99 = pmt \\2251091.306 & \text{for}\: 100 = pmt \\3089195.242 & \text{for}\: 101 = pmt \\0.0 & \text{for}\: 102 = pmt \\2403046.29 & \text{for}\: 103 = pmt \\3407642.678 & \text{for}\: 104 = pmt \\3742641.473 & \text{for}\: 105 = pmt \\\begin{cases} 3859086.519 & \text{for}\: t \leq 1504773960 \\3479677.835 & \text{for}\: t > 1504773960 \end{cases} & \text{for}\: 106 = pmt \\2301116.873 & \text{for}\: 107 = pmt \\4799718.446 & \text{for}\: 108 = pmt \\2257621.217 & \text{for}\: 109 = pmt \\2392671.93 & \text{for}\: 110 = pmt \\2052237.358 + \frac{211762.6317}{e^{\frac{t}{4693996} - \frac{1518090261}{4693996}} + 1.0} + \frac{233101.8712}{e^{\frac{t}{10000000} - \frac{2967}{20}} + 1.0} & \text{for}\: 111 = pmt \\2231500.108 & \text{for}\: 112 = pmt \\2837813.272 & \text{for}\: 113 = pmt \\2921642.98 & \text{for}\: 114 = pmt \\1776538.307 & \text{for}\: 115 = pmt \\3662058.047 & \text{for}\: 116 = pmt \\1246509.686 + \frac{959244.9637}{e^{\frac{t}{18688783} - \frac{1557614478}{18688783}} + 1.0} & \text{for}\: 117 = pmt \\0.0 & \text{for}\: 118 = pmt \\\begin{cases} 2097681.03 + \frac{74907.89833}{e^{\frac{t}{6074} - \frac{741500639}{3037}} + 1.0} + \frac{129338.6989}{e^{\frac{t}{1841541} - \frac{497937888}{613847}} + 1.0} & \text{for}\: t < 1499232274 \\1343738.198 + \frac{260559.0245}{e^{\frac{t}{8772264} - \frac{84394555}{487348}} + 1.0} & \text{for}\: t \geq 1499232274 \end{cases} & \text{for}\: 119 = pmt \\2450979.006 & \text{for}\: 120 = pmt \\4731755.778 & \text{for}\: 121 = pmt \\2283167.277 & \text{for}\: 122 = pmt \\2301250.175 & \text{for}\: 123 = pmt \\2137431.046 + \frac{344094.203}{e^{- \frac{t}{39671008} + \frac{764999967}{19835504}} + 1.0} & \text{for}\: 124 = pmt \\2226097.981 & \text{for}\: 125 = pmt \\4920224.793 & \text{for}\: 126 = pmt \\4734429.18 & \text{for}\: 127 = pmt \\2300458.769 & \text{for}\: 128 = pmt \\2686355.283 & \text{for}\: 129 = pmt \\0.0 & \text{for}\: 130 = pmt \\3348157.065 & \text{for}\: 131 = pmt \\4600822.549 & \text{for}\: 132 = pmt \\3278819.315 & \text{for}\: 133 = pmt \\0.0 & \text{for}\: 134 = pmt \vee 135 = pmt \\3863358.341 & \text{for}\: 136 = pmt \\0.0 & \text{for}\: 137 = pmt \\4416918.461 & \text{for}\: 138 = pmt \\0.0 & \text{for}\: 139 = pmt \\4767612.085 & \text{for}\: 140 = pmt \\\begin{cases} 3204981.427 & \text{for}\: t < 1502383532 \\2747905.214 + \frac{76412.58316}{e^{\frac{t}{4372} - \frac{1522035413}{4372}} + 1.0} + \frac{182349.2073}{e^{\frac{t}{382262} - \frac{765677072}{191131}} + 1.0} + \frac{450200.3998}{e^{\frac{t}{92089034} - \frac{747903164}{46044517}} + 1.0} & \text{for}\: t \geq 1502383532 \end{cases} & \text{for}\: 141 = pmt \\\begin{cases} 2037599.726 + \frac{65793.36198}{e^{\frac{t}{17332} - \frac{1483018883}{17332}} + 1.0} + \frac{163613.7533}{e^{\frac{t}{2159883} - \frac{1493813419}{2159883}} + 1.0} & \text{for}\: t < 1502383532 \\1402569.355 + \frac{144850.1061}{e^{\frac{t}{5427} - \frac{170140940}{603}} + 1.0} + \frac{192167.6127}{e^{\frac{t}{428161} - \frac{1521061510}{428161}} + 1.0} + \frac{721744.3364}{e^{\frac{t}{11294600} - \frac{7490000}{56473}} + 1.0} & \text{for}\: t \geq 1502383532 \end{cases} & \text{for}\: 142 = pmt \\3360784.193 & \text{for}\: 143 = pmt \\2654278.911 & \text{for}\: 144 = pmt \\3373660.172 & \text{for}\: 145 = pmt \\4004618.599 & \text{for}\: 146 = pmt \\4892346.136 & \text{for}\: 147 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1525132800 \\3995369.667 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 148 = pmt \\2354770.044 & \text{for}\: 149 = pmt \\0.0 & \text{for}\: 150 = pmt \\4028339.654 & \text{for}\: 151 = pmt \\0.0 & \text{for}\: 152 = pmt \\3631411.86 & \text{for}\: 153 = pmt \\2735430.911 & \text{for}\: 154 = pmt \\2353102.059 & \text{for}\: 155 = pmt \\3200178.266 & \text{for}\: 156 = pmt \\\begin{cases} 2270820.279 & \text{for}\: t < 1502383532 \\1345240.504 + \frac{92873.54987}{e^{\frac{t}{4397} - \frac{1521043256}{4397}} + 1.0} + \frac{66727.57548}{e^{\frac{t}{4445} - \frac{1531425141}{4445}} + 1.0} + \frac{862976.7744}{e^{\frac{t}{27403449} - \frac{1548248917}{27403449}} + 1.0} & \text{for}\: t \geq 1502383532 \end{cases} & \text{for}\: 157 = pmt \\4446703.885 & \text{for}\: 158 = pmt \\\begin{cases} 4114239.21 & \text{for}\: t \leq 1489337078 \\3085148.615 & \text{for}\: t > 1489337078 \end{cases} & \text{for}\: 159 = pmt \\2285591.61 & \text{for}\: 160 = pmt \\2344707.299 & \text{for}\: 161 = pmt \\0.0 & \text{for}\: 162 = pmt \\2203878.513 & \text{for}\: 163 = pmt \\2259826.429 & \text{for}\: 164 = pmt \\2570436.9 & \text{for}\: 165 = pmt \\2345924.687 & \text{for}\: 166 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1525132800 \\1636498.277 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 167 = pmt \\2257235.257 + \frac{34805.40179}{e^{\frac{t}{2921} - \frac{1483050146}{2921}} + 1.0} & \text{for}\: 168 = pmt \\4504589.162 & \text{for}\: 169 = pmt \\4776809.848 & \text{for}\: 170 = pmt \\3289174.689 & \text{for}\: 171 = pmt \\3997409.092 & \text{for}\: 172 = pmt \\2330777.639 & \text{for}\: 173 = pmt \\2206350.929 + \frac{29981.63605}{e^{\frac{t}{3904} - \frac{92688337}{244}} + 1.0} & \text{for}\: 174 = pmt \\4289612.039 + \frac{69696.93442}{e^{\frac{t}{7749} - \frac{494337223}{2583}} + 1.0} & \text{for}\: 175 = pmt \\2751969.25 & \text{for}\: 176 = pmt \\2925574.82 & \text{for}\: 177 = pmt \\0.0 & \text{for}\: 178 = pmt \\2331405.89 & \text{for}\: 179 = pmt \\4786799.474 & \text{for}\: 180 = pmt \\4791040.533 & \text{for}\: 181 = pmt \\3256479.601 & \text{for}\: 182 = pmt \\0.0 & \text{for}\: 183 = pmt \\2230084.596 & \text{for}\: 184 = pmt \\4228180.348 & \text{for}\: 185 = pmt \\3983937.85 & \text{for}\: 186 = pmt \\4066102.367 & \text{for}\: 187 = pmt \\2253493.386 & \text{for}\: 188 = pmt \\2249075.814 & \text{for}\: 189 = pmt \\\begin{cases} 4770523.746 & \text{for}\: t \leq 1484731748 \\0 & \text{for}\: t \leq 1525132800 \\4539537.353 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 190 = pmt \\2672274.462 & \text{for}\: 191 = pmt \\3527164.467 & \text{for}\: 192 = pmt \\4599985.851 + \frac{61042.21105}{e^{\frac{t}{1004} - \frac{370760836}{251}} + 1.0} & \text{for}\: 193 = pmt \\3360105.439 & \text{for}\: 194 = pmt \\2253339.027 & \text{for}\: 195 = pmt \\2241082.721 & \text{for}\: 196 = pmt \\2224387.69 & \text{for}\: 197 = pmt \\0.0 & \text{for}\: 198 = pmt \\3263106.192 & \text{for}\: 199 = pmt \\2136224.656 & \text{for}\: 200 = pmt \\2950000.0 + \frac{138563.3096}{e^{\frac{t}{78757} - \frac{1482919016}{78757}} + 1.0} + \frac{153984.8853}{e^{\frac{t}{2135928} - \frac{186362500}{266991}} + 1.0} + \frac{267541.3263}{e^{\frac{t}{4320454} - \frac{759000000}{2160227}} + 1.0} & \text{for}\: 201 = pmt \\2165282.33 & \text{for}\: 202 = pmt \\0.0 & \text{for}\: 203 = pmt \\3894267.276 & \text{for}\: 204 = pmt \\\begin{cases} 1910643.005 & \text{for}\: t \leq 1490173263 \\1460080.954 & \text{for}\: t > 1490173263 \end{cases} & \text{for}\: 205 = pmt \\0.0 & \text{for}\: 206 = pmt \\3794553.86 & \text{for}\: 207 = pmt \\2433956.212 & \text{for}\: 208 = pmt \\1970121.067 + \frac{84837.82143}{e^{\frac{t}{1000000} - \frac{7419}{5}} + 1.0} & \text{for}\: 209 = pmt \\3343854.018 & \text{for}\: 210 = pmt \\3851690.466 & \text{for}\: 211 = pmt \\4242064.36 & \text{for}\: 212 = pmt \\0.0 & \text{for}\: 213 = pmt \vee 214 = pmt \\4834082.954 & \text{for}\: 215 = pmt \\4104687.299 & \text{for}\: 216 = pmt \\\begin{cases} 1802625.906 + \frac{121957.7087}{e^{\frac{t}{59649} - \frac{494293961}{19883}} + 1.0} + \frac{170985.2674}{e^{\frac{t}{2230938} - \frac{248638267}{371823}} + 1.0} & \text{for}\: t < 1502383532 \\6904.355259 + \frac{61269.84432}{e^{\frac{t}{1379} - \frac{1520771851}{1379}} + 1.0} + \frac{48463.24148}{e^{\frac{t}{7193} - \frac{1530939693}{7193}} + 1.0} + \frac{3400435.076}{e^{\frac{t}{96575292} - \frac{135996809}{8779572}} + 1.0} & \text{for}\: t \geq 1502383532 \end{cases} & \text{for}\: 217 = pmt \\4686745.044 & \text{for}\: 218 = pmt \\4661072.668 & \text{for}\: 219 = pmt \\2357301.334 & \text{for}\: 220 = pmt \\4781829.72 & \text{for}\: 221 = pmt \\3403911.445 & \text{for}\: 222 = pmt \\4762211.752 & \text{for}\: 223 = pmt \\3170752.993 & \text{for}\: 224 = pmt \\2374928.733 & \text{for}\: 225 = pmt \\4585408.392 & \text{for}\: 226 = pmt \\2758007.461 & \text{for}\: 227 = pmt \\2646862.902 & \text{for}\: 228 = pmt \\4639094.617 & \text{for}\: 229 = pmt \\2226133.115 & \text{for}\: 230 = pmt \\3744656.373 & \text{for}\: 231 = pmt \\2297378.692 & \text{for}\: 232 = pmt \\2540338.164 & \text{for}\: 233 = pmt \\0.0 & \text{for}\: 234 = pmt \\4681585.178 & \text{for}\: 235 = pmt \\2288534.93 & \text{for}\: 236 = pmt \\2268280.583 & \text{for}\: 237 = pmt \\4692863.886 & \text{for}\: 238 = pmt \\0.0 & \text{for}\: 239 = pmt \\2335985.492 & \text{for}\: 240 = pmt \\4223874.777 & \text{for}\: 241 = pmt \\4566435.895 & \text{for}\: 242 = pmt \\4286326.901 & \text{for}\: 243 = pmt \\0.0 & \text{for}\: 244 = pmt \\3995778.55 & \text{for}\: 245 = pmt \\3461287.708 & \text{for}\: 246 = pmt \\4526276.55 & \text{for}\: 247 = pmt \\80000.0 & \text{for}\: 254 = pmt \\100000.0 & \text{for}\: 255 = pmt \vee 256 = pmt \vee 257 = pmt \vee 258 = pmt \vee 259 = pmt \\2500000.0 & \text{otherwise} \end{cases}$$

In [4]:
import pymongo

# Establish connection
password = 'PLEASE_PUT_CORRECT_PASSWORD'  
c = pymongo.MongoClient("mongodb://shingo:%s@xenon1t-daq.lngs.infn.it:27017/run" % password)

# Connect to run database
db = c['run']

# Grab the collection storing gain models
collection = db['gains']

print("There are", collection.count(), "gain models currently available.")


There are 14 gain models currently available.

In [5]:
def print_gain_models(collection):
    """Display high level information about each model."""
    
    for doc in collection.find(sort=(('calculation_time', -1),)):
        print('_id', doc['_id'])
        print('\tModel calculated at:', doc['calculation_time'])
        #print('\tVersion:', doc['version'])
        print('\tComment:', doc['comment'])

In [6]:
print_gain_models(collection)


_id 5992eef760f9e91316cf9132
	Model calculated at: 2017-08-15 12:54:14.355000
	Comment: version 3.1 is updated using latest LED calibration data (data until August 7th)
_id 595c7cc737dcca05429298f9
	Model calculated at: 2017-07-05 05:44:37.734000
	Comment: version 3 is modified to take into account the HV change for PMT 119
_id 5959f43537dcca26ba1bd61f
	Model calculated at: 2017-07-03 07:37:21.933000
	Comment: version 2 is modified to take into account the HV change for PMT 21
_id 5955a5f160f9e93814e57ec4
	Model calculated at: 2017-06-30 01:14:19.437000
	Comment: version 1 is modified to take into account the HV change for PMT 21
_id 593a9adb60f9e914e0ea144f
	Model calculated at: 2017-06-09 12:55:53.119000
	Comment: version 0 is modified to take into account the HV change for PMT 31
_id 59010bb937dcca2b722ba472
	Model calculated at: 2017-04-26 21:05:54.155000
	Comment: A gain model estimated with LED data taken from 25th Nov 2016 to 18th Apr 2017. This model is valid for both SR0 and SR1. This model is the first model for SR1. A typo for PMT 51 gain in SR0 is fixed. Version tag is added
_id 5900aea337dcca2b722ba471
	Model calculated at: 2017-04-26 14:28:50.586000
	Comment: A gain model estimated with LED data taken from 25th Nov 2016 to 18th Apr 2017. This model is valid for both SR0 and SR1. This model is the first model for SR1. A typo for PMT 51 gain in SR0 is fixed
_id 5900614a37dcca2b722ba470
	Model calculated at: 2017-04-26 08:55:35.379000
	Comment: A gain model estimated with LED data taken from 25th Nov 2016 to 18th Apr 2017. This model is valid for both SR0 and SR1. This model is the first model for SR1
_id 589e12b260f9e90a2c3de3a0
	Model calculated at: 2017-02-10 19:20:38.839000
	Comment: A gain model estimated with LED data taken from 25th Nov 2016 to 17th Jan 2017. For 5 PMTs (2, 61, 78, 85, 217) whose gains were decreased due to Rn220 calibration, mean value of gains before/during/after the calibration are calculated separately. t0 variable is removed, and gains for the acquisition monitor are implemented
_id 589c799160f9e97af40cfcc4
	Model calculated at: 2017-02-09 14:04:02.568000
	Comment: A gain model estimated with LED data taken from 25th Nov 2016 to 17th Jan 2017. For 5 PMTs (2, 61, 78, 85, 217) whose gains were decreased due to Rn220 calibration, mean value of gains before/during/after the calibration are calculated separately. t0 variable is removed.
_id 589b909f60f9e97af40cfcc3
	Model calculated at: 2017-02-08 21:38:43.597000
	Comment: A gain model estimated with LED data taken from 25th Nov 2016 to 17th Jan 2017. For 5 PMTs (2, 61, 78, 85, 217) whose gains were decreased due to Rn220 calibration, mean value of gains before/during/after the calibration are calculated separately
_id 584ef5d760f9e91be5361ffa
	Model calculated at: 2016-12-12 19:01:07.350000
	Comment: Shingo's new data based on the HV-scan results(Run 2227-2240). Gains for PMTs with low SPE acceptance (<50%) are set to 0 
_id 5812111960f9e9681b540d77
	Model calculated at: 2016-10-27 14:36:49.212000
	Comment: Gain model estimated with the HV-scan results (Run 2227-2240)
_id 578f259fce76ef2300192300
	Model calculated at: 2016-07-20 07:17:51.158000
	Comment: Powerlaw from Heidelberg test bench

In [7]:
def display_latest(collection):
    doc = collection.find_one(sort=(('calculation_time', -1),))
    print('_id', doc['_id'])
    print('\tModel calculated at:', doc['calculation_time'])
    print('\tComment:', doc['comment'])
    print('\tVersion:', doc['version'])
    return parse_expr(doc['function'])

In [8]:
display_latest(collection)


_id 5992eef760f9e91316cf9132
	Model calculated at: 2017-08-15 12:54:14.355000
	Comment: version 3.1 is updated using latest LED calibration data (data until August 7th)
	Version: 4.0
/project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/sympy-1.1.1-py3.4.egg/sympy/core/numbers.py:948: SymPyDeprecationWarning: 

Using 'prec=XX' to denote decimal precision has been deprecated since
SymPy 1.1. Use 'dps=XX' for decimal precision and 'precision=XX' for
binary precision instead. See
https://github.com/sympy/sympy/issues/12820 for more info.

  deprecated_since_version="1.1").warn()
Out[8]:
$$\begin{cases} 2432700.0 & \text{for}\: 0 = pmt \\0.0 & \text{for}\: 1 = pmt \\\begin{cases} 2059331.5 + \frac{317850.2093}{e^{\frac{t}{173535} - \frac{1482644659}{173535}} + 1.0} & \text{for}\: t < 1484731748 \\0 & \text{for}\: t \geq 1484731748 \end{cases} & \text{for}\: 2 = pmt \\\begin{cases} 2118230.955 & \text{for}\: t \geq 1479749714 \vee t \leq 1477656000 \\1185630 & \text{otherwise} \end{cases} & \text{for}\: 3 = pmt \\3913679.225 & \text{for}\: 4 = pmt \\2179060.163 & \text{for}\: 5 = pmt \\4783011.443 & \text{for}\: 6 = pmt \\2285389.845 & \text{for}\: 7 = pmt \\2304369.691 & \text{for}\: 8 = pmt \\3553740.483 & \text{for}\: 9 = pmt \\2424223.806 & \text{for}\: 10 = pmt \\2962568.505 + \frac{82990.73527}{e^{\frac{t}{761508} - \frac{41401000}{21153}} + 1.0} & \text{for}\: 11 = pmt \\0.0 & \text{for}\: 12 = pmt \\3088785.198 & \text{for}\: 13 = pmt \\2156613.547 & \text{for}\: 14 = pmt \\2443124.348 & \text{for}\: 15 = pmt \\2681879.821 & \text{for}\: 16 = pmt \\2115355.556 & \text{for}\: 17 = pmt \\2397657.989 & \text{for}\: 18 = pmt \\2307939.772 & \text{for}\: 19 = pmt \\2397467.678 & \text{for}\: 20 = pmt \\\begin{cases} 2244990.483 & \text{for}\: t \leq 1498766880 \\1678221.071 & \text{for}\: t \leq 1498979340 \\1503646.148 & \text{for}\: t > 1498979340 \end{cases} & \text{for}\: 21 = pmt \\4320583.445 & \text{for}\: 22 = pmt \\2353569.392 & \text{for}\: 23 = pmt \\3171167.39 & \text{for}\: 24 = pmt \\2315386.654 & \text{for}\: 25 = pmt \\0.0 & \text{for}\: 26 = pmt \vee 27 = pmt \\2433458.991 & \text{for}\: 28 = pmt \\2358719.138 & \text{for}\: 29 = pmt \\4061145.328 & \text{for}\: 30 = pmt \\\begin{cases} 2249473.921 + \frac{76233.24609}{e^{\frac{t}{7488} - \frac{494334281}{2496}} + 1.0} & \text{for}\: t < 1490535931 \\1643037.866 & \text{for}\: t < 1493721839 \\1200110.914 & \text{for}\: t < 1497013200 \\1021081.003 & \text{for}\: t \geq 1497013200 \end{cases} & \text{for}\: 31 = pmt \\4145096.968 & \text{for}\: 32 = pmt \\2436739.412 & \text{for}\: 33 = pmt \\0.0 & \text{for}\: 34 = pmt \\3187287.617 & \text{for}\: 35 = pmt \\2319201.628 & \text{for}\: 36 = pmt \\2443450.604 & \text{for}\: 37 = pmt \\3784919.344 & \text{for}\: 38 = pmt \\3313370.084 + \frac{107630.6269}{e^{\frac{t}{2112} - \frac{1483009393}{2112}} + 1.0} & \text{for}\: 39 = pmt \\2404329.832 + \frac{94183.74569}{e^{\frac{t}{26779} - \frac{1483018963}{26779}} + 1.0} & \text{for}\: 40 = pmt \\3125667.601 & \text{for}\: 41 = pmt \\3727044.81 & \text{for}\: 42 = pmt \\2339796.18 & \text{for}\: 43 = pmt \\2794000.096 & \text{for}\: 44 = pmt \\2631032.165 & \text{for}\: 45 = pmt \\2259287.624 & \text{for}\: 46 = pmt \\3602532.858 & \text{for}\: 47 = pmt \\2268778.18 + \frac{60868.80901}{e^{\frac{t}{34147} - \frac{1483127328}{34147}} + 1.0} & \text{for}\: 48 = pmt \\\begin{cases} 4355169.472 & \text{for}\: t \leq 1482418401 \\2273325.758 & \text{for}\: t > 1482418401 \end{cases} & \text{for}\: 49 = pmt \\3753031.014 & \text{for}\: 50 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1484731748 \\3726368.859 & \text{for}\: t > 1484731748 \end{cases} & \text{for}\: 51 = pmt \\2408889.99 & \text{for}\: 52 = pmt \\2141638.667 & \text{for}\: 53 = pmt \\3644141.598 & \text{for}\: 54 = pmt \\1974087.343 & \text{for}\: 55 = pmt \\4578695.963 & \text{for}\: 56 = pmt \\3446182.628 & \text{for}\: 57 = pmt \\\begin{cases} 2168250.61 & \text{for}\: t \leq 1484064477 \\1654483.767 & \text{for}\: t > 1484064477 \end{cases} & \text{for}\: 58 = pmt \\2275539.052 & \text{for}\: 59 = pmt \\2845516.165 & \text{for}\: 60 = pmt \\\begin{cases} 2041636.916 + \frac{148648.0689}{e^{\frac{t}{89155} - \frac{1482902732}{89155}} + 1.0} & \text{for}\: t < 1490325004 \\1371400.061 + \frac{118453.319}{e^{\frac{t}{2290746} - \frac{1495470611}{2290746}} + 1.0} & \text{for}\: t \geq 1490325004 \end{cases} & \text{for}\: 61 = pmt \\0.0 & \text{for}\: 62 = pmt \\3817850.832 & \text{for}\: 63 = pmt \\3553878.858 & \text{for}\: 64 = pmt \\0.0 & \text{for}\: 65 = pmt \\2104605.165 + \frac{84771.84938}{e^{\frac{t}{6743} - \frac{1483005457}{6743}} + 1.0} + \frac{140276.0393}{e^{\frac{t}{2539903} - \frac{1492905600}{2539903}} + 1.0} & \text{for}\: 66 = pmt \\2358730.251 & \text{for}\: 67 = pmt \\4822736.96 & \text{for}\: 68 = pmt \\3032499.085 + \frac{87261.90934}{e^{\frac{t}{1064} - \frac{1483074049}{1064}} + 1.0} & \text{for}\: 69 = pmt \\3767360.131 & \text{for}\: 70 = pmt \\1984868.52 + \frac{89326.86877}{e^{\frac{t}{70491} - \frac{1490186525}{70491}} + 1.0} + \frac{87016.06829}{e^{\frac{t}{77172} - \frac{370739639}{19293}} + 1.0} + \frac{101240.5338}{e^{\frac{t}{147315} - \frac{1167606}{115}} + 1.0} & \text{for}\: 71 = pmt \\2150756.216 + \frac{83657.72612}{e^{\frac{t}{2381073} - \frac{496656000}{793691}} + 1.0} & \text{for}\: 72 = pmt \\0.0 & \text{for}\: 73 = pmt \\4802930.631 & \text{for}\: 74 = pmt \\4651988.118 & \text{for}\: 75 = pmt \\2921450.436 & \text{for}\: 76 = pmt \\3349141.367 & \text{for}\: 77 = pmt \\1749554.381 + \frac{110267.9558}{e^{\frac{t}{59184} - \frac{1483019927}{59184}} + 1.0} + \frac{95203.36136}{e^{\frac{t}{1858988} - \frac{373226400}{464747}} + 1.0} & \text{for}\: 78 = pmt \\0.0 & \text{for}\: 79 = pmt \\3376351.832 & \text{for}\: 80 = pmt \\4189051.24 & \text{for}\: 81 = pmt \\4433400.712 & \text{for}\: 82 = pmt \\2098564.488 & \text{for}\: 83 = pmt \\2547402.221 & \text{for}\: 84 = pmt \\1888822.681 + \frac{113594.5885}{e^{\frac{t}{82880} - \frac{74145577}{4144}} + 1.0} + \frac{241598.6967}{e^{\frac{t}{2588159} - \frac{1494194911}{2588159}} + 1.0} & \text{for}\: 85 = pmt \\0.0 & \text{for}\: 86 = pmt \\2472595.99 & \text{for}\: 87 = pmt \\0.0 & \text{for}\: 88 = pmt \\2631022.437 & \text{for}\: 89 = pmt \\2318192.84 & \text{for}\: 90 = pmt \\0.0 & \text{for}\: 91 = pmt \\3485209.48 & \text{for}\: 92 = pmt \\2291383.536 & \text{for}\: 93 = pmt \\2943499.67 & \text{for}\: 94 = pmt \\4228517.12 & \text{for}\: 95 = pmt \\4396198.087 & \text{for}\: 96 = pmt \\2972169.678 & \text{for}\: 97 = pmt \\2106049.791 & \text{for}\: 98 = pmt \\2250216.709 & \text{for}\: 99 = pmt \\2251522.503 & \text{for}\: 100 = pmt \\3088910.664 & \text{for}\: 101 = pmt \\0.0 & \text{for}\: 102 = pmt \\2407942.768 & \text{for}\: 103 = pmt \\3413813.425 & \text{for}\: 104 = pmt \\3750955.176 & \text{for}\: 105 = pmt \\3846970.057 + \frac{109204.2411}{e^{\frac{t}{41403} - \frac{494344528}{13801}} + 1.0} & \text{for}\: 106 = pmt \\2305215.965 & \text{for}\: 107 = pmt \\4803797.284 & \text{for}\: 108 = pmt \\2262734.911 & \text{for}\: 109 = pmt \\2393566.927 & \text{for}\: 110 = pmt \\2337492.5 & \text{for}\: 111 = pmt \\2229830.51 & \text{for}\: 112 = pmt \\2843725.62 & \text{for}\: 113 = pmt \\2922553.754 & \text{for}\: 114 = pmt \\1778200.479 & \text{for}\: 115 = pmt \\3663065.144 & \text{for}\: 116 = pmt \\2174280.495 & \text{for}\: 117 = pmt \\0.0 & \text{for}\: 118 = pmt \\\begin{cases} 2097682.762 + \frac{74908.41173}{e^{\frac{t}{7523} - \frac{1483000905}{7523}} + 1.0} + \frac{129335.715}{e^{\frac{t}{1841368} - \frac{186726708}{230171}} + 1.0} & \text{for}\: t < 1499232274 \\1581556.175 & \text{for}\: t \geq 1499232274 \end{cases} & \text{for}\: 119 = pmt \\2447642.749 & \text{for}\: 120 = pmt \\4738854.515 & \text{for}\: 121 = pmt \\2287168.008 & \text{for}\: 122 = pmt \\2300981.455 & \text{for}\: 123 = pmt \\2229850.272 & \text{for}\: 124 = pmt \\2228500.436 & \text{for}\: 125 = pmt \\4911399.237 & \text{for}\: 126 = pmt \\4745375.938 & \text{for}\: 127 = pmt \\2304544.976 & \text{for}\: 128 = pmt \\2687277.081 & \text{for}\: 129 = pmt \\0.0 & \text{for}\: 130 = pmt \\3358897.561 & \text{for}\: 131 = pmt \\4604375.954 & \text{for}\: 132 = pmt \\3281145.668 & \text{for}\: 133 = pmt \\0.0 & \text{for}\: 134 = pmt \vee 135 = pmt \\3867213.379 & \text{for}\: 136 = pmt \\0.0 & \text{for}\: 137 = pmt \\4424894.958 & \text{for}\: 138 = pmt \\0.0 & \text{for}\: 139 = pmt \\4763962.469 & \text{for}\: 140 = pmt \\3204981.427 & \text{for}\: 141 = pmt \\2037599.726 + \frac{65793.36198}{e^{\frac{t}{17332} - \frac{1483018883}{17332}} + 1.0} + \frac{163613.7533}{e^{\frac{t}{2159883} - \frac{1493813419}{2159883}} + 1.0} & \text{for}\: 142 = pmt \\3361400.705 & \text{for}\: 143 = pmt \\2657899.498 & \text{for}\: 144 = pmt \\3382850.841 & \text{for}\: 145 = pmt \\4004996.756 & \text{for}\: 146 = pmt \\4895845.36 & \text{for}\: 147 = pmt \\0.0 & \text{for}\: 148 = pmt \\2355569.047 & \text{for}\: 149 = pmt \\0.0 & \text{for}\: 150 = pmt \\4035769.634 & \text{for}\: 151 = pmt \\0.0 & \text{for}\: 152 = pmt \\3631995.38 & \text{for}\: 153 = pmt \\2737401.439 & \text{for}\: 154 = pmt \\2353328.768 & \text{for}\: 155 = pmt \\3208296.821 & \text{for}\: 156 = pmt \\2270820.279 & \text{for}\: 157 = pmt \\4458172.205 & \text{for}\: 158 = pmt \\\begin{cases} 4114239.21 & \text{for}\: t \leq 1489337078 \\3091663.159 & \text{for}\: t > 1489337078 \end{cases} & \text{for}\: 159 = pmt \\2286101.245 & \text{for}\: 160 = pmt \\2343698.314 & \text{for}\: 161 = pmt \\0.0 & \text{for}\: 162 = pmt \\2208745.515 & \text{for}\: 163 = pmt \\2265005.528 & \text{for}\: 164 = pmt \\2574094.705 & \text{for}\: 165 = pmt \\2351592.162 & \text{for}\: 166 = pmt \\0.0 & \text{for}\: 167 = pmt \\2258103.036 + \frac{33937.25247}{e^{\frac{t}{1275} - \frac{98871888}{85}} + 1.0} & \text{for}\: 168 = pmt \\4515907.936 & \text{for}\: 169 = pmt \\4787913.409 & \text{for}\: 170 = pmt \\3290881.602 & \text{for}\: 171 = pmt \\3998070.015 & \text{for}\: 172 = pmt \\2328998.511 & \text{for}\: 173 = pmt \\2210546.737 + \frac{25778.02735}{e^{\frac{t}{1141} - \frac{211863483}{163}} + 1.0} & \text{for}\: 174 = pmt \\4289614.181 + \frac{67290.12722}{e^{\frac{t}{1011} - \frac{1483095154}{1011}} + 1.0} & \text{for}\: 175 = pmt \\2750604.823 & \text{for}\: 176 = pmt \\2925434.209 & \text{for}\: 177 = pmt \\0.0 & \text{for}\: 178 = pmt \\2335768.408 & \text{for}\: 179 = pmt \\4788268.384 & \text{for}\: 180 = pmt \\4802241.674 & \text{for}\: 181 = pmt \\3259283.074 & \text{for}\: 182 = pmt \\0.0 & \text{for}\: 183 = pmt \\2234728.192 & \text{for}\: 184 = pmt \\4236769.264 & \text{for}\: 185 = pmt \\3985946.356 & \text{for}\: 186 = pmt \\4067105.065 & \text{for}\: 187 = pmt \\2257972.322 & \text{for}\: 188 = pmt \\2257539.884 & \text{for}\: 189 = pmt \\\begin{cases} 4770523.746 & \text{for}\: t \leq 1484731748 \\0 & \text{for}\: t > 1484731748 \end{cases} & \text{for}\: 190 = pmt \\2672913.927 & \text{for}\: 191 = pmt \\3526263.275 & \text{for}\: 192 = pmt \\4599147.92 + \frac{61880.36703}{e^{\frac{t}{1050} - \frac{741545963}{525}} + 1.0} & \text{for}\: 193 = pmt \\3364867.008 & \text{for}\: 194 = pmt \\2257249.351 & \text{for}\: 195 = pmt \\2243348.289 & \text{for}\: 196 = pmt \\2227130.777 & \text{for}\: 197 = pmt \\0.0 & \text{for}\: 198 = pmt \\3266518.43 & \text{for}\: 199 = pmt \\2141982.735 & \text{for}\: 200 = pmt \\3222773.99 + \frac{143405.7765}{e^{\frac{t}{81994} - \frac{1482923571}{81994}} + 1.0} + \frac{142655.1839}{e^{\frac{t}{1740171} - \frac{87700000}{102363}} + 1.0} & \text{for}\: 201 = pmt \\2168047.15 & \text{for}\: 202 = pmt \\0.0 & \text{for}\: 203 = pmt \\3888655.953 & \text{for}\: 204 = pmt \\\begin{cases} 1910643.005 & \text{for}\: t \leq 1490173263 \\1450886.073 & \text{for}\: t > 1490173263 \end{cases} & \text{for}\: 205 = pmt \\0.0 & \text{for}\: 206 = pmt \\3797610.913 & \text{for}\: 207 = pmt \\2431951.079 & \text{for}\: 208 = pmt \\1986429.895 + \frac{60732.0028}{e^{\frac{t}{33808} - \frac{1483038709}{33808}} + 1.0} & \text{for}\: 209 = pmt \\3348428.347 & \text{for}\: 210 = pmt \\3856516.392 & \text{for}\: 211 = pmt \\4249209.327 & \text{for}\: 212 = pmt \\0.0 & \text{for}\: 213 = pmt \vee 214 = pmt \\4839853.209 & \text{for}\: 215 = pmt \\4105876.125 & \text{for}\: 216 = pmt \\1802625.906 + \frac{121957.7087}{e^{\frac{t}{59649} - \frac{494293961}{19883}} + 1.0} + \frac{170985.2674}{e^{\frac{t}{2230938} - \frac{248638267}{371823}} + 1.0} & \text{for}\: 217 = pmt \\4704599.207 & \text{for}\: 218 = pmt \\4671564.548 & \text{for}\: 219 = pmt \\2354243.616 & \text{for}\: 220 = pmt \\4781690.681 & \text{for}\: 221 = pmt \\3406115.524 & \text{for}\: 222 = pmt \\4761844.489 & \text{for}\: 223 = pmt \\3176912.243 & \text{for}\: 224 = pmt \\2387929.042 & \text{for}\: 225 = pmt \\4593492.498 & \text{for}\: 226 = pmt \\2761105.156 & \text{for}\: 227 = pmt \\2648806.224 & \text{for}\: 228 = pmt \\4638143.826 & \text{for}\: 229 = pmt \\2229885.926 & \text{for}\: 230 = pmt \\3741967.015 & \text{for}\: 231 = pmt \\2299486.113 & \text{for}\: 232 = pmt \\2544000.222 & \text{for}\: 233 = pmt \\0.0 & \text{for}\: 234 = pmt \\4678772.758 & \text{for}\: 235 = pmt \\2289942.618 & \text{for}\: 236 = pmt \\2270578.318 & \text{for}\: 237 = pmt \\4709968.838 & \text{for}\: 238 = pmt \\0.0 & \text{for}\: 239 = pmt \\2334480.27 & \text{for}\: 240 = pmt \\4225956.644 & \text{for}\: 241 = pmt \\4580827.132 & \text{for}\: 242 = pmt \\4314836.227 & \text{for}\: 243 = pmt \\0.0 & \text{for}\: 244 = pmt \\3999214.909 & \text{for}\: 245 = pmt \\3457237.058 & \text{for}\: 246 = pmt \\4543867.393 & \text{for}\: 247 = pmt \\80000.0 & \text{for}\: 254 = pmt \\100000.0 & \text{for}\: 255 = pmt \vee 256 = pmt \vee 257 = pmt \vee 258 = pmt \vee 259 = pmt \\2500000.0 & \text{otherwise} \end{cases}$$

In [9]:
import datetime

new_model_document = {
  "comment": "New gain model after SR1 updated using all the data until 180723",
  "calculation_time": datetime.datetime.utcnow(),
  "version": "5.0",
  "function": new_model_string
}

In [10]:
collection.insert(new_model_document)


/project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/ipykernel/__main__.py:1: DeprecationWarning: insert is deprecated. Use insert_one or insert_many instead.
  if __name__ == '__main__':
Out[10]:
ObjectId('5b5fb8be37dcca4e7e059f41')

In [11]:
print_gain_models(collection)


_id 5b5fb8be37dcca4e7e059f41
	Model calculated at: 2018-07-31 01:13:02.902000
	Comment: New gain model after SR1 updated using all the data until 180723
_id 5992eef760f9e91316cf9132
	Model calculated at: 2017-08-15 12:54:14.355000
	Comment: version 3.1 is updated using latest LED calibration data (data until August 7th)
_id 595c7cc737dcca05429298f9
	Model calculated at: 2017-07-05 05:44:37.734000
	Comment: version 3 is modified to take into account the HV change for PMT 119
_id 5959f43537dcca26ba1bd61f
	Model calculated at: 2017-07-03 07:37:21.933000
	Comment: version 2 is modified to take into account the HV change for PMT 21
_id 5955a5f160f9e93814e57ec4
	Model calculated at: 2017-06-30 01:14:19.437000
	Comment: version 1 is modified to take into account the HV change for PMT 21
_id 593a9adb60f9e914e0ea144f
	Model calculated at: 2017-06-09 12:55:53.119000
	Comment: version 0 is modified to take into account the HV change for PMT 31
_id 59010bb937dcca2b722ba472
	Model calculated at: 2017-04-26 21:05:54.155000
	Comment: A gain model estimated with LED data taken from 25th Nov 2016 to 18th Apr 2017. This model is valid for both SR0 and SR1. This model is the first model for SR1. A typo for PMT 51 gain in SR0 is fixed. Version tag is added
_id 5900aea337dcca2b722ba471
	Model calculated at: 2017-04-26 14:28:50.586000
	Comment: A gain model estimated with LED data taken from 25th Nov 2016 to 18th Apr 2017. This model is valid for both SR0 and SR1. This model is the first model for SR1. A typo for PMT 51 gain in SR0 is fixed
_id 5900614a37dcca2b722ba470
	Model calculated at: 2017-04-26 08:55:35.379000
	Comment: A gain model estimated with LED data taken from 25th Nov 2016 to 18th Apr 2017. This model is valid for both SR0 and SR1. This model is the first model for SR1
_id 589e12b260f9e90a2c3de3a0
	Model calculated at: 2017-02-10 19:20:38.839000
	Comment: A gain model estimated with LED data taken from 25th Nov 2016 to 17th Jan 2017. For 5 PMTs (2, 61, 78, 85, 217) whose gains were decreased due to Rn220 calibration, mean value of gains before/during/after the calibration are calculated separately. t0 variable is removed, and gains for the acquisition monitor are implemented
_id 589c799160f9e97af40cfcc4
	Model calculated at: 2017-02-09 14:04:02.568000
	Comment: A gain model estimated with LED data taken from 25th Nov 2016 to 17th Jan 2017. For 5 PMTs (2, 61, 78, 85, 217) whose gains were decreased due to Rn220 calibration, mean value of gains before/during/after the calibration are calculated separately. t0 variable is removed.
_id 589b909f60f9e97af40cfcc3
	Model calculated at: 2017-02-08 21:38:43.597000
	Comment: A gain model estimated with LED data taken from 25th Nov 2016 to 17th Jan 2017. For 5 PMTs (2, 61, 78, 85, 217) whose gains were decreased due to Rn220 calibration, mean value of gains before/during/after the calibration are calculated separately
_id 584ef5d760f9e91be5361ffa
	Model calculated at: 2016-12-12 19:01:07.350000
	Comment: Shingo's new data based on the HV-scan results(Run 2227-2240). Gains for PMTs with low SPE acceptance (<50%) are set to 0 
_id 5812111960f9e9681b540d77
	Model calculated at: 2016-10-27 14:36:49.212000
	Comment: Gain model estimated with the HV-scan results (Run 2227-2240)
_id 578f259fce76ef2300192300
	Model calculated at: 2016-07-20 07:17:51.158000
	Comment: Powerlaw from Heidelberg test bench

In [12]:
display_latest(collection)


_id 5b5fb8be37dcca4e7e059f41
	Model calculated at: 2018-07-31 01:13:02.902000
	Comment: New gain model after SR1 updated using all the data until 180723
	Version: 5.0
/project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/sympy-1.1.1-py3.4.egg/sympy/core/numbers.py:948: SymPyDeprecationWarning: 

Using 'prec=XX' to denote decimal precision has been deprecated since
SymPy 1.1. Use 'dps=XX' for decimal precision and 'precision=XX' for
binary precision instead. See
https://github.com/sympy/sympy/issues/12820 for more info.

  deprecated_since_version="1.1").warn()
Out[12]:
$$\begin{cases} 1714027.877 + \frac{797646.2123}{e^{\frac{t}{43698725} - \frac{63600000}{1747949}} + 1.0} & \text{for}\: 0 = pmt \\0.0 & \text{for}\: 1 = pmt \\\begin{cases} 2059331.5 + \frac{317850.2093}{e^{\frac{t}{173535} - \frac{1482644659}{173535}} + 1.0} & \text{for}\: t < 1484731748 \\0 & \text{for}\: t \geq 1484731748 \end{cases} & \text{for}\: 2 = pmt \\\begin{cases} 2114948.631 & \text{for}\: t \geq 1479749714 \vee t \leq 1477656000 \\1185630 & \text{otherwise} \end{cases} & \text{for}\: 3 = pmt \\3911403.114 & \text{for}\: 4 = pmt \\2174952.395 & \text{for}\: 5 = pmt \\4787662.301 & \text{for}\: 6 = pmt \\2282290.134 & \text{for}\: 7 = pmt \\2306758.899 & \text{for}\: 8 = pmt \\3547885.388 & \text{for}\: 9 = pmt \\2424047.23 & \text{for}\: 10 = pmt \\2920853.476 + \frac{171636.7776}{e^{\frac{t}{7252570} - \frac{149043600}{725257}} + 1.0} & \text{for}\: 11 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1525132800 \\4095444.65 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 12 = pmt \\3083532.044 & \text{for}\: 13 = pmt \\2153954.677 & \text{for}\: 14 = pmt \\2436135.098 & \text{for}\: 15 = pmt \\2676866.964 & \text{for}\: 16 = pmt \\2005079.645 + \frac{117373.8401}{e^{\frac{t}{5469333} - \frac{503870480}{1823111}} + 1.0} & \text{for}\: 17 = pmt \\2399631.928 & \text{for}\: 18 = pmt \\2305471.244 & \text{for}\: 19 = pmt \\2397076.584 & \text{for}\: 20 = pmt \\\begin{cases} 2244990.483 & \text{for}\: t \leq 1498766880 \\1678221.071 & \text{for}\: t \leq 1498979340 \\1131844.061 + \frac{373681.1201}{e^{\frac{t}{4698795} - \frac{102000000}{313253}} + 1.0} & \text{for}\: t > 1498979340 \end{cases} & \text{for}\: 21 = pmt \\4320653.907 & \text{for}\: 22 = pmt \\2252282.63 + \frac{112326.1374}{e^{\frac{t}{7032150} - \frac{301935223}{1406430}} + 1.0} & \text{for}\: 23 = pmt \\3169682.64 & \text{for}\: 24 = pmt \\2242440.468 + \frac{74240.29326}{e^{\frac{t}{3609826} - \frac{756392316}{1804913}} + 1.0} & \text{for}\: 25 = pmt \\0.0 & \text{for}\: 26 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1525132800 \\3575882.225 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 27 = pmt \\2257870.253 + \frac{361534.4057}{e^{- \frac{t}{11161454} + \frac{1491816617}{11161454}} + 1.0} & \text{for}\: 28 = pmt \\2356935.656 & \text{for}\: 29 = pmt \\4056954.778 & \text{for}\: 30 = pmt \\\begin{cases} 2249473.921 + \frac{76233.24609}{e^{\frac{t}{7488} - \frac{494334281}{2496}} + 1.0} & \text{for}\: t < 1490535931 \\1643037.866 & \text{for}\: t < 1493721839 \\1200110.914 & \text{for}\: t < 1497013200 \\548217.2803 + \frac{483717.0078}{e^{\frac{t}{3894893} - \frac{1514878911}{3894893}} + 1.0} & \text{for}\: t \geq 1497013200 \end{cases} & \text{for}\: 31 = pmt \\4145615.555 & \text{for}\: 32 = pmt \\2432879.693 & \text{for}\: 33 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1525132800 \\3187867.318 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 34 = pmt \\3194599.443 & \text{for}\: 35 = pmt \\2309283.851 & \text{for}\: 36 = pmt \\2436856.367 & \text{for}\: 37 = pmt \\3773656.828 & \text{for}\: 38 = pmt \\3307217.976 + \frac{113423.8467}{e^{\frac{t}{2100} - \frac{370776109}{525}} + 1.0} & \text{for}\: 39 = pmt \\1737906.772 + \frac{810804.4523}{e^{\frac{t}{30617944} - \frac{193125000}{3827243}} + 1.0} & \text{for}\: 40 = pmt \\3014243.369 + \frac{1002077.984}{e^{\frac{t}{20059304} - \frac{1450000001}{20059304}} + 1.0} & \text{for}\: 41 = pmt \\3731762.602 & \text{for}\: 42 = pmt \\2336041.01 & \text{for}\: 43 = pmt \\2794629.893 & \text{for}\: 44 = pmt \\2629846.598 & \text{for}\: 45 = pmt \\2258661.903 & \text{for}\: 46 = pmt \\3602584.962 & \text{for}\: 47 = pmt \\1870756.586 + \frac{460703.1388}{e^{\frac{t}{18433105} - \frac{306000000}{3686621}} + 1.0} & \text{for}\: 48 = pmt \\\begin{cases} 4355169.472 & \text{for}\: t \leq 1482418401 \\2262950.226 & \text{for}\: t > 1482418401 \end{cases} & \text{for}\: 49 = pmt \\3738675.745 & \text{for}\: 50 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1484731748 \\3720655.479 & \text{for}\: t > 1484731748 \end{cases} & \text{for}\: 51 = pmt \\2401290.798 & \text{for}\: 52 = pmt \\2139772.448 & \text{for}\: 53 = pmt \\3644871.352 & \text{for}\: 54 = pmt \\1976574.082 & \text{for}\: 55 = pmt \\4578696.252 & \text{for}\: 56 = pmt \\3446715.225 & \text{for}\: 57 = pmt \\\begin{cases} 2168250.61 & \text{for}\: t \leq 1484064477 \\1654373.185 & \text{for}\: t > 1484064477 \end{cases} & \text{for}\: 58 = pmt \\2272423.602 & \text{for}\: 59 = pmt \\2843760.336 & \text{for}\: 60 = pmt \\\begin{cases} 2041636.826 + \frac{148647.9514}{e^{\frac{t}{89166} - \frac{741451364}{44583}} + 1.0} & \text{for}\: t < 1490325004 \\85.519023 + \frac{77198.06853}{e^{\frac{t}{11688} - \frac{1522304593}{11688}} + 1.0} + \frac{2705439.559}{e^{\frac{t}{65539536} - \frac{1495550143}{65539536}} + 1.0} & \text{for}\: t \geq 1490325004 \end{cases} & \text{for}\: 61 = pmt \\0.0 & \text{for}\: 62 = pmt \\3812202.101 & \text{for}\: 63 = pmt \\3547512.523 & \text{for}\: 64 = pmt \\0.0 & \text{for}\: 65 = pmt \\\begin{cases} 2104605.165 + \frac{84771.84938}{e^{\frac{t}{6743} - \frac{1483005457}{6743}} + 1.0} + \frac{140276.0393}{e^{\frac{t}{2539903} - \frac{1492905600}{2539903}} + 1.0} & \text{for}\: t < 1502383532 \\125203.7525 + \frac{149781.7835}{e^{\frac{t}{3782} - \frac{1530937381}{3782}} + 1.0} + \frac{106262.1077}{e^{\frac{t}{239570} - \frac{760698584}{119785}} + 1.0} + \frac{3536840.952}{e^{\frac{t}{84983692} - \frac{1495640921}{84983692}} + 1.0} & \text{for}\: t \geq 1502383532 \end{cases} & \text{for}\: 66 = pmt \\1874444.371 + \frac{34555.50422}{e^{\frac{t}{1000} - \frac{296605989}{200}} + 1.0} + \frac{575399.8546}{e^{\frac{t}{23486773} - \frac{1530000000}{23486773}} + 1.0} & \text{for}\: 67 = pmt \\4814261.431 & \text{for}\: 68 = pmt \\3030420.839 + \frac{89338.6615}{e^{\frac{t}{2899} - \frac{1483065484}{2899}} + 1.0} & \text{for}\: 69 = pmt \\3761517.64 & \text{for}\: 70 = pmt \\\begin{cases} 1984868.52 + \frac{89326.86877}{e^{\frac{t}{70491} - \frac{1490186525}{70491}} + 1.0} + \frac{87016.06829}{e^{\frac{t}{77172} - \frac{370739639}{19293}} + 1.0} + \frac{101240.5338}{e^{\frac{t}{147315} - \frac{1167606}{115}} + 1.0} & \text{for}\: t < 1502383532 \\367392.4749 + \frac{218402.9346}{e^{\frac{t}{11783} - \frac{1530893094}{11783}} + 1.0} + \frac{216512.8804}{e^{\frac{t}{96415} - \frac{1521852784}{96415}} + 1.0} + \frac{2668850.715}{e^{\frac{t}{26604898} - \frac{748093437}{13302449}} + 1.0} & \text{for}\: t \geq 1502383532 \end{cases} & \text{for}\: 71 = pmt \\2133684.74 + \frac{119387.7266}{e^{\frac{t}{5124177} - \frac{165552000}{569353}} + 1.0} & \text{for}\: 72 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1525132800 \\2014523.739 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 73 = pmt \\4791546.883 & \text{for}\: 74 = pmt \\4652413.815 & \text{for}\: 75 = pmt \\2918239.34 & \text{for}\: 76 = pmt \\3340955.745 & \text{for}\: 77 = pmt \\1360050.787 + \frac{92819.16053}{e^{\frac{t}{4506} - \frac{741502657}{2253}} + 1.0} + \frac{106805.4133}{e^{\frac{t}{539552} - \frac{1520637397}{539552}} + 1.0} + \frac{463614.0624}{e^{\frac{t}{14081201} - \frac{1505901173}{14081201}} + 1.0} & \text{for}\: 78 = pmt \\0.0 & \text{for}\: 79 = pmt \\3371657.835 & \text{for}\: 80 = pmt \\4186750.529 & \text{for}\: 81 = pmt \\4431289.794 & \text{for}\: 82 = pmt \\2098635.285 & \text{for}\: 83 = pmt \\2544099.012 & \text{for}\: 84 = pmt \\1253660.771 + \frac{99865.35807}{e^{\frac{t}{71943} - \frac{1482897574}{71943}} + 1.0} + \frac{353802.4221}{e^{\frac{t}{4453667} - \frac{1496099888}{4453667}} + 1.0} + \frac{547761.0984}{e^{\frac{t}{4762424} - \frac{760314843}{2381212}} + 1.0} & \text{for}\: 85 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1525132800 \\2210868.099 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 86 = pmt \\\begin{cases} 2472595.99 & \text{for}\: t \leq 1502323200 \\409968.6725 + \frac{2012985.678}{e^{\frac{t}{1420212} - \frac{759728005}{710106}} + 1.0} & \text{for}\: t \leq 1525168124 \\0 & \text{for}\: t > 1525168124 \end{cases} & \text{for}\: 87 = pmt \\0.0 & \text{for}\: 88 = pmt \\2630956.612 & \text{for}\: 89 = pmt \\2311313.473 & \text{for}\: 90 = pmt \\0.0 & \text{for}\: 91 = pmt \\3485772.453 & \text{for}\: 92 = pmt \\1395226.088 + \frac{944915.4136}{e^{\frac{t}{31718246} - \frac{793841682}{15859123}} + 1.0} & \text{for}\: 93 = pmt \\2941925.972 & \text{for}\: 94 = pmt \\4220655.865 & \text{for}\: 95 = pmt \\4240658.656 + \frac{455856.5799}{e^{\frac{t}{19608134} - \frac{740000000}{9804067}} + 1.0} & \text{for}\: 96 = pmt \\2968317.033 & \text{for}\: 97 = pmt \\2105334.885 & \text{for}\: 98 = pmt \\2244610.005 & \text{for}\: 99 = pmt \\2251091.306 & \text{for}\: 100 = pmt \\3089195.242 & \text{for}\: 101 = pmt \\0.0 & \text{for}\: 102 = pmt \\2403046.29 & \text{for}\: 103 = pmt \\3407642.678 & \text{for}\: 104 = pmt \\3742641.473 & \text{for}\: 105 = pmt \\\begin{cases} 3859086.519 & \text{for}\: t \leq 1504773960 \\3479677.835 & \text{for}\: t > 1504773960 \end{cases} & \text{for}\: 106 = pmt \\2301116.873 & \text{for}\: 107 = pmt \\4799718.446 & \text{for}\: 108 = pmt \\2257621.217 & \text{for}\: 109 = pmt \\2392671.93 & \text{for}\: 110 = pmt \\2052237.358 + \frac{211762.6317}{e^{\frac{t}{4693996} - \frac{1518090261}{4693996}} + 1.0} + \frac{233101.8712}{e^{\frac{t}{10000000} - \frac{2967}{20}} + 1.0} & \text{for}\: 111 = pmt \\2231500.108 & \text{for}\: 112 = pmt \\2837813.272 & \text{for}\: 113 = pmt \\2921642.98 & \text{for}\: 114 = pmt \\1776538.307 & \text{for}\: 115 = pmt \\3662058.047 & \text{for}\: 116 = pmt \\1246509.686 + \frac{959244.9637}{e^{\frac{t}{18688783} - \frac{1557614478}{18688783}} + 1.0} & \text{for}\: 117 = pmt \\0.0 & \text{for}\: 118 = pmt \\\begin{cases} 2097681.03 + \frac{74907.89833}{e^{\frac{t}{6074} - \frac{741500639}{3037}} + 1.0} + \frac{129338.6989}{e^{\frac{t}{1841541} - \frac{497937888}{613847}} + 1.0} & \text{for}\: t < 1499232274 \\1343738.198 + \frac{260559.0245}{e^{\frac{t}{8772264} - \frac{84394555}{487348}} + 1.0} & \text{for}\: t \geq 1499232274 \end{cases} & \text{for}\: 119 = pmt \\2450979.006 & \text{for}\: 120 = pmt \\4731755.778 & \text{for}\: 121 = pmt \\2283167.277 & \text{for}\: 122 = pmt \\2301250.175 & \text{for}\: 123 = pmt \\2137431.046 + \frac{344094.203}{e^{- \frac{t}{39671008} + \frac{764999967}{19835504}} + 1.0} & \text{for}\: 124 = pmt \\2226097.981 & \text{for}\: 125 = pmt \\4920224.793 & \text{for}\: 126 = pmt \\4734429.18 & \text{for}\: 127 = pmt \\2300458.769 & \text{for}\: 128 = pmt \\2686355.283 & \text{for}\: 129 = pmt \\0.0 & \text{for}\: 130 = pmt \\3348157.065 & \text{for}\: 131 = pmt \\4600822.549 & \text{for}\: 132 = pmt \\3278819.315 & \text{for}\: 133 = pmt \\0.0 & \text{for}\: 134 = pmt \vee 135 = pmt \\3863358.341 & \text{for}\: 136 = pmt \\0.0 & \text{for}\: 137 = pmt \\4416918.461 & \text{for}\: 138 = pmt \\0.0 & \text{for}\: 139 = pmt \\4767612.085 & \text{for}\: 140 = pmt \\\begin{cases} 3204981.427 & \text{for}\: t < 1502383532 \\2747905.214 + \frac{76412.58316}{e^{\frac{t}{4372} - \frac{1522035413}{4372}} + 1.0} + \frac{182349.2073}{e^{\frac{t}{382262} - \frac{765677072}{191131}} + 1.0} + \frac{450200.3998}{e^{\frac{t}{92089034} - \frac{747903164}{46044517}} + 1.0} & \text{for}\: t \geq 1502383532 \end{cases} & \text{for}\: 141 = pmt \\\begin{cases} 2037599.726 + \frac{65793.36198}{e^{\frac{t}{17332} - \frac{1483018883}{17332}} + 1.0} + \frac{163613.7533}{e^{\frac{t}{2159883} - \frac{1493813419}{2159883}} + 1.0} & \text{for}\: t < 1502383532 \\1402569.355 + \frac{144850.1061}{e^{\frac{t}{5427} - \frac{170140940}{603}} + 1.0} + \frac{192167.6127}{e^{\frac{t}{428161} - \frac{1521061510}{428161}} + 1.0} + \frac{721744.3364}{e^{\frac{t}{11294600} - \frac{7490000}{56473}} + 1.0} & \text{for}\: t \geq 1502383532 \end{cases} & \text{for}\: 142 = pmt \\3360784.193 & \text{for}\: 143 = pmt \\2654278.911 & \text{for}\: 144 = pmt \\3373660.172 & \text{for}\: 145 = pmt \\4004618.599 & \text{for}\: 146 = pmt \\4892346.136 & \text{for}\: 147 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1525132800 \\3995369.667 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 148 = pmt \\2354770.044 & \text{for}\: 149 = pmt \\0.0 & \text{for}\: 150 = pmt \\4028339.654 & \text{for}\: 151 = pmt \\0.0 & \text{for}\: 152 = pmt \\3631411.86 & \text{for}\: 153 = pmt \\2735430.911 & \text{for}\: 154 = pmt \\2353102.059 & \text{for}\: 155 = pmt \\3200178.266 & \text{for}\: 156 = pmt \\\begin{cases} 2270820.279 & \text{for}\: t < 1502383532 \\1345240.504 + \frac{92873.54987}{e^{\frac{t}{4397} - \frac{1521043256}{4397}} + 1.0} + \frac{66727.57548}{e^{\frac{t}{4445} - \frac{1531425141}{4445}} + 1.0} + \frac{862976.7744}{e^{\frac{t}{27403449} - \frac{1548248917}{27403449}} + 1.0} & \text{for}\: t \geq 1502383532 \end{cases} & \text{for}\: 157 = pmt \\4446703.885 & \text{for}\: 158 = pmt \\\begin{cases} 4114239.21 & \text{for}\: t \leq 1489337078 \\3085148.615 & \text{for}\: t > 1489337078 \end{cases} & \text{for}\: 159 = pmt \\2285591.61 & \text{for}\: 160 = pmt \\2344707.299 & \text{for}\: 161 = pmt \\0.0 & \text{for}\: 162 = pmt \\2203878.513 & \text{for}\: 163 = pmt \\2259826.429 & \text{for}\: 164 = pmt \\2570436.9 & \text{for}\: 165 = pmt \\2345924.687 & \text{for}\: 166 = pmt \\\begin{cases} 0 & \text{for}\: t \leq 1525132800 \\1636498.277 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 167 = pmt \\2257235.257 + \frac{34805.40179}{e^{\frac{t}{2921} - \frac{1483050146}{2921}} + 1.0} & \text{for}\: 168 = pmt \\4504589.162 & \text{for}\: 169 = pmt \\4776809.848 & \text{for}\: 170 = pmt \\3289174.689 & \text{for}\: 171 = pmt \\3997409.092 & \text{for}\: 172 = pmt \\2330777.639 & \text{for}\: 173 = pmt \\2206350.929 + \frac{29981.63605}{e^{\frac{t}{3904} - \frac{92688337}{244}} + 1.0} & \text{for}\: 174 = pmt \\4289612.039 + \frac{69696.93442}{e^{\frac{t}{7749} - \frac{494337223}{2583}} + 1.0} & \text{for}\: 175 = pmt \\2751969.25 & \text{for}\: 176 = pmt \\2925574.82 & \text{for}\: 177 = pmt \\0.0 & \text{for}\: 178 = pmt \\2331405.89 & \text{for}\: 179 = pmt \\4786799.474 & \text{for}\: 180 = pmt \\4791040.533 & \text{for}\: 181 = pmt \\3256479.601 & \text{for}\: 182 = pmt \\0.0 & \text{for}\: 183 = pmt \\2230084.596 & \text{for}\: 184 = pmt \\4228180.348 & \text{for}\: 185 = pmt \\3983937.85 & \text{for}\: 186 = pmt \\4066102.367 & \text{for}\: 187 = pmt \\2253493.386 & \text{for}\: 188 = pmt \\2249075.814 & \text{for}\: 189 = pmt \\\begin{cases} 4770523.746 & \text{for}\: t \leq 1484731748 \\0 & \text{for}\: t \leq 1525132800 \\4539537.353 & \text{for}\: t > 1525132800 \end{cases} & \text{for}\: 190 = pmt \\2672274.462 & \text{for}\: 191 = pmt \\3527164.467 & \text{for}\: 192 = pmt \\4599985.851 + \frac{61042.21105}{e^{\frac{t}{1004} - \frac{370760836}{251}} + 1.0} & \text{for}\: 193 = pmt \\3360105.439 & \text{for}\: 194 = pmt \\2253339.027 & \text{for}\: 195 = pmt \\2241082.721 & \text{for}\: 196 = pmt \\2224387.69 & \text{for}\: 197 = pmt \\0.0 & \text{for}\: 198 = pmt \\3263106.192 & \text{for}\: 199 = pmt \\2136224.656 & \text{for}\: 200 = pmt \\2950000.0 + \frac{138563.3096}{e^{\frac{t}{78757} - \frac{1482919016}{78757}} + 1.0} + \frac{153984.8853}{e^{\frac{t}{2135928} - \frac{186362500}{266991}} + 1.0} + \frac{267541.3263}{e^{\frac{t}{4320454} - \frac{759000000}{2160227}} + 1.0} & \text{for}\: 201 = pmt \\2165282.33 & \text{for}\: 202 = pmt \\0.0 & \text{for}\: 203 = pmt \\3894267.276 & \text{for}\: 204 = pmt \\\begin{cases} 1910643.005 & \text{for}\: t \leq 1490173263 \\1460080.954 & \text{for}\: t > 1490173263 \end{cases} & \text{for}\: 205 = pmt \\0.0 & \text{for}\: 206 = pmt \\3794553.86 & \text{for}\: 207 = pmt \\2433956.212 & \text{for}\: 208 = pmt \\1970121.067 + \frac{84837.82143}{e^{\frac{t}{1000000} - \frac{7419}{5}} + 1.0} & \text{for}\: 209 = pmt \\3343854.018 & \text{for}\: 210 = pmt \\3851690.466 & \text{for}\: 211 = pmt \\4242064.36 & \text{for}\: 212 = pmt \\0.0 & \text{for}\: 213 = pmt \vee 214 = pmt \\4834082.954 & \text{for}\: 215 = pmt \\4104687.299 & \text{for}\: 216 = pmt \\\begin{cases} 1802625.906 + \frac{121957.7087}{e^{\frac{t}{59649} - \frac{494293961}{19883}} + 1.0} + \frac{170985.2674}{e^{\frac{t}{2230938} - \frac{248638267}{371823}} + 1.0} & \text{for}\: t < 1502383532 \\6904.355259 + \frac{61269.84432}{e^{\frac{t}{1379} - \frac{1520771851}{1379}} + 1.0} + \frac{48463.24148}{e^{\frac{t}{7193} - \frac{1530939693}{7193}} + 1.0} + \frac{3400435.076}{e^{\frac{t}{96575292} - \frac{135996809}{8779572}} + 1.0} & \text{for}\: t \geq 1502383532 \end{cases} & \text{for}\: 217 = pmt \\4686745.044 & \text{for}\: 218 = pmt \\4661072.668 & \text{for}\: 219 = pmt \\2357301.334 & \text{for}\: 220 = pmt \\4781829.72 & \text{for}\: 221 = pmt \\3403911.445 & \text{for}\: 222 = pmt \\4762211.752 & \text{for}\: 223 = pmt \\3170752.993 & \text{for}\: 224 = pmt \\2374928.733 & \text{for}\: 225 = pmt \\4585408.392 & \text{for}\: 226 = pmt \\2758007.461 & \text{for}\: 227 = pmt \\2646862.902 & \text{for}\: 228 = pmt \\4639094.617 & \text{for}\: 229 = pmt \\2226133.115 & \text{for}\: 230 = pmt \\3744656.373 & \text{for}\: 231 = pmt \\2297378.692 & \text{for}\: 232 = pmt \\2540338.164 & \text{for}\: 233 = pmt \\0.0 & \text{for}\: 234 = pmt \\4681585.178 & \text{for}\: 235 = pmt \\2288534.93 & \text{for}\: 236 = pmt \\2268280.583 & \text{for}\: 237 = pmt \\4692863.886 & \text{for}\: 238 = pmt \\0.0 & \text{for}\: 239 = pmt \\2335985.492 & \text{for}\: 240 = pmt \\4223874.777 & \text{for}\: 241 = pmt \\4566435.895 & \text{for}\: 242 = pmt \\4286326.901 & \text{for}\: 243 = pmt \\0.0 & \text{for}\: 244 = pmt \\3995778.55 & \text{for}\: 245 = pmt \\3461287.708 & \text{for}\: 246 = pmt \\4526276.55 & \text{for}\: 247 = pmt \\80000.0 & \text{for}\: 254 = pmt \\100000.0 & \text{for}\: 255 = pmt \vee 256 = pmt \vee 257 = pmt \vee 258 = pmt \vee 259 = pmt \\2500000.0 & \text{otherwise} \end{cases}$$

In [13]:
#####db['runs_new'].update_many({'detector': 'tpc', 'number' : {'$gt' : 11996}}, {'$unset' : {'processor.DEFAULT.gains':True}} )


Out[13]:
<pymongo.results.UpdateResult at 0x7ff463c6cdc8>

In [ ]: