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')
Beispiel #2
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')
Beispiel #3
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'
    )
Beispiel #5
0
class ReadJSONList(Function):
    """Read the content of a JSON file as a list."""

    src = Inputs.path(description='Path to a input JSON file.',
                      path='input_path')

    @command
    def list_dir(self):
        return 'echo parsing JSON information to a list...'

    data = Outputs.list(description='The content of JSON file as a list.',
                        path='input_path')
Beispiel #6
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'
    )
Beispiel #7
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)