本文整理汇总了Python中nell.utilities.TimeAgent.rad2deg方法的典型用法代码示例。如果您正苦于以下问题:Python TimeAgent.rad2deg方法的具体用法?Python TimeAgent.rad2deg怎么用?Python TimeAgent.rad2deg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nell.utilities.TimeAgent
的用法示例。
在下文中一共展示了TimeAgent.rad2deg方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: solar_avoidance_degrees
# 需要导入模块: from nell.utilities import TimeAgent [as 别名]
# 或者: from nell.utilities.TimeAgent import rad2deg [as 别名]
def solar_avoidance_degrees(self):
"""
Returns 0.0 if there is no solar avoidance, otherwise returns
this obs param in degrees.
"""
sa = self.get_solar_avoidance()
return 0.0 if sa is None else TimeAgent.rad2deg(sa)
示例2: get_deg
# 需要导入模块: from nell.utilities import TimeAgent [as 别名]
# 或者: from nell.utilities.TimeAgent import rad2deg [as 别名]
def get_deg(self, value):
degs = TimeAgent.rad2deg(value)
if degs < 0:
degs = abs(degs)
sign = "-"
else:
sign = " "
fpart, ddegs = modf(degs)
fpart, dmins = modf(fpart * 60)
dsecs = round(fpart * 60, 1)
if dsecs > 59.9:
dmins = dmins + 1
dsecs = 0.0
if dmins > 59.9:
ddegs = ddegs + 1
dmins = 0.0
return "%s%02i:%02i:%04.1f" % (sign, int(ddegs), int(dmins), dsecs)
示例3: jsondict
# 需要导入模块: from nell.utilities import TimeAgent [as 别名]
# 或者: from nell.utilities.TimeAgent import rad2deg [as 别名]
def jsondict(self):
irradiance = self.sesshun.irradiance()
solarAvoid = self.sesshun.get_solar_avoidance()
solarAvoid = None if solarAvoid is None else TimeAgent.rad2deg(solarAvoid) # DB in radians
d = {"id" : self.sesshun.id
, "pcode" : self.sesshun.project.pcode
, "handle" : self.sesshun.toHandle()
, "type" : self.sesshun.session_type.type
, "science" : self.sesshun.observing_type.type
, "total_time" : self.sesshun.allotment.total_time
, "PSC_time" : self.sesshun.allotment.psc_time
, "sem_time" : self.sesshun.allotment.max_semester_time
, "remaining" : 0 if self.sesshun.observing_type.type == "maintenance" \
else TimeAccounting().getTimeRemaining(self.sesshun)
, "grade" : self.sesshun.allotment.grade
, "orig_ID" : self.sesshun.original_id
, "name" : self.sesshun.name
, "freq" : self.sesshun.frequency
, "req_max" : self.sesshun.max_duration
, "req_min" : self.sesshun.min_duration
, "between" : self.sesshun.time_between
, "enabled" : self.sesshun.status.enabled
, "authorized" : self.sesshun.status.authorized
, "complete" : self.sesshun.status.complete
, "backup" : self.sesshun.status.backup
, "guaranteed" : self.sesshun.guaranteed()
, "gas" : self.sesshun.good_atmospheric_stability() or False
, "transit" : self.sesshun.transit() or False
#, "nighttime" : self.sesshun.nighttime() or False
, "time_of_day": self.sesshun.get_time_of_day()
, "lst_ex" : self.sesshun.get_lst_string('LST Exclude') or ""
, "lst_in" : self.sesshun.get_lst_string('LST Include') or ""
, "receiver" : self.sesshun.get_receiver_req()
, "project_complete" : "Yes" if self.sesshun.project.complete else "No"
, "xi_factor" : self.sesshun.get_min_eff_tsys_factor() or 1.0
, "el_limit" : self.sesshun.get_elevation_limit() or None # None is default
, "solar_avoid": solarAvoid
, "trk_err_threshold" : self.sesshun.get_tracking_error_threshold()
, "src_size" : self.sesshun.get_source_size()
, "keyhole" : self.sesshun.keyhole()
, "irradiance" : 300 if irradiance is None and
self.sesshun.observing_type.type == 'continuum'
else irradiance
}
try:
target = self.sesshun.target
except Target.DoesNotExist:
pass
else:
d.update({"source" : target.source
, "coord_mode" : target.system.name
, "source_h" : TimeAgent.rad2deg(target.horizontal) \
if target.system.name == 'Galactic' \
else TimeAgent.rad2hr(target.horizontal)
, "source_v" : TimeAgent.rad2deg(target.vertical)
})
# Remove all None values
for k, v in d.items():
if v is None:
_ = d.pop(k)
return d