コード例 #1
0
class CreateRadiantEnclosureInfo(Function):
    """Create JSONs with radiant enclosure information from a HBJSON input file.

    This enclosure info is intended to be consumed by thermal mapping functions.
    """

    model = Inputs.file(description='Path to input HBJSON file.',
                        path='model.hbjson')

    @command
    def hbjson_to_radiant_enclosure_info(self):
        return 'honeybee-radiance translate model-radiant-enclosure-info model.hbjson ' \
            '--folder output --log-file enclosure_list.json'

    enclosure_list = Outputs.dict(
        description=
        'A list of dictionaries that include information about generated '
        'radiant enclosure files.',
        path='enclosure_list.json')

    enclosure_list_file = Outputs.file(
        description=
        'A JSON file that includes information about generated radiant '
        'enclosure files.',
        path='enclosure_list.json')

    output_folder = Outputs.folder(
        description=
        'Output folder with the enclosure info JSONs for each grid.',
        path='output')
コード例 #2
0
class CreateLeedSkies(Function):
    """Generate two climate-based lear skies for LEED v4.1 Daylight Option 2."""

    wea = Inputs.file(
        description=
        'Path to a Typical Meteorological Year (TMY) .wea file. The file '
        'must be annual with a timestep of 1 for a non-leap year.',
        extensions=['wea'],
        path='sky.wea')

    north = Inputs.int(
        description='An angle for north direction. Default is 0.',
        default=0,
        spec={
            'type': 'integer',
            'maximum': 360,
            'minimum': 0
        })

    @command
    def create_leed_skies(self):
        return 'honeybee-radiance sky leed-illuminance sky.wea ' \
            '--north {{self.north}} --folder output --log-file output/sky_info.json'

    sky_list = Outputs.list(
        description='A JSON array containing the information about the two '
        'generated sky files.',
        path='output/sky_info.json')

    output_folder = Outputs.folder(
        description='Output folder with the generated sky files.',
        path='output')
コード例 #3
0
class CreateRadianceFolderView(Function):
    """Create a Radiance folder from a HBJSON input file."""

    input_model = Inputs.file(description='Path to input HBJSON file.',
                              path='model.hbjson')

    view_filter = Inputs.str(
        description='Text for a view identifer or a pattern to filter the views '
        'of the model that are simulated. For instance, first_floor_* will simulate '
        'only the views that have an identifier that starts with first_floor_. By '
        'default, all views in the model will be simulated.',
        default='*')

    @command
    def hbjson_to_rad_folder(self):
        return 'honeybee-radiance translate model-to-rad-folder model.hbjson ' \
            '--view "{{self.view_filter}}" --view-check'

    model_folder = Outputs.folder(description='Radiance folder.', path='model')

    views = Outputs.list(description='Views information.',
                         path='model/view/_info.json')

    views_file = Outputs.file(description='Views information JSON file.',
                              path='model/view/_info.json')
コード例 #4
0
class ModelToOsm(Function):
    """Translate a Model JSON file into an OpenStudio Model and corresponding IDF."""

    model = Inputs.file(
        description='Honeybee model in JSON format.', path='model.json',
        extensions=['hbjson', 'json']
    )

    sim_par = Inputs.file(
        description='SimulationParameter JSON that describes the settings for the '
        'simulation.', path='sim-par.json', extensions=['json']
    )

    @command
    def model_to_osm(self):
        return 'honeybee-energy translate model-to-osm model.json ' \
            '--sim-par-json sim-par.json --folder output ' \
            '--log-file output/output_paths.json'

    osm = Outputs.file(
        description='The OpenStudio model file.', path='output/run/in.osm'
    )

    idf = Outputs.file(
        description='The IDF file.', path='output/run/in.idf'
    )
コード例 #5
0
class SimulateIdf(Function):
    """Simulate an IDF file in EnergyPlus."""

    idf = Inputs.file(description='Path to a simulate-able IDF file.',
                      path='model.idf',
                      extensions=['idf'])

    epw = Inputs.file(description='Weather file.',
                      path='weather.epw',
                      extensions=['epw'])

    @command
    def simulate_model(self):
        return 'honeybee-energy simulate idf model.idf weather.epw --folder output'

    sql = Outputs.file(
        description='The result SQL file output by the simulation.',
        path='output/eplusout.sql')

    zsz = Outputs.file(
        description=
        'The result CSV with the zone loads over the design day output '
        'by the simulation.',
        path='output/epluszsz.csv',
        optional=True)

    html = Outputs.file(
        description='The result HTML page with summary reports output by the '
        'simulation.',
        path='output/eplustbl.htm')

    err = Outputs.file(
        description='The error report output by the simulation.',
        path='output/eplusout.err')
