pyPPPETM.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:Parallel.GAMIT 作者: demiangomez 项目源码 文件源码
def todictionary(self, time_series=False):
        # convert the ETM adjustment into a dirtionary
        # optionally, output the whole time series as well

        # start with the parameters
        etm = dict()
        etm['Linear'] = {'tref': self.Linear.tref, 'params': self.Linear.values.tolist()}
        etm['Jumps'] = [{'type':jump.type, 'year': jump.year, 'a': jump.a.tolist(), 'b': jump.b.tolist(), 'T': jump.T} for jump in self.Jumps.table]
        etm['Periodic'] = {'frequencies': self.Periodic.frequencies, 'sin': self.Periodic.sin.tolist(), 'cos': self.Periodic.cos.tolist()}

        if time_series:
            ts = dict()
            ts['t'] = self.ppp_soln.t.tolist()
            ts['x'] = self.ppp_soln.x.tolist()
            ts['y'] = self.ppp_soln.y.tolist()
            ts['z'] = self.ppp_soln.z.tolist()

            etm['time_series'] = ts

        return etm
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号