Header change in radiance

Hi Greg,

It seems there was a header change introduced last year to the image format (additional spaces to the resolution) that causes some problems with other radiance tools, plus it seems to be inconsistent.

I have quite complex scripts running a new method for annual glare simulations and it was running on head releases from 2016 and 2021. Now that I used the current release it failed and it took me one day to find out that actually pgblur is producing “sometimes” (not always) a wrong x-resolution in the header (output resolution differ from input), and it seems to be related to a different header that comes from newer versions from rtrace. Our guess here is that pgblur was not updated when the change was introduced?

Further, we saw that rtrace produces the “new spaces” in the header after the number, whereas pfilt introduces the spaces before the number… So the parsing in some of the c-shell scripts that read out the header would probably fail (e.g. in pacuity.csh normpat.csh pgblur.csh vlpic.csh ).

example:

getinfo -d  test.hdr 
test.hdr: -Y       55 +X       52

pfilt  test.hdr |getinfo -d
-Y 55       +X 52 

pgblur -r 4 test.hdr  |getinfo -d
-Y 55       +X 26      

If needed I can send the test.hdr, which I was not able to upload here, even it has only 55x52 pixels.

Could you check (and fix) that problem ?

Thank you!
best
Jan

Hi Jan,

Thanks for pointing out this error. The change in formatting of the resolution string was done to maintain byte alignment on raw data files where that matters, allowing memory-mapped access for improved efficiency in some tools. However, I didn’t do this consistently! As you point out, pfilt produces different formatting than some other tools. I have corrected this, so the resolution numbers are now right-justified in all cases. This should work with the existing pgblur script, but I have also updated the script to accept either spacing. The latest CVS should resolve these issues.

Cheers,
-Greg

Hi Greg,

I don’t know if any one uses these scripts but FYI: pacuity.csh, normpat.csh, and vlpic.csh have the same sed expression as pgblur that fails to parse the new resolution string.

Thanks, Stephen. I made the handling of these more robust as well in case anyone is using them. The new change to pfilt should fix the problem for infleixble scripts in any case.

Cheers,
-Greg