Skip to content

Commit

Permalink
Merge pull request #76 from NREL/fix-amy-weather
Browse files Browse the repository at this point in the history
Latest measures. Fixes using AMY weather files that had no ethoriz/gh…
  • Loading branch information
shorowit committed Sep 6, 2017
2 parents 1f5f4f5 + a352a74 commit 3edcfc5
Show file tree
Hide file tree
Showing 52 changed files with 1,399 additions and 548 deletions.
16 changes: 8 additions & 8 deletions resources/measures/ResidentialAirflow/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<schema_version>3.0</schema_version>
<name>residential_airflow</name>
<uid>7d2adf5c-9995-49be-b662-a23d2452bb36</uid>
<version_id>6e349a9c-9207-47f9-aa99-8dc5e4df7b66</version_id>
<version_modified>20170731T151909Z</version_modified>
<version_id>aaa5759e-457d-475e-b439-c78479a848b9</version_id>
<version_modified>20170906T152559Z</version_modified>
<xml_checksum>19EEDBBB</xml_checksum>
<class_name>ResidentialAirflow</class_name>
<display_name>Set Residential Airflow</display_name>
Expand Down Expand Up @@ -665,12 +665,6 @@
<usage_type>resource</usage_type>
<checksum>3C131B97</checksum>
</file>
<file>
<filename>weather.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>36B7CAC2</checksum>
</file>
<file>
<filename>schedules.rb</filename>
<filetype>rb</filetype>
Expand Down Expand Up @@ -814,5 +808,11 @@
<usage_type>test</usage_type>
<checksum>03DB0FF8</checksum>
</file>
<file>
<filename>weather.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>8F96C373</checksum>
</file>
</files>
</measure>
61 changes: 52 additions & 9 deletions resources/measures/ResidentialAirflow/resources/weather.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def process_epw(epw_path, header_only)
if not File.exist?(epw_path)
@runner.registerError("Cannot find weather file at #{epw_path}.")
@error = true
return nil, nil
return nil, nil, nil
end

epw_file = OpenStudio::EpwFile.new(epw_path, !header_only)
Expand Down Expand Up @@ -105,14 +105,57 @@ def process_epw(epw_path, header_only)
hourdict['month'] = epwdata.month
hourdict['day'] = epwdata.day
hourdict['hour'] = epwdata.hour
hourdict['db'] = epwdata.dryBulbTemperature.get
hourdict['dp'] = epwdata.dewPointTemperature.get
hourdict['rh'] = epwdata.relativeHumidity.get / 100.0
hourdict['ethoriz'] = epwdata.extraterrestrialHorizontalRadiation.get
hourdict['ghoriz'] = epwdata.globalHorizontalRadiation.get
hourdict['dirnormal'] = epwdata.directNormalRadiation.get # W/m^2
hourdict['diffhoriz'] = epwdata.diffuseHorizontalRadiation.get # W/m^2
hourdict['ws'] = epwdata.windSpeed.get
if epwdata.dryBulbTemperature.is_initialized
hourdict['db'] = epwdata.dryBulbTemperature.get
else
@runner.registerError("Cannot retrieve dryBulbTemperature from the EPW for hour #{hournum+1}.")
@error = true
end
if epwdata.dewPointTemperature.is_initialized
hourdict['dp'] = epwdata.dewPointTemperature.get
else
@runner.registerError("Cannot retrieve dewPointTemperature from the EPW for hour #{hournum+1}.")
@error = true
end
if epwdata.relativeHumidity.is_initialized
hourdict['rh'] = epwdata.relativeHumidity.get / 100.0
else
@runner.registerError("Cannot retrieve relativeHumidity from the EPW for hour #{hournum+1}.")
@error = true
end
#if epwdata.extraterrestrialHorizontalRadiation.is_initialized
# hourdict['ethoriz'] = epwdata.extraterrestrialHorizontalRadiation.get
#else
# @runner.registerError("Cannot retrieve extraterrestrialHorizontalRadiation from the EPW for hour #{hournum+1}.")
# @error = true
#end
#if epwdata.globalHorizontalRadiation.is_initialized
# hourdict['ghoriz'] = epwdata.globalHorizontalRadiation.get
#else
# @runner.registerError("Cannot retrieve globalHorizontalRadiation from the EPW for hour #{hournum+1}.")
# @error = true
#end
if epwdata.directNormalRadiation.is_initialized
hourdict['dirnormal'] = epwdata.directNormalRadiation.get # W/m^2
else
@runner.registerError("Cannot retrieve directNormalRadiation from the EPW for hour #{hournum+1}.")
@error = true
end
if epwdata.diffuseHorizontalRadiation.is_initialized
hourdict['diffhoriz'] = epwdata.diffuseHorizontalRadiation.get # W/m^2
else
@runner.registerError("Cannot retrieve diffuseHorizontalRadiation from the EPW for hour #{hournum+1}.")
@error = true
end
if epwdata.windSpeed.is_initialized
hourdict['ws'] = epwdata.windSpeed.get
else
@runner.registerError("Cannot retrieve windSpeed from the EPW for hour #{hournum+1}.")
@error = true
end
if @error
return nil, nil, nil
end
hourdata << hourdict