コード例 #6
0
class CreateSunMatrix(Function):
    """Generate a Radiance sun matrix (AKA sun-path)."""

    north = Inputs.int(
        description='An angle for north direction. Default is 0.',
        default=0,
        spec={
            'type': 'integer',
            'maximum': 360,
            'minimum': 0
        })

    wea = Inputs.file(description='Path to a wea file.',
                      extensions=['wea'],
                      path='sky.wea')

    output_type = Inputs.int(
        description='Output type. 0 is for visible and 1 is for solar.',
        default=0,
        spec={
            'type': 'integer',
            'maximum': 1,
            'minimum': 0
        })

    @command
    def generate_sun_matrix(self):
        return 'gendaymtx -n -D sunpath.mtx -M suns.mod -O{{self.output_type}} ' \
            '-r {{self.north}} -v sky.wea'

    sunpath = Outputs.file(description='Output sunpath matrix.',
                           path='sunpath.mtx')

    sun_modifiers = Outputs.file(
        description='List of sun modifiers in sunpath.', path='suns.mod')
コード例 #7
0
class SplitGrid(Function):
    """Split a single sensor grid file into multiple smaller grids."""

    sensor_count = Inputs.int(
        description='Number of maximum sensors in each generated grid.',
        spec={
            'type': 'integer',
            'minimum': 1
        })

    input_grid = Inputs.file(description='Input grid file.', path='grid.pts')

    @command
    def split_grid(self):
        return 'honeybee-radiance grid split grid.pts ' \
            '{{self.sensor_count}} --folder output --log-file output/grids_info.json'

    grids_list = Outputs.list(
        description=
        'A JSON array that includes information about generated sensor '
        'grids.',
        path='output/grids_info.json')

    output_folder = Outputs.folder(
        description='Output folder with new sensor grids.', path='output')
コード例 #8
0
class MapResultInfo(Function):
    """Get a JSON that specifies the data type and units for comfort map outputs."""

    comfort_model = Inputs.str(
        description='Text for the comfort model of the thermal mapping '
        'simulation. Choose from: pmv, adaptive, utci.',
        spec={
            'type': 'string',
            'enum': ['pmv', 'adaptive', 'utci']
        })

    run_period = Inputs.str(
        description=
        'The AnalysisPeriod string that dictates the start and end of '
        'the analysis (eg. "6/21 to 9/21 between 8 and 16 @1"). If unspecified, it '
        'will be assumed results are for a full year.',
        default='')

    qualifier = Inputs.str(
        description=
        'Text for any options used on the comfort map simulation that '
        'change the output data type of results. For example, the write-set-map text '
        'of the pmv map can be passed here to ensure the output of this command is '
        'for SET instead of operative temperature.',
        default='')

    @command
    def map_results_information(self):
        return 'ladybug-comfort map map-result-info {{self.comfort_model}} ' \
            '--run-period "{{self.run_period}}" --qualifier "{{self.qualifier}}" ' \
            '--folder output --log-file results_info.json'

    results_info_file = Outputs.file(
        description=
        'A JSON that specifies the data type and units for all comfort map '
        'outputs.',
        path='results_info.json')

    viz_config_file = Outputs.file(
        description=
        'A JSON that specifies configurations for VTK visualizations.',
        path='output/config.json')

    temperature_info = Outputs.file(
        description=
        'A JSON that specifies the data type and units for temperature map '
        'results.',
        path='output/temperature.json')

    condition_info = Outputs.file(
        description='A JSON that specifies the data type and units for thermal '
        'condition map results.',
        path='output/condition.json')

    condition_intensity_info = Outputs.file(
        description='A JSON that specifies the data type and units for '
        'condition intensity map results.',
        path='output/condition_intensity.json')
コード例 #9
0
class BaselineOrientationSimPars(Function):
    """Get SimulationParameters with different north angles for a baseline building sim.
    """

    ddy = Inputs.file(
        description='A DDY file with design days to be included in the '
        'SimulationParameter',
        path='input.ddy',
        extensions=['ddy'])

    run_period = Inputs.str(
        description=
        'An AnalysisPeriod string or an IDF RunPeriod string to set the '
        'start and end dates of the simulation (eg. "6/21 to 9/21 between 0 and 23 @1").'
        ' If None, the simulation will be annual.',
        default='')

    north = Inputs.int(
        description=
        'A number from -360 to 360 for the counterclockwise difference '
        'between North and the positive Y-axis in degrees. 90 is west; 270 is east',
        default=0,
        spec={
            'type': 'integer',
            'maximum': 360,
            'minimum': -360
        })

    filter_des_days = Inputs.str(
        description=
        'A switch for whether the ddy-file should be filtered to only '
        'include 99.6 and 0.4 design days',
        default='filter-des-days',
        spec={
            'type': 'string',
            'enum': ['filter-des-days', 'all-des-days']
        })

    @command
    def baseline_orientation_sim_pars(self):
        return 'honeybee-energy settings orientation-sim-pars input.ddy ' \
            '0 90 180 270 --run-period "{{self.run_period}}" --start-north ' \
            '{{self.north}} --{{self.filter_des_days}} --folder output ' \
            '--log-file output/sim_par_info.json'

    sim_par_list = Outputs.dict(
        description=
        'A JSON array that includes information about generated simulation '
        'parameters.',
        path='output/sim_par_info.json')

    output_folder = Outputs.folder(
        description='Output folder with the simulation parameters.',
        path='output')
コード例 #10
0
class Tcp(Function):
    """Compute Thermal Comfort Petcent (TCP) from thermal condition CSV map."""

    condition_csv = Inputs.file(
        description=
        'A CSV file of thermal conditions output by a thermal mapping '
        'function.',
        path='condition.csv',
        extensions=['csv', 'cond'])

    enclosure_info = Inputs.file(
        description='A JSON file containing information about the radiant '
        'enclosure that sensor points belong to.',
        path='enclosure_info.json',
        extensions=['json'])

    occ_schedule_json = Inputs.file(
        description='An occupancy schedule JSON output by the honeybee-energy '
        'model-occ-schedules function.',
        path='occ_schedule.json',
        extensions=['json'])

    schedule = Inputs.file(
        description=
        'An optional path to a CSV file to specify the relevant times '
        'during which comfort should be evaluated. If specified, this will override '
        'the occ-schedule-json for both indoor and outdoor conditions. Values '
        'should be 0-1 separated by new line.',
        path='schedule.txt',
        optional=True)

    @command
    def compute_tcp(self):
        return 'ladybug-comfort map tcp condition.csv enclosure_info.json ' \
            '--schedule schedule.txt --occ-schedule-json occ_schedule.json ' \
            '--folder output'

    tcp = Outputs.file(
        description='A CSV that contains the Thermal Comfort Percent (TCP) for '
        'each sensor.',
        path='output/tcp.csv')

    hsp = Outputs.file(
        description='A CSV that contains the Heat Sensation Percent (HSP) for '
        'each sensor.',
        path='output/hsp.csv')

    csp = Outputs.file(
        description='A CSV that contains the Cold Sensation Percent (CSP) for '
        'each sensor.',
        path='output/csp.csv')
コード例 #11
0
class CreateOctree(Function):
    """Generate an octree from a Radiance folder."""

    # inputs
    include_aperture = Inputs.str(
        default='include',
        description=
        'A value to indicate if the static aperture should be included in '
        'octree. Valid values are include and exclude. Default is include.',
        spec={
            'type': 'string',
            'enum': ['include', 'exclude']
        })

    black_out = Inputs.str(
        default='default',
        description=
        'A value to indicate if the black material should be used. Valid '
        'values are default and black. Default value is default.',
        spec={
            'type': 'string',
            'enum': ['black', 'default']
        })

    model = Inputs.folder(description='Path to Radiance model folder.',
                          path='model')

    @command
    def create_octree(self):
        return 'honeybee-radiance octree from-folder model --output scene.oct ' \
            '--{{self.include_aperture}}-aperture --{{self.black_out}}'

    # outputs
    scene_file = Outputs.file(description='Output octree file.',
                              path='scene.oct')
コード例 #12
0
class AdjustSkyForMetric(Function):
    """Adjust a sky file to ensure it is suitable for a given metric.

    Specifcally, this ensures that skies being created with gendaylit have a -O
    option that aligns with visible vs. solar energy.
    """

    sky = Inputs.file(
        description='Path to a .sky file to be adjusted based on the metric.',
        path='input.sky')

    metric = Inputs.str(
        description=
        'Text for the type of metric to be output from the calculation. '
        'Choose from: illuminance, irradiance, luminance, radiance.',
        default='illuminance',
        spec={
            'type': 'string',
            'enum': ['illuminance', 'irradiance', 'luminance', 'radiance']
        })

    @command
    def adjust_sky_for_metric(self):
        return 'honeybee-radiance sky adjust-for-metric {{self.sky}} ' \
            '--metric {{self.metric}}'

    adjusted_sky = Outputs.file(description='Adjusted sky file.',
                                path='{{self.metric}}.sky')
