当前位置: 首页>>代码示例>>Python>>正文


Python Settings.update方法代码示例

本文整理汇总了Python中Settings.Settings.update方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.update方法的具体用法?Python Settings.update怎么用?Python Settings.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Settings.Settings的用法示例。


在下文中一共展示了Settings.update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: pole

# 需要导入模块: from Settings import Settings [as 别名]
# 或者: from Settings.Settings import update [as 别名]
    def pole(cls, look):
        """
        Create xplanet pole as arc based on observation
        """
        key1 = str(look.wave.time.tt)
        key2 = look.planet.origname

        if key2 in Settings().locationstorage:
            if key1 in Settings().locationstorage[key2]:
                l1 = Settings().locationstorage[key2][key1]
            else:
                l1 = cls.calculate_lat_long(look.wave.time, look)
                tmp = Settings().locationstorage[key2]
                tmp.update({key1: l1})
                Settings().locationstorage[key2] = tmp
        else:
            l1 = cls.calculate_lat_long(look.wave.time, look)
            Settings().locationstorage[key2] = {key1: l1}

        l2 = Settings().midpoint

        return '{} {} {} {} {}'.format(str(l1[0]),
                                       str(l1[1]),
                                       str(l2[0]),
                                       str(l2[1]),
                                       look.planet.color + " spacing=0.5")
开发者ID:lorinc-czegledi,项目名称:antikythera,代码行数:28,代码来源:MarkerGenerator.py

示例2: mark

# 需要导入模块: from Settings import Settings [as 别名]
# 或者: from Settings.Settings import update [as 别名]
    def mark(cls, look, displayname=None):
        """
        Create xplanet marker based on observation
        """
        key1 = str(look.wave.time.tt)
        key2 = look.planet.origname

        if key2 in Settings().locationstorage:
            if key1 in Settings().locationstorage[key2]:
                l1 = Settings().locationstorage[key2][key1]
            # print("found")
            else:
                l1 = cls.calculate_lat_long(look.wave.time, look)
                tmp = Settings().locationstorage[key2]
                tmp.update({key1: l1})
                Settings().locationstorage[key2] = tmp
        else:
            l1 = cls.calculate_lat_long(look.wave.time, look)
            Settings().locationstorage[key2] = {key1: l1}

        if displayname is None:
            displayname = look.planet.name

        return '{} {} "{}" {}'.format(str(l1[0]),
                                      str(l1[1]),
                                      displayname,
                                      look.planet.color)
开发者ID:lorinc-czegledi,项目名称:antikythera,代码行数:29,代码来源:MarkerGenerator.py

示例3: arc

# 需要导入模块: from Settings import Settings [as 别名]
# 或者: from Settings.Settings import update [as 别名]
    def arc(cls, look):
        """
        Create xplanet arc based on observation
        """
        key1 = str(look.wave.time.tt)

        key2 = look.planet.origname

        if key2 in Settings().locationstorage:
            if key1 in Settings().locationstorage[key2]:
                l1 = Settings().locationstorage[key2][key1]

            else:
                l1 = cls.calculate_lat_long(look.wave.time, look)

                tmp = Settings().locationstorage[key2]

                tmp.update({key1: l1})
                Settings().locationstorage[key2] = tmp
        else:
            l1 = cls.calculate_lat_long(look.wave.time, look)
            Settings().locationstorage[key2] = {key1: l1}
        # newtime=JulianDate(tt=look.wave.time.tt+0.0006944444444444445)
        newtime = JulianDate(tt=look.wave.time.tt + 0.001388888888888889)
        # newtime=JulianDate(tt=look.wave.time.tt+0.003472222222222222)

        key1 = str(newtime.tt)

        if key2 in Settings().locationstorage:
            if key1 in Settings().locationstorage[key2]:
                l2 = Settings().locationstorage[key2][key1]
            else:
                l2 = cls.calculate_lat_long(newtime, look)
                tmp = Settings().locationstorage[key2]
                tmp.update({key1: l2})
                Settings().locationstorage[key2] = tmp
        else:
            l2 = cls.calculate_lat_long(newtime, look)
            Settings().locationstorage[key2] = {key1: l2}

        return '{} {} {} {} {}'.format(str(l1[0]),
                                       str(l1[1]),
                                       str(l2[0]),
                                       str(l2[1]),
                                       look.planet.color + " spacing=0.1")
开发者ID:lorinc-czegledi,项目名称:antikythera,代码行数:47,代码来源:MarkerGenerator.py


注:本文中的Settings.Settings.update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。