當前位置: 首頁>>代碼示例>>Python>>正文


Python JulianDate.utc_iso方法代碼示例

本文整理匯總了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"
開發者ID:nickhen,項目名稱:python-skyfield,代碼行數:9,代碼來源:test_timelib.py

示例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"
開發者ID:nickhen,項目名稱:python-skyfield,代碼行數:9,代碼來源:test_timelib.py

示例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"
開發者ID:nickhen,項目名稱:python-skyfield,代碼行數:9,代碼來源:test_timelib.py

示例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",
    ]
開發者ID:nickhen,項目名稱:python-skyfield,代碼行數:15,代碼來源:test_timelib.py

示例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",
    ]
開發者ID:nickhen,項目名稱:python-skyfield,代碼行數:15,代碼來源:test_timelib.py

示例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"
開發者ID:nickhen,項目名稱:python-skyfield,代碼行數:6,代碼來源:test_timelib.py


注:本文中的skyfield.timelib.JulianDate.utc_iso方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。