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')

    bsdf_folder = Outputs.folder(
        description='Folder containing any BSDF files needed for the simulation.',
        path='model/bsdf', optional=True
    )

    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'
    )
Пример #2
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')
Пример #3
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')
Пример #4
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')
Пример #5
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')
class CreateRadianceFolderGrid(Function):
    """Create a Radiance folder from a HBJSON input file."""

    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='*'
    )

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

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

    bsdf_folder = Outputs.folder(
        description='Folder containing any BSDF files needed for the simulation.',
        path='model/bsdf', optional=True
    )

    sensor_grids = Outputs.list(
        description='Information for exported sensor grids in grids subfolder.',
        path='model/grid/_info.json'
    )

    sensor_grids_file = Outputs.file(
        description='Information JSON file for exported sensor grids in grids '
        'subfolder.', path='model/grid/_info.json'
    )

    model_sensor_grids = Outputs.list(
        description='Sensor grids information from the HB model.',
        path='model/grid/_model_grids_info.json'
    )

    model_sensor_grids_file = Outputs.file(
        description='Sensor grids information from the HB model JSON file.',
        path='model/grid/_model_grids_info.json'
    )
Пример #7
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')
Пример #8
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')
Пример #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 AnnualDaylightMetrics(Function):
    """Calculate annual daylight metrics for annual daylight simulation."""

    folder = Inputs.folder(
        description='This folder is an output folder of annual daylight recipe. Folder '
        'should include grids_info.json and sun-up-hours.txt. The command uses the list '
        'in grids_info.json to find the result files for each sensor grid.',
        path='raw_results'
    )

    schedule = Inputs.file(
        description='Path to an annual schedule file. Values should be 0-1 separated '
        'by new line. If not provided an 8-5 annual schedule will be created.',
        path='schedule.txt', optional=True
    )

    thresholds = Inputs.str(
        description='A string to change the threshold for daylight autonomy and useful '
        'daylight illuminance. Valid keys are -t for daylight autonomy threshold, -lt '
        'for the lower threshold for useful daylight illuminance and -ut for the upper '
        'threshold. The defult is -t 300 -lt 100 -ut 3000. The order of the keys is not '
        'important and you can include one or all of them. For instance if you only '
        'want to change the upper threshold to 2000 lux you should use -ut 2000 as '
        'the input.', default='-t 300 -lt 100 -ut 3000'
    )

    @command
    def calculate_annual_metrics(self):
        return 'honeybee-radiance post-process annual-daylight raw_results ' \
            '--schedule schedule.txt {{self.thresholds}} --sub_folder ../metrics'

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

    daylight_autonomy = Outputs.folder(
        description='Daylight autonomy results.', path='metrics/da'
    )

    continuous_daylight_autonomy = Outputs.folder(
        description='Continuous daylight autonomy results.', path='metrics/cda'
    )

    useful_daylight_illuminance_lower = Outputs.folder(
        description='Lower useful daylight illuminance results.',
        path='metrics/udi_lower'
    )

    useful_daylight_illuminance = Outputs.folder(
        description='Useful daylight illuminance results.', path='metrics/udi'
    )

    useful_daylight_illuminance_upper = Outputs.folder(
        description='Upper useful daylight illuminance results.',
        path='metrics/udi_upper'
    )
Пример #11
0
class CreateRadianceFolder(Function):
    """Create a Radiance folder from a HBJSON input file."""

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

    @command
    def hbjson_to_rad_folder(self):
        return 'honeybee-radiance translate model-to-rad-folder model.hbjson'

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

    sensor_grids = Outputs.list(
        description='Sensor grids information.', path='model/grid/_info.json'
    )

    sensor_grids_file = Outputs.file(
        description='Sensor grids information JSON file.', path='model/grid/_info.json'
    )