コード例 #13
0
class EpwToWea(Function):
    """Translate an .epw file to a .wea file."""

    epw = Inputs.file(description='Weather file.',
                      path='weather.epw',
                      extensions=['epw'])

    period = Inputs.str(
        description=
        'An AnalysisPeriod string to filter the datetimes in the resulting '
        'Wea (eg. "6/21 to 9/21 between 8 and 16 @1"). Note that the timestep '
        'of the analysis period should match the input timestep and a * must be at '
        'the end of the string if the input epw is for a leap year. If None, '
        'the Wea will be annual.',
        default='')

    timestep = Inputs.int(
        description=
        'An integer to set the number of time steps per hour. Default is 1 '
        'for one value per hour. Note that this input will only do a linear '
        'interpolation over the data in the epw file.',
        default=1)

    @command
    def epw_to_wea(self):
        return 'ladybug translate epw-to-wea weather.epw ' \
            '--analysis-period "{{self.period}}" --timestep {{self.timestep}} ' \
            '--output-file weather.wea'

    wea = Outputs.file(description='A wea file generated from the input epw.',
                       path='weather.wea')
コード例 #14
0
class WeaToConstant(Function):
    """Convert a Wea file to have a constant value for each datetime.

    This is useful in workflows where hourly irradiance values are inconsequential
    to the analysis and one is only using the Wea as a format to pass location
    and datetime information (eg. for direct sun hours).
    """

    wea = Inputs.file(
        description='Wea file with irradiance values to be set to constant.',
        path='weather.wea',
        extensions=['wea'])

    value = Inputs.int(
        description=
        'The direct and diffuse irradiance value that will be written '
        'in for all datetimes of the Wea.',
        default=1000)

    @command
    def wea_to_constant(self):
        return 'ladybug translate wea-to-constant weather.wea ' \
            '--value {{self.value}} --output-file constant.wea'

    constant_wea = Outputs.file(
        description=
        'A wea file with constant irradiance values for each datetime.',
        path='constant.wea')
コード例 #15
0
class WindowsByRatio(Function):
    """Add windows to all outdoor walls of a model given a ratio."""

    model = Inputs.file(description='Dragonfly model in JSON format.',
                        path='model.dfjson',
                        extensions=['dfjson', 'json'])

    ratio = Inputs.str(
        description=
        'A number between 0 and 1 (but not perfectly equal to 1) for the '
        'desired ratio between window area and wall area. If multiple values are '
        'input here (each separated by a space), different WindowParameters will be '
        'assigned based on cardinal direction, starting with north and moving '
        'clockwise.',
        default='0.4')

    @command
    def windows_by_ratio(self):
        return 'dragonfly edit windows-by-ratio model.dfjson {{self.ratio}} ' \
            '--output-file new_model.dfjson'

    new_model = Outputs.file(
        description='Dragonfly Model JSON with window parameters set based on '
        'the input ratio.',
        path='new_model.dfjson')
コード例 #16
0
class MergeImages(Function):
    """Merge several .HDR image files with similar starting name into one."""

    folder = Inputs.folder(
        description='Target folder with the input .HDR image files.',
        path='input_folder')

    name = Inputs.str(description='Base name for files to be merged.',
                      default='view')

    extension = Inputs.str(
        description='File extension including the . before the extension '
        '(e.g. .HDR, .pic, .unf)',
        default='.unf')

    scale_factor = Inputs.float(
        description='A number that will be used to scale the dimensions of the '
        'output image as it is filtered for anti-aliasing.',
        default=1)

    @command
    def merge_files(self):
        return 'honeybee-radiance view merge input_folder view ' \
            '{{self.extension}} --scale-factor {{self.scale_factor}} ' \
            '--name {{self.name}}'

    result_image = Outputs.file(description='Output combined image file.',
                                path='{{self.name}}.HDR')
コード例 #17
0
class ModelOccSchedules(Function):
    """Translate a Model's occupancy schedules into a JSON of 0/1 values.

    This JSON is useful in workflows that compute thermal comfort percent,
    daylight autonomy, etc.
    """

    model = Inputs.file(
        description='Honeybee model in JSON format.', path='model.json',
        extensions=['hbjson', 'json']
    )

    period = Inputs.str(
        description='An AnalysisPeriod string to dictate the start and end of the '
        'exported occupancy values (eg. "6/21 to 9/21 between 0 and 23 @1"). Note '
        'that the timestep of the period will determine the timestep of output '
        'values. If unspecified, the values will be annual.', default=''
    )

    threshold = Inputs.float(
        description='A number between 0 and 1 for the threshold at and above which '
        'a schedule value is considered occupied.', default=0.1,
        spec={'type': 'number', 'maximum': 1, 'minimum': 0}
    )

    @command
    def export_model_occ_schedules(self):
        return 'honeybee-energy translate model-occ-schedules model.json ' \
            '--threshold {{self.threshold}} --period "{{self.period}}" ' \
            '--output-file occ_schedules.json'

    occ_schedule_json = Outputs.file(
        description='An occupancy schedule JSON that is useful in workflows like '
        'thermal comfort percent, daylight autonomy, etc.', path='occ_schedules.json'
    )
