# filter the radiation by _hoys if they are input if len(_hoys_) != 0: _direct_rad = _direct_rad.filter_by_hoys(_hoys_) _diffuse_rad = _diffuse_rad.filter_by_hoys(_hoys_) # create the wea and write it to the default_epw_folder wea = Wea(_location, _direct_rad, _diffuse_rad) wea_duration = len(wea) / wea.timestep wea_folder = _folder_ if _folder_ is not None else \ os.path.join(lb_folders.default_epw_folder, 'sky_matrices') metd = _direct_rad.header.metadata wea_basename = metd['city'].replace(' ', '_') if 'city' in metd else 'unnamed' wea_path = os.path.join(wea_folder, wea_basename) wea_file = wea.write(wea_path) # execute the Radiance gendaymtx command use_shell = True if os.name == 'nt' else False # command for direct patches cmds = [gendaymtx_exe, '-m', str(density), '-d', '-O1', '-A', wea_file] process = subprocess.Popen(cmds, stdout=subprocess.PIPE, shell=use_shell) stdout = process.communicate() dir_data_str = stdout[0] # command for diffuse patches cmds = [gendaymtx_exe, '-m', str(density), '-s', '-O1', '-A', wea_file] process = subprocess.Popen(cmds, stdout=subprocess.PIPE, shell=use_shell) stdout = process.communicate() diff_data_str = stdout[0] # parse the data into a single matrix
density = 2 if high_density_ else 1 # filter the radiation by _hoys if they are input if len(_hoys_) != 0: _direct_rad = _direct_rad.filter_by_hoys(_hoys_) _diffuse_rad = _diffuse_rad.filter_by_hoys(_hoys_) # create the wea and write it to the default_epw_folder wea = Wea(_location, _direct_rad, _diffuse_rad) wea_duration = len(wea) / wea.timestep wea_folder = _folder_ if _folder_ is not None else \ os.path.join(lb_folders.default_epw_folder, 'sky_matrices') metd = _direct_rad.header.metadata wea_basename = os.path.join(wea_folder, metd['city'].replace(' ', '_')) \ if 'city' in metd else 'unnamed' wea_file = wea.write(wea_basename) # execute the Radiance gendaymtx command use_shell = True if os.name == 'nt' else False # command for direct patches cmds = [gendaymtx_exe, '-m', str(density), '-d', '-O1', '-A', wea_file] process = subprocess.Popen(cmds, stdout=subprocess.PIPE, shell=use_shell) stdout = process.communicate() dir_data_str = stdout[0] # command for diffuse patches cmds = [gendaymtx_exe, '-m', str(density), '-s', '-O1', '-A', wea_file] process = subprocess.Popen(cmds, stdout=subprocess.PIPE, shell=use_shell) stdout = process.communicate() diff_data_str = stdout[0] # parse the data into a single matrix