Is there a Scripting Language in Homer Pro to process "Results"?
Is there a Scripting Language in Homer Pro to process "Results"
I need to Export a lot Tabular, Cash Flow Data for multiple Sensitivity/Optimization Cases.
I recommend Python as a scripting language for data analysis and manipulation and Jupyter (IPython) notebooks for writing and running code. Python is widely used for scientific computing and has many useful packages. See https://www.scipy.org/stackspec.html for the core ones, but also https://salib.github.io/SALib/ for sensitivity analysis. In particular, I find Pandas and the "DataFrame.read_csv" method to be very useful. I've been using Python to generate inputs for HOMER and reformatting individual Simulation Results CSVs for viewing in DView ( https://beopt.nrel.gov/downloadDView).
I haven't used the SALib Python package and was merely pointing out some resources I know of for the original question. HOMER as you probably know has sensitivity variables for performing sensitivity analyses from "inside" (see http://www.homerenergy.com/support/docs/3.9/sensitivity_analysis.html).
The Python module I wrote has several functions for extrapolating load or resource data that don't align with HOMER's timestep - e.g. daily peak load or annual daily hydro flow - into a format HOMER can use, which for my project's timestep of 60 min is a 1 column x 8760 row CSV file. Some of these can save time over creating these files manually (in Excel for example).
I created a public GitHub repository for my HOMER scripts and will update it as I develop it and have time.
I'm having trouble opening csv files exported from Homer in Dview. On file example is attached.
I get this message: "The selected file is not of the correct format, is corrupt, no longer exists, or you do not have permission to open it."
I can open the same file in Excel or notepad.
Do you have any tip?
The problem is the timestamp column, DView does not require one. Did you run my Python dview function on your simulation results CSV exported from HOMER? That should have deleted the timestamp column, which happens here: https://github.com/MatthewSteen/homer/blob/master/homer.py#L98. If it didn't work, please send me the HOMER CSV file and/or open an issue for this on GitHub: https://github.com/MatthewSteen/homer/issues.
Also, HOMER has a very nice built-in viewer for results that is comparable to DView. However, if you're sharing results, e.g. with clients, it's nice to have a free option that doesn't require a HOMER license.
Hi @Matt Steen
I'm trying to run your script with Spyder but I get this error:
File "<stdin>", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
The csv file is attached.
Single backslashes are interpreted as an escape character in Python strings. Try one of these:
1. Add an r at the beginning of the string:
2. Add two backslashes to the path: