# Since these products use at least one layer that requires a BSDF model a BSDF hemisphere must be
# used.  In this example a standard quarter basis is used.  Other predefined basis include Small, Half, and Full
# Custom BSDF basis is not yet supported in Python.  Please contact us if your work requires calculations with
# a custom BSDF basis.
bsdf_hemisphere = pywincalc.BSDFHemisphere.create(
    pywincalc.BSDFBasisType.QUARTER)

# Download some product data from the IGSDB.  This example gets a generic single clear 3mm glazing (NFRC 102),
# a venetian blind manufactured by Pella (CGDB ID 3000) and a perforated screen manufacturerd by Solar Comfort
# (CGDB ID 18000)
generic_clear_3mm_glass_igsdb_id = 363
slim_white_pella_venetian_blind_igsdb_id = 14684

generic_clear_3mm_glass_igsdb_response = requests.get(
    url_single_product.format(id=generic_clear_3mm_glass_igsdb_id),
    headers=headers)
slim_white_pella_venetian_blind_igsdb_response = requests.get(
    url_single_product.format(id=slim_white_pella_venetian_blind_igsdb_id),
    headers=headers)

generic_clear_3mm_glass = pywincalc.parse_json(
    generic_clear_3mm_glass_igsdb_response.content)
slim_white_pella_venetian_blind = pywincalc.parse_json(
    slim_white_pella_venetian_blind_igsdb_response.content)

# Create a glazing system using the NFRC U environment in order to get NFRC U results
# U and SHGC can be caculated for any given environment but in order to get results
# The NFRC U and SHGC environments are provided as already constructed environments and Glazing_System
# defaults to using the NFRC U environments
gap_1 = pywincalc.Gap(pywincalc.PredefinedGasType.AIR,
                      .0127)  # .0127 is gap thickness in meters

# A woven shade requires a BSDF hemisphere.  Create one based on a standard quarter basis for this test
bsdf_hemisphere = pywincalc.BSDFHemisphere.create(
    pywincalc.BSDFBasisType.QUARTER)

# Download some product data from the IGSDB.  This example gets a generic single clear 3mm glazing (NFRC 102),
# and a material to use as part of the woven shade.
generic_clear_3mm_glass_igsdb_id = 363

# This is the same material used in the venetian example but could be any material in the igsdb
shade_material_igsdb_id = 14477

generic_clear_3mm_glass_igsdb_response = requests.get(
    url_single_product.format(id=generic_clear_3mm_glass_igsdb_id),
    headers=headers)
shade_material_igsdb_response = requests.get(
    url_single_product.format(id=shade_material_igsdb_id), headers=headers)

generic_clear_3mm_glass = pywincalc.parse_json(
    generic_clear_3mm_glass_igsdb_response.content)

shade_material = pywincalc.parse_json(shade_material_igsdb_response.content)

# Perforated screens need Perforated_Geometry.
# Make a rectangular perforation here.  Other options include circular and square
# Note: While using a string for perforation type is not ideal it is used here because this
# example is mostly using data from the IGSDB for the material and only adding a custom geometry
# For an example where the data is completely custom generated see custom_perforated.py
perforation_type = "rectangular"
# Since these products use at least one layer that requires a BSDF model a BSDF hemisphere must be
# used.  In this example a standard quarter basis is used.  Other predefined basis include Small, Half, and Full
# Custom BSDF basis is not yet supported in Python.  Please contact us if your work requires calculations with
# a custom BSDF basis.
bsdf_hemisphere = pywincalc.BSDFHemisphere.create(
    pywincalc.BSDFBasisType.QUARTER)

# Download some product data from the IGSDB.  This example gets a generic single clear 3mm glazing (NFRC 102),
# a venetian blind manufactured by Pella (CGDB ID 3000) and a perforated screen manufacturerd by Solar Comfort
# (CGDB ID 18000)
generic_clear_3mm_glass_igsdb_id = 363
slim_white_pella_venetian_blind_igsdb_id = 14684
thermeshade_perforated_screen_igsdb_id = 14990

generic_clear_3mm_glass_igsdb_response = requests.get(
    url_single_product.format(id=generic_clear_3mm_glass_igsdb_id),
    headers=headers)
thermeshade_perforated_screen_igsdb_response = requests.get(
    url_single_product.format(id=thermeshade_perforated_screen_igsdb_id),
    headers=headers)

generic_clear_3mm_glass = pywincalc.parse_json(
    generic_clear_3mm_glass_igsdb_response.content)
thermeshade_perforated_screen = pywincalc.parse_json(
    thermeshade_perforated_screen_igsdb_response.content)

# Create a glazing system using the NFRC U environment in order to get NFRC U results
# U and SHGC can be caculated for any given environment but in order to get results
# The NFRC U and SHGC environments are provided as already constructed environments and Glazing_System
# defaults to using the NFRC U environments
optical_standard = pywincalc.load_standard(optical_standard_path)

