• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python clearsky.ineichen函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_ineichen_altitude

def test_ineichen_altitude():
    expected = pd.DataFrame(
        np.array([[1134.24312405,  994.95377835,  154.40492924]]),
        columns=['ghi', 'dni', 'dhi'])

    out = clearsky.ineichen(10, 1, 3, altitude=pd.Series(2000))
    assert_frame_equal(expected, out)
开发者ID:mikofski,项目名称:pvlib-python,代码行数:7,代码来源:test_clearsky.py


示例2: test_ineichen_dni_extra

def test_ineichen_dni_extra():
    expected = pd.DataFrame(
        np.array([[1042.72590228,  946.35279683,  110.75033088]]),
        columns=['ghi', 'dni', 'dhi'])

    out = clearsky.ineichen(10, 1, 3, dni_extra=pd.Series(1370))
    assert_frame_equal(expected, out)
开发者ID:mikofski,项目名称:pvlib-python,代码行数:7,代码来源:test_clearsky.py


示例3: test_ineichen_series

def test_ineichen_series():
    times = pd.date_range(start='2014-06-24', end='2014-06-25', freq='3h',
                          tz='America/Phoenix')
    apparent_zenith = pd.Series(np.array(
        [124.0390863, 113.38779941, 82.85457044, 46.0467599, 10.56413562,
         34.86074109, 72.41687122, 105.69538659, 124.05614124]),
        index=times)
    am = pd.Series(np.array(
        [nan, nan, 6.97935524, 1.32355476, 0.93527685,
         1.12008114, 3.01614096, nan, nan]),
        index=times)
    expected = pd.DataFrame(np.
        array([[   0.        ,    0.        ,    0.        ],
               [   0.        ,    0.        ,    0.        ],
               [  65.49426624,  321.16092181,   25.54562017],
               [ 704.6968125 ,  888.90147035,   87.73601277],
               [1044.1230677 ,  953.24925854,  107.03109696],
               [ 853.02065704,  922.06124712,   96.42909484],
               [ 251.99427693,  655.44925241,   53.9901349 ],
               [   0.        ,    0.        ,    0.        ],
               [   0.        ,    0.        ,    0.        ]]),
                            columns=['ghi', 'dni', 'dhi'],
                            index=times)

    out = clearsky.ineichen(apparent_zenith, am, 3)
    assert_frame_equal(expected, out)
开发者ID:mikofski,项目名称:pvlib-python,代码行数:26,代码来源:test_clearsky.py


示例4: test_disc_keys

def test_disc_keys():
    clearsky_data = clearsky.ineichen(times, tus, linke_turbidity=3)
    disc_data = irradiance.disc(clearsky_data['GHI'], ephem_data['zenith'], 
                              ephem_data.index)
    assert 'DNI_gen_DISC' in disc_data.columns
    assert 'Kt_gen_DISC' in disc_data.columns
    assert 'AM' in disc_data.columns
开发者ID:djgagne,项目名称:pvlib-python,代码行数:7,代码来源:test_irradiance.py


示例5: test_ineichen_nans

def test_ineichen_nans():
    length = 4

    apparent_zenith = np.full(length, 10.)
    apparent_zenith[0] = np.nan

    linke_turbidity = np.full(length, 3.)
    linke_turbidity[1] = np.nan

    dni_extra = np.full(length, 1370.)
    dni_extra[2] = np.nan

    airmass_absolute = np.full(length, 1.)

    expected = OrderedDict()
    expected['ghi'] = np.full(length, np.nan)
    expected['dni'] = np.full(length, np.nan)
    expected['dhi'] = np.full(length, np.nan)

    expected['ghi'][length-1] = 1042.72590228
    expected['dni'][length-1] = 946.35279683
    expected['dhi'][length-1] = 110.75033088

    out = clearsky.ineichen(apparent_zenith, airmass_absolute,
                            linke_turbidity, dni_extra=dni_extra)

    for k, v in expected.items():
        assert_allclose(expected[k], out[k])
开发者ID:mikofski,项目名称:pvlib-python,代码行数:28,代码来源:test_clearsky.py


示例6: test_ineichen_series_perez_enhancement

