Time Series Data of VistaPro Variable using VE Script API

The VE Python API allows users create simple programs using the Python Programming Language, to interact with a VE Model and/or Vista Results File
Post Reply
Veerpal Kaur
VE Newbie
VE Newbie
Posts: 1
Joined: Thu Feb 15, 2024 3:44 pm

Time Series Data of VistaPro Variable using VE Script API

Post by Veerpal Kaur »

Hi all,

I am using Python VE Scripting API for accessing the Room Variables for .clg file

Does anyone know whether or not it is possible to get the data of date and time of the variable via VE Script API.

I am using VistaPro variable “Space conditioning sensible.” and I extracted this variable as : scs = results_file_reader.get_results('Space conditioning sensible','Space conditioning sensible', 'z')

I want to get the date and time along with the variable value

I couldn’t find any support document on the internet for this .

Any help from from the community would be appreciated on this.

Regards,
Veerpal Kaur
enerGwizz
VE Student
VE Student
Posts: 46
Joined: Thu Mar 01, 2012 6:36 pm
Location: Los Angeles

Re: Time Series Data of VistaPro Variable using VE Script API

Post by enerGwizz »

I don't believe that's available in the results file, but you can figure it out with some legwork.

Code: Select all

first_day = results_file_reader.first_day
last_day = results_file_reader.last_day
results_per_day = results_file_reader.results_per_day
sim_year = results_file_reader.simulation_year
We use the Pandas library from there, which is magical for crunching data tables like this. For our own scripts, we validate that there are 365 days and 8760 values in the series first (i.e. hourly results for a non-leap year) and then use this:

Code: Select all

dt_index = pd.date_range(start="{}-01-01 01:00:00".format(sim_year), periods=8760, freq='H')
--
Greg
Post Reply