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


Python callisto.CallistoSpectrogram类代码示例

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


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

示例1: test_create_url_kw

def test_create_url_kw():
    URL = (
        "http://soleil.i4ds.ch/solarradio/data/2002-20yy_Callisto/2011/09/22/"
        "BIR_20110922_050000_01.fit.gz"
    )
    ca = CallistoSpectrogram.create(url=URL)
    assert np.array_equal(ca, CallistoSpectrogram.read(URL))
开发者ID:JordanBallew,项目名称:sunpy,代码行数:7,代码来源:test_callisto.py

示例2: test_create_glob_kw

def test_create_glob_kw():
    PATTERN = os.path.join(
        os.path.dirname(CALLISTO_IMAGE),
        "BIR_*"
    )
    ca = CallistoSpectrogram.create(pattern=PATTERN)[0]
    assert np.array_equal(ca, CallistoSpectrogram.read(CALLISTO_IMAGE))
开发者ID:JordanBallew,项目名称:sunpy,代码行数:7,代码来源:test_callisto.py

示例3: test_create_single_glob

def test_create_single_glob():
    PATTERN = os.path.join(
        os.path.dirname(CALLISTO_IMAGE),
        "BIR_*"
    )
    ca = CallistoSpectrogram.create(PATTERN)
    assert np.array_equal(ca.data, CallistoSpectrogram.read(CALLISTO_IMAGE).data)
开发者ID:Rapternmn,项目名称:sunpy,代码行数:7,代码来源:test_callisto.py

示例4: test_create_glob_kw

def test_create_glob_kw(CALLISTO_IMAGE, CALLISTO_IMAGE_GLOB_INDEX, CALLISTO_IMAGE_GLOB_KEY):
    PATTERN = os.path.join(
        os.path.dirname(CALLISTO_IMAGE),
        CALLISTO_IMAGE_GLOB_KEY
    )
    ca = CallistoSpectrogram.create(pattern=PATTERN)[CALLISTO_IMAGE_GLOB_INDEX]
    assert_allclose(ca.data, CallistoSpectrogram.read(CALLISTO_IMAGE).data)
开发者ID:Alex-Ian-Hamilton,项目名称:sunpy,代码行数:7,代码来源:test_callisto.py

示例5: test_create_glob

def test_create_glob():
    PATTERN = os.path.join(
        os.path.dirname(sunpy.data.test.__file__),
        "BIR_*"
    )
    ca = CallistoSpectrogram.create(PATTERN)
    assert len(ca) == 2
开发者ID:JordanBallew,项目名称:sunpy,代码行数:7,代码来源:test_callisto.py

示例6: test_create_glob

def test_create_glob(CALLISTO_IMAGE_GLOB_KEY):
    PATTERN = os.path.join(
        os.path.dirname(sunpy.data.test.__file__),
        CALLISTO_IMAGE_GLOB_KEY
    )
    ca = CallistoSpectrogram.create(PATTERN)
    assert len(ca) == 2
开发者ID:Alex-Ian-Hamilton,项目名称:sunpy,代码行数:7,代码来源:test_callisto.py

示例7: test_homogenize_rightfq

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,代码行数:46,代码来源:test_callisto.py

示例8: test_read

def test_read(CALLISTO_IMAGE):
    ca = CallistoSpectrogram.read(CALLISTO_IMAGE)
    assert ca.start == datetime(2011, 9, 22, 5, 0, 0, 454000)
    assert ca.t_init == 18000.0
    assert ca.shape == (200, 3600)
    assert ca.t_delt == 0.25
    # Test linearity of time axis.
    assert np.array_equal(ca.time_axis, np.linspace(0, 0.25 * (ca.shape[1] - 1), ca.shape[1]))
    assert ca.dtype == np.uint8
开发者ID:amhuertash,项目名称:sunpy,代码行数:9,代码来源:test_callisto.py

示例9: test_homogenize_both

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,代码行数:43,代码来源:test_callisto.py

示例10: test_create_file

def test_create_file():
    ca = CallistoSpectrogram.create(CALLISTO_IMAGE)
    assert np.array_equal(ca, CallistoSpectrogram.read(CALLISTO_IMAGE))
开发者ID:JordanBallew,项目名称:sunpy,代码行数:3,代码来源:test_callisto.py

示例11: test_extend

def test_extend(CALLISTO_IMAGE):
    im = CallistoSpectrogram.create(CALLISTO_IMAGE)
    im2 = im.extend()
    # Not too stable test, but works.
    assert im2.data.shape == (200, 7200)
开发者ID:Alex-Ian-Hamilton,项目名称:sunpy,代码行数:5,代码来源:test_callisto.py

示例12: test_create_single_glob

def test_create_single_glob(CALLISTO_IMAGE, CALLISTO_IMAGE_GLOB_INDEX, CALLISTO_IMAGE_GLOB_KEY):
    PATTERN = os.path.join(os.path.dirname(CALLISTO_IMAGE), CALLISTO_IMAGE_GLOB_KEY)
    ca = CallistoSpectrogram.create(PATTERN)
    assert_allclose(ca[CALLISTO_IMAGE_GLOB_INDEX].data,
                    CallistoSpectrogram.read(CALLISTO_IMAGE).data)
开发者ID:Alex-Ian-Hamilton,项目名称:sunpy,代码行数:5,代码来源:test_callisto.py

示例13: test_create_file_kw

def test_create_file_kw(CALLISTO_IMAGE):
    ca = CallistoSpectrogram.create(filename=CALLISTO_IMAGE)
    assert np.array_equal(ca.data, CallistoSpectrogram.read(CALLISTO_IMAGE).data)
开发者ID:Alex-Ian-Hamilton,项目名称:sunpy,代码行数:3,代码来源:test_callisto.py

示例14:

from sunpy.spectra.sources.callisto import CallistoSpectrogram
tstart, tend = "2011-06-07T06:00:00", "2011-06-07T07:45:00"
callisto = CallistoSpectrogram.from_range("BIR", tstart, tend)
callisto_nobg = callisto.subtract_bg()
callisto_nobg.peek(vmin=0)
开发者ID:Cadair,项目名称:sunpy-0.4-paper,代码行数:5,代码来源:spectra.py


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