def test_ineichen_series_perez_enhancement():
    times = pd.date_range(start='2014-06-24', end='2014-06-25', freq='3h',
                          tz='America/Phoenix')
    apparent_zenith = pd.Series(np.array(
        [124.0390863, 113.38779941, 82.85457044, 46.0467599, 10.56413562,
         34.86074109, 72.41687122, 105.69538659, 124.05614124]),
        index=times)
    am = pd.Series(np.array(
        [nan, nan, 6.97935524, 1.32355476, 0.93527685,
         1.12008114, 3.01614096, nan, nan]),
        index=times)
    expected = pd.DataFrame(np.
        array([[   0.        ,    0.        ,    0.        ],
               [   0.        ,    0.        ,    0.        ],
               [  91.1249279 ,  321.16092171,   51.17628184],
               [ 716.46580547,  888.9014706 ,   99.50500553],
               [1053.42066073,  953.24925905,  116.3286895 ],
               [ 863.54692748,  922.06124652,  106.9553658 ],
               [ 271.06382275,  655.44925213,   73.05968076],
               [   0.        ,    0.        ,    0.        ],
               [   0.        ,    0.        ,    0.        ]]),
                            columns=['ghi', 'dni', 'dhi'],
                            index=times)

    out = clearsky.ineichen(apparent_zenith, am, 3, perez_enhancement=True)
    assert_frame_equal(expected, out)
开发者ID:mikofski,项目名称:pvlib-python,代码行数:26,代码来源:test_clearsky.py


示例7: test_ineichen_altitude

def test_ineichen_altitude():
    expected = pd.DataFrame(
        np.array([[ 1145.64245696,   994.95377835,   165.80426215]]),
        columns=['ghi', 'dni', 'dhi'])

    out = clearsky.ineichen(10, 1, 3, altitude=pd.Series(2000))
    assert_frame_equal(expected, out)
开发者ID:caskeep,项目名称:pvlib-python,代码行数:7,代码来源:test_clearsky.py


示例8: test_ineichen_dni_extra

def test_ineichen_dni_extra():
    expected = pd.DataFrame(
        np.array([[ 1053.20547182,   946.35279683,   121.22990042]]),
        columns=['ghi', 'dni', 'dhi'])

    out = clearsky.ineichen(10, 1, 3, dni_extra=pd.Series(1370))
    assert_frame_equal(expected, out)
开发者ID:caskeep,项目名称:pvlib-python,代码行数:7,代码来源:test_clearsky.py


示例9: get_clearsky

    def get_clearsky(self, times, model='ineichen', **kwargs):
        """
        Calculate the clear sky estimates of GHI, DNI, and/or DHI
        at this location.
        
        Parameters
        ----------
        times : DatetimeIndex
        
        model : str
            The clear sky model to use.
        
        kwargs passed to the relevant function(s).
        
        Returns
        -------
        clearsky : DataFrame
            Column names are: ``ghi, dni, dhi``.
        """
        
        if model == 'ineichen':
            cs = clearsky.ineichen(times, latitude=self.latitude,
                                   longitude=self.longitude,
                                   altitude=self.altitude,
                                   **kwargs)
        elif model == 'haurwitz':
            solpos = self.get_solarposition(times, **kwargs)
            cs = clearsky.haurwitz(solpos['apparent_zenith'])
        else:
            raise ValueError('{} is not a valid clear sky model'
                             .format(model))

        return cs
开发者ID:JohannesOos,项目名称:pvlib-python,代码行数:33,代码来源:location.py


示例10: get_clearsky

    def get_clearsky(self, times, model='ineichen', **kwargs):
        """
        Calculate the clear sky estimates of GHI, DNI, and/or DHI
        at this location.

        Parameters
        ----------
        times : DatetimeIndex

        model : str
            The clear sky model to use. Must be one of
            'ineichen', 'haurwitz', 'simplified_solis'.

        kwargs passed to the relevant functions. Climatological values
        are assumed in many cases. See code for details.

        Returns
        -------
        clearsky : DataFrame
            Column names are: ``ghi, dni, dhi``.
        """

        if model == 'ineichen':
            cs = clearsky.ineichen(times, latitude=self.latitude,
                                   longitude=self.longitude,
                                   altitude=self.altitude,
                                   **kwargs)
        elif model == 'haurwitz':
            solpos = self.get_solarposition(times, **kwargs)
            cs = clearsky.haurwitz(solpos['apparent_zenith'])
        elif model == 'simplified_solis':

            # these try/excepts define default values that are only
            # evaluated if necessary. ineichen does some of this internally
            try:
                dni_extra = kwargs.pop('dni_extra')
            except KeyError:
                dni_extra = irradiance.extraradiation(times.dayofyear)

            try:
                pressure = kwargs.pop('pressure')
            except KeyError:
                pressure = atmosphere.alt2pres(self.altitude)

            try:
                apparent_elevation = kwargs.pop('apparent_elevation')
            except KeyError:
                solpos = self.get_solarposition(
                    times, pressure=pressure, **kwargs)
                apparent_elevation = solpos['apparent_elevation']

            cs = clearsky.simplified_solis(
                apparent_elevation, pressure=pressure, dni_extra=dni_extra,
                **kwargs)
        else:
            raise ValueError('{} is not a valid clear sky model'
                             .format(model))

        return cs