class ModelToHoneybee(Function):
    """Translate a Dragonfly Model JSON file into several Honeybee Models."""

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

    obj_per_model = Inputs.str(
        description=
        'Text to describe how the input Model should be divided across the '
        'output Models. Choose from: District, Building, Story.',
        default='Story',
        spec={
            'type': 'string',
            'enum': ['District', 'Building', 'Story']
        })

    use_multiplier = Inputs.str(
        description=
        'A switch to note whether the multipliers on each Building story '
        'should be passed along to the generated Honeybee Room objects or if full '
        'geometry objects should be written for each story in the building.',
        default='full-geometry',
        spec={
            'type': 'string',
            'enum': ['full-geometry', 'multiplier']
        })

    include_plenum = Inputs.str(
        description=
        'A switch to indicate whether ceiling/floor plenums should be '
        'auto-generated for the Rooms.',
        default='no-plenum',
        spec={
            'type': 'string',
            'enum': ['no-plenum', 'plenum']
        })

    shade_dist = Inputs.str(
        description=
        'A number to note the distance beyond which other buildings shade '
        'should be excluded from a given Honeybee Model. This can include the units of '
        'the distance (eg. 100ft) or, if no units are provided, the value will be '
        'interpreted in the dragonfly model units. If 0, shade from all neighboring '
        'buildings will be excluded from the resulting models.',
        default='50m')

    @command
    def model_to_honeybee(self):
        return 'dragonfly translate model-to-honeybee model.dfjson ' \
            '--obj-per-model {{self.obj_per_model}} --{{self.use_multiplier}} ' \
            '--{{self.include_plenum}} --shade-dist {{self.shade_dist}} ' \
            '--folder output --log-file output/hbjson_info.json'

    hbjson_list = Outputs.dict(
        description=
        'A JSON array that includes information about generated honeybee '
        'models.',
        path='output/hbjson_info.json')

    output_folder = Outputs.folder(
        description='Output folder with the output HBJSON models.',
        path='output')
Пример #13
0
class SimulateModel(Function):
    """Simulate a Model JSON file in EnergyPlus."""

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

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

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

    additional_string = Inputs.str(
        description='An additional text string to be appended to the IDF before '
        'simulation. The input should include complete EnergyPlus objects as a '
        'single string following the IDF format. This input can be used to include '
        'EnergyPlus objects that are not currently supported by honeybee.',
        default='')

    @command
    def simulate_model(self):
        return 'honeybee-energy simulate model model.hbjson weather.epw ' \
            '--sim-par-json sim-par.json --additional-string ' \
            '"{{self.additional_string}}" --folder output'

    result_folder = Outputs.folder(
        description='Folder containing all simulation result files.',
        path='output/run')

    hbjson = Outputs.file(
        description=
        'A clean version of the input model that is in a format, which can '
        'be easily consumed by OpenStudio and directly matched to EnergyPlus results.',
        path='output/in.hbjson')

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

    idf = Outputs.file(description='The IDF model used in the simulation.',
                       path='output/run/in.idf')

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

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

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

    err = Outputs.file(
        description='The error report output by the simulation.',
        path='output/run/eplusout.err')
class AdaptiveMtx(Function):
    """Get CSV files with matrices of Adaptive comfort from matrices of Adaptive inputs.
    """

    air_temperature_mtx = Inputs.file(
        description='A CSV file with with a matrix of air temperature values in '
        'celsius.', path='air_temperature.csv', extensions=['csv']
    )

    prevailing_temperature = Inputs.file(
        description='A CSV file with with a list of prevailing outdoor temperatures '
        'in a single row (one temperautre per column).',
        path='prevailing.csv', extensions=['csv']
    )

    rad_temperature_mtx = Inputs.file(
        description='A CSV file with with a matrix of mean radiant temperature '
        'values in celsius.', path='rad_temperature.csv', extensions=['csv']
    )

    rad_delta_mtx = Inputs.file(
        description='A CSV file with with with a matrix of MRT deltas in celsius '
        'to be added to the base MRT values.', path='rad_delta.csv', extensions=['csv']
    )

    air_speed_json = Inputs.file(
        description='A JSON file conaining a simplified set of air speed values '
        'for each row of the matrix in m/s.', path='air_speed.json', extensions=['json']
    )

    comfort_par = Inputs.str(
        description='An AdaptiveParameter string to customize the assumptions of '
        'the Adaptive comfort model.', default='--standard ASHRAE-55'
    )

    @command
    def run_adaptive_mtx(self):
        return 'ladybug-comfort mtx adaptive air_temperature.csv prevailing.csv ' \
            '--rad-temperature-mtx rad_temperature.csv --rad-delta-mtx rad_delta.csv ' \
            '--air-speed-json air_speed.json --comfort-par "{{self.comfort_par}}" ' \
            '--folder output'

    result_folder = Outputs.folder(
        description='Folder containing all of the output CSV files.', path='output'
    )

    temperature_map = Outputs.file(
        description='CSV file containing a map of Operative Temperature (To) for each '
        'sensor and step of the analysis.', path='output/temperature.csv'
    )

    condition_map = Outputs.file(
        description='CSV file containing a map of comfort conditions for each '
        'sensor and step of the analysis. -1 indicates unacceptably cold conditions. '
        '+1 indicates unacceptably hot conditions. 0 indicates neutral (comfortable) '
        'conditions.', path='output/condition.csv'
    )

    deg_from_neutral_map = Outputs.file(
        description='CSV file containing a map of the degrees Celsius from the '
        'adaptive comfort neutral temperature for each sensor and step of the '
        'analysis. This can be used to understand not just whether conditions are '
        'acceptable but how uncomfortably hot or cold they are.',
        path='output/condition_intensity.csv'
    )