if (hournum + 1) % 24 == 0
Expand Down
16 changes: 8 additions & 8 deletions resources/measures/ResidentialApplianceClothesWasher/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<schema_version>3.0</schema_version>
<name>residential_clothes_washer</name>
<uid>640bfdca-ba67-461e-b517-1a7291c22b22</uid>
<version_id>d2bba385-e241-45cc-bb9a-9c13f8a41ddf</version_id>
<version_modified>20170731T151909Z</version_modified>
<version_id>d7e53cf2-778a-4442-a00c-7d8ba6344ca6</version_id>
<version_modified>20170906T152600Z</version_modified>
<xml_checksum>126F1C43</xml_checksum>
<class_name>ResidentialClothesWasher</class_name>
<display_name>Set Residential Clothes Washer</display_name>
Expand Down Expand Up @@ -526,12 +526,6 @@
<usage_type>resource</usage_type>
<checksum>3C131B97</checksum>
</file>
<file>
<filename>weather.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>36B7CAC2</checksum>
</file>
<file>
<filename>schedules.rb</filename>
<filetype>rb</filetype>
Expand Down Expand Up @@ -627,5 +621,11 @@
<usage_type>test</usage_type>
<checksum>4D7ADA4E</checksum>
</file>
<file>
<filename>weather.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>8F96C373</checksum>
</file>
</files>
</measure>
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def process_epw(epw_path, header_only)
if not File.exist?(epw_path)
@runner.registerError("Cannot find weather file at #{epw_path}.")
@error = true
return nil, nil
return nil, nil, nil
end

epw_file = OpenStudio::EpwFile.new(epw_path, !header_only)
Expand Down Expand Up @@ -105,14 +105,57 @@ def process_epw(epw_path, header_only)
hourdict['month'] = epwdata.month
hourdict['day'] = epwdata.day
hourdict['hour'] = epwdata.hour
hourdict['db'] = epwdata.dryBulbTemperature.get
hourdict['dp'] = epwdata.dewPointTemperature.get
hourdict['rh'] = epwdata.relativeHumidity.get / 100.0
hourdict['ethoriz'] = epwdata.extraterrestrialHorizontalRadiation.get
hourdict['ghoriz'] = epwdata.globalHorizontalRadiation.get
hourdict['dirnormal'] = epwdata.directNormalRadiation.get # W/m^2
hourdict['diffhoriz'] = epwdata.diffuseHorizontalRadiation.get # W/m^2
hourdict['ws'] = epwdata.windSpeed.get
if epwdata.dryBulbTemperature.is_initialized
hourdict['db'] = epwdata.dryBulbTemperature.get
else
@runner.registerError("Cannot retrieve dryBulbTemperature from the EPW for hour #{hournum+1}.")
@error = true
end
if epwdata.dewPointTemperature.is_initialized
hourdict['dp'] = epwdata.dewPointTemperature.get
else
@runner.registerError("Cannot retrieve dewPointTemperature from the EPW for hour #{hournum+1}.")
@error = true
end
if epwdata.relativeHumidity.is_initialized
hourdict['rh'] = epwdata.relativeHumidity.get / 100.0
else
@runner.registerError("Cannot retrieve relativeHumidity from the EPW for hour #{hournum+1}.")
@error = true
end
#if epwdata.extraterrestrialHorizontalRadiation.is_initialized
# hourdict['ethoriz'] = epwdata.extraterrestrialHorizontalRadiation.get
#else
# @runner.registerError("Cannot retrieve extraterrestrialHorizontalRadiation from the EPW for hour #{hournum+1}.")
# @error = true
#end
#if epwdata.globalHorizontalRadiation.is_initialized
# hourdict['ghoriz'] = epwdata.globalHorizontalRadiation.get
#else
# @runner.registerError("Cannot retrieve globalHorizontalRadiation from the EPW for hour #{hournum+1}.")
# @error = true
#end
if epwdata.directNormalRadiation.is_initialized
hourdict['dirnormal'] = epwdata.directNormalRadiation.get # W/m^2
else
@runner.registerError("Cannot retrieve directNormalRadiation from the EPW for hour #{hournum+1}.")
@error = true
end
if epwdata.diffuseHorizontalRadiation.is_initialized
hourdict['diffhoriz'] = epwdata.diffuseHorizontalRadiation.get # W/m^2
else
@runner.registerError("Cannot retrieve diffuseHorizontalRadiation from the EPW for hour #{hournum+1}.")
@error = true
end
if epwdata.windSpeed.is_initialized
hourdict['ws'] = epwdata.windSpeed.get
else
@runner.registerError("Cannot retrieve windSpeed from the EPW for hour #{hournum+1}.")
@error = true
end
if @error
return nil, nil, nil
end
hourdata << hourdict