コード例 #18
0
class RayTracingPicture(Function):
    """Run ray-tracing with rpict command for an input octree and a view file.."""

    view = Inputs.file(description='Input view file.', path='view.vf')

    scene_file = Inputs.file(
        description='Path to an octree file to describe the scene.',
        path='scene.oct')

    radiance_parameters = Inputs.str(
        description='Radiance parameters to be exposed within recipes. -h is '
        'usually already included in the fixed_radiance_parameters and -I will '
        'be overwritten based on the input metric.',
        default='-ab 2')

    metric = Inputs.str(
        description=
        'Text for the type of metric to be output from the calculation. '
        'Choose from: illuminance, irradiance, luminance, radiance.',
        default='luminance',
        spec={
            'type': 'string',
            'enum': ['illuminance', 'irradiance', 'luminance', 'radiance']
        })

    resolution = Inputs.int(
        description=
        'An integer for the maximum dimension of the image in pixels '
        '(either width or height depending on the input view angle and type).',
        spec={
            'type': 'integer',
            'minimum': 1
        },
        default=512)

    scale_factor = Inputs.float(
        description=
        'A number that will be multiplied by the input resolution to '
        'scale the dimensions of the output image. This is useful in workflows if '
        'one plans to re-scale the image after the ray tracing calculation to '
        'improve anti-aliasing.',
        default=1)

    ambient_cache = Inputs.file(
        description='Path to the ambient cache if an overture calculation was '
        'specified. If unspecified, no ambient cache will be used.',
        path='view.amb',
        optional=True)

    @command
    def ray_tracing(self):
        return 'honeybee-radiance rpict rpict scene.oct view.vf ' \
            '--rad-params "{{self.radiance_parameters}}" --metric {{self.metric}} ' \
            '--resolution {{self.resolution}} --scale-factor {{self.scale_factor}} ' \
            '--output view.HDR'

    result_image = Outputs.file(
        description='Path to the High Dynamic Range (HDR) image file of the '
        'input view.',
        path='view.HDR')
コード例 #19
0
class MergeFiles(Function):
    """Merge several files with similar starting name into one."""

    name = Inputs.str(
        description='Base name for files to be merged.',
        default='grid'
    )

    extension = Inputs.str(
        description='File extension including the . before the extension (e.g. .res, '
        '.ill)'
    )

    folder = Inputs.folder(
        description='Target folder with the input files.',
        path='input_folder'
    )

    @command
    def merge_files(self):
        return 'honeybee-radiance grid merge input_folder grid ' \
            ' {{self.extension}} --name {{self.name}}'

    result_file = Outputs.file(
        description='Output result file.', path='{{self.name}}{{self.extension}}'
    )
コード例 #20
0
class CreateSkyMatrix(Function):
    """Generate a sun-up sky matrix."""

    north = Inputs.int(
        description='An angle for north direction. Default is 0.',
        default=0,
        spec={
            'type': 'integer',
            'maximum': 360,
            'minimum': 0
        })

    sky_component = Inputs.str(
        description='A switch for generating sun-only using -d or exclude sun '
        'contribution using -s. The default is an empty string for including both.',
        default=' ',
        spec={
            'type': 'string',
            'enum': ['-s', '-d', ' ']
        })

    wea = Inputs.file(description='Path to a wea file.',
                      extensions=['wea'],
                      path='sky.wea')

    @command
    def generate_sky_matrix(self):
        return 'gendaymtx -u -O0 -r {{self.north}} -v {{self.sky_component}} sky.wea > sky.mtx'

    sky_matrix = Outputs.file(description='Output Sky matrix', path='sky.mtx')