class PmvMtx(Function):
    """Get CSV files with matrices of PMV comfort from matrices of PMV inputs."""

    air_temperature_mtx = Inputs.file(
        description='A CSV file with with a matrix of air temperature values in '
        'celsius.', path='air_temperature.csv', extensions=['csv']
    )

    rel_humidity_mtx = Inputs.file(
        description='A CSV file with with a matrix of relative humidity values in '
        'percent.', path='rel_humidity.csv', extensions=['csv']
    )

    rad_temperature_mtx = Inputs.file(
        description='A CSV file with with a matrix of mean radiant temperature '
        'values in celsius.', path='rad_temperature.csv', extensions=['csv']
    )

    rad_delta_mtx = Inputs.file(
        description='A CSV file with with with a matrix of MRT deltas in celsius '
        'to be added to the base MRT values.', path='rad_delta.csv', extensions=['csv']
    )

    air_speed_json = Inputs.file(
        description='A JSON file conaining a simplified set of air speed values '
        'for each row of the matrix in m/s.', path='air_speed.json', extensions=['json']
    )

    met_rate = Inputs.file(
        description='The path to a CSV file containing a single number for metabolic '
        'rate in met or multiple numbers (with one value per row) that align with the '
        'width of the input matrices. If unspecified, than 1.1 will be used.',
        path='met.txt', optional=True
    )

    clo_value = Inputs.file(
        description='The path to a CSV file containing a single number for clothing '
        'level in clo or multiple numbers (with one value per row) that align with the '
        'width of the input matrices. If unspecified, than 0.7 will be used.',
        path='clo.txt', optional=True
    )

    comfort_par = Inputs.str(
        description='A PMVParameter string to customize the assumptions of '
        'the PMV comfort model.', default='--ppd-threshold 10'
    )

    write_set_map = Inputs.str(
        description='A switch to note whether the output temperature CSV should '
        'record Operative Temperature or Standard Effective Temperature (SET). '
        'SET is relatively intense to compute and so only recording Operative '
        'Temperature can greatly reduce run time, particularly when air speeds '
        'are low. However, SET accounts for all 6 PMV model inputs and so is a '
        'more representative "feels-like" temperature for the PMV model.',
        default='write-op-map',
        spec={'type': 'string', 'enum': ['write-op-map', 'write-set-map']}
    )

    @command
    def run_pmv_mtx(self):
        return 'ladybug-comfort mtx pmv air_temperature.csv rel_humidity.csv ' \
            '--rad-temperature-mtx rad_temperature.csv --rad-delta-mtx rad_delta.csv ' \
            '--air-speed-json air_speed.json --met-rate met.txt ' \
            '--clo-value clo.txt --comfort-par "{{self.comfort_par}}" ' \
            '--{{self.write_set_map}} --folder output'

    result_folder = Outputs.folder(
        description='Folder containing all of the output CSV files.', path='output'
    )

    temperature_map = Outputs.file(
        description='CSV file containing a map of Operative Temperature (To) or '
        'Standard Effective Temperature (SET) for each sensor and step of the analysis.'
        'The write-set-map input determines which of the two metrics this file '
        'contains.', path='output/temperature.csv'
    )

    condition_map = Outputs.file(
        description='CSV file containing a map of comfort conditions for each '
        'sensor and step of the analysis. -1 indicates unacceptably cold conditions. '
        '+1 indicates unacceptably hot conditions. 0 indicates neutral (comfortable) '
        'conditions.', path='output/condition.csv'
    )

    pmv_map = Outputs.file(
        description='CSV file containing the Predicted Mean Vote (PMV) for each '
        'sensor and step of the analysis. This can be used to understand not just '
        'whether conditions are acceptable but how uncomfortably hot or cold they are.',
        path='output/condition_intensity.csv'
    )
