예제 #1
0
def test_site_init():
    site = Site(latitude=40.0, elevation=100.0)

    assert site is not None
    assert site.latitude == 40.0
    assert site.longitude == 0.0
    assert site.elevation == 100.0
예제 #2
0
def test_declination():
    site = Site(latitude=47.68, longitude=-122.25, elevation=20.0)
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)

    assert round(solar_angles.declination.max(), 2) == 23.45
    assert round(solar_angles.declination.min(), 2) == -23.45
예제 #3
0
def test_equation_of_time():
    site = Site(latitude=47.68, longitude=-122.25, elevation=20.0)
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)

    assert round(solar_angles.equation_of_time.max(), 1) == 16.4
    assert round(solar_angles.equation_of_time.min(), 1) == -14.3
예제 #4
0
def test_gamma():
    site = Site(latitude=47.68, longitude=-122.25, elevation=20.0)
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)

    assert round(solar_angles.gamma.max(), 0) == 359
    assert round(solar_angles.gamma.min(), 0) == 0
예제 #5
0
def test_surface_init():
    site = Site()
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)
    surface = Surface('surface1', azimuth=0, tilt=90, width=1, height=1)

    assert surface is not None
예제 #6
0
def test_sun_surface_azimuth():
    site = Site(latitude=47.68, longitude=-122.25, elevation=20.0)
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)
    surface = Surface('surface1', azimuth=0, tilt=90, width=1, height=1)
    surface_solar_angles = SurfaceSolarAngles(time, solar_angles, surface)

    assert round(surface_solar_angles.sun_surface_azimuth.max(), 0) == 90.0
    assert round(surface_solar_angles.sun_surface_azimuth.min(), 0) == 0.0
예제 #7
0
def test_heat_transfer_surface_init():
    site = Site()
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)
    weather = EPW(time)
    weather.direct_normal_radiation = np.ones(time.length)
    weather.diffuse_horizontal_radiation = np.ones(time.length)
    surface = Surface('surface1', azimuth=0, tilt=90, width=1, height=1)
    ht_surface = HeatTransferSurface('ht_surface1', time, solar_angles,
                                     weather, surface)

    assert ht_surface is not None
예제 #8
0
def test_external_shortwave_radiation_init():
    settings = Settings('')
    site = Site()
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)
    weather = EPW(time)
    weather.direct_normal_radiation = np.ones(time.length)
    weather.diffuse_horizontal_radiation = np.ones(time.length)
    surface = Surface('surface1', azimuth=0, tilt=90, width=1, height=1)
    surface_solar_angles = SurfaceSolarAngles(time, solar_angles, surface)
    external_shortwave_radiation = ExternalShortwaveRadiation(
        time, solar_angles, weather, surface, surface_solar_angles)

    assert external_shortwave_radiation is not None
예제 #9
0
def test_incident_diffuse_radiation():
    settings = Settings('')
    site = Site(latitude=0, longitude=0, elevation=0.0)
    time = Time()
    weather = EPW(time)
    weather.direct_normal_radiation = np.ones(time.length)
    weather.diffuse_horizontal_radiation = np.ones(time.length)
    solar_angles = SolarAngles(time=time, site=site)
    surface = Surface('surface1', azimuth=0, tilt=90, width=1, height=1)
    surface_solar_angles = SurfaceSolarAngles(time, solar_angles, surface)
    external_shortwave_radiation = ExternalShortwaveRadiation(
        time, solar_angles, weather, surface, surface_solar_angles)

    assert round(external_shortwave_radiation.incident_diffuse_radiation.max(),
                 2) == 1.3
    assert round(external_shortwave_radiation.incident_diffuse_radiation.min(),
                 2) == 0.55
예제 #10
0
def test_us_eastern_standard_meridian_calculation():
    # representative city: Washington DC, USA
    site = Site(latitude=38.91, longitude=-77.04)

    assert site.local_standard_meridian == -75.0
예제 #11
0
def test_us_atlantic_standard_meridian_calculation():
    # representative city: Halifax, Nova Scotia, Canada
    site = Site(latitude=44.65, longitude=-63.58)

    assert site.local_standard_meridian == -60.0
예제 #12
0
def test_solar_angles_init():
    site = Site()
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)

    assert solar_angles is not None
예제 #13
0
def test_us_hawaii_aleutian_standard_meridian_calculation():
    # representative city: Honolulu, HI, USA
    site = Site(latitude=21.31, longitude=-157.86)

    assert site.local_standard_meridian == -150.0
예제 #14
0
def test_us_alaska_standard_meridian_calculation():
    # representative city: Juneau, AK, USA
    site = Site(latitude=61.22, longitude=-149.90)

    assert site.local_standard_meridian == -135.0
예제 #15
0
def test_us_pacific_standard_meridian_calculation():
    # representative city: Seattle, WA, USA
    site = Site(latitude=47.68, longitude=-122.25)

    assert site.local_standard_meridian == -120.0
예제 #16
0
def test_us_mountain_standard_meridian_calculation():
    # representative city: Salt Lake City, UT, USA
    site = Site(latitude=40.76, longitude=-111.89)

    assert site.local_standard_meridian == -105.0
예제 #17
0
def test_us_central_standard_meridian_calculation():
    # representative city: Saint Louis, MO, USA
    site = Site(latitude=38.63, longitude=-90.20)

    assert site.local_standard_meridian == -90.0