开发者ID:cbirkj,项目名称:pvlib-python,代码行数:59,代码来源:location.py


示例11: test_ineichen_scalar_input

def test_ineichen_scalar_input():
    expected = OrderedDict()
    expected['ghi'] = 1038.159219
    expected['dni'] = 942.2081860378344
    expected['dhi'] = 110.26529293612793

    out = clearsky.ineichen(10., 1., 3.)
    for k, v in expected.items():
        assert_allclose(expected[k], out[k])
开发者ID:mikofski,项目名称:pvlib-python,代码行数:9,代码来源:test_clearsky.py


示例12: test_ineichen_scalar_input

def test_ineichen_scalar_input():
    expected = OrderedDict()
    expected['ghi'] = 1048.592893113678
    expected['dni'] = 942.2081860378344
    expected['dhi'] = 120.6989665520498

    out = clearsky.ineichen(10., 1., 3.)
    for k, v in expected.items():
        assert_allclose(expected[k], out[k])
开发者ID:caskeep,项目名称:pvlib-python,代码行数:9,代码来源:test_clearsky.py


示例13: test_ineichen_arrays

def test_ineichen_arrays():
    expected = OrderedDict()

    expected['ghi'] = (np.
        array([[[ 1106.78342709,  1064.7691287 ,  1024.34972343],
                [  847.84529406,   815.66047425,   784.69741345],
                [  192.19092519,   184.89521884,   177.87646277]],

               [[  959.12310134,   775.2374976 ,   626.60692548],
                [  734.73092205,   593.86637713,   480.00875328],
                [  166.54997871,   134.61857872,   108.80915072]],

               [[ 1026.15144142,   696.85030591,   473.22483724],
                [  786.0776095 ,   533.81830453,   362.51125692],
                [  178.18932781,   121.00678573,    82.17463061]]]))

    expected['dni'] = (np.
        array([[[ 1024.58284359,   942.20818604,   861.11344424],
                [ 1024.58284359,   942.20818604,   861.11344424],
                [ 1024.58284359,   942.20818604,   861.11344424]],

               [[  687.61305142,   419.14891162,   255.50098235],
                [  687.61305142,   419.14891162,   255.50098235],
                [  687.61305142,   419.14891162,   255.50098235]],

               [[  458.62196014,   186.46177428,    75.80970012],
                [  458.62196014,   186.46177428,    75.80970012],
                [  458.62196014,   186.46177428,    75.80970012]]]))

    expected['dhi'] = (np.
            array([[[  82.20058349,  122.56094266,  163.23627919],
                    [  62.96930021,   93.88712907,  125.04624459],
                    [  14.27398153,   21.28248435,   28.34568241]],

                   [[ 271.51004993,  356.08858598,  371.10594313],
                    [ 207.988765  ,  272.77968255,  284.28364554],
                    [  47.14722539,   61.83413404,   64.44187075]],

                   [[ 567.52948128,  510.38853163,  397.41513712],
                    [ 434.75280544,  390.98029849,  304.4376574 ],
                    [  98.5504602 ,   88.62803842,   69.01041434]]]))

    apparent_zenith = np.linspace(0, 80, 3)
    airmass_absolute = np.linspace(1, 10, 3)
    linke_turbidity = np.linspace(2, 4, 3)

    apparent_zenith, airmass_absolute, linke_turbidity = \
        np.meshgrid(apparent_zenith, airmass_absolute, linke_turbidity)

    out = clearsky.ineichen(apparent_zenith, airmass_absolute, linke_turbidity)

    for k, v in expected.items():
        assert_allclose(expected[k], out[k])