class UtciMtx(Function):
    """Get CSV files with matrices of UTCI comfort from matrices of UTCI inputs."""

    air_temperature_mtx = Inputs.file(
        description='A CSV file with with a matrix of air temperature values in '
        'celsius.', path='air_temperature.csv', extensions=['csv']
    )

    rel_humidity_mtx = Inputs.file(
        description='A CSV file with with a matrix of relative humidity values in '
        'percent.', path='rel_humidity.csv', extensions=['csv']
    )

    rad_temperature_mtx = Inputs.file(
        description='A CSV file with with a matrix of mean radiant temperature '
        'values in celsius.', path='rad_temperature.csv', extensions=['csv']
    )

    rad_delta_mtx = Inputs.file(
        description='A CSV file with with with a matrix of MRT deltas in celsius '
        'to be added to the base MRT values.', path='rad_delta.csv', extensions=['csv']
    )

    wind_speed_json = Inputs.file(
        description='A JSON file conaining a simplified set of meteorological wind '
        'speed values for each row of the matrix in m/s.',
        path='wind_speed.json', extensions=['json']
    )

    air_speed_mtx = Inputs.file(
        description='A CSV file with with a matrix of air speed values in m/s. '
        'Note that these values are not meteorological and should be AT HUMAN '
        'SUBJECT LEVEL. If specified, this overrides the wind-speed-json input.',
        path='air_speed.csv', extensions=['csv'], optional=True
    )

    comfort_par = Inputs.str(
        description='A UTCIParameter string to customize the assumptions of '
        'the UTCI comfort model.', default='--cold 9 --heat 26'
    )

    @command
    def run_utci_mtx(self):
        return 'ladybug-comfort mtx utci air_temperature.csv rel_humidity.csv ' \
            '--rad-temperature-mtx rad_temperature.csv --rad-delta-mtx rad_delta.csv ' \
            '--wind-speed-json wind_speed.json --air-speed-mtx air_speed.csv ' \
            '--comfort-par "{{self.comfort_par}}" --folder output'

    result_folder = Outputs.folder(
        description='Folder containing all of the output CSV files.', path='output'
    )

    temperature_map = Outputs.file(
        description='CSV file containing a map of Universal Thermal Climate Index '
        '(UTCI) temperatures for each sensor and step of the analysis.',
        path='output/temperature.csv'
    )

    condition_map = Outputs.file(
        description='CSV file containing a map of comfort conditions for each '
        'sensor and step of the analysis. -1 indicates unacceptably cold conditions. '
        '+1 indicates unacceptably hot conditions. 0 indicates neutral (comfortable) '
        'conditions.', path='output/condition.csv'
    )

    category_map = Outputs.file(
        description='CSV file containing a map of the heat/cold stress categories '
        'for each sensor and step of the analysis. -5 indicates extreme cold stress. '
        '+5 indicates extreme heat stress. 0 indicates no thermal stress. '
        'This can be used to understand not just whether conditions are '
        'acceptable but how uncomfortably hot or cold they are.',
        path='output/condition_intensity.csv'
    )
