当前位置: 首页>>代码示例>>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;未经允许,请勿转载。