示例#1
0
def test_physicaliam_scalar():
    aoi = -45.
    iam = pvsystem.physicaliam(aoi, 1.526, 0.002, 4)
    expected = 0.98797788
    assert_allclose(iam, expected, equal_nan=True)
    aoi = np.nan
    iam = pvsystem.physicaliam(aoi, 1.526, 0.002, 4)
    expected = np.nan
    assert_allclose(iam, expected, equal_nan=True)
示例#2
0
def test_physicaliam():
    aoi = np.array([-90. , -67.5, -45. , -22.5,   0. ,  22.5,  45. ,  67.5,  90. , np.nan])
    iam = pvsystem.physicaliam(aoi, 1.526, 0.002, 4)
    expected = np.array([        0,  0.8893998,  0.98797788,  0.99926198,         1,
        0.99926198,  0.98797788,  0.8893998,         0, np.nan])
    assert_allclose(iam, expected, equal_nan=True)

    # GitHub issue 397
    aoi = pd.Series(aoi)
    iam = pvsystem.physicaliam(aoi, 1.526, 0.002, 4)
    expected = pd.Series(expected)
    assert_series_equal(iam, expected)
示例#3
0
def test_physicaliam():
    aoi = np.array([-90. , -67.5, -45. , -22.5,   0. ,  22.5,  45. ,  67.5,  90. , np.nan])
    iam = pvsystem.physicaliam(aoi, 1.526, 0.002, 4)
    expected = np.array([        0,  0.8893998,  0.98797788,  0.99926198,         1,
        0.99926198,  0.98797788,  0.8893998,         0, np.nan])
    assert_allclose(iam, expected, equal_nan=True)

    # GitHub issue 397
    aoi = pd.Series(aoi)
    iam = pvsystem.physicaliam(aoi, 1.526, 0.002, 4)
    expected = pd.Series(expected)
    assert_series_equal(iam, expected)
示例#4
0
def test_physicaliam():
    thetas = np.linspace(-90, 90, 9)
    iam = pvsystem.physicaliam(4, 0.002, 1.526, thetas)
    expected = np.array([
        nan, 0.8893998, 0.98797788, 0.99926198, nan, 0.99926198, 0.98797788,
        0.8893998, nan
    ])
    assert np.isclose(iam, expected, equal_nan=True).all()
示例#5
0
def test_physicaliam():
    thetas = np.array(
        [-90., -67.5, -45., -22.5, 0., 22.5, 45., 67.5, 90., np.nan])
    iam = pvsystem.physicaliam(thetas, 1.526, 0.002, 4)
    expected = np.array([
        0, 0.8893998, 0.98797788, 0.99926198, 1, 0.99926198, 0.98797788,
        0.8893998, 0, np.nan
    ])
    assert_allclose(iam, expected, equal_nan=True)
示例#6
0
def test_physicaliam():
    thetas = pd.Series(np.linspace(-180,180,361))
    iam = pvsystem.physicaliam(4, 0.002, 1.526, thetas)
示例#7
0
def test_physicaliam():
    thetas = np.linspace(-90, 90, 9)
    iam = pvsystem.physicaliam(4, 0.002, 1.526, thetas)
    expected = np.array([        nan,  0.8893998 ,  0.98797788,  0.99926198,         nan,
        0.99926198,  0.98797788,  0.8893998 ,         nan])
    assert np.isclose(iam, expected, equal_nan=True).all()
def test_proper():
	IAM=physicaliam(.05,.5,.2,pd.DataFrame(list(range(90))))	
	assert(np.size(IAM)==90)