Пример #17
0
class SplitView(Function):
    """Split a single view file (.vf) into multiple smaller views."""

    view_count = Inputs.int(
        description=
        'Number of views into which the input view will be subdivided.',
        spec={
            'type': 'integer',
            'minimum': 1
        })

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

    overture = Inputs.str(
        description='A switch to note whether an ambient file (.amb) should be '
        'generated for an overture calculation before the view is split into smaller '
        'views. With an overture calculation, the ambient file (aka ambient cache) is '
        'first populated with values. Thereby ensuring that - when reused to create '
        'an image - Radiance uses interpolation between already calculated values '
        'rather than less reliable extrapolation. The overture calculation has '
        'comparatively small computation time to full rendering but is single-core '
        'can become time consuming in situations with very high numbers of '
        'rendering multiprocessors.',
        default='overture',
        spec={
            'type': 'string',
            'enum': ['overture', 'skip-overture']
        })

    scene_file = Inputs.file(
        description=
        'Path to an octree file for the overture calculation. This must be '
        'specified when the overture is not skipped.',
        path='scene.oct',
        optional=True)

    radiance_parameters = Inputs.str(
        description='Radiance parameters for the overture calculation. '
        'If unspecified, default rpict paramters will be used.',
        default='-ab 2')

    bsdf_folder = Inputs.folder(
        description='Folder containing any BSDF files needed for ray tracing.',
        path='model/bsdf',
        optional=True)

    @command
    def split_view(self):
        return 'honeybee-radiance view split view.vf ' \
            '{{self.view_count}} --{{self.overture}} ' \
            '--octree {{self.scene_file}} --rad-params "{{self.radiance_parameters}}" ' \
            '--folder output --log-file output/views_info.json'

    views_list = Outputs.list(
        description='A JSON array that includes information about generated '
        'views.',
        path='output/views_info.json')

    output_folder = Outputs.folder(
        description='Output folder with new view files.', path='output')

    ambient_cache = Outputs.file(
        description='Path to the ambient cache if an overture calculation was '
        'specified.',
        path='output/view.amb',
        optional=True)
Пример #18
0
class PmvMap(Function):
    """Get CSV files with maps of PMV comfort from EnergyPlus and Radiance results."""

    result_sql = Inputs.file(
        description=
        'A SQLite file that was generated by EnergyPlus and contains '
        'hourly or sub-hourly thermal comfort results.',
        path='result.sql',
        extensions=['sql', 'db', 'sqlite'])

    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'])

    epw = Inputs.file(
        description='Weather file used to estimate conditions for any outdoor '
        'sensors and to compute sun positions.',
        path='weather.epw',
        extensions=['epw'])

    total_irradiance = Inputs.file(
        description=
        'A Radiance .ill containing total irradiance for each sensor in '
        'the enclosure-info.',
        path='total.ill',
        extensions=['ill', 'irr'])

    direct_irradiance = Inputs.file(
        description=
        'A Radiance .ill containing direct irradiance for each sensor in '
        'the enclosure-info.',
        path='direct.ill',
        extensions=['ill', 'irr'])

    ref_irradiance = Inputs.file(
        description=
        'A Radiance .ill containing ground-reflected irradiance for each '
        'sensor in the enclosure-info.',
        path='ref.ill',
        extensions=['ill', 'irr'])

    sun_up_hours = Inputs.file(
        description=
        'A sun-up-hours.txt file output by Radiance and aligns with the '
        'input irradiance files.',
        path='sun-up-hours.txt')

    air_speed = Inputs.str(
        description=
        'A single number for air speed in m/s or a string of a JSON array '
        'with numbers that align with the result-sql reporting period. This '
        'will be used for all indoor comfort evaluation.',
        default='0.1')

    met_rate = Inputs.str(
        description='A single number for metabolic rate in met or a string of a '
        'JSON array with numbers that align with the result-sql reporting period.',
        default='1.1')

    clo_value = Inputs.str(
        description=
        'A single number for clothing level in clo or a string of a JSON '
        'array with numbers that align with the result-sql reporting period.',
        default='0.7')

    solarcal_par = Inputs.str(
        description='A SolarCalParameter string to customize the assumptions of '
        'the SolarCal model.',
        default='--posture seated --sharp 135 '
        '--absorptivity 0.7 --emissivity 0.95')

    comfort_par = Inputs.str(
        description='A PMVParameter string to customize the assumptions of '
        'the PMV comfort model.',
        default='--ppd-threshold 10')

    run_period = Inputs.str(
        description=
        'An AnalysisPeriod string to set the start and end dates of the '
        'analysis (eg. "6/21 to 9/21 between 8 and 16 @1"). If None, the analysis '
        'will be for the entire result_sql run period.',
        default='')

    write_set_map = Inputs.str(
        description='A switch to note whether the output temperature CSV should '
        'record Operative Temperature or Standard Effective Temperature (SET). '
        'SET is relatively intense to compute and so only recording Operative '
        'Temperature can greatly reduce run time, particularly when air speeds '
        'are low. However, SET accounts for all 6 PMV model inputs and so is a '
        'more representative "feels-like" temperature for the PMV model.',
        default='write-op-map',
        spec={
            'type': 'string',
            'enum': ['write-op-map', 'write-set-map']
        })

    @command
    def run_pmv_map(self):
        return 'ladybug-comfort map pmv result.sql enclosure_info.json ' \
            'weather.epw --total-irradiance total.ill --direct-irradiance direct.ill ' \
            '--ref-irradiance ref.ill --sun-up-hours sun-up-hours.txt ' \
            '--air-speed "{{self.air_speed}}" --met-rate "{{self.met_rate}}" ' \
            '--clo-value "{{self.clo_value}}" --solarcal-par "{{self.solarcal_par}}" ' \
            '--comfort-par "{{self.comfort_par}}" --run-period "{{self.run_period}}" ' \
            '--{{self.write_set_map}}  --folder output'

    result_folder = Outputs.folder(
        description='Folder containing all of the output CSV files.',
        path='output')

    temperature_map = Outputs.file(
        description='CSV file containing a map of Operative Temperature (To) or '
        'Standard Effective Temperature (SET) for each sensor and step of the analysis.'
        'The write-set-map input determines which of the two metrics this file '
        'contains.',
        path='output/temperature.csv')

    condition_map = Outputs.file(
        description='CSV file containing a map of comfort conditions for each '
        'sensor and step of the analysis. -1 indicates unacceptably cold conditions. '
        '+1 indicates unacceptably hot conditions. 0 indicates neutral (comfortable) '
        'conditions.',
        path='output/condition.csv')

    pmv_map = Outputs.file(
        description='CSV file containing the Predicted Mean Vote (PMV) for each '
        'sensor and step of the analysis. This can be used to understand not just '
        'whether conditions are acceptable but how uncomfortably hot or cold they are.',
        path='output/condition_intensity.csv')