开发者ID:caskeep,项目名称:pvlib-python,代码行数:53,代码来源:test_clearsky.py


示例14: test_ineichen_arrays

def test_ineichen_arrays():
    expected = OrderedDict()

    expected['ghi'] = (np.
        array([[[1095.77074798, 1054.17449885, 1014.15727338],
                [ 839.40909243,  807.54451692,  776.88954373],
                [ 190.27859353,  183.05548067,  176.10656239]],

               [[ 773.49041181,  625.19479557,  505.33080493],
                [ 592.52803177,  478.92699901,  387.10585505],
                [ 134.31520045,  108.56393694,   87.74977339]],

               [[ 545.9968869 ,  370.78162375,  251.79449885],
                [ 418.25788117,  284.03520249,  192.88577665],
                [  94.81136442,   64.38555328,   43.72365587]]]))

    expected['dni'] = (np.
        array([[[1014.38807396,  942.20818604,  861.11344424],
                [1014.38807396,  942.20818604,  861.11344424],
                [1014.38807396,  942.20818604,  861.11344424]],

               [[ 687.61305142,  419.14891162,  255.50098235],
                [ 687.61305142,  419.14891162,  255.50098235],
                [ 687.61305142,  419.14891162,  255.50098235]],

               [[ 458.62196014,  186.46177428,   75.80970012],
                [ 458.62196014,  186.46177428,   75.80970012],
                [ 458.62196014,  186.46177428,   75.80970012]]]))

    expected['dhi'] = (np.
        array([[[ 81.38267402, 111.96631281, 153.04382915],
                [ 62.3427452 ,  85.77117175, 117.23837487],
                [ 14.13195304,  19.44274618,  26.57578203]],

               [[ 85.87736039, 206.04588395, 249.82982258],
                [ 65.78587472, 157.84030442, 191.38074731],
                [ 14.91244713,  35.77949226,  43.38249342]],

               [[ 87.37492676, 184.31984947, 175.98479873],
                [ 66.93307711, 141.19719644, 134.81217714],
                [ 15.17249681,  32.00680597,  30.5594396 ]]]))

    apparent_zenith = np.linspace(0, 80, 3)
    airmass_absolute = np.linspace(1, 10, 3)
    linke_turbidity = np.linspace(2, 4, 3)

    apparent_zenith, airmass_absolute, linke_turbidity = \
        np.meshgrid(apparent_zenith, airmass_absolute, linke_turbidity)

    out = clearsky.ineichen(apparent_zenith, airmass_absolute, linke_turbidity)

    for k, v in expected.items():
        assert_allclose(expected[k], out[k])
开发者ID:mikofski,项目名称:pvlib-python,代码行数:53,代码来源:test_clearsky.py


示例15: test_ineichen_supply_linke

def test_ineichen_supply_linke():
    expected = pd.DataFrame(np.array([[0.,0.,0.],
                                      [0.,0.,0.],
                                      [40.18673553,322.0649964,80.23287692],
                                      [95.14405816,876.49507151,703.48596755],
                                      [118.45873721,939.81653473,1042.34531752],
                                      [105.36671577,909.113377,851.3283881],
                                      [61.91607984,647.40869542,257.47471759],
                                      [0.,0.,0.],
                                      [0.,0.,0.]]),
                            columns=['dhi', 'dni', 'ghi'],
                            index=times_localized)
    out = clearsky.ineichen(times, tus, linke_turbidity=3)
    assert_frame_equal(expected, out)
开发者ID:pyElena21,项目名称:pvlib-python,代码行数:14,代码来源:test_clearsky.py


示例16: test_ineichen_airmass

def test_ineichen_airmass():
    expected = pd.DataFrame(np.array([[0.,0.,0.],
                                      [0.,0.,0.],
                                      [41.70761136,293.72203458,78.22953786],
                                      [95.20590465,876.1650047,703.31872722],
                                      [118.46089555,939.8078753,1042.33896321],
                                      [105.39577655,908.97804342,851.24640259],
                                      [62.35382269,642.91022293,256.55363539],
                                      [0.,0.,0.],
                                      [0.,0.,0.]]),
                            columns=['dhi', 'dni', 'ghi'],
                            index=times_localized)
    out = clearsky.ineichen(times, tus, linke_turbidity=3,
                            airmass_model='simple')
    assert_frame_equal(expected, out)