if (hournum + 1) % 24 == 0
Expand Down
16 changes: 8 additions & 8 deletions resources/measures/ResidentialApplianceDishwasher/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<schema_version>3.0</schema_version>
<name>residential_dishwasher</name>
<uid>09ea4570-4666-4a55-812f-5e90091f5325</uid>
<version_id>fbe23292-a393-4089-9ce6-575dcdb6ec11</version_id>
<version_modified>20170731T151910Z</version_modified>
<version_id>d94f8d36-f956-4c00-9213-045b37921c7b</version_id>
<version_modified>20170906T152600Z</version_modified>
<xml_checksum>126F1C43</xml_checksum>
<class_name>ResidentialDishwasher</class_name>
<display_name>Set Residential Dishwasher</display_name>
Expand Down Expand Up @@ -488,12 +488,6 @@
<usage_type>resource</usage_type>
<checksum>3C131B97</checksum>
</file>
<file>
<filename>weather.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>36B7CAC2</checksum>
</file>
<file>
<filename>ResidentialDishwasher_Test.rb</filename>
<filetype>rb</filetype>
Expand Down Expand Up @@ -589,5 +583,11 @@
<usage_type>test</usage_type>
<checksum>4D7ADA4E</checksum>
</file>
<file>
<filename>weather.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>8F96C373</checksum>
</file>
</files>
</measure>
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def process_epw(epw_path, header_only)
if not File.exist?(epw_path)
@runner.registerError("Cannot find weather file at #{epw_path}.")
@error = true
return nil, nil
return nil, nil, nil
end

epw_file = OpenStudio::EpwFile.new(epw_path, !header_only)
Expand Down Expand Up @@ -105,14 +105,57 @@ def process_epw(epw_path, header_only)
hourdict['month'] = epwdata.month
hourdict['day'] = epwdata.day
hourdict['hour'] = epwdata.hour
hourdict['db'] = epwdata.dryBulbTemperature.get
hourdict['dp'] = epwdata.dewPointTemperature.get
hourdict['rh'] = epwdata.relativeHumidity.get / 100.0
hourdict['ethoriz'] = epwdata.extraterrestrialHorizontalRadiation.get
hourdict['ghoriz'] = epwdata.globalHorizontalRadiation.get
hourdict['dirnormal'] = epwdata.directNormalRadiation.get # W/m^2
hourdict['diffhoriz'] = epwdata.diffuseHorizontalRadiation.get # W/m^2
hourdict['ws'] = epwdata.windSpeed.get
if epwdata.dryBulbTemperature.is_initialized
hourdict['db'] = epwdata.dryBulbTemperature.get
else
@runner.registerError("Cannot retrieve dryBulbTemperature from the EPW for hour #{hournum+1}.")
@error = true
end
if epwdata.dewPointTemperature.is_initialized
hourdict['dp'] = epwdata.dewPointTemperature.get
else
@runner.registerError("Cannot retrieve dewPointTemperature from the EPW for hour #{hournum+1}.")
@error = true
end
if epwdata.relativeHumidity.is_initialized
hourdict['rh'] = epwdata.relativeHumidity.get / 100.0
else
@runner.registerError("Cannot retrieve relativeHumidity from the EPW for hour #{hournum+1}.")
@error = true
end
#if epwdata.extraterrestrialHorizontalRadiation.is_initialized
# hourdict['ethoriz'] = epwdata.extraterrestrialHorizontalRadiation.get
#else
# @runner.registerError("Cannot retrieve extraterrestrialHorizontalRadiation from the EPW for hour #{hournum+1}.")
# @error = true
#end
#if epwdata.globalHorizontalRadiation.is_initialized
# hourdict['ghoriz'] = epwdata.globalHorizontalRadiation.get
#else
# @runner.registerError("Cannot retrieve globalHorizontalRadiation from the EPW for hour #{hournum+1}.")
# @error = true
#end
if epwdata.directNormalRadiation.is_initialized
hourdict['dirnormal'] = epwdata.directNormalRadiation.get # W/m^2
else
@runner.registerError("Cannot retrieve directNormalRadiation from the EPW for hour #{hournum+1}.")
@error = true
end
if epwdata.diffuseHorizontalRadiation.is_initialized
hourdict['diffhoriz'] = epwdata.diffuseHorizontalRadiation.get # W/m^2
else
@runner.registerError("Cannot retrieve diffuseHorizontalRadiation from the EPW for hour #{hournum+1}.")
@error = true
end
if epwdata.windSpeed.is_initialized
hourdict['ws'] = epwdata.windSpeed.get
else
@runner.registerError("Cannot retrieve windSpeed from the EPW for hour #{hournum+1}.")
@error = true
end
if @error
return nil, nil, nil
end
hourdata << hourdict

