openstudio-calibration 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +29 -0
  3. data/CHANGELOG.md +14 -0
  4. data/Gemfile +20 -0
  5. data/Jenkinsfile +6 -0
  6. data/LICENSE.md +27 -0
  7. data/README.md +33 -0
  8. data/Rakefile +50 -0
  9. data/doc_templates/LICENSE.md +27 -0
  10. data/doc_templates/README.md.erb +42 -0
  11. data/doc_templates/copyright_erb.txt +36 -0
  12. data/doc_templates/copyright_js.txt +4 -0
  13. data/doc_templates/copyright_ruby.txt +34 -0
  14. data/lib/files/.gitkeep +0 -0
  15. data/lib/measures/AddMonthlyJSONUtilityData/LICENSE.md +27 -0
  16. data/lib/measures/AddMonthlyJSONUtilityData/README.md +96 -0
  17. data/lib/measures/AddMonthlyJSONUtilityData/README.md.erb +42 -0
  18. data/lib/measures/AddMonthlyJSONUtilityData/measure.rb +280 -0
  19. data/lib/measures/AddMonthlyJSONUtilityData/measure.xml +163 -0
  20. data/lib/measures/AddMonthlyUtilityData/LICENSE.md +27 -0
  21. data/lib/measures/AddMonthlyUtilityData/README.md +64 -0
  22. data/lib/measures/AddMonthlyUtilityData/README.md.erb +42 -0
  23. data/lib/measures/AddMonthlyUtilityData/measure.rb +312 -0
  24. data/lib/measures/AddMonthlyUtilityData/measure.xml +115 -0
  25. data/lib/measures/AddMonthlyUtilityData/tests/AddMonthlyUtilityData_Test.rb +88 -0
  26. data/lib/measures/AddMonthlyUtilityData/tests/electric_billed_usages.json +198 -0
  27. data/lib/measures/AddMonthlyUtilityData/tests/gas_billed_usages.json +198 -0
  28. data/lib/measures/CalibrationReports/LICENSE.md +27 -0
  29. data/lib/measures/CalibrationReports/README.md +26 -0
  30. data/lib/measures/CalibrationReports/README.md.erb +42 -0
  31. data/lib/measures/CalibrationReports/measure.rb +511 -0
  32. data/lib/measures/CalibrationReports/measure.xml +98 -0
  33. data/lib/measures/CalibrationReports/resources/report.html.in +379 -0
  34. data/lib/measures/CalibrationReports/tests/CalibrationReports_Test.rb +523 -0
  35. data/lib/measures/CalibrationReports/tests/ExampleModel.osm +10497 -0
  36. data/lib/measures/CalibrationReports/tests/ExampleModelNoDemandInput.osm +10560 -0
  37. data/lib/measures/CalibrationReports/tests/ExampleModelNoGasInput.osm +10456 -0
  38. data/lib/measures/CalibrationReports/tests/USA_CO_Golden-NREL.724666_TMY3.epw +8768 -0
  39. data/lib/measures/CalibrationReportsEnhanced/LICENSE.md +27 -0
  40. data/lib/measures/CalibrationReportsEnhanced/README.md +143 -0
  41. data/lib/measures/CalibrationReportsEnhanced/README.md.erb +42 -0
  42. data/lib/measures/CalibrationReportsEnhanced/measure.rb +798 -0
  43. data/lib/measures/CalibrationReportsEnhanced/measure.xml +372 -0
  44. data/lib/measures/CalibrationReportsEnhanced/resources/report.html.in +380 -0
  45. data/lib/measures/CalibrationReportsEnhanced/tests/CalibrationReportsEnhanced_Test.rb +734 -0
  46. data/lib/measures/CalibrationReportsEnhanced/tests/ExampleModel.osm +10497 -0
  47. data/lib/measures/CalibrationReportsEnhanced/tests/ExampleModel_FuelOil.osm +12740 -0
  48. data/lib/measures/CalibrationReportsEnhanced/tests/USA_CO_Golden-NREL.724666_TMY3.epw +8768 -0
  49. data/lib/measures/CalibrationReportsEnhanced21/LICENSE.md +27 -0
  50. data/lib/measures/CalibrationReportsEnhanced21/README.md +109 -0
  51. data/lib/measures/CalibrationReportsEnhanced21/README.md.erb +42 -0
  52. data/lib/measures/CalibrationReportsEnhanced21/measure.rb +690 -0
  53. data/lib/measures/CalibrationReportsEnhanced21/measure.xml +269 -0
  54. data/lib/measures/CalibrationReportsEnhanced21/resources/report.html.in +380 -0
  55. data/lib/measures/CoilCoolingDXSingleSpeedMultiplier/LICENSE.md +27 -0
  56. data/lib/measures/CoilCoolingDXSingleSpeedMultiplier/README.md +48 -0
  57. data/lib/measures/CoilCoolingDXSingleSpeedMultiplier/README.md.erb +42 -0
  58. data/lib/measures/CoilCoolingDXSingleSpeedMultiplier/measure.rb +237 -0
  59. data/lib/measures/CoilCoolingDXSingleSpeedMultiplier/measure.xml +93 -0
  60. data/lib/measures/CoilCoolingDXSingleSpeedPercentChange/LICENSE.md +27 -0
  61. data/lib/measures/CoilCoolingDXSingleSpeedPercentChange/README.md +48 -0
  62. data/lib/measures/CoilCoolingDXSingleSpeedPercentChange/README.md.erb +42 -0
  63. data/lib/measures/CoilCoolingDXSingleSpeedPercentChange/measure.rb +228 -0
  64. data/lib/measures/CoilCoolingDXSingleSpeedPercentChange/measure.xml +93 -0
  65. data/lib/measures/CoilCoolingDXTwoSpeedMultiplier/LICENSE.md +27 -0
  66. data/lib/measures/CoilCoolingDXTwoSpeedMultiplier/README.md +64 -0
  67. data/lib/measures/CoilCoolingDXTwoSpeedMultiplier/README.md.erb +42 -0
  68. data/lib/measures/CoilCoolingDXTwoSpeedMultiplier/measure.rb +280 -0
  69. data/lib/measures/CoilCoolingDXTwoSpeedMultiplier/measure.xml +111 -0
  70. data/lib/measures/CoilCoolingDXTwoSpeedPercentChange/LICENSE.md +27 -0
  71. data/lib/measures/CoilCoolingDXTwoSpeedPercentChange/README.md +64 -0
  72. data/lib/measures/CoilCoolingDXTwoSpeedPercentChange/README.md.erb +42 -0
  73. data/lib/measures/CoilCoolingDXTwoSpeedPercentChange/measure.rb +270 -0
  74. data/lib/measures/CoilCoolingDXTwoSpeedPercentChange/measure.xml +111 -0
  75. data/lib/measures/CoilCoolingWaterMultiplier/LICENSE.md +27 -0
  76. data/lib/measures/CoilCoolingWaterMultiplier/README.md +80 -0
  77. data/lib/measures/CoilCoolingWaterMultiplier/README.md.erb +42 -0
  78. data/lib/measures/CoilCoolingWaterMultiplier/measure.rb +324 -0
  79. data/lib/measures/CoilCoolingWaterMultiplier/measure.xml +129 -0
  80. data/lib/measures/CoilCoolingWaterPercentChange/LICENSE.md +27 -0
  81. data/lib/measures/CoilCoolingWaterPercentChange/README.md +80 -0
  82. data/lib/measures/CoilCoolingWaterPercentChange/README.md.erb +42 -0
  83. data/lib/measures/CoilCoolingWaterPercentChange/measure.rb +311 -0
  84. data/lib/measures/CoilCoolingWaterPercentChange/measure.xml +129 -0
  85. data/lib/measures/CoilHeatingElectricMultiplier/LICENSE.md +27 -0
  86. data/lib/measures/CoilHeatingElectricMultiplier/README.md +48 -0
  87. data/lib/measures/CoilHeatingElectricMultiplier/README.md.erb +42 -0
  88. data/lib/measures/CoilHeatingElectricMultiplier/measure.rb +240 -0
  89. data/lib/measures/CoilHeatingElectricMultiplier/measure.xml +93 -0
  90. data/lib/measures/CoilHeatingElectricPercentChange/LICENSE.md +27 -0
  91. data/lib/measures/CoilHeatingElectricPercentChange/README.md +48 -0
  92. data/lib/measures/CoilHeatingElectricPercentChange/README.md.erb +42 -0
  93. data/lib/measures/CoilHeatingElectricPercentChange/measure.rb +231 -0
  94. data/lib/measures/CoilHeatingElectricPercentChange/measure.xml +93 -0
  95. data/lib/measures/CoilHeatingGasMultiplier/LICENSE.md +27 -0
  96. data/lib/measures/CoilHeatingGasMultiplier/README.md +64 -0
  97. data/lib/measures/CoilHeatingGasMultiplier/README.md.erb +42 -0
  98. data/lib/measures/CoilHeatingGasMultiplier/measure.rb +282 -0
  99. data/lib/measures/CoilHeatingGasMultiplier/measure.xml +111 -0
  100. data/lib/measures/CoilHeatingGasPercentChange/LICENSE.md +27 -0
  101. data/lib/measures/CoilHeatingGasPercentChange/README.md +64 -0
  102. data/lib/measures/CoilHeatingGasPercentChange/README.md.erb +42 -0
  103. data/lib/measures/CoilHeatingGasPercentChange/measure.rb +271 -0
  104. data/lib/measures/CoilHeatingGasPercentChange/measure.xml +111 -0
  105. data/lib/measures/CoilHeatingWaterMultiplier/LICENSE.md +27 -0
  106. data/lib/measures/CoilHeatingWaterMultiplier/README.md +48 -0
  107. data/lib/measures/CoilHeatingWaterMultiplier/README.md.erb +42 -0
  108. data/lib/measures/CoilHeatingWaterMultiplier/measure.rb +235 -0
  109. data/lib/measures/CoilHeatingWaterMultiplier/measure.xml +93 -0
  110. data/lib/measures/CoilHeatingWaterPercentChange/LICENSE.md +27 -0
  111. data/lib/measures/CoilHeatingWaterPercentChange/README.md +48 -0
  112. data/lib/measures/CoilHeatingWaterPercentChange/README.md.erb +42 -0
  113. data/lib/measures/CoilHeatingWaterPercentChange/measure.rb +226 -0
  114. data/lib/measures/CoilHeatingWaterPercentChange/measure.xml +93 -0
  115. data/lib/measures/ConstructionLayerZeroMaterialProperties/LICENSE.md +27 -0
  116. data/lib/measures/ConstructionLayerZeroMaterialProperties/README.md +88 -0
  117. data/lib/measures/ConstructionLayerZeroMaterialProperties/README.md.erb +42 -0
  118. data/lib/measures/ConstructionLayerZeroMaterialProperties/measure.rb +221 -0
  119. data/lib/measures/ConstructionLayerZeroMaterialProperties/measure.xml +194 -0
  120. data/lib/measures/ElectricBaseboardEfficiencyAndCapacity/LICENSE.md +27 -0
  121. data/lib/measures/ElectricBaseboardEfficiencyAndCapacity/README.md +40 -0
  122. data/lib/measures/ElectricBaseboardEfficiencyAndCapacity/README.md.erb +42 -0
  123. data/lib/measures/ElectricBaseboardEfficiencyAndCapacity/measure.rb +102 -0
  124. data/lib/measures/ElectricBaseboardEfficiencyAndCapacity/measure.xml +78 -0
  125. data/lib/measures/ExteriorWallThermalPropertiesMultiplier/LICENSE.md +27 -0
  126. data/lib/measures/ExteriorWallThermalPropertiesMultiplier/README.md +48 -0
  127. data/lib/measures/ExteriorWallThermalPropertiesMultiplier/README.md.erb +42 -0
  128. data/lib/measures/ExteriorWallThermalPropertiesMultiplier/measure.rb +263 -0
  129. data/lib/measures/ExteriorWallThermalPropertiesMultiplier/measure.xml +97 -0
  130. data/lib/measures/ExteriorWallThermalPropertiesPercentChange/LICENSE.md +27 -0
  131. data/lib/measures/ExteriorWallThermalPropertiesPercentChange/README.md +48 -0
  132. data/lib/measures/ExteriorWallThermalPropertiesPercentChange/README.md.erb +42 -0
  133. data/lib/measures/ExteriorWallThermalPropertiesPercentChange/measure.rb +253 -0
  134. data/lib/measures/ExteriorWallThermalPropertiesPercentChange/measure.xml +97 -0
  135. data/lib/measures/FansMultiplier/LICENSE.md +27 -0
  136. data/lib/measures/FansMultiplier/README.md +64 -0
  137. data/lib/measures/FansMultiplier/README.md.erb +42 -0
  138. data/lib/measures/FansMultiplier/measure.rb +297 -0
  139. data/lib/measures/FansMultiplier/measure.xml +166 -0
  140. data/lib/measures/FansPercentChange/LICENSE.md +27 -0
  141. data/lib/measures/FansPercentChange/README.md +64 -0
  142. data/lib/measures/FansPercentChange/README.md.erb +42 -0
  143. data/lib/measures/FansPercentChange/measure.rb +286 -0
  144. data/lib/measures/FansPercentChange/measure.xml +166 -0
  145. data/lib/measures/GeneralCalibrationMeasureMultiplier/LICENSE.md +27 -0
  146. data/lib/measures/GeneralCalibrationMeasureMultiplier/README.md +112 -0
  147. data/lib/measures/GeneralCalibrationMeasureMultiplier/README.md.erb +42 -0
  148. data/lib/measures/GeneralCalibrationMeasureMultiplier/measure.rb +639 -0
  149. data/lib/measures/GeneralCalibrationMeasureMultiplier/measure.xml +229 -0
  150. data/lib/measures/GeneralCalibrationMeasurePercentChange/LICENSE.md +27 -0
  151. data/lib/measures/GeneralCalibrationMeasurePercentChange/README.md +112 -0
  152. data/lib/measures/GeneralCalibrationMeasurePercentChange/README.md.erb +42 -0
  153. data/lib/measures/GeneralCalibrationMeasurePercentChange/measure.rb +756 -0
  154. data/lib/measures/GeneralCalibrationMeasurePercentChange/measure.xml +229 -0
  155. data/lib/measures/HardSizeHvac/LICENSE.md +27 -0
  156. data/lib/measures/HardSizeHvac/README.md +26 -0
  157. data/lib/measures/HardSizeHvac/README.md.erb +42 -0
  158. data/lib/measures/HardSizeHvac/measure.rb +88 -0
  159. data/lib/measures/HardSizeHvac/measure.xml +81 -0
  160. data/lib/measures/MaalkaMonthlyJSONUtilityData/LICENSE.md +27 -0
  161. data/lib/measures/MaalkaMonthlyJSONUtilityData/README.md +104 -0
  162. data/lib/measures/MaalkaMonthlyJSONUtilityData/README.md.erb +42 -0
  163. data/lib/measures/MaalkaMonthlyJSONUtilityData/measure.rb +304 -0
  164. data/lib/measures/MaalkaMonthlyJSONUtilityData/measure.xml +216 -0
  165. data/lib/measures/RValueOfInsulationForConstructionMultiplier/LICENSE.md +27 -0
  166. data/lib/measures/RValueOfInsulationForConstructionMultiplier/README.md +40 -0
  167. data/lib/measures/RValueOfInsulationForConstructionMultiplier/README.md.erb +42 -0
  168. data/lib/measures/RValueOfInsulationForConstructionMultiplier/measure.rb +196 -0
  169. data/lib/measures/RValueOfInsulationForConstructionMultiplier/measure.xml +132 -0
  170. data/lib/measures/RValueOfInsulationForConstructionPercentageChange/LICENSE.md +27 -0
  171. data/lib/measures/RValueOfInsulationForConstructionPercentageChange/README.md +40 -0
  172. data/lib/measures/RValueOfInsulationForConstructionPercentageChange/README.md.erb +42 -0
  173. data/lib/measures/RValueOfInsulationForConstructionPercentageChange/measure.rb +189 -0
  174. data/lib/measures/RValueOfInsulationForConstructionPercentageChange/measure.xml +132 -0
  175. data/lib/measures/RoofThermalPropertiesMultiplier/LICENSE.md +27 -0
  176. data/lib/measures/RoofThermalPropertiesMultiplier/README.md +48 -0
  177. data/lib/measures/RoofThermalPropertiesMultiplier/README.md.erb +42 -0
  178. data/lib/measures/RoofThermalPropertiesMultiplier/measure.rb +263 -0
  179. data/lib/measures/RoofThermalPropertiesMultiplier/measure.xml +97 -0
  180. data/lib/measures/RoofThermalPropertiesPercentChange/LICENSE.md +27 -0
  181. data/lib/measures/RoofThermalPropertiesPercentChange/README.md +48 -0
  182. data/lib/measures/RoofThermalPropertiesPercentChange/README.md.erb +42 -0
  183. data/lib/measures/RoofThermalPropertiesPercentChange/measure.rb +253 -0
  184. data/lib/measures/RoofThermalPropertiesPercentChange/measure.xml +97 -0
  185. data/lib/measures/TimeseriesObjectiveFunction/LICENSE.md +27 -0
  186. data/lib/measures/TimeseriesObjectiveFunction/README.md +207 -0
  187. data/lib/measures/TimeseriesObjectiveFunction/README.md.erb +42 -0
  188. data/lib/measures/TimeseriesObjectiveFunction/measure.rb +748 -0
  189. data/lib/measures/TimeseriesObjectiveFunction/measure.xml +435 -0
  190. data/lib/measures/TimeseriesObjectiveFunction/resources/report.html.erb +288 -0
  191. data/lib/measures/TimeseriesPlot/LICENSE.md +27 -0
  192. data/lib/measures/TimeseriesPlot/README.md +56 -0
  193. data/lib/measures/TimeseriesPlot/README.md.erb +42 -0
  194. data/lib/measures/TimeseriesPlot/measure.rb +302 -0
  195. data/lib/measures/TimeseriesPlot/measure.xml +137 -0
  196. data/lib/measures/TimeseriesPlot/resources/report.html.erb +270 -0
  197. data/lib/measures/WaterHeaterMixedMultiplier/LICENSE.md +27 -0
  198. data/lib/measures/WaterHeaterMixedMultiplier/README.md +64 -0
  199. data/lib/measures/WaterHeaterMixedMultiplier/README.md.erb +42 -0
  200. data/lib/measures/WaterHeaterMixedMultiplier/measure.rb +255 -0
  201. data/lib/measures/WaterHeaterMixedMultiplier/measure.xml +180 -0
  202. data/lib/measures/WaterHeaterMixedPercentChange/LICENSE.md +27 -0
  203. data/lib/measures/WaterHeaterMixedPercentChange/README.md +64 -0
  204. data/lib/measures/WaterHeaterMixedPercentChange/README.md.erb +42 -0
  205. data/lib/measures/WaterHeaterMixedPercentChange/measure.rb +245 -0
  206. data/lib/measures/WaterHeaterMixedPercentChange/measure.xml +180 -0
  207. data/lib/measures/zone_report/LICENSE.md +27 -0
  208. data/lib/measures/zone_report/README.md +26 -0
  209. data/lib/measures/zone_report/README.md.erb +42 -0
  210. data/lib/measures/zone_report/measure.rb +706 -0
  211. data/lib/measures/zone_report/measure.xml +67 -0
  212. data/lib/measures/zone_report/resources/report.html.in +342 -0
  213. data/lib/openstudio-calibration-measures.rb +36 -0
  214. data/lib/openstudio/calibration_measures.rb +37 -0
  215. data/lib/openstudio/calibration_measures/extension.rb +49 -0
  216. data/lib/openstudio/calibration_measures/version.rb +40 -0
  217. data/openstudio-calibration.gemspec +30 -0
  218. metadata +331 -0
