I am not sure from your description which vendor, but suspect you are
referring to .fpf as the "FLIR public file format" you are trying to read.
If correct, I think you need a detailed description of the file format. I
tried to find one online, but the FLIR website says the detailed FLIR public
file format is contained in the Owner's Manual, and/or Researcher's manual.
I would start there, as it may be that the header is 'variable' (ie could be
4 bytes for one version, different for a subsequent version, or maybe the
header itself contains some insight as to how to read/offset the remaining
bytes (hence your basic assumption works for most files but not all). Eg
perhaps "pixeloffset" in your example may need to be set upon reading the
header ?
If you have the manual can you check there (or email me directly a copy of
the section) and I can have a look. I could not readily find the file
description online.
Regards, Rob Hodgkinson
On 22/12/07 11:28 AM, "David Porter" <[EMAIL PROTECTED]> wrote:
> (Still a newbie, but more knowledgeable than before)
> I am having trouble reading images from a only few files out of a series
> of files. The image file info is below.
>
> The "xxxx.fpf" files consist of a header followed by a matrix of single
> precision IEEE floating-point values, each representing one point of the
> image. A C-style description of the header layout can be found in the
> header file fpfimg.h, available in the installation directory. The image
> point values are stored starting from the top left corner, row by row.
>
> (The following line is from the header file referred to above)
>
> Float 32 bit IEEE floating point number, sign + 23 bit mantissa +
> 8 bit exponent,Representing numbers in the range +/- 1038
>
> My code boils down to this:
> c4f =: _1 & (3!:5) NB. 4 chars to float
>
>
> dat=: freads fn NB. reads the file
> i1=: (pixeloffset)}. dat NB. drop header
> i2=:c4f {.i1 NB. converts to float
>
> This seems to work on 43 files, but on the 44th file, I get a length
> error. Looking at i1, it is not mod 4. When I either curtail it to be
> mod 4 or pad it to be mod 4, it reads but the image looks like an old TV
> with the horizontal hold mis-set.
>
> To add to the confusion, the viewing software from the vendor reads all
> the files wonderfully. So I am guessing I am doing something wrong.
> Any suggestions?
>
> Dave Porter
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm