ladybug-tools / honeybee-dynamo

:honeybee: :blue_book: Honeybee library and plugin for Dynamo
GNU General Public License v3.0
17 stars 8 forks source link

Daylight Coefficient Image Based Error #31

Closed DambronOlivier closed 7 years ago

DambronOlivier commented 7 years ago

Hi @mostaphaRoudsari

After trying out the sample file of DC Image Based using the sky matrix, the following error comes up: capture

I have been trying out with three different epw, still in vain.

mostaphaRoudsari commented 7 years ago

Hi @DambronOlivier, the error is happening because for some reason the images are not created, or created with a different name and the component fails to find and rename them. Can you open the component and comment these lines and see what will be the output.

mostaphaRoudsari commented 7 years ago

Hi @DambronOlivier, Did you have the file from an earlier study open? The error message has a Windows Error. I will add a catch for this to give a warning instead of crashing.

mostaphaRoudsari commented 7 years ago

This should be fixed now. Thanks @DambronOlivier for reporting the issue.

DambronOlivier commented 7 years ago

Hi @mostaphaRoudsari , Thanks for all the updates.

I still do get a permission issue, though I did not open any files. It seems that "inside_0001.hdr" is well renamed to "inside_06_01_10". The error starts at the "inside_0002". Moreover, although the HDR are created, they are all 1kb sized. capture5

I have tried to change the permissions to the whole folder C:\Ladybug and this comes up: capture6

Could it be that some parts of the code are still active over the "results( )"?

mostaphaRoudsari commented 7 years ago

@DambronOlivier thanks for testing the updated version. At least it doesn't crash!

Hmm. 1KB hdr file shows that the file is corrupted but that shouldn't make a difference for renaming. Try to run the script below and let's see if you get the similar error. Is the 001 image also 1KB?

In the image-based analysis results just collect the path to the images in the folder so that shouldn't be the problem.

import os

fp = r'c:\ladybug\workshop\imagebased_daylightcoeff\results'
hdrs = (f for f in os.listdir(fp) if f.lower().endswith('.hdr'))
for f in hdrs:
    os.rename(os.path.join(fp, f), os.path.join(fp, f + '_renamed'))
mostaphaRoudsari commented 7 years ago

I can recreate the error on Windows 10! I'll keep you posted. image

mostaphaRoudsari commented 7 years ago

Here is what makes the hdr files for matrices corrupt. I assume these issues are coming from the same source. image

mostaphaRoudsari commented 7 years ago

@DambronOlivier this issue turns out to be deep down in calculating view size in Radiance. It was happening since you were trying a non-square view. This should be fixed now. Update honeybee libraries, close Rhino and re-run the grasshopper definition. Make sure to set reuse daylightMTX to False so it overwrites the current failed hdrs. image

DambronOlivier commented 7 years ago

@mostaphaRoudsari Wonderful!