Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
0

How can I obtain the meter.csv file using the EnergyPlus Python API?

asked 2024-04-30 09:01:17 -0500

Irfan's avatar

updated 2024-05-01 09:20:33 -0500

I'm simulating an IDF file using the EnergyPlus Python API, but I'm not obtaining the <prefix>meter.csv file. However, when I run the IDF file simulation directly with EP launch, I do get the <prefix>meter.csv. Could someone please advise me on how to obtain the meter.csv file using the EnergyPlus API?

edit retag flag offensive close merge delete

Comments

See if this documentation can help.

https://nrel.github.io/EnergyPlus/api...

sashadf1's avatar sashadf1  ( 2024-05-01 14:42:35 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2024-05-07 04:00:24 -0500

PmP's avatar

updated 2024-05-07 04:01:35 -0500

I don't use the python API but I just done this last week using batch, so you should be able to do the same in Python.

The meter.CSV isn't an output from E+, it is an output from READVARSESO.exe, a tool built in EP Launch that reads the .eso and .mtr files. This is the information page:

https://bigladdersoftware.com/epx/docs/8-0/input-output-reference/page-090.html.

That .exe is in every E+ download in the "postprocess" folder, so you already have it. Once you call E+ from Python and get the .ESO, calling the ReadvarsEso with the correct arguments and some neccesary file in the same folder should work. With the link I gave you should be able to make it work for yourself in python, but I leave to you how I made it work for myself in case it helps.

In particular, readvars needs 2 files .mvi and .rvi for the variable and meter .CSV files respectively, so the call to readvarsESO in my case looks like this (Unlimited makes it so you can output more than 255 variables):

ReadVarsESO ins.rvi unlimited  
ReadVarsESO ins.mvi unlimited

And those ins.rvi and .mvi look like this:

The whole content of the .mvi is:

!idfName!out.mtr
!idfName!outmeter.csv

And for the .rvi:

!idfName!out.eso
!idfName!out.csv

So my workflow (Because I modified the E+ source code so I call E+ not from EPLaunch) is using batch to call E+ and after simulating I get the names of the .eso and .mtr files, write it into the .rvi and .mvi accordingly, and call readvars with the previously stated arguments. That way I get the .csv and meter.csv files to work with.

Implementing this in python is something that you can probably do yourself so I wish you luck in your simulations, PMP

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

2 followers

Stats

Asked: 2024-04-30 09:01:17 -0500

Seen: 77 times

Last updated: May 07