开发者ID:pyElena21,项目名称:pvlib-python,代码行数:15,代码来源:test_clearsky.py


示例17: test_ineichen_required

def test_ineichen_required():
    # the clearsky function should call lookup_linke_turbidity by default
    # will fail without scipy
    expected = pd.DataFrame(np.array([[0.,0.,0.],
                                      [0.,0.,0.],
                                      [40.53660309,302.47614235,78.1470311],
                                      [98.88372629,865.98938602,699.93403875],
                                      [122.57870881,931.83716051,1038.62116584],
                                      [109.30270612,899.88002304,847.68806472],
                                      [64.25699595,629.91187925,254.53048144],
                                      [0.,0.,0.],
                                      [0.,0.,0.]]),
                            columns=['dhi', 'dni', 'ghi'],
                            index=times_localized)
    out = clearsky.ineichen(times, tus)
    assert_frame_equal(expected, out)
开发者ID:pyElena21,项目名称:pvlib-python,代码行数:16,代码来源:test_clearsky.py


示例18: test_ineichen_required

def test_ineichen_required():
    # the clearsky function should call lookup_linke_turbidity by default
    expected = pd.DataFrame(
        np.array([[    0.        ,     0.        ,     0.        ],
                  [    0.        ,     0.        ,     0.        ],
                  [   51.47811191,   265.33462162,    84.48262202],
                  [  105.008507  ,   832.29100407,   682.67761951],
                  [  121.97988054,   901.31821834,  1008.02102657],
                  [  112.57957512,   867.76297247,   824.61702926],
                  [   76.69672675,   588.8462898 ,   254.5808329 ],
                  [    0.        ,     0.        ,     0.        ],
                  [    0.        ,     0.        ,     0.        ]]),
                            columns=['dhi', 'dni', 'ghi'],
                            index=times_localized)
    out = clearsky.ineichen(times_localized, tus.latitude, tus.longitude)
    assert_frame_equal(expected, out)
开发者ID:cbirkj,项目名称:pvlib-python,代码行数:16,代码来源:test_clearsky.py


示例19: test_ineichen_supply_linke

def test_ineichen_supply_linke():
    expected = pd.DataFrame(np.array(
        [[    0.        ,     0.        ,     0.        ],
         [    0.        ,     0.        ,     0.        ],
         [   40.16490879,   321.71856556,    80.12815294],
         [   95.14336873,   876.49252839,   703.47605855],
         [  118.4587024 ,   939.81646535,  1042.34480815],
         [  105.36645492,   909.11265773,   851.32459694],
         [   61.91187639,   647.35889938,   257.42691896],
         [    0.        ,     0.        ,     0.        ],
         [    0.        ,     0.        ,     0.        ]]),
                            columns=['dhi', 'dni', 'ghi'],
                            index=times_localized)
    out = clearsky.ineichen(times_localized, tus.latitude, tus.longitude,
                            altitude=tus.altitude,
                            linke_turbidity=3)
    assert_frame_equal(expected, out)
开发者ID:cbirkj,项目名称:pvlib-python,代码行数:17,代码来源:test_clearsky.py


示例20: test_ineichen_airmass

def test_ineichen_airmass():
    expected = pd.DataFrame(
        np.array([[    0.        ,     0.        ,     0.        ],
                  [    0.        ,     0.        ,     0.        ],
                  [   53.90422388,   257.01655613,    85.87406435],
                  [  101.34055688,   842.92925705,   686.39337307],
                  [  117.7573735 ,   909.70367947,  1012.04184961],
                  [  108.6233401 ,   877.30589626,   828.49118038],
                  [   75.23108133,   602.06895546,   257.10961202],
                  [    0.        ,     0.        ,     0.        ],
                  [    0.        ,     0.        ,     0.        ]]),
                            columns=['dhi', 'dni', 'ghi'],
                            index=times_localized)
    out = clearsky.ineichen(times_localized, tus.latitude, tus.longitude,
                            linke_turbidity=3,
                            airmass_model='simple')
    assert_frame_equal(expected, out)
开发者ID:cbirkj,项目名称:pvlib-python,代码行数:17,代码来源:test_clearsky.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python irradiance.extraradiation函数代码示例发布时间:2022-05-25
下一篇:
Python atmosphere.relativeairmass函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap