Error when using new gensdaymtx and epw2wea files

Hi Radiance community,

I tried to follow “New Hyperspectral Rendering Capabilities in Radiance” workshop held by Greg Ward and Taoning Wang on 2024.
So when I run the below command, I get this error message: “need WEA in photopic unit”
epw2wea -a CAN_ON_Ottawa_CWEC.epw | gensdaymtx -u -m 1 -of > text.mtx

I tried different EPW files and all get the same error.
So I would appreciate it if you could let me know how I can solve this error.

Best regards,
Majid

Hi Majid,

There has being some changes with how gensdaymtx takes input weather data. You can just feed epw file to gensdaymtx directly without using epw2wea. epw2wea only output irradiance rather than illuminance values.

Hi Taoning,

Thank you so much for your help.
So, following your presentation on Radiance workshop, I run the below command:
gensdaymtx -n 8 -u -m 1 -of CAN_ON_Ottawa_CWEC.epw | rcrop 1 0 0 0 > CAN_ON_Ottawa_CWEC.mtx

but I got this error messgae:
rcrop: bad input header

However if I do like these instead:
gensdaymtx -n 8 -u -m 1 CAN_ON_Ottawa_CWEC.epw > CAN_ON_Ottawa_CWEC.tmp
rcrop 1 0 0 0 CAN_ON_Ottawa_CWEC.tmp > CAN_ON_Ottawa_CWEC.mtx
it works.

However, my first question is why we use rcrop 1 0 0 0 and not 0 0 0 0 ?

Then to continue to do calculation a series of calculation points, I did rfluxmtx like this:
rfluxmtx -v -I+ -y 487 -ad 10000 -lw 0.0001 -ab 3 -cs 9 - test_sky_dc.rad -i test.oct < test.pts > test.mtx

The test_sky_dc.rad is defined like this:
#@rfluxmtx h=u u=Y
void glow ground_glow
0
0
4 1 1 1 0

ground_glow source ground
0
0
4 0 0 -1 180

#@rfluxmtx h=r1 u=Y
void glow sky_glow
0
0
4 1 1 1 0

sky_glow source sky
0
0
4 0 0 1 180

Next I did like this:
rcomb -n 8 -fc test.mtx -m CAN_ON_Ottawa_CWEC.mtx > testttt.mtx

but I got this error message:
rcomb: number of input columns does not match number of rows in ‘CAN_ON_Ottawa_CWEC.mtx’

What should I do to solve this?

Best regards,
Majid

Hi Majid,

The reason for using “rcrop 1 0 0 0” is to remove the first row from the matrix, which corresponds to the ground. (“rcrop 0 0 0 0” would be a no-op.) This assumes you are not using a ground component, which it appears you are from your rfluxmtx input. So, I would leave this command off in your case.

I do wonder why you got an error when you piped the output directly to rcrop. If you are using the Windows PowerShell, this tends to create non-ASCII output files. I would avoid it whenever possible. If you are on a Unix system, I am even more puzzled and was not able to reproduce the error.

Also, there is rarely a need for the -n option to rcomb, which doesn’t work under Windows and only helps in rare cases, anyway.

Cheers,
-Greg

Hi Greg,

Thank you so much for your explanation. Now I tested on Mac and gendaylit / rcrop works well.
However, I still get a similar error on Mac when running this command:
rcomb -n 8 -fc test.mtx -m CAN_ON_Ottawa_CWEC.mtx > testttt.mtx
In Mac it says: rcomb: number of components does not match those in ‘CAN_ON_Ottawa_CWEC.mtx’
I would appreciate it if you could help me resolve this issue.

Best regards,
Majid

Hi Majid,

You need to compute the same number of wavelengths in rfluxmtx if you want to multiply the spectra together without losing precision. So, if you run rfluxmtx with “-cs 20” it should produce a matrix with the same number of components as in the output from gensdaymtx.

It is possible to convert the number of components prior to concatenation, but the results will suffer.

Best,
-Greg

Hi Greg,

Thank you much. Now everything is clear to me.

Best regards,
Majid