Page 1 of 1

Using VELocate() on model that isn't open

Posted: Thu Nov 30, 2023 4:10 am
by bbrannon4
I'm working on a script to pull some data based on a selected annual results file. I'd also like to include some non-results file specific project metadata, sat latitude and longitude for example. In the show_location_and_weather.py example file it just references the model that's open, and I can't find any documentation on how to pass a different model reference. Does anyone have any ideas? I also don't quite understand what VELocate() itself does (it's never mentioned in the documentation) and what the purpose of open_wea_data() is, since it's doesn't actually return anything. Part of the example file code:

Code: Select all

    # create the API object for ApLocate data
    loc = iesve.VELocate()

    # read the data for the current project
    loc.open_wea_data()

    # get the currently available ApLocate data as a dictionary
    data = loc.get()
    

Re: Using VELocate() on model that isn't open

Posted: Sat Mar 09, 2024 12:11 am
by enerGwizz
Hi Ben,
I'm not positive, but I don't think you can do that for a project that isn't open. What you MIGHT be able to do is to determine the weather file used from the results file you're opening. Then go directly to the weather file to open it and extract the lat/long from that. EPW files are a csv-like text-based file, so you can read them with Python.

Also, FYI.. VELocate data is stored a bit inconsistently depending on how the user set the location. For example, if you use the wizard and follow the steps to select a location, city/state/country fields will be saved one way. If you use the map app within ApLocate to search and find your project location, the data will be saved differently. If your scripts are just for your own models, and you always do this the same way, it shouldn't be an issue.