本文整理汇总了Python中skyfield.timelib.JulianDate.utc_iso方法的典型用法代码示例。如果您正苦于以下问题:Python JulianDate.utc_iso方法的具体用法?Python JulianDate.utc_iso怎么用?Python JulianDate.utc_iso使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类skyfield.timelib.JulianDate
的用法示例。
在下文中一共展示了JulianDate.utc_iso方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_iso_of_leap_second_with_fraction
# 需要导入模块: from skyfield.timelib import JulianDate [as 别名]
# 或者: from skyfield.timelib.JulianDate import utc_iso [as 别名]
def test_iso_of_leap_second_with_fraction():
jd = JulianDate(utc=(1973, 12, 31, 23, 59, 60.12349))
assert jd.utc_iso(places=0) == "1973-12-31T23:59:60Z"
assert jd.utc_iso(places=1) == "1973-12-31T23:59:60.1Z"
assert jd.utc_iso(places=2) == "1973-12-31T23:59:60.12Z"
assert jd.utc_iso(places=3) == "1973-12-31T23:59:60.123Z"
assert jd.utc_iso(places=4) == "1973-12-31T23:59:60.1235Z"
示例2: test_iso_of_decimal_that_rounds_down
# 需要导入模块: from skyfield.timelib import JulianDate [as 别名]
# 或者: from skyfield.timelib.JulianDate import utc_iso [as 别名]
def test_iso_of_decimal_that_rounds_down():
jd = JulianDate(utc=(2014, 12, 21, 6, 3, 1.234234))
assert jd.utc_iso(places=0) == "2014-12-21T06:03:01Z"
assert jd.utc_iso(places=1) == "2014-12-21T06:03:01.2Z"
assert jd.utc_iso(places=2) == "2014-12-21T06:03:01.23Z"
assert jd.utc_iso(places=3) == "2014-12-21T06:03:01.234Z"
assert jd.utc_iso(places=4) == "2014-12-21T06:03:01.2342Z"
示例3: test_iso_of_decimal_that_rounds_up
# 需要导入模块: from skyfield.timelib import JulianDate [as 别名]
# 或者: from skyfield.timelib.JulianDate import utc_iso [as 别名]
def test_iso_of_decimal_that_rounds_up():
jd = JulianDate(utc=(1915, 12, 2, 3, 4, 5.6786786))
assert jd.utc_iso(places=0) == "1915-12-02T03:04:06Z"
assert jd.utc_iso(places=1) == "1915-12-02T03:04:05.7Z"
assert jd.utc_iso(places=2) == "1915-12-02T03:04:05.68Z"
assert jd.utc_iso(places=3) == "1915-12-02T03:04:05.679Z"
assert jd.utc_iso(places=4) == "1915-12-02T03:04:05.6787Z"
示例4: test_iso_of_array_showing_fractions
# 需要导入模块: from skyfield.timelib import JulianDate [as 别名]
# 或者: from skyfield.timelib.JulianDate import utc_iso [as 别名]
def test_iso_of_array_showing_fractions():
jd = JulianDate(utc=(1973, 12, 31, 23, 59, np.arange(58.75, 63.1, 0.5)))
assert jd.utc_iso(places=2) == [
"1973-12-31T23:59:58.75Z",
"1973-12-31T23:59:59.25Z",
"1973-12-31T23:59:59.75Z",
"1973-12-31T23:59:60.25Z",
"1973-12-31T23:59:60.75Z",
"1974-01-01T00:00:00.25Z",
"1974-01-01T00:00:00.75Z",
"1974-01-01T00:00:01.25Z",
"1974-01-01T00:00:01.75Z",
]
示例5: test_iso_of_array_showing_whole_seconds
# 需要导入模块: from skyfield.timelib import JulianDate [as 别名]
# 或者: from skyfield.timelib.JulianDate import utc_iso [as 别名]
def test_iso_of_array_showing_whole_seconds():
jd = JulianDate(utc=(1973, 12, 31, 23, 59, np.arange(58.75, 63.1, 0.5)))
assert jd.utc_iso(places=0) == [
"1973-12-31T23:59:59Z",
"1973-12-31T23:59:59Z",
"1973-12-31T23:59:60Z",
"1973-12-31T23:59:60Z",
"1974-01-01T00:00:00Z",
"1974-01-01T00:00:00Z",
"1974-01-01T00:00:01Z",
"1974-01-01T00:00:01Z",
"1974-01-01T00:00:02Z",
]
示例6: test_early_utc
# 需要导入模块: from skyfield.timelib import JulianDate [as 别名]
# 或者: from skyfield.timelib.JulianDate import utc_iso [as 别名]
def test_early_utc():
jd = JulianDate(utc=(1915, 12, 2, 3, 4, 5.6786786))
assert abs(jd.tt - 2420833.6283317441) < epsilon
assert jd.utc_iso() == "1915-12-02T03:04:06Z"