Пример #19
0
class IrradianceContribMap(Function):
    """Get .ill files with maps of irradiance contributions from dynamic windows."""

    result_sql = Inputs.file(
        description=
        'A SQLite file that was generated by EnergyPlus and contains '
        'hourly or sub-hourly thermal comfort results.',
        path='result.sql',
        extensions=['sql', 'db', 'sqlite'])

    direct_specular = Inputs.file(
        description='A Radiance .ill file containing direct irradiance for the '
        'specular version of the aperture group.',
        path='direct_spec.ill',
        extensions=['ill', 'irr'])

    indirect_specular = Inputs.file(
        description=
        'An Radiance .ill file containing indirect irradiance for the '
        'specular version of the aperture group.',
        path='indirect_spec.ill',
        extensions=['ill', 'irr'])

    ref_specular = Inputs.file(
        description=
        'A Radiance .ill containing ground-reflected irradiance for the '
        'specular version of the aperture group.',
        path='ref_spec.ill',
        extensions=['ill', 'irr'])

    indirect_diffuse = Inputs.file(
        description=
        'An Radiance .ill file containing indirect irradiance for the '
        'diffuse version of the aperture group.',
        path='indirect_diff.ill',
        extensions=['ill', 'irr'])

    ref_diffuse = Inputs.file(
        description=
        'A Radiance .ill containing ground-reflected irradiance for the '
        'diffuse version of the aperture group.',
        path='ref_diff.ill',
        extensions=['ill', 'irr'])

    sun_up_hours = Inputs.file(
        description=
        'A sun-up-hours.txt file output by Radiance and aligns with the '
        'input irradiance files.',
        path='sun-up-hours.txt')

    aperture_id = Inputs.str(
        description='Text string for the identifier of the aperture associated '
        'with the irradiance.')

    @command
    def run_irradiance_contrib(self):
        return 'ladybug-comfort map irradiance-contrib result.sql direct_spec.ill ' \
            'indirect_spec.ill ref_spec.ill indirect_diff.ill ref_diff.ill ' \
            'sun-up-hours.txt --aperture-id "{{self.aperture_id}}" --folder output'

    result_folder = Outputs.folder(
        description='Folder containing all of the output .ill files.',
        path='output')