コード例 #21
0
class EnergyUseIntensity(Function):
    """Get information about energy use intensity from energy simulation SQLite files."""

    result_folder = Inputs.folder(
        description='Path to folder containing SQLite files that were generated '
        'by EnergyPlus. This can be a single EnergyPlus simulation folder or '
        'it can be a folder with multiple sql files, in which case EUI will '
        'be computed across all results.',
        path='result_folder')

    units = Inputs.str(
        description=
        'A switch to indicate whether the data in the resulting JSON '
        'should be in SI or IP units. Valid values are "si" and "ip".',
        default='si',
        spec={
            'type': 'string',
            'enum': ['si', 'ip']
        })

    @command
    def energy_use_intensity(self):
        return 'honeybee-energy result energy-use-intensity result_folder ' \
            '--{{inputs.units}} --output-file output.json'

    eui_json = Outputs.file(
        description=
        'A JSON object with the following keys - eui, total_floor_area, '
        'total_energy, end_uses. The eui value is the energy use intensity across '
        'the total floor area. The end_uses value is a dictionary containing a '
        'breakdown of the eui by end use.',
        path='output.json')
コード例 #22
0
class SumRow(Function):
    """Postprocess a Radiance matrix and add all the numbers in each row.

    This function is useful for translating Radiance results to outputs like radiation
    to total radiation. Input matrix must be in ASCII format. The header in the input
    file will be ignored.
    """

    # inputs
    input_mtx = Inputs.file(
        description='Input Radiance matrix in ASCII format', path='input.mtx')

    divisor = Inputs.float(
        description=
        'An optional number, that the summed row will be divided by. '
        'For example, this can be a timestep, which can be used to ensure that a '
        'summed row of irradiance yields cumulative radiation over the entire '
        'time period of the matrix.',
        default=1)

    @command
    def sum_mtx_row(self):
        return 'honeybee-radiance post-process sum-row input.mtx ' \
            '--divisor {{self.divisor}} --output sum.mtx'

    # outputs
    output_mtx = Outputs.file(description='Newly created sum matrix.',
                              path='sum.mtx')
コード例 #23
0
class CreateRadianceFolder(Function):
    """Create a Radiance folder from a HBJSON input file.

    This function creates the folder but doesn't expose information for sensor grids
    and views.
    """

    input_model = Inputs.file(description='Path to input HBJSON file.',
                              path='model.hbjson')

    grid_filter = Inputs.str(
        description=
        'Text for a grid identifer or a pattern to filter the sensor grids '
        'of the model that are simulated. For instance, first_floor_* will simulate '
        'only the sensor grids that have an identifier that starts with '
        'first_floor_. By default, all grids in the model will be simulated.',
        default='*')

    view_filter = Inputs.str(
        description='Text for a view identifer or a pattern to filter the views '
        'of the model that are simulated. For instance, first_floor_* will simulate '
        'only the views that have an identifier that starts with first_floor_. By '
        'default, all views in the model will be simulated.',
        default='*')

    @command
    def hbjson_to_rad_folder(self):
        return 'honeybee-radiance translate model-to-rad-folder model.hbjson ' \
            '--grid "{{self.grid_filter}}" --view "{{self.view_filter}}"'

    model_folder = Outputs.folder(description='Radiance folder.', path='model')
コード例 #24
0
class CreateSkyDome(Function):
    """Create a skydome for daylight coefficient studies."""
    @command
    def gen_sky_dome(self):
        return 'honeybee-radiance sky skydome --name rflux_sky.sky'

    sky_dome = Outputs.file(description='A sky hemisphere with ground.',
                            path='rflux_sky.sky')
コード例 #25
0
class AnnualIrradianceMetrics(Function):
    """Calculate annual irradiance metrics for annual irradiance simulation."""

    folder = Inputs.folder(
        description='A folder output from and annual irradiance recipe.',
        path='raw_results')

    wea = Inputs.file(
        description=
        'The .wea file that was used in the annual irradiance simulation. '
        'This will be used to determine the duration of the analysis for computing '
        'average irradiance.',
        path='weather.wea')

    timestep = Inputs.int(
        description='The timestep of the Wea file, which is used to ensure the '
        'summed row of irradiance yields cumulative radiation over the time '
        'period of the Wea.',
        default=1)

    @command
    def calculate_irradiance_metrics(self):
        return 'honeybee-radiance post-process annual-irradiance raw_results ' \
            'weather.wea --timestep {{self.timestep}} --sub-folder ../metrics'

    # outputs
    metrics = Outputs.folder(
        description='Annual irradiance metrics folder. This folder includes all '
        'the other subfolders which are exposed as separate outputs.',
        path='metrics')

    average_irradiance = Outputs.folder(
        description=
        'Average irradiance in W/m2 for each sensor over the wea period.',
        path='metrics/average_irradiance')

    peak_irradiance = Outputs.folder(
        description=
        'The highest irradiance value in W/m2 for each sensor during '
        'the wea period.',
        path='metrics/average_irradiance')

    cumulative_radiation = Outputs.folder(
        description='The cumulative radiation in kWh/m2 for each sensor over '
        'the wea period.',
        path='metrics/cumulative_radiation')