@@ -0,0 +1,372 @@
1
+ <measure>
2
+ <schema_version>3.0</schema_version>
3
+ <name>calibration_reports_enhanced</name>
4
+ <uid>e6642d40-7366-4647-8724-53a37991d668</uid>
5
+ <version_id>b3ad0dfa-5173-4df2-8f42-41b0cce011f4</version_id>
6
+ <version_modified>20200325T030943Z</version_modified>
7
+ <xml_checksum>2C8A3EEF</xml_checksum>
8
+ <class_name>CalibrationReportsEnhanced</class_name>
9
+ <display_name>Calibration Reports Enhanced</display_name>
10
+ <description>This measure is intended for calibibration of modeled results against user entered utility bill.</description>
11
+ <modeler_description>Measure looks at consumption for electricity and natural gas, and demand for electricity. It is inteneded to be used with no more than one gas an electric bills. Each bill can have multiple billing periods. Make sure ot use an AMY matching the utility data time frame.</modeler_description>
12
+ <arguments>
13
+ <argument>
14
+ <name>electric_nmbe_limit</name>
15
+ <display_name>Electric NMBE limit (%)</display_name>
16
+ <type>Double</type>
17
+ <required>true</required>
18
+ <model_dependent>false</model_dependent>
19
+ <default_value>5</default_value>
20
+ </argument>
21
+ <argument>
22
+ <name>electric_cvrmse_limit</name>
23
+ <display_name>Electric CVRMSE limit (%)</display_name>
24
+ <type>Double</type>
25
+ <required>true</required>
26
+ <model_dependent>false</model_dependent>
27
+ <default_value>15</default_value>
28
+ </argument>
29
+ <argument>
30
+ <name>gas_nmbe_limit</name>
31
+ <display_name>Gas NMBE limit (%)</display_name>
32
+ <type>Double</type>
33
+ <required>true</required>
34
+ <model_dependent>false</model_dependent>
35
+ <default_value>5</default_value>
36
+ </argument>
37
+ <argument>
38
+ <name>gas_cvrmse_limit</name>
39
+ <display_name>Gas CVRMSE limit (%)</display_name>
40
+ <type>Double</type>
41
+ <required>true</required>
42
+ <model_dependent>false</model_dependent>
43
+ <default_value>15</default_value>
44
+ </argument>
45
+ <argument>
46
+ <name>fuel_oil_nmbe_limit</name>
47
+ <display_name>Fuel Oil#2 NMBE limit (%)</display_name>
48
+ <type>Double</type>
49
+ <required>true</required>
50
+ <model_dependent>false</model_dependent>
51
+ <default_value>5</default_value>
52
+ </argument>
53
+ <argument>
54
+ <name>fuel_oil_cvrmse_limit</name>
55
+ <display_name>Fuel Oil#2 CVRMSE limit (%)</display_name>
56
+ <type>Double</type>
57
+ <required>true</required>
58
+ <model_dependent>false</model_dependent>
59
+ <default_value>15</default_value>
60
+ </argument>
61
+ </arguments>
62
+ <outputs>
63
+ <output>
64
+ <name>electricity_consumption_actual</name>
65
+ <display_name>electricity_consumption_actual</display_name>
66
+ <short_name>electricity_consumption_actual</short_name>
67
+ <type>Double</type>
68
+ <model_dependent>false</model_dependent>
69
+ </output>
70
+ <output>
71
+ <name>electricity_consumption_modeled</name>
72
+ <display_name>electricity_consumption_modeled</display_name>
73
+ <short_name>electricity_consumption_modeled</short_name>
74
+ <type>Double</type>
75
+ <model_dependent>false</model_dependent>
76
+ </output>
77
+ <output>
78
+ <name>electricity_consumption_cvrmse</name>
79
+ <display_name>electricity_consumption_cvrmse</display_name>
80
+ <short_name>electricity_consumption_cvrmse</short_name>
81
+ <type>Double</type>
82
+ <model_dependent>false</model_dependent>
83
+ </output>
84
+ <output>
85
+ <name>electricity_consumption_nmbe</name>
86
+ <display_name>electricity_consumption_nmbe</display_name>
87
+ <short_name>electricity_consumption_nmbe</short_name>
88
+ <type>Double</type>
89
+ <model_dependent>false</model_dependent>
90
+ </output>
91
+ <output>
92
+ <name>electricity_sum_of_squares</name>
93
+ <display_name>electricity_sum_of_squares</display_name>
94
+ <short_name>electricity_sum_of_squares</short_name>
95
+ <type>Double</type>
96
+ <model_dependent>false</model_dependent>
97
+ </output>
98
+ <output>
99
+ <name>electricity_dof</name>
100
+ <display_name>electricity_dof</display_name>
101
+ <short_name>electricity_dof</short_name>
102
+ <type>Double</type>
103
+ <model_dependent>false</model_dependent>
104
+ </output>
105
+ <output>
106
+ <name>electricity_rmse</name>
107
+ <display_name>electricity_rmse</display_name>
108
+ <short_name>electricity_rmse</short_name>
109
+ <type>Double</type>
110
+ <model_dependent>false</model_dependent>
111
+ </output>
112
+ <output>
113
+ <name>electricity_peak_demand_nmbe</name>
114
+ <display_name>electricity_peak_demand_nmbe</display_name>
115
+ <short_name>electricity_peak_demand_nmbe</short_name>
116
+ <type>Double</type>
117
+ <model_dependent>false</model_dependent>
118
+ </output>
119
+ <output>
120
+ <name>electricity_peak_demand_actual</name>
121
+ <display_name>electricity_peak_demand_actual</display_name>
122
+ <short_name>electricity_peak_demand_actual</short_name>
123
+ <type>Double</type>
124
+ <model_dependent>false</model_dependent>
125
+ </output>
126
+ <output>
127
+ <name>electricity_peak_demand_modeled</name>
128
+ <display_name>electricity_peak_demand_modeled</display_name>
129
+ <short_name>electricity_peak_demand_modeled</short_name>
130
+ <type>Double</type>
131
+ <model_dependent>false</model_dependent>
132
+ </output>
133
+ <output>
134
+ <name>natural_gas_consumption_actual</name>
135
+ <display_name>natural_gas_consumption_actual</display_name>
136
+ <short_name>natural_gas_consumption_actual</short_name>
137
+ <type>Double</type>
138
+ <model_dependent>false</model_dependent>
139
+ </output>
140
+ <output>
141
+ <name>natural_gas_consumption_modeled</name>
142
+ <display_name>natural_gas_consumption_modeled</display_name>
143
+ <short_name>natural_gas_consumption_modeled</short_name>
144
+ <type>Double</type>
145
+ <model_dependent>false</model_dependent>
146
+ </output>
147
+ <output>
148
+ <name>natural_gas_consumption_cvrmse</name>
149
+ <display_name>natural_gas_consumption_cvrmse</display_name>
150
+ <short_name>natural_gas_consumption_cvrmse</short_name>
151
+ <type>Double</type>
152
+ <model_dependent>false</model_dependent>
153
+ </output>
154
+ <output>
155
+ <name>natural_gas_consumption_nmbe</name>
156
+ <display_name>natural_gas_consumption_nmbe</display_name>
157
+ <short_name>natural_gas_consumption_nmbe</short_name>
158
+ <type>Double</type>
159
+ <model_dependent>false</model_dependent>
160
+ </output>
161
+ <output>
162
+ <name>natural_gas_sum_of_squares</name>
163
+ <display_name>natural_gas_sum_of_squares</display_name>
164
+ <short_name>natural_gas_sum_of_squares</short_name>
165
+ <type>Double</type>
166
+ <model_dependent>false</model_dependent>
167
+ </output>
168
+ <output>
169
+ <name>natural_gas_dof</name>
170
+ <display_name>natural_gas_dof</display_name>
171
+ <short_name>natural_gas_dof</short_name>
172
+ <type>Double</type>
173
+ <model_dependent>false</model_dependent>
174
+ </output>
175
+ <output>
176
+ <name>natural_gas_rmse</name>
177
+ <display_name>natural_gas_rmse</display_name>
178
+ <short_name>natural_gas_rmse</short_name>
179
+ <type>Double</type>
180
+ <model_dependent>false</model_dependent>
181
+ </output>
182
+ <output>
183
+ <name>fuel_oil_2_consumption_actual</name>
184
+ <display_name>fuel_oil_2_consumption_actual</display_name>
185
+ <short_name>fuel_oil_2_consumption_actual</short_name>
186
+ <type>Double</type>
187
+ <model_dependent>false</model_dependent>
188
+ </output>
189
+ <output>
190
+ <name>fuel_oil_2_consumption_modeled</name>
191
+ <display_name>fuel_oil_2_consumption_modeled</display_name>
192
+ <short_name>fuel_oil_2_consumption_modeled</short_name>
193
+ <type>Double</type>
194
+ <model_dependent>false</model_dependent>
195
+ </output>
196
+ <output>
197
+ <name>fuel_oil_2_consumption_cvrmse</name>
198
+ <display_name>fuel_oil_2_consumption_cvrmse</display_name>
199
+ <short_name>fuel_oil_2_consumption_cvrmse</short_name>
200
+ <type>Double</type>
201
+ <model_dependent>false</model_dependent>
202
+ </output>
203
+ <output>
204
+ <name>fuel_oil_2_consumption_nmbe</name>
205
+ <display_name>fuel_oil_2_consumption_nmbe</display_name>
206
+ <short_name>fuel_oil_2_consumption_nmbe</short_name>
207
+ <type>Double</type>
208
+ <model_dependent>false</model_dependent>
209
+ </output>
210
+ <output>
211
+ <name>fuel_oil_2_sum_of_squares</name>
212
+ <display_name>fuel_oil_2_sum_of_squares</display_name>
213
+ <short_name>fuel_oil_2_sum_of_squares</short_name>
214
+ <type>Double</type>
215
+ <model_dependent>false</model_dependent>
216
+ </output>
217
+ <output>
218
+ <name>fuel_oil_2_dof</name>
219
+ <display_name>fuel_oil_2_dof</display_name>
220
+ <short_name>fuel_oil_2_dof</short_name>
221
+ <type>Double</type>
222
+ <model_dependent>false</model_dependent>
223
+ </output>
224
+ <output>
225
+ <name>fuel_oil_2_rmse</name>
226
+ <display_name>fuel_oil_2_rmse</display_name>
227
+ <short_name>fuel_oil_2_rmse</short_name>
228
+ <type>Double</type>
229
+ <model_dependent>false</model_dependent>
230
+ </output>
231
+ <output>
232
+ <name>total_sum_of_squares</name>
233
+ <display_name>total_sum_of_squares</display_name>
234
+ <short_name>total_sum_of_squares</short_name>
235
+ <type>Double</type>
236
+ <model_dependent>false</model_dependent>
237
+ </output>
238
+ <output>
239
+ <name>total_dof</name>
240
+ <display_name>total_dof</display_name>
241
+ <short_name>total_dof</short_name>
242
+ <type>Double</type>
243
+ <model_dependent>false</model_dependent>
244
+ </output>
245
+ <output>
246
+ <name>total_rmse</name>
247
+ <display_name>total_rmse</display_name>
248
+ <short_name>total_rmse</short_name>
249
+ <type>Double</type>
250
+ <model_dependent>false</model_dependent>
251
+ </output>
252
+ <output>
253
+ <name>electricity_cvrmse_within_limit</name>
254
+ <display_name>electricity_cvrmse_within_limit</display_name>
255
+ <short_name>electricity_cvrmse_within_limit</short_name>
256
+ <type>Double</type>
257
+ <model_dependent>false</model_dependent>
258
+ </output>
259
+ <output>
260
+ <name>electricity_nmbe_within_limit</name>
261
+ <display_name>electricity_nmbe_within_limit</display_name>
262
+ <short_name>electricity_nmbe_within_limit</short_name>
263
+ <type>Double</type>
264
+ <model_dependent>false</model_dependent>
265
+ </output>
266
+ <output>
267
+ <name>natural_gas_cvrmse_within_limit</name>
268
+ <display_name>natural_gas_cvrmse_within_limit</display_name>
269
+ <short_name>natural_gas_cvrmse_within_limit</short_name>
270
+ <type>Double</type>
271
+ <model_dependent>false</model_dependent>
272
+ </output>
273
+ <output>
274
+ <name>natural_gas_nmbe_within_limit</name>
275
+ <display_name>natural_gas_nmbe_within_limit</display_name>
276
+ <short_name>natural_gas_nmbe_within_limit</short_name>
277
+ <type>Double</type>
278
+ <model_dependent>false</model_dependent>
279
+ </output>
280
+ <output>
281
+ <name>fuel_oil_2_cvrmse_within_limit</name>
282
+ <display_name>fuel_oil_2_cvrmse_within_limit</display_name>
283
+ <short_name>fuel_oil_2_cvrmse_within_limit</short_name>
284
+ <type>Double</type>
285
+ <model_dependent>false</model_dependent>
286
+ </output>
287
+ <output>
288
+ <name>fuel_oil_2_nmbe_within_limit</name>
289
+ <display_name>fuel_oil_2_nmbe_within_limit</display_name>
290
+ <short_name>fuel_oil_2_nmbe_within_limit</short_name>
291
+ <type>Double</type>
292
+ <model_dependent>false</model_dependent>
293
+ </output>
294
+ </outputs>
295
+ <provenances/>
296
+ <tags>
297
+ <tag>Reporting.QAQC</tag>
298
+ </tags>
299
+ <attributes>
300
+ <attribute>
301
+ <name>Measure Type</name>
302
+ <value>ReportingMeasure</value>
303
+ <datatype>string</datatype>
304
+ </attribute>
305
+ <attribute>
306
+ <name>Uses SketchUp API</name>
307
+ <value>false</value>
308
+ <datatype>boolean</datatype>
309
+ </attribute>
310
+ </attributes>
311
+ <files>
312
+ <file>
313
+ <filename>ExampleModel.osm</filename>
314
+ <filetype>osm</filetype>
315
+ <usage_type>test</usage_type>
316
+ <checksum>5A314A0A</checksum>
317
+ </file>
318
+ <file>
319
+ <filename>USA_CO_Golden-NREL.724666_TMY3.epw</filename>
320
+ <filetype>epw</filetype>
321
+ <usage_type>test</usage_type>
322
+ <checksum>BDF687C1</checksum>
323
+ </file>
324
+ <file>
325
+ <filename>report.html.in</filename>
326
+ <filetype>in</filetype>
327
+ <usage_type>resource</usage_type>
328
+ <checksum>B112BA5D</checksum>
329
+ </file>
330
+ <file>
331
+ <filename>ExampleModel_FuelOil.osm</filename>
332
+ <filetype>osm</filetype>
333
+ <usage_type>test</usage_type>
334
+ <checksum>4FC9D41F</checksum>
335
+ </file>
336
+ <file>
337
+ <filename>LICENSE.md</filename>
338
+ <filetype>md</filetype>
339
+ <usage_type>license</usage_type>
340
+ <checksum>E0468DD6</checksum>
341
+ </file>
342
+ <file>
343
+ <filename>README.md.erb</filename>
344
+ <filetype>erb</filetype>
345
+ <usage_type>readmeerb</usage_type>
346
+ <checksum>703C9964</checksum>
347
+ </file>
348
+ <file>
349
+ <filename>README.md</filename>
350
+ <filetype>md</filetype>
351
+ <usage_type>readme</usage_type>
352
+ <checksum>9073A0CD</checksum>
353
+ </file>
354
+ <file>
355
+ <version>
356
+ <software_program>OpenStudio</software_program>
357
+ <identifier>1.11.0</identifier>
358
+ <min_compatible>1.11.0</min_compatible>
359
+ </version>
360
+ <filename>measure.rb</filename>
361
+ <filetype>rb</filetype>
362
+ <usage_type>script</usage_type>
363
+ <checksum>ACA4EC77</checksum>
364
+ </file>
365
+ <file>
366
+ <filename>CalibrationReportsEnhanced_Test.rb</filename>
367
+ <filetype>rb</filetype>
368
+ <usage_type>test</usage_type>
369
+ <checksum>98659D83</checksum>
370
+ </file>
371
+ </files>
372
+ </measure>
@@ -0,0 +1,380 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Calibration | OpenStudio</title>
6
+ <link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet">
7
+ <style type="text/css">
8
+ body {
9
+ font: 10px sans-serif;
10
+ min-width: 750px;
11
+ }
12
+ table {
13
+ max-width:700px;
14
+ }
15
+ .axis path, .axis line {
16
+ fill: none;
17
+ stroke: #000;
18
+ shape-rendering: crispEdges;
19
+ }
20
+ .bar {
21
+ fill: steelblue;
22
+ }
23
+ .x.axis path {
24
+ display: none;
25
+ }
26
+ .d3-tip {
27
+ line-height: 1;
28
+ font-weight: bold;
29
+ padding: 12px;
30
+ background: rgba(0, 0, 0, 0.8);
31
+ color: #fff;
32
+ border-radius: 2px;
33
+ }
34
+ /* Creates a small triangle extender for the tooltip */
35
+ .d3-tip:after {
36
+ box-sizing: border-box;
37
+ display: inline;
38
+ font-size: 10px;
39
+ width: 100%;
40
+ line-height: 1;
41
+ color: rgba(0, 0, 0, 0.8);
42
+ content:"\25BC";
43
+ position: absolute;
44
+ text-align: center;
45
+ }
46
+ /* Style northward tooltips differently */
47
+ .d3-tip.n:after {
48
+ margin: -1px 0 0 0;
49
+ top: 100%;
50
+ left: 0;
51
+ }
52
+ .chartInfo h6 {
53
+ display: inline;
54
+ }
55
+ </style>
56
+ <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
57
+ <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.3.9/d3.min.js"></script>
58
+ <script type="text/javascript">
59
+ // http://labratrevenge.com/d3-tip/javascripts/d3.tip.min.js
60
+ d3.tip=function(){function t(t){v=m(t),w=v.createSVGPoint(),document.body.appendChild(x)}function e(){return"n"}function n(){return[0,0]}function r(){return" "}function o(){var t=p();return{top:t.n.y-x.offsetHeight,left:t.n.x-x.offsetWidth/2}}function s(){var t=p();return{top:t.s.y,left:t.s.x-x.offsetWidth/2}}function l(){var t=p();return{top:t.e.y-x.offsetHeight/2,left:t.e.x}}function u(){var t=p();return{top:t.w.y-x.offsetHeight/2,left:t.w.x-x.offsetWidth}}function f(){var t=p();return{top:t.nw.y-x.offsetHeight,left:t.nw.x-x.offsetWidth}}function i(){var t=p();return{top:t.ne.y-x.offsetHeight,left:t.ne.x}}function a(){var t=p();return{top:t.sw.y,left:t.sw.x-x.offsetWidth}}function c(){var t=p();return{top:t.se.y,left:t.e.x}}function d(){var t=d3.select(document.createElement("div"));return t.style({position:"absolute",opacity:0,pointerEvents:"none",boxSizing:"border-box"}),t.node()}function m(t){return t=t.node(),"svg"==t.tagName.toLowerCase()?t:t.ownerSVGElement}function p(){var t=d3.event.target,e={},n=t.getScreenCTM(),r=t.getBBox(),o=r.width,s=r.height,l=r.x,u=r.y,f=document.body.scrollTop,i=document.body.scrollLeft;return document.documentElement&&document.documentElement.scrollTop&&(f=document.documentElement.scrollTop,i=document.documentElement.scrollLeft),w.x=l+i,w.y=u+f,e.nw=w.matrixTransform(n),w.x+=o,e.ne=w.matrixTransform(n),w.y+=s,e.se=w.matrixTransform(n),w.x-=o,e.sw=w.matrixTransform(n),w.y-=s/2,e.w=w.matrixTransform(n),w.x+=o,e.e=w.matrixTransform(n),w.x-=o/2,w.y-=s/2,e.n=w.matrixTransform(n),w.y+=s,e.s=w.matrixTransform(n),e}var y=e,g=n,h=r,x=d(),v=null,w=null;t.show=function(){var e,n=h.apply(this,arguments),r=g.apply(this,arguments),o=y.apply(this,arguments),s=d3.select(x),l=0;for(s.html(n).style({opacity:1,pointerEvents:"all"});l--;)s.classed(E[l],!1);return e=T.get(o).apply(this),s.classed(o,!0).style({top:e.top+r[0]+"px",left:e.left+r[1]+"px"}),t},t.hide=function(){return nodel=d3.select(x),nodel.style({opacity:0,pointerEvents:"none"}),t},t.attr=function(e){if(2>arguments.length&&"string"==typeof e)return d3.select(x).attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(d3.select(x),n),t},t.style=function(e){if(2>arguments.length&&"string"==typeof e)return d3.select(x).style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(d3.select(x),n),t},t.direction=function(e){return arguments.length?(y=null==e?e:d3.functor(e),t):y},t.offset=function(e){return arguments.length?(g=null==e?e:d3.functor(e),t):g},t.html=function(e){return arguments.length?(h=null==e?e:d3.functor(e),t):h};var T=d3.map({n:o,s:s,e:l,w:u,nw:f,ne:i,sw:a,se:c}),E=T.keys();return t};
61
+ </script>
62
+ </head>
63
+ <body>
64
+ <div style="width:250px;display:inline-block;">
65
+ <label>Calibration Method</label>
66
+ <select id="calibrationMethodSelect">
67
+ </select>
68
+ </div>
69
+ <div style="width:400px;display:inline-block;">
70
+ <h6 id="calibrationString"></h6>
71
+ </div>
72
+ <div id="consumptionString-0" class="chartInfo"></div>
73
+ <div id="chart-0"></div>
74
+ <div id="table-0" ></div>
75
+ <div id="consumptionString-1" class="chartInfo"></div>
76
+ <div id="chart-1"></div>
77
+ <div id="table-1" ></div>
78
+ <div id="consumptionString-2" class="chartInfo"></div>
79
+ <div id="chart-2"></div>
80
+ <div id="table-2" ></div>
81
+ <div id="consumptionString-3" class="chartInfo"></div>
82
+ <div id="chart-3"></div>
83
+ <div id="table-3" ></div>
84
+ <script type="text/javascript">
85
+ function numFormat(n) {
86
+ var parts = n.toString().split(".");
87
+ return parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",") + (parts[1] ? "." + parts[1] : "");
88
+ }
89
+
90
+ <%= energy %>
91
+
92
+ $.each(calibrationGuidelines, function (index, value) {
93
+ $('#calibrationMethodSelect')
94
+ .append($("<option></option>")
95
+ .attr("value", index)
96
+ .text(value));
97
+ });
98
+
99
+ $("#calibrationMethodSelect").change(onMethodChange);
100
+
101
+ var maxNMBE = 0;
102
+ var maxCVRMSE = 0;
103
+
104
+ function onMethodChange() {
105
+ if ($('#calibrationMethodSelect').val() == "0") {
106
+ maxNMBE = ashraeMaxNMBE;
107
+ maxCVRMSE = ashraeMaxCVRMSE;
108
+ } else {
109
+ maxNMBE = fempMaxNMBE;
110
+ maxCVRMSE = fempMaxCVRMSE;
111
+ }
112
+ $('#calibrationString').text("NMBE of " + maxNMBE + "% or less and CV(RMSE) of " + maxCVRMSE + "% relative to monthly data. Must contain all utility data for one year and real weather data. Check the guideline for additional requirements.");
113
+
114
+ $('.table').each(function(i) {
115
+ $(this).find('tr:last td:not(:first)').each(function(j) {
116
+ var value = $(this).text().replace(/%/g, '');
117
+ if (value != "&mdash;") {
118
+ var num = parseFloat(value);
119
+ if (Math.abs(num) > maxNMBE) {
120
+ num = "<font color=\"red\">" + num;
121
+ }
122
+ num = num + "%";
123
+ $(this).html(num);
124
+ }
125
+ });
126
+ })
127
+
128
+ for (var c in charts) {
129
+
130
+ if(consumption[charts[c]]){
131
+ cvrmseString = "<h6>CV(RMSE) = </h6>"
132
+ num = consumption[charts[c]].cvrsme;
133
+ if (Math.abs(num) > maxCVRMSE) {
134
+ num = "<font color=\"red\">" + num + "<font color=\"black\">";
135
+ }
136
+ cvrmseString = cvrmseString + num;
137
+
138
+ nmbeString = "<h6>NMBE = </h6>"
139
+ num = consumption[charts[c]].nmbe;
140
+ if (Math.abs(num) > maxNMBE) {
141
+ num = "<font color=\"red\">" + num;
142
+ }
143
+ nmbeString = nmbeString + num;
144
+
145
+ string = "<h4 style=\"margin-bottom:-10px;\">" + charts[c] + " (" + consumption[charts[c]].units + ")</h4>";
146
+ if(charts[c] != "Electricity Demand"){
147
+ string = string + "<br>" + cvrmseString + "<br>" + nmbeString;
148
+ }
149
+ $('#consumptionString-' + c).html(string);
150
+ }
151
+
152
+ }
153
+
154
+ }
155
+
156
+ onMethodChange();
157
+
158
+ function outputTable(name, units, obj, id) {
159
+ var $table = $('<table id="' + name.toLowerCase().replace(/ /g, '-') + '">').addClass("table table-striped table-bordered table-condensed");
160
+ var headers = '';
161
+ for (var i = 1; i <= obj.Start.length; i++) headers += '<th>' + i + '</th>';
162
+ $table.append('<thead>').children('thead').append('<tr />').children('tr').append('<th>&nbsp;</th>').append(headers);
163
+ var $tbody = $table.append('<tbody />').children('tbody');
164
+ var key;
165
+ for (key in obj) {
166
+ if (obj.hasOwnProperty(key)) {
167
+ if (key == "Start" | key == "End" | key == "Actual" | key == "Model" | key == "NMBE") {
168
+ var $row = $tbody.append('<tr />').children('tr:last');
169
+ $row.append("<td>" + key + "</td>");
170
+ for (i = 0; i < obj.Start.length; i++) {
171
+ var num = obj[key][i] === 0 ? "&mdash;" : numFormat(obj[key][i]);
172
+
173
+ if (num != "&mdash;") {
174
+ if (key == "NMBE") {
175
+ if (Math.abs(num) > maxNMBE) {
176
+ num = "<font color=\"red\">" + num;
177
+ }
178
+ num = num + "%";
179
+ }
180
+ }
181
+
182
+ $row.append("<td>" + num + "</td>");
183
+ }
184
+ }
185
+ }
186
+ }
187
+ $table.appendTo('#' + id);
188
+ }
189
+
190
+ var margin = {
191
+ top: 20.5,
192
+ right: 20,
193
+ bottom: 30,
194
+ left: 40.5
195
+ },
196
+ width = 560 - margin.left - margin.right,
197
+ height = 300 - margin.top - margin.bottom;
198
+
199
+ var x0 = d3.scale.ordinal()
200
+ .rangeRoundBands([0, width], 0.1);
201
+
202
+ var x1 = d3.scale.ordinal();
203
+
204
+ var y = d3.scale.linear()
205
+ .range([height, 0]);
206
+
207
+ var color = d3.scale.ordinal()
208
+ .range(["#8CC739", "#29AAE7"]);
209
+
210
+ var xAxis = d3.svg.axis()
211
+ .scale(x0)
212
+ .orient("bottom");
213
+
214
+ var yAxis = d3.svg.axis()
215
+ .scale(y)
216
+ .orient("left")
217
+ .tickFormat(d3.format(".2s"));
218
+
219
+ var tip = d3.tip()
220
+ .attr('class', 'd3-tip')
221
+ .offset([-10, 0])
222
+ .html(function (d) {
223
+ return "<strong>" + d3.event.target.__data__.name + ":</strong> <span style='color:red'>" + d3.event.target.__data__.value + "</span>";
224
+ });
225
+
226
+ var charts = ["Electricity Consumption", "Electricity Demand", "Natural Gas Consumption", "Fuel Oil 2 Consumption"];
227
+
228
+ for (var c in charts) {
229
+
230
+ if(consumption[charts[c]]){
231
+
232
+ if (c == 0) {
233
+ margin.right = 125;
234
+ }
235
+
236
+ cvrmseString = "<h6>CV(RMSE) = </h6>"
237
+ num = consumption[charts[c]].cvrsme;
238
+ if (Math.abs(num) > maxCVRMSE) {
239
+ num = "<font color=\"red\">" + num + "<font color=\"black\">";
240
+ }
241
+ cvrmseString = cvrmseString + num;
242
+
243
+ nmbeString = "<h6>NMBE = </h6>"
244
+ num = consumption[charts[c]].nmbe;
245
+ if (Math.abs(num) > maxNMBE) {
246
+ num = "<font color=\"red\">" + num;
247
+ }
248
+ nmbeString = nmbeString + num;
249
+
250
+ string = "<h4 style=\"margin-bottom:-10px;\">" + charts[c] + " (" + consumption[charts[c]].units + ")</h4>";
251
+ if(charts[c] != "Electricity Demand"){
252
+ string = string + "<br>" + cvrmseString + "<br>" + nmbeString;
253
+ }
254
+ $('#consumptionString-' + c).html(string);
255
+
256
+ var svg = d3.select("#chart-" + c).append("svg")
257
+ .attr("width", width + margin.left + margin.right)
258
+ .attr("height", height + margin.top + margin.bottom)
259
+ .append("g")
260
+ .attr("transform", "translate(" + margin.left + "," + margin.top + ")");
261
+ svg.call(tip);
262
+
263
+ data = [];
264
+ for (var enduse in consumption[charts[c]].data) {
265
+ if (enduse == "Actual" | enduse == "Model") {
266
+ var enduse_data = consumption[charts[c]].data[enduse];
267
+ for (var i = 1; i <= enduse_data.length; i++) {
268
+ if (data.length < enduse_data.length) {
269
+ var temp = {
270
+ "Month": i
271
+ };
272
+ temp[enduse] = enduse_data[i - 1];
273
+ data.push(temp);
274
+ } else {
275
+ data[i - 1][enduse] = enduse_data[i - 1];
276
+ }
277
+ }
278
+ }
279
+ }
280
+ var comparison = d3.keys(data[0]).filter(function (key) {
281
+ return key !== "Month";
282
+ });
283
+
284
+ data.forEach(function (d) {
285
+ d.consumption = comparison.map(function (name) {
286
+ return {
287
+ name: name,
288
+ value: +d[name]
289
+ };
290
+ });
291
+ });
292
+
293
+ x0.domain(data.map(function (d) {
294
+ return d.Month;
295
+ }));
296
+ x1.domain(comparison).rangeRoundBands([0, x0.rangeBand()]);
297
+ y.domain([0, d3.max(data, function (d) {
298
+ return d3.max(d.consumption, function (d) {
299
+ return d.value;
300
+ });
301
+ })]);
302
+
303
+ //data.sort(function(a, b) { return b.total - a.total; });
304
+
305
+ svg.append("g")
306
+ .attr("class", "x axis")
307
+ .attr("transform", "translate(0," + height + ")")
308
+ .call(xAxis);
309
+
310
+ svg.append("g")
311
+ .attr("class", "y axis")
312
+ .call(yAxis)
313
+ .append("text")
314
+ .attr("transform", "rotate(-90)")
315
+ .attr("y", -36)
316
+ .attr("dy", ".71em")
317
+ .style("text-anchor", "end")
318
+ .text(consumption[charts[c]].units);
319
+
320
+ var month = svg.selectAll(".month")
321
+ .data(data)
322
+ .enter().append("g")
323
+ .attr("class", "g")
324
+ .on('mouseover', tip.show)
325
+ .on('mouseout', tip.hide)
326
+ .attr("transform", function (d) {
327
+ return "translate(" + x0(d.Month) + ",0)";
328
+ });
329
+
330
+ month.selectAll("rect")
331
+ .data(function (d) {
332
+ return d.consumption;
333
+ })
334
+ .enter().append("rect")
335
+ .attr("width", x1.rangeBand())
336
+ .attr("x", function (d) {
337
+ return x1(d.name);
338
+ })
339
+ .attr("y", function (d) {
340
+ return y(d.value);
341
+ })
342
+ .attr("height", function (d) {
343
+ return height - y(d.value);
344
+ })
345
+ .style("fill", function (d) {
346
+ return color(d.name);
347
+ });
348
+
349
+ var legend = svg.selectAll(".legend")
350
+ .data(comparison.slice().reverse())
351
+ .enter().append("g")
352
+ .attr("class", "legend")
353
+ .attr("transform", function (d, i) {
354
+ return "translate(0," + i * 20 + ")";
355
+ });
356
+
357
+ legend.append("rect")
358
+ .attr("x", width + 105)
359
+ .attr("width", 18)
360
+ .attr("height", 18)
361
+ .style("fill", color);
362
+
363
+ legend.append("text")
364
+ .attr("x", width + 105 - 3)
365
+ .attr("y", 9)
366
+ .attr("dy", ".35em")
367
+ .style("text-anchor", "end")
368
+ .text(function (d) {
369
+ return d;
370
+ });
371
+
372
+ svg.selectAll(".g").attr("stroke", "black");
373
+
374
+ outputTable(charts[c], consumption[charts[c]].units, consumption[charts[c]].data, "table-" + c);
375
+ }
376
+
377
+ }
378
+ </script>
379
+ </body>
380
+ </html>