Пример #20
0
class UtciMap(Function):
    """Get CSV files with maps of UTCI comfort from EnergyPlus and Radiance results."""

    result_sql = Inputs.file(
        description=
        'A SQLite file that was generated by EnergyPlus and contains '
        'hourly or sub-hourly thermal comfort results.',
        path='result.sql',
        extensions=['sql', 'db', 'sqlite'])

    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'])

    epw = Inputs.file(
        description='Weather file used to estimate conditions for any outdoor '
        'sensors and to compute sun positions.',
        path='weather.epw',
        extensions=['epw'])

    total_irradiance = Inputs.file(
        description=
        'A Radiance .ill containing total irradiance for each sensor in '
        'the enclosure-info.',
        path='total.ill',
        extensions=['ill', 'irr'])

    direct_irradiance = Inputs.file(
        description=
        'A Radiance .ill containing direct irradiance for each sensor in '
        'the enclosure-info.',
        path='direct.ill',
        extensions=['ill', 'irr'])

    ref_irradiance = Inputs.file(
        description=
        'A Radiance .ill containing ground-reflected irradiance for each '
        'sensor in the enclosure-info.',
        path='ref.ill',
        extensions=['ill', 'irr'])

    sun_up_hours = Inputs.file(
        description=
        'A sun-up-hours.txt file output by Radiance and aligns with the '
        'input irradiance files.',
        path='sun-up-hours.txt')

    wind_speed = Inputs.str(
        description=
        'A single number for meteorological wind speed in m/s or a string '
        'of a JSON array with numbers that align with the result-sql reporting period. '
        'This will be used for all indoor comfort evaluation while the EPW wind speed '
        'will be used for the outdoors.',
        default='0.5')

    solarcal_par = Inputs.str(
        description='A SolarCalParameter string to customize the assumptions of '
        'the SolarCal model.',
        default='--posture seated --sharp 135 '
        '--absorptivity 0.7 --emissivity 0.95')

    comfort_par = Inputs.str(
        description='A UTCIParameter string to customize the assumptions of '
        'the UTCI comfort model.',
        default='--cold 9 --heat 26')

    run_period = Inputs.str(
        description=
        'An AnalysisPeriod string to set the start and end dates of the '
        'analysis (eg. "6/21 to 9/21 between 8 and 16 @1"). If None, the analysis '
        'will be for the entire result_sql run period.',
        default='')

    @command
    def run_utci_map(self):
        return 'ladybug-comfort map utci result.sql enclosure_info.json ' \
            'weather.epw --total-irradiance total.ill --direct-irradiance direct.ill ' \
            '--ref-irradiance ref.ill --sun-up-hours sun-up-hours.txt ' \
            '--wind-speed "{{self.wind_speed}}" --solarcal-par ' \
            '"{{self.solarcal_par}}" --comfort-par "{{self.comfort_par}}" ' \
            '--run-period "{{self.run_period}}" --folder output'

    result_folder = Outputs.folder(
        description='Folder containing all of the output CSV files.',
        path='output')

    temperature_map = Outputs.file(
        description=
        'CSV file containing a map of Universal Thermal Climate Index '
        '(UTCI) temperatures for each sensor and step of the analysis.',
        path='output/temperature.csv')

    condition_map = Outputs.file(
        description='CSV file containing a map of comfort conditions for each '
        'sensor and step of the analysis. -1 indicates unacceptably cold conditions. '
        '+1 indicates unacceptably hot conditions. 0 indicates neutral (comfortable) '
        'conditions.',
        path='output/condition.csv')

    category_map = Outputs.file(
        description=
        'CSV file containing a map of the heat/cold stress categories '
        'for each sensor and step of the analysis. -5 indicates extreme cold stress. '
        '+5 indicates extreme heat stress. 0 indicates no thermal stress. '
        'This can be used to understand not just whether conditions are '
        'acceptable but how uncomfortably hot or cold they are.',
        path='output/condition_intensity.csv')