Ejemplo n.º 1
0
def test_leap_year():
    """Test clear sky with leap year."""
    location = Location(
        'Chicago Ohare Intl Ap', '-', 'USA', 41.98, -87.92, -6.0, 201.0)
    wea = Wea.from_ashrae_clear_sky(location, is_leap_year=True)

    assert wea.diffuse_horizontal_irradiance.datetimes[1416].month == 2
    assert wea.diffuse_horizontal_irradiance.datetimes[1416].day == 29
    assert wea.diffuse_horizontal_irradiance.datetimes[1416].hour == 0

    assert wea.diffuse_horizontal_irradiance.datetimes[1416 + 12].month == 2
    assert wea.diffuse_horizontal_irradiance.datetimes[1416 + 12].day == 29
    assert wea.diffuse_horizontal_irradiance.datetimes[1416 + 12].hour == 12
Ejemplo n.º 2
0
def test_from_clear_sky():
    """Test from original clear sky"""
    location = Location(
        'Chicago Ohare Intl Ap', '-', 'USA', 41.98, -87.92, -6.0, 201.0)
    wea_from_clear_sky = Wea.from_ashrae_clear_sky(location)

    assert wea_from_clear_sky.location.city == 'Chicago Ohare Intl Ap'
    assert wea_from_clear_sky.timestep == 1
    assert wea_from_clear_sky.diffuse_horizontal_irradiance[0] == \
        pytest.approx(0, rel=1e-3)
    assert wea_from_clear_sky.direct_normal_irradiance[0] == \
        pytest.approx(0, rel=1e-3)
    assert wea_from_clear_sky.diffuse_horizontal_irradiance[12] == \
        pytest.approx(60.72258, rel=1e-3)
    assert wea_from_clear_sky.direct_normal_irradiance[12] == \
        pytest.approx(857.00439, rel=1e-3)
Ejemplo n.º 3
0
    raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))


if all_required_inputs(ghenv.Component):
    stat_obj = STAT(_stat_file)

    # output location and climate zone
    location = stat_obj.location
    ashrae_zone = stat_obj.ashrae_climate_zone
    koppen_zone = stat_obj.koppen_climate_zone

    # output clear sky radiation
    try:  # first see if we can get the values from monthly optical depths
        wea = Wea.from_stat_file(_stat_file)
    except:  # no optical data was found; use the original clear sky
        wea = Wea.from_ashrae_clear_sky(location)
    clear_dir_norm_rad = wea.direct_normal_irradiance
    clear_diff_horiz_rad = wea.diffuse_horizontal_irradiance

    # output design day objects
    ann_heat_dday_996 = stat_obj.annual_heating_design_day_996
    ann_heat_dday_990 = stat_obj.annual_heating_design_day_990
    ann_cool_dday_004 = stat_obj.annual_cooling_design_day_004
    ann_cool_dday_010 = stat_obj.annual_cooling_design_day_010
    monthly_ddays_050 = stat_obj.monthly_cooling_design_days_050
    monthly_ddays_100 = stat_obj.monthly_cooling_design_days_100

    # output extreme and typical weeks
    extreme_cold_week = stat_obj.extreme_cold_week
    extreme_hot_week = stat_obj.extreme_hot_week
    typical_weeks = []
        clearness_: A factor that will be multiplied by the output of the model.
            This is to help account for locations where clear, dry skies predominate
            (e.g., at high elevations) or, conversely, where hazy and humid conditions
            are frequent. See Threlkeld and Jordan (1958) for recommended values.
            Typical values range from 0.95 to 1.05 and are usually never more than 1.2.
            Default is set to 1.0.
        timestep_: An integer representing the timestep with which to make the
            WEA object.  Default is set to 1 for 1 step per hour of the year.
    Returns:
        wea: A wea object from stat file. This wea object represents an original 
            ASHRAE Clear Sky, which is intended to determine peak solar load and
            sizing parmeters for HVAC systems.
"""

ghenv.Component.Name = "HoneybeePlus_ClearSky"
ghenv.Component.NickName = 'ClearSky'
ghenv.Component.Message = 'VER 0.0.05\nOCT_22_2018'
ghenv.Component.Category = "HoneybeePlus"
ghenv.Component.SubCategory = '02 :: Daylight :: Light Sources'
ghenv.Component.AdditionalHelpFromDocStrings = "3"

try:
    from ladybug.wea import Wea
except ImportError as e:
    raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))

if _location:
    timestep_ = 1 if timestep_ is None else timestep_
    clearness_ = 1 if clearness_ is None else clearness_
    wea = Wea.from_ashrae_clear_sky(_location, clearness_, timestep_)