> Hi,
>
> It would be great to be able to put the edf data format directly into
> your program for testing. Unfortunately there is no strict standard
> but
> generally there is a 1kbyte ascii header which contains information,
> most importantly the array size, data type, and byte order. For the
> Pixium detector operated on ID15 an example header would be the
> following (32bit example),
>
> {
> HeaderID = EH:000001:000000:000000 ;
> Image = 1;
> ByteOrder = LowByteFirst ;
> DataType = UnsignedLong ;
> Dim_1 = 2640;
> Dim_2 = 1920;
> Size = 20275200;
> count_time = Na ;
> point_no = 0 ;
> preset = Na ;
> col_end = 1919;
> col_beg = 0;
> row_end = 2639;
> row_beg = 0;
> col_bin = 1;
> row_bin = 1;
> time = Wed Dec 05 18:14:43 2007;
> acq_timestamp = 1196874880.645389;
> dir = N:/inhouse/JohnD/December07/Standards;
> suffix = .edf;
> prefix = S5-12-1810_;
> run = 1;
> title = PIXIUM4700 Detector Image ;
> }
>
> The header always ends with a "}", it is best to search for this and
> then begin loading the data from the next byte (the 1kbyte header size
> is not always adhered to). This should then be able to load images
> from all .edf type files.
>
> ...
>
> Look forward to seeing how it works.
>
> Cheers
I emailed John asking him a few questions about the format:
> Hi John. My name is Joshua Lande and I coded up most all of the Area
> DIffraction Machine. I am an undergraduate at Marlboro College in
> Vermont and I am happy to work with you to get my program to read in
> whatever file formats you are interested in.
>
> Although I haven't yet coded up .edf support, based on your
> description it doesn't look like it should be too hard to get it to
> work. Thanks for the files.
>
> I have a few questions for you at this point. The first is that some
> of the files you sent me store data as 4byte unsigned integers.
> Right now, my program stores any data I load into the program as 4
> byte signed integers because I wrote the program in python and the
> python's Numeric library dose not handle unsigned values very well.
> In principle, I could migrate my code over to unsigned 8 byte
> integers, but this would slow my code down and would require a bit
> of overhead to implement. So I guess my question is: would there be
> any problem with clipping any of the pixels greater than or equal to
> 2^31 = 2,147,483,648 and setting them all to 2^31-1 so that I can
> fit the files you sent me into my array of signed 4 byte integers?
> Or are pixels with these really high intensities important so that
> clipping any of them would be a bad idea? I can always make the
> program spit out warnings (probably to the console) it if finds any
> values that are too large to store in the program.
>
> Second, I see that the data you sent only has the header field
> DataType set to "UnsignedShort" and "UnsignedLong". Are these the
> only possible values? Or should I expect to also see things like
> floating point numbers in the data?
>
> Is the field ByteOrder always set to "LowByteFirst"?
>
> ...
>
> Josh
He replied with the answer
> ...
>
> No problem to convert to the data to 4 byte signed, it will
> certainly be unlikely with all the detectors I use (or any for that
> matter) that this value will be exceeded, but in the unlikely case a
> warning would be great.
>
> The .edf format is a bit of an "anything goes" type format, so
> expecting any data type may be needed for complete compatibility. Is
> the field ByteOrder always set to "LowByteFirst"? I don't know...
> again I guess my advice would be expect anything.
>
> So I apologize for the randomness of the .edf format and hope it
> isn't too much of a pain to add.
>
> Cheers
I will see what I can do to implement this format and respond after I
make some progress.
Josh