Revision history [back]
You should be able to create a time series with zero values, though the tricky parts may be getting the right Vector object and the right first report time. Here's Ruby code to do it for a complete year:
require 'openstudio'
values = OpenStudio::Vector.new(8760, 0.0)
date = OpenStudio::Date.new(OpenStudio::MonthOfYear.new("Jan"), 1, 2009)
time = OpenStudio::Time.new(0,1,0,0)
timeSeries = OpenStudio::TimeSeries.new(date, time, values, "")
Note that in the documentation the firstReportDateTime
arguments are going to be the date and time of the first value in the time series, so if I had used one of those constructors I would be passing in 1/1/2009 01:00.
There are more examples here on creating time series. Unfortunately, the Ruby tests are gone now, only the C++ tests remain.
You should be able to create a time series with zero values, though the tricky parts may be getting the right Vector object and the right first report time. Here's Ruby code to do it for a complete year:
require 'openstudio'
values = OpenStudio::Vector.new(8760, 0.0)
date = OpenStudio::Date.new(OpenStudio::MonthOfYear.new("Jan"), 1, 2009)
time = OpenStudio::Time.new(0,1,0,0)
timeSeries = OpenStudio::TimeSeries.new(date, time, values, "")
Note that in the documentation the firstReportDateTime
arguments are going to be the date and time of the first value in the time series, so if I had used one of those constructors I would be passing in 1/1/2009 01:00.
There are more examples here and here on creating time series. Unfortunately, the Ruby tests are gone now, only the C++ tests remain.series
You should be able to create a time series with zero values, though the tricky parts part may be getting the right Vector object and the right first report time. Here's Ruby code to do it for a complete year:
require 'openstudio'
values = OpenStudio::Vector.new(8760, 0.0)
date = OpenStudio::Date.new(OpenStudio::MonthOfYear.new("Jan"), 1, 2009)
time = OpenStudio::Time.new(0,1,0,0)
timeSeries = OpenStudio::TimeSeries.new(date, time, values, "")
Note that in the documentation the firstReportDateTime
arguments are going to be the date and time of the first value in the time series, so if I had used one of those constructors I would be passing in 1/1/2009 01:00.
There are more examples here and here on creating time series