コード例 #26
0
class ResultCsvQueryable(Function):
    """Get a CSV of energy simulation results as an easily query-able SQLite table."""

    result_sql = Inputs.file(
        description='A SQLite file that was generated by EnergyPlus.',
        path='result.sql',
        extensions=['sql', 'db', 'sqlite'])

    model = Inputs.file(
        description=
        'Honeybee model in JSON format that will be matched to results '
        'in the result sql and used to account for triangulated sub-faces, room '
        'multipliers, and any area normalization of results.',
        path='model.json',
        extensions=['hbjson', 'json'])

    output_name = Inputs.str(
        description=
        'An EnergyPlus output name to be retrieved from the result-sql. '
        '(eg. Zone Operative Temperature). This can also be a JSON array of names '
        'formatted with [] brackets.')

    run_period = Inputs.str(
        description='The name of the run period from which the CSV data will be '
        'selected. (eg. BOSTON LOGAN INTL ARPT ANN CLG .4% CONDNS DB=>MWB).')

    units = Inputs.str(
        description='A switch to indicate whether the data in the resulting CSV '
        'should be in SI or IP units. Valid values are "si" and "ip".',
        default='si',
        spec={
            'type': 'string',
            'enum': ['si', 'ip']
        })

    normalization = Inputs.str(
        description=
        'A switch to indicate whether the data in the resulting CSV should '
        'be normalized by floor area (in the case of Zone/System data) or surface '
        'area (in the case of Surface data). This has no effect if the requested '
        'data is not normalizable. Valid values are "normalize" and "no-normalize".',
        default='normalize',
        spec={
            'type': 'string',
            'enum': ['normalize', 'no-normalize']
        })

    @command
    def result_csv_queryable(self):
        return 'honeybee-energy result output-csv-queryable result.sql model.json ' \
            '"{{inputs.run-period}}" "{{inputs.output_name}}" --{{inputs.units}} ' \
            '--{{inputs.normalization}} --folder output --log-file output/col_names.json'

    column_names = Outputs.file(
        description='A list of DataCollection JSONs that match the requested '
        'output name.',
        path='output.json')
コード例 #27
0
class ConvertToBinary(Function):
    """Convert a Radiance matrix to a new matrix with 0-1 values."""

    # inputs
    input_mtx = Inputs.file(
        description='Input Radiance matrix in ASCII format', path='input.mtx')

    minimum = Inputs.float(
        description='Minimum range for the values that will be converted to 1.',
        default=-1 * 10**100)

    maximum = Inputs.float(
        description='Maximum range for the values that will be converted to 1.',
        default=10**100)

    include_min = Inputs.str(
        description=
        'A flag to include the minimum threshold itself. By default the '
        'threshold value will be included.',
        default='include',
        spec={
            'type': 'string',
            'enum': ['include', 'exclude']
        })

    include_max = Inputs.str(
        description=
        'A flag to include the maximum threshold itself. By default the '
        'threshold value will be included.',
        default='include',
        spec={
            'type': 'string',
            'enum': ['include', 'exclude']
        })

    reverse = Inputs.str(
        description=
        'A flag to reverse the selection logic. This is useful for cases '
        'that you want to all the values outside a certain range to be converted to 1. '
        'By default the input logic will be used as is.',
        default='comply',
        spec={
            'type': 'string',
            'enum': ['comply', 'reverse']
        })

    @command
    def convert_to_zero_one(self):
        return 'honeybee-radiance post-process convert-to-binary input.mtx ' \
            '--output binary.mtx --maximum {{self.maximum}} ' \
            '--minimum {{self.minimum}} --{{self.reverse}} ' \
            '--{{self.include_min}}-min --{{self.include_max}}-max'

    # outputs
    output_mtx = Outputs.file(description='Newly created binary matrix.',
                              path='binary.mtx')
