I’m really enjoying looking through the cyclops tutorial files, but I’ve run into a slight hiccup, and I haven’t been able to find much documentation on the issue because Cyclops is still so new. When I open up the daylight autonomy tutorial file, I’m asked to input an EPW file to the weather component, but when I use the filepath node and connect it to the weather, I am given this error message:
Solution exception:Could not load the specified EPW file: Index was outside the bounds of the array.
Is there any specific file folder my epw needs to be in for the weather component to access it? I tried moving it to my downloads folder, but to no avail. Thanks in advance for your help!
The input should simply be a path to the file. As long as you have read access I believe it should work.
But judging by the warning it seems the file is found but Cyclops is running into problems when reading the data. So I believe your EPW file might be corrupt or it is written in a way that Cyclops can’t handle. Could you maybe test with a few others and see if you get the same warning?
Would be great if you could send the EPW file that doesn’t work and we can test our end and see if we can make the parsing more resilient.
I’ve swapped out a few different EPW files to check, but have run into this same error across several different files. I’ve attached two files that had this error, with the Phoenix one being the initial file I was trying to use.
The component did work with a few other EPW files, but not the one I was originally hoping to utilize. USA_AZ_Phoenix_TMY2.epw (1.4 MB)
I’m hitting the same issue - I’ve tried 3 different weather files from the CIBSE 2016 data set. I know from experience that the CIBSE epws didn’t used to work with LBT. Although that’s now resolved, at that time I wrote this janky code below to “fix” the CIBSE weather files. Sharing in case it helps identify the issue Cyclops is hitting.
import rhinoscriptsyntax as rs
import os
try:
import ladybug.epw as epw
except ImportError as e:
raise ImportError('\nFailed to import ladybug:\n\t{}'.format(e))
try:
from ladybug_rhino.grasshopper import all_required_inputs
except ImportError as e:
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
epw_data = epw.EPW(_epw_file)
raw_data = epw_data.to_file_string().split("\n")[-8761:]
new_data = []
for item in raw_data:
new_data.append(item + ",0,0,0")
start_data = epw_data.to_file_string().split("\n")[:8]
output_data = start_data + new_data
output_data = '\n'.join(output_data)
output_epw = epw.EPW.from_file_string(output_data)
base_name = os.path.basename(_epw_file)
base_path = os.path.dirname(_epw_file)
output_file_name = base_path + "\LBT\CustomLBT" + base_name
print(output_file_name)
output_epw.write(output_file_name)
output_path = output_file_name
ddy_folder = base_path + "\LBT"
And thanks for the suggestion, as your code indicates, it seems some files are missing the last three fields (Albedo, Liquid Precipitation Depth, Liquid Precipitation Quantity).
@Andrew_Luttrell We’ve pushed a new version (1.1.3) which includes a fix for this and some other updates to the EPW parsing, if you update Cyclops your file should work.
But please come back if you’re still running into errors!