本文整理匯總了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"