コード例 #28
0
class DaylightContribution(Function):
    """
    Calculate daylight contribution for a grid of sensors from a series of modifiers
    using rcontrib command.
    """

    radiance_parameters = Inputs.str(
        description='Radiance parameters. -I and -aa 0 are already included in '
        'the command.',
        default='')

    fixed_radiance_parameters = Inputs.str(
        description='Radiance parameters. -I and -aa 0 are already included in '
        'the command.',
        default='-aa 0')

    calculate_values = Inputs.str(
        description='A switch to indicate if the values should be multiplied. '
        'Otherwise the contribution is calculated as a coefficient. Default is set to '
        'value. Use coeff for contribution',
        default='value',
        spec={
            'type': 'string',
            'enum': ['value', 'coeff']
        })

    sensor_count = Inputs.int(
        description='Number of maximum sensors in each generated grid.',
        spec={
            'type': 'integer',
            'minimum': 1
        })

    modifiers = Inputs.file(
        description=
        'Path to modifiers file. In most cases modifiers are sun modifiers.',
        path='suns.mod')

    sensor_grid = Inputs.file(description='Path to sensor grid files.',
                              path='grid.pts',
                              extensions=['pts'])

    scene_file = Inputs.file(
        description='Path to an octree file to describe the scene.',
        path='scene.oct',
        extensions=['oct'])

    @command
    def run_daylight_coeff(self):
        return 'honeybee-radiance dc scontrib scene.oct grid.pts suns.mod ' \
            '--{{self.calculate_values}} --sensor-count {{self.sensor_count}} ' \
            '--rad-params "{{self.radiance_parameters}}" --rad-params-locked ' \
            '"{{self.fixed_radiance_parameters}}" --output results.ill'

    result_file = Outputs.file(description='Output result file.',
                               path='results.ill')
コード例 #29
0
class Count(Function):
    """Count values in a row that meet a certain criteria."""

    # inputs
    input_mtx = Inputs.file(
        description='Input Radiance matrix in ASCII format', path='input.mtx')

    minimum = Inputs.float(
        description='Minimum range for the values that should be counted.',
        default=-1 * 10**100)

    maximum = Inputs.float(
        description='Maximum range for the values that should be counted.',
        default=10**100)

    include_min = Inputs.str(
        description=
        'A flag to include the minimum threshold itself. By default the '
        'threshold value will be included.',
        default='include',
        spec={
            'type': 'string',
            'enum': ['include', 'exclude']
        })

    include_max = Inputs.str(
        description=
        'A flag to include the maximum threshold itself. By default the '
        'threshold value will be included.',
        default='include',
        spec={
            'type': 'string',
            'enum': ['include', 'exclude']
        })

    reverse = Inputs.str(
        description=
        'A flag to reverse the selection logic. This is useful for cases '
        'that you want to all the values outside a certain range. By default the input '
        'logic will be used as is.',
        default='comply',
        spec={
            'type': 'string',
            'enum': ['comply', 'reverse']
        })

    @command
    def count_values(self):
        return 'honeybee-radiance post-process count input.mtx ' \
            '--output counter.mtx --maximum {{self.maximum}} ' \
            '--minimum {{self.minimum}} --{{self.reverse}} ' \
            '--{{self.include_min}}-min --{{self.include_max}}-max'

    # outputs
    output_mtx = Outputs.file(description='Newly created binary matrix.',
                              path='counter.mtx')
コード例 #30
0
class LeedIlluminanceCredits(Function):
    """Estimate LEED daylight credits from two point-in-time illuminance folders."""

    folder = Inputs.folder(
        description=
        'Project folder for a LEED illuminance simulation. It should '
        'contain a HBJSON model and two sub-folders of complete point-in-time '
        'illuminance simulations labeled "9AM" and "3PM". These two sub-folders should '
        'each have results folders that include a grids_info.json and .res files with '
        'illuminance values for each sensor. If Meshes are found for the sensor '
        'grids in the HBJSON file, they will be used to compute percentages '
        'of occupied floor area that pass vs. fail. Otherwise, all sensors will '
        'be assumed to represent an equal amount of floor area.',
        path='raw_results')

    glare_control_devices = Inputs.str(
        description=
        'A switch to note whether the model has "view-preserving automatic '
        '(with manual override) glare-control devices," which means that illuminance '
        'only needs to be above 300 lux and not between 300 and 3000 lux.',
        default='glare-control',
        spec={
            'type': 'string',
            'enum': ['glare-control', 'no-glare-control']
        })

    @command
    def calculate_leed_credits(self):
        return 'honeybee-radiance post-process leed-illuminance raw_results ' \
            '--{{self.glare_control_devices}} --sub-folder ../pass_fail ' \
            '--output-file credit_summary.json'

    # outputs
    pass_fail_results = Outputs.folder(
        description='Pass/Fail results folder. This folder includes results for '
        'each sensor indicating whether they pass or fail the LEED criteria.',
        path='pass_fail')

    credit_summary = Outputs.folder(
        description=
        'JSON file containing the number of LEED credits achieved and '
        'a summary of the percentage of the sensor grid area that meets the criteria.',
        path='credit_summary.json')