本文整理汇总了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")
示例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)
示例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")