Is there an rcalc for dctimestep?

Is there a way to make dctimestep output a single value for each hour instead of an RGB triplet? It looks as if the three-component output is hardcoded. For rtrace, I would use rcalc to combine the RGB values and reduce the file size, but writing an rcalc expression for 8760 triplets seems impractical.

The 3-component/value thing is hard-coded as you say. However, you can pass the output through rmtxop to perform the conversion you are after:

dctimestep .. | rmtxop -c .265 .76 .065 - > result.mtx

If you want to incorporate the 179 conversion to photometric units, you would use:

dctimestep .. | rmtxop -c 47 120 12 - > result.mtx

If you produce binary values, either of the above would be faster as a result, but just as fast and using less memory is rcalc with getinfo:

dctimestep -of .. | getinfo -c rcalc -if3 -of -e '$1=$1*47+$2*120+$3*12' > result.mtx

This trick only works with binary matrix files, because there are no end-of-line characters to worry about. I’m also a bit worried that the NCOMP= line would be incorrect, which you could fix with getinfo and the -a option, but it would mean another command in the pipeline.

Thanks Greg,

Both options worked for me. Using getinfo does not alter the NCOMP= line, so the extra pipe is necessary:

dctimestep -of .. | getinfo -c rcalc -if3 -of -e "$1=$1*.265+$2*.76+$3*.065" | getinfo -a NCOMP=1 > result.mtx

For the record, rmtxop was a little faster for me; it took 90% of the time that getinfo took. The resulting binary mtx files are only 10% the size of the original ascii files.