Пример #1
0
def radiation_singleprocessing(cea_daysim, zone_building_names, locator,
                               settings, geometry_pickle_dir, num_processes):
    weather_path = locator.get_weather_file()
    # check inconsistencies and replace by max value of weather file
    weatherfile = epwreader.epw_reader(weather_path)
    max_global = weatherfile['glohorrad_Whm2'].max()

    list_of_building_names = [
        building_name for building_name in settings.buildings
        if building_name in zone_building_names
    ]
    # get chunks of buildings to iterate
    chunks = [
        list_of_building_names[i:i + settings.n_buildings_in_chunk] for i in
        range(0, len(list_of_building_names), settings.n_buildings_in_chunk)
    ]

    write_sensor_data = settings.write_sensor_data
    radiance_parameters = {
        "rad_ab": settings.rad_ab,
        "rad_ad": settings.rad_ad,
        "rad_as": settings.rad_as,
        "rad_ar": settings.rad_ar,
        "rad_aa": settings.rad_aa,
        "rad_lr": settings.rad_lr,
        "rad_st": settings.rad_st,
        "rad_sj": settings.rad_sj,
        "rad_lw": settings.rad_lw,
        "rad_dj": settings.rad_dj,
        "rad_ds": settings.rad_ds,
        "rad_dr": settings.rad_dr,
        "rad_dp": settings.rad_dp
    }
    grid_size = {
        "walls_grid": settings.walls_grid,
        "roof_grid": settings.roof_grid
    }

    num_chunks = len(chunks)
    if num_chunks == 1:
        for chunk_n, building_names in enumerate(chunks):
            daysim_main.isolation_daysim(chunk_n, cea_daysim, building_names,
                                         locator, radiance_parameters,
                                         write_sensor_data, grid_size,
                                         max_global, weatherfile,
                                         geometry_pickle_dir)
    else:
        vectorize(daysim_main.isolation_daysim,
                  num_processes)(range(0, num_chunks),
                                 repeat(cea_daysim, num_chunks), chunks,
                                 repeat(locator, num_chunks),
                                 repeat(radiance_parameters, num_chunks),
                                 repeat(write_sensor_data, num_chunks),
                                 repeat(grid_size, num_chunks),
                                 repeat(max_global, num_chunks),
                                 repeat(weatherfile, num_chunks),
                                 repeat(geometry_pickle_dir, num_chunks))
Пример #2
0
def radiation_singleprocessing(rad, bldg_dict_list, locator,
                               aweatherfile_path):

    # get chunks of buildings to iterate
    simul_params = settings.SIMUL_PARAMS
    chunks = [
        bldg_dict_list[i:i + simul_params['n_build_in_chunk']] for i in range(
            0, len(bldg_dict_list), simul_params['n_build_in_chunk'])
    ]

    for chunk_n, bldg_dict in enumerate(chunks):
        daysim_main.isolation_daysim(chunk_n, rad, bldg_dict, locator,
                                     settings.RAD_PARMS, aweatherfile_path)
Пример #3
0
def radiation_singleprocessing(rad, geometry_3D_zone, locator, settings):

    weather_path = locator.get_weather_file()
    # check inconsistencies and replace by max value of weather file
    weatherfile = epwreader.epw_reader(weather_path)
    max_global = weatherfile['glohorrad_Whm2'].max()

    selected_buildings = [bldg_dict for bldg_dict in geometry_3D_zone if bldg_dict['name'] in settings.buildings]
    # get chunks of buildings to iterate
    chunks = [selected_buildings[i:i + settings.n_buildings_in_chunk] for i in
              range(0, len(selected_buildings),
                    settings.n_buildings_in_chunk)]

    for chunk_n, building_dict in enumerate(chunks):
        daysim_main.isolation_daysim(chunk_n, rad, building_dict, locator, settings, max_global, weatherfile)
Пример #4
0
def radiation_singleprocessing(rad, geometry_3D_zone, locator, settings):
    if settings.buildings == []:
        # get chunks of buildings to iterate
        chunks = [
            geometry_3D_zone[i:i + settings.n_buildings_in_chunk] for i in
            range(0, len(geometry_3D_zone), settings.n_buildings_in_chunk)
        ]
    else:
        list_of_building_names = settings.buildings
        chunks = []
        for bldg_dict in geometry_3D_zone:
            if bldg_dict['name'] in list_of_building_names:
                chunks.append([bldg_dict])

    for chunk_n, building_dict in enumerate(chunks):
        daysim_main.isolation_daysim(chunk_n, rad, building_dict, locator,
                                     settings)
def radiation_singleprocessing(rad, geometry_3D_zone, locator, settings):

    weather_path = locator.get_weather_file()
    # check inconsistencies and replace by max value of weather file
    weatherfile = epwreader.epw_reader(weather_path)['glohorrad_Whm2'].values
    max_global = weatherfile.max()

    if settings.buildings == []:
        # get chunks of buildings to iterate
        chunks = [geometry_3D_zone[i:i + settings.n_buildings_in_chunk] for i in
                  range(0, len(geometry_3D_zone),
                        settings.n_buildings_in_chunk)]
    else:
        list_of_building_names = settings.buildings
        chunks = []
        for bldg_dict in geometry_3D_zone:
            if bldg_dict['name'] in list_of_building_names:
                chunks.append([bldg_dict])

    for chunk_n, building_dict in enumerate(chunks):
        daysim_main.isolation_daysim(chunk_n, rad, building_dict, locator, settings, max_global)
Пример #6
0
def radiation_singleprocessing(rad, bldg_dict_list, aresults_path, rad_params, aweatherfile_path):

    num_buildings = len(bldg_dict_list)
    chunk_n = None
    for i, bldg_dict in enumerate(bldg_dict_list):
        daysim_main.isolation_daysim(chunk_n, rad, bldg_dict, aresults_path, rad_params, aweatherfile_path)