Hi Guys, I noticed that the Varian file format has a bit in the status code (a short value in the 32 byte header) which indicates wether spectra data are Float or Integer . However, I'm concerned this may not always be "set" .... i.e. I'm concerned that in some instances, this bit is ignored.
I'm wondering if there is any more reliable way to guess wether the numerical content in a spectrum is floating point or integer.......
Please let me know ! Thanks!
That value is used, and is most often used to specify 16 bit ints instead of 32 bit ints. I've never actually encountered a 32 bit float data set, although SpinWorks should handle it. I think I will try generating a floating point data set to see if it works :-)
Since digitizers are integer devices, there isn't much point in storing the fids as floats. Except: For a very large number of scans where you may overflow the 32 bit word; Real time digital signal processing may be done in floating point and it may make sense to save the result in floating point. All processing of the data should be done in floating point (typically 64 bit).
To decode the status word:
You should probably check for float first because Varian states that the 16/32 bit bit (S32) is ignored if the float bit is set.
In a modern language (C#, probably Java and others) you could try something like:
Hello, I didn't know that Varian has that numeric mode bit, thanks for bringing it up. Floating point option offers greater "dynamic range" of storable numbers.
edit: Kirk is right - there is probably no way to guess whether a one given number is float or integer, since in the end both are represented by a bunch of bits (here is a Wikipedia page about Floating Point representation), however there may be a way to analyze a pattern within a set of numbers casted as integers and casted as floats. It's kind of like guessing in which language some text is written by looking at a sample. It does seem to be more complicated than I thought, anyway - below is the answer I've given originally:
Take a look here for more details.
So you could run through all the numbers with one of the methods and determine the format of entire set.
Yes, The code is used.... but there are 16 bits in it. The real question is, which ones are commonly used ? It is known that Varian does not write values for some of their binary meta data flags, i.e. they just write zeros, and assume that you will use the procpar for all, or most, meta data.
1) So is the bit which signifies INT vs FLOAT always used when the varian folks write out spectra ?
2) Is there a way to find out (from the procpar) wether values are INT or FLOAT ?
3) What is more common in Varian spectra ? INT or FLOAT ?
answered Mar 04 '10 at 09:21