当前位置: 首页>>代码示例>>Python>>正文


Python CallistoSpectrogram._homogenize_params方法代码示例

本文整理汇总了Python中sunpy.spectra.sources.callisto.CallistoSpectrogram._homogenize_params方法的典型用法代码示例。如果您正苦于以下问题:Python CallistoSpectrogram._homogenize_params方法的具体用法?Python CallistoSpectrogram._homogenize_params怎么用?Python CallistoSpectrogram._homogenize_params使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sunpy.spectra.sources.callisto.CallistoSpectrogram的用法示例。


在下文中一共展示了CallistoSpectrogram._homogenize_params方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_homogenize_rightfq

# 需要导入模块: from sunpy.spectra.sources.callisto import CallistoSpectrogram [as 别名]
# 或者: from sunpy.spectra.sources.callisto.CallistoSpectrogram import _homogenize_params [as 别名]
def test_homogenize_rightfq():
    a = np.float64(np.random.randint(0, 255, 3600))[np.newaxis, :]
        
    c1 = CallistoSpectrogram(
        a,
        np.arange(3600),
        np.array([1]),
        datetime(2011, 1, 1),
        datetime(2011, 1, 1, 1),
        0,
        1,
        'Time',
        'Frequency',
        'Test',
        None,
        None,
        None,
        False
    )
    b = 2 * a + 1
    c2 = CallistoSpectrogram(
        np.concatenate([
            np.arange(3600)[np.newaxis, :], b,
            np.arange(3600)[np.newaxis, :]
            ], 0),
        np.arange(3600),
        np.array([0, 1, 2]),
        datetime(2011, 1, 1),
        datetime(2011, 1, 1, 1),
        0,
        1,
        'Time',
        'Frequency',
        'Test',
        None,
        None,
        None,
        False
    )
    pairs_indices, factors, constants = c1._homogenize_params(
        c2, 0
    )    
    assert pairs_indices == [(0, 1)]
    assert_array_almost_equal(factors, [0.5], 2)
    assert_array_almost_equal(constants, [-0.5], 2)
    assert_array_almost_equal(factors[0] * b + constants[0], a)
开发者ID:JordanBallew,项目名称:sunpy,代码行数:48,代码来源:test_callisto.py

示例2: test_homogenize_both

# 需要导入模块: from sunpy.spectra.sources.callisto import CallistoSpectrogram [as 别名]
# 或者: from sunpy.spectra.sources.callisto.CallistoSpectrogram import _homogenize_params [as 别名]
def test_homogenize_both():
    a = np.float64(np.random.randint(0, 255, 3600))[np.newaxis, :]

    c1 = CallistoSpectrogram(
        a,
        np.arange(3600),
        np.array([1]),
        datetime(2011, 1, 1),
        datetime(2011, 1, 1, 1),
        0,
        1,
        "Time",
        "Frequency",
        "Test",
        None,
        None,
        None,
        False,
    )
    b = 2 * a + 1
    c2 = CallistoSpectrogram(
        b,
        np.arange(3600),
        np.array([1]),
        datetime(2011, 1, 1),
        datetime(2011, 1, 1, 1),
        0,
        1,
        "Time",
        "Frequency",
        "Test",
        None,
        None,
        None,
        False,
    )

    pairs_indices, factors, constants = c1._homogenize_params(c2, 0)

    assert pairs_indices == [(0, 0)]
    assert_array_almost_equal(factors, [0.5], 2)
    assert_array_almost_equal(constants, [-0.5], 2)
    assert_array_almost_equal(factors[0] * b + constants[0], a)
开发者ID:amhuertash,项目名称:sunpy,代码行数:45,代码来源:test_callisto.py


注:本文中的sunpy.spectra.sources.callisto.CallistoSpectrogram._homogenize_params方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。