if (hournum + 1) % 24 == 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<schema_version>3.0</schema_version>
<name>process_constructions_foundations_floors_basement_finished</name>
<uid>4b37c726-d6c4-473b-990a-0923c302ed36</uid>
<version_id>6c17d5d7-70d5-4aca-ad87-e2f664826221</version_id>
<version_modified>20170731T151910Z</version_modified>
<version_id>62f56335-3f2d-4772-9dba-0dd14e7a9751</version_id>
<version_modified>20170831T031751Z</version_modified>
<xml_checksum>1E963D9C</xml_checksum>
<class_name>ProcessConstructionsFoundationsFloorsBasementFinished</class_name>
<display_name>Set Residential Foundations/Floors - Finished Basement Constructions</display_name>
Expand Down Expand Up @@ -254,16 +254,16 @@
<checksum>73D070F0</checksum>
</file>
<file>
<filename>SFD_2000sqft_2story_SL_GRG_UA.osm</filename>
<filename>SFD_2000sqft_2story_SL_UA.osm</filename>
<filetype>osm</filetype>
<usage_type>test</usage_type>
<checksum>9538B6D0</checksum>
<checksum>A6433770</checksum>
</file>
<file>
<filename>SFD_2000sqft_2story_SL_UA.osm</filename>
<filename>SFD_2000sqft_2story_SL_GRG_UA.osm</filename>
<filetype>osm</filetype>
<usage_type>test</usage_type>
<checksum>A6433770</checksum>
<checksum>4805C9B4</checksum>
</file>
</files>
</measure>
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<schema_version>3.0</schema_version>
<name>process_constructions_foundations_floors_basement_unfinished</name>
<uid>ebc21070-2d4b-4a2a-bd15-f18bf3e77b49</uid>
<version_id>0b1caee4-24d8-4cd4-8f40-b04098666c21</version_id>
<version_modified>20170731T151910Z</version_modified>
<version_id>bf77040d-746c-48e7-8139-37b6018ae52b</version_id>
<version_modified>20170831T031751Z</version_modified>
<xml_checksum>1E963D9C</xml_checksum>
<class_name>ProcessConstructionsFoundationsFloorsBasementUnfinished</class_name>
<display_name>Set Residential Foundations/Floors - Unfinished Basement Constructions</display_name>
Expand Down Expand Up @@ -287,16 +287,16 @@
<checksum>73D070F0</checksum>
</file>
<file>
<filename>SFD_2000sqft_2story_SL_GRG_UA.osm</filename>
<filename>SFD_2000sqft_2story_SL_UA.osm</filename>
<filetype>osm</filetype>
<usage_type>test</usage_type>
<checksum>9538B6D0</checksum>
<checksum>A6433770</checksum>
</file>
<file>
<filename>SFD_2000sqft_2story_SL_UA.osm</filename>
<filename>SFD_2000sqft_2story_SL_GRG_UA.osm</filename>
<filetype>osm</filetype>
<usage_type>test</usage_type>
<checksum>A6433770</checksum>
<checksum>4805C9B4</checksum>
</file>
</files>
</measure>

0 comments on commit 3edcfc5

Please sign in to comment.