First time here? Check out the Help page!
1 | initial version |
You should be able to create a time series with zero values, though the tricky 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
2 | No.2 Revision |
You should be able to create a time series with zero values, though the tricky part 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
3 | No.3 Revision |
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 seriesseries. Unfortunately, the Ruby tests are gone now, only the C++ tests remain.