Page 1 of 1

accessing surface data from aps

Posted: Wed Oct 03, 2018 11:40 am
by EC_Alv
Hi There,

I am after some documentation for accessing surface data via the "get_surface_results" or "get_opening_results"
API. Could i have some hint or an example?

for var in Variables_of_interest:
results = results_reader.get_surface_results(RoomIDs, RoomNames, var, 'Int surface temperature', start_day = 1, end_day = 2)
Total_results.append(results)

Cheers

Re: accessing surface data from aps

Posted: Thu Oct 04, 2018 3:03 pm
by Rhind
Hi,

Here are the relevant sections from the manual:
get_opening_results( room_id, surface_index, opening_index, aps_var, vista_var, start_day = -1, end_day = -1 ) -> Numpy array of floats
Get the results for specified opening + variable. See variables list for available variables and matching level. See get_results for start_day and end_day details.

get_surface_results( room_id, aps_handle, aps_var, vista_var, start_day = -1, end_day = -1 )
-> Numpy array of floats
Get the results for specified surface + variable. See variables list for available variables and matching level. See get_results for start_day and end_day details.
And here's a simple example script:

Code: Select all

import iesve
from ies_file_picker import IesFilePicker

total_surface_results = []
total_opening_results = []

# Get the current VE project.  
project = iesve.VEProject.get_current_project()

# Open APS file:
file_name = IesFilePicker.pick_aps_file()
with iesve.ResultsReader.open(file_name) as results_reader:
    assert results_reader is not None, "Error opening results file"

    # Go through all the models
    models = project.models
    for model in models:
        # Go through all the bodies
        bodies = model.get_bodies_and_ids(False)
        for id, body in bodies.items():
            if body.type != iesve.VEBody_type.room:
                continue

            # Go through all the surfaces
            surfaces = body.get_surfaces()
            for surface in surfaces:    
                surface_results = results_reader.get_surface_results(id, surface.get_properties()['aps_handle'], 'Int surface temperature', 'Int surface temperature')
                total_surface_results.append(surface_results)
                
                # Go through all the openings
                openings = surface.get_openings()

                for opening in openings:
                    opening_results = results_reader.get_opening_results(id, surface.index, opening.get_properties()['index'], 'Opening volume flow in', 'Volume flow in') 
                    total_opening_results.append(opening_results)

print("Surface results:")
print (total_surface_results)

print("Opening results:")
print (total_opening_results)
Hope that helps.

Re: accessing surface data from aps

Posted: Fri Oct 05, 2018 3:54 pm
by EC_Alv
Hi,

thanks for that, very clear example!
i see how the hierarchy gets unrolled and accessed.

Script works, but i have a couple of other question?
  • what exactly is the "aps_handle"?
  • I suppose results are only plotted for occupied period, by hour?
  • why do I get four columns of data? (basically, what am i looking at!?!)
  • how do I distinguish between walls/roof and ceiling surface temperature?
  • what happens if the wall has a windows in it? what surface temperature is returned?
basically, what I am trying to automate is to extract boundary conditions for a third party CFD analysis software

Best

Re: accessing surface data from aps

Posted: Mon Oct 15, 2018 4:21 pm
by EC_Alv
Hi,
I gave myself a few answers:

Q:I suppose results are only plotted for occupied period, by hour?
A: ---> results are reported for 24h per day during a specific time period (start day - end day)

Q:why do I get four columns of data? (basically, what am i looking at!?!)
A: ---> room>surface>24h values temperature

Q:how do I distinguish between walls/roof and ceiling surface temperature?
A: ---> adding the id and surface type to the surface print will help to distinguish the surfaces (anyway normally 0 is the floor and 1 is the ceiling)
---> print("Boundary_Type:",surface.type, "\nSurface_Index:", surface.index)

will need a little help for the remaining bits:
what happens if the wall has a windows in it? what surface temperature is returned?
what exactly is the "aps_handle"?


One more thing: I cannot access surface temperature of walls with 100% glazing and of internal walls.
In case of glazed walls if I reduce the percentage of glazing to less than 100% the surf temperature is extracted …. But the reading is only relative to the opaque part

Any recommendations on how do I extract surface temperature
1. from a glazed “child” surface?
2. from an internal wall?
3. From a 100% glazed wall (maybe same approach to be used on point 1)

Re: accessing surface data from aps

Posted: Tue Oct 23, 2018 8:36 am
by Rhind
what exactly is the "aps_handle"?
This handle uniquely identifies the surface within a room as surface level results are also available for adjacencies and openings.

Re: accessing surface data from aps

Posted: Tue Apr 29, 2025 4:03 pm
by murphyrw
People have been asking this question for 7 years. Believe it is solved here:
https://forums.iesve.com/viewtopic.php? ... ab#p114617