glazing_system_width = 1.0  # width of the glazing system in meters
glazing_system_height = 1.0  # height of the glazing system in meters

# Define the gap between the shade and the glazing
gap_1 = pywincalc.Gap(pywincalc.PredefinedGasType.AIR,
                      .0127)  # .0127 is gap thickness in meters

bsdf_hemisphere = pywincalc.BSDFHemisphere.create(pywincalc.BSDFBasisType.FULL)

generic_clear_3mm_glass_igsdb_id = 363
bsdf_igsdb_id = 14710

generic_clear_3mm_glass_igsdb_response = requests.get(
    url_single_product.format(id=generic_clear_3mm_glass_igsdb_id),
    headers=headers)

bsdf_igsdb_response = requests.get(
    url_single_product_datafile.format(id=bsdf_igsdb_id), headers=headers)

clear_3 = pywincalc.parse_json(generic_clear_3mm_glass_igsdb_response.content)

# The BSDF data is currently stored as XML on igsdb.lbl.gov.  As a result it needs to be
# parsed using the xml string parser instead of the json parser
bsdf_shade = pywincalc.parse_bsdf_xml_string(bsdf_igsdb_response.content)

# Create a glazing system using the NFRC U environment in order to get NFRC U results
# U and SHGC can be caculated for any given environment but in order to get results
# The NFRC U and SHGC environments are provided as already constructed environments and Glazing_System
# defaults to using the NFRC U environments
Example #5
0
glazing_system_height = 1.0  # height of the glazing system in meters

# Define the gap between the shade and the glazing
gap_1 = pywincalc.Gap(pywincalc.PredefinedGasType.AIR, .0127)  # .0127 is gap thickness in meters

# A woven shade requires a BSDF hemisphere.  Create one based on a standard quarter basis for this test
bsdf_hemisphere = pywincalc.BSDFHemisphere.create(pywincalc.BSDFBasisType.QUARTER)

# Download some product data from the IGSDB.  This example gets a generic single clear 3mm glazing (NFRC 102),
# and a material to use as part of the woven shade.
generic_clear_3mm_glass_igsdb_id = 363

# This is the same material used in the venetian example but could be any material in the igsdb
shade_material_igsdb_id = 14477

generic_clear_3mm_glass_igsdb_response = requests.get(url_single_product.format(id=generic_clear_3mm_glass_igsdb_id),
                                                      headers=headers)
shade_material_igsdb_response = requests.get(
    url_single_product.format(id=shade_material_igsdb_id), headers=headers)

generic_clear_3mm_glass = pywincalc.parse_json(generic_clear_3mm_glass_igsdb_response.content)

shade_material = pywincalc.parse_json(shade_material_igsdb_response.content)

# Woven shades need Woven_Geometry.
thread_diameter = 0.002  # 2mm diameter
thread_spacing = 0.003  # 3mm spacing
shade_thickness = 0.002  # 2mm shade thickness
geometry = pywincalc.WovenGeometry(thread_diameter, thread_spacing, shade_thickness)

# combine the shade_material and the geometry together into a Product_Composistion_Data
Example #6
0
# those results will not be based on EN 673
optical_standard_path = "standards/W5_NFRC_2003.std"
optical_standard = pywincalc.load_standard(optical_standard_path)

glazing_system_width = 1.0  # width of the glazing system in meters
glazing_system_height = 1.0  # height of the glazing system in meters

# Define the gap between the shade and the glazing
gap_1 = pywincalc.Gap(pywincalc.PredefinedGasType.AIR, .0127)  # .0127 is gap thickness in meters

# Download some product data from the IGSDB.  This example gets a generic single clear 3mm glazing (NFRC 102),
# and a generic single clear 6mm glazing (NFRC 103)
generic_clear_3mm_glass_igsdb_id = 363
generic_clear_6mm_glass_igsdb_id = 362

generic_clear_3mm_glass_igsdb_response = requests.get(url_single_product.format(id=generic_clear_3mm_glass_igsdb_id),
                                                      headers=headers)
generic_clear_6mm_glass_igsdb_response = requests.get(url_single_product.format(id=generic_clear_6mm_glass_igsdb_id),
                                                      headers=headers)

generic_clear_3mm_glass = pywincalc.parse_json(generic_clear_3mm_glass_igsdb_response.content)
generic_clear_6mm_glass = pywincalc.parse_json(generic_clear_6mm_glass_igsdb_response.content)

# Create a glazing system using the NFRC U environment in order to get NFRC U results
# U and SHGC can be caculated for any given environment.  In order to get NFRC U and SHGC results the systems must
# use the standard NFRC U and SHGC environments
# The NFRC U and SHGC environments are provided as already constructed environments.
# Glazing_System defaults to using the NFRC U environment
glazing_system_u_environment = pywincalc.GlazingSystem(optical_standard=optical_standard,
                                                     solid_layers=[generic_clear_6mm_glass, generic_clear_3mm_glass],
                                                     gap_layers=[gap_1],