5-phase - Direct sun coefficients simulation - "dctimestep" question

Dear All,

I am using 5-phase method to simulate a case of roller shade covering a part of window at a specific time. This is my working folder 5phase_image - Google Drive. My commands are stored in 5ph_part1.sh (3-phase), 5ph_part2.sh (direct solar part of the 3-phase), and 5ph_part3.sh (direct sun coefficients). 5ph_part1.sh and 5ph_part2.sh were run successfully and the results are stored at 5phase_image/results/7592.hdr and 7592_direct.hdr. For the commands in 5ph_part3.sh, I had error when running the command
dctimestep -o results/cds/lum_sun_1%04d.hdr matrices/cds/hdr/lum_sun_1${idx}.hdr skyVectors/TP_image_sun.smx
and the error was “fatal - unexpected EOF in header”.

Any advice on how to solve this error would be greatly appreciated.
Thanks in advance,

I looked at your files, and all the files starting with “matrices/cds/hdr/lum_sun_1” are truncated, so the command that generated those has an error. This was generated (I think) by:

pcomb -h -e ‘ro=ri(1)*ri(2)+ri(3);go=gi(1)*gi(2)+gi(3);bo=bi(1)*bi(2)+bi(3)’ -o matrices/cds/materialMap_1.hdr -o matrices/cds/hdrIllSpace/5phviewM1_${idx}.hdr -o matrices/cds/hdrLumFacade/5phviewM1_${idx}.hdr > matrices/cds/hdr/lum_sun_1${idx}.hdr

I don’t really know if or why this command is failing, but the output does appear to be wrong. I did a spot-check and the inputs to pcomb seem OK. Maybe this is enough for you to track down the issue, or at least find an earlier failure point.


It was because the sky division used in procee of calculating sun coefficient was inconsistent with the one used in gendaymtx. This will cause the demension mismatch when executing matrix multiplication.

Hi Yongqing,

I think these inconsistent sky divisions will only result in files without data when executing matrix multiplication. I have also tried with -m 1 and still have the error of “fatal - unexpected EOF in header”.

Hi Greg and Yongquing,
I think my error starts with this command

vwrays -vf 5phview.vp -x 400 -y 400 -pj 0.7 -ff | rcontrib -w- -i -ab 1 -ad 256 -lw 1.0e-3 -dc 1 -dt 0 -dj 0 -ffc -n 16 vwrays -vf 5phview.vp -x 400 -y 400 -d -o matrices/cds/hdrIllSpace/5phviewM1_%04d.hdr -e MF:1 -f reinhart.cal -b rbin -bn Nrbins -m solar octrees/sunCoefficients_1.oct

because all my 5phviewM1_%04d.hdr files are black while I can see light in sunCoefficients_1.oct when using

rvu -ab 12 -vf 5phview.vp octrees/sunCoefficients_1.oct

I also checked the results files of sunCoefficients_2.oct and hdrLumFacade/5phviewM1_%04d.hdr files. The result images were black.

Thank you for your help.