[GenABEL-dev] Float to double conversion in filevector/DatABEL files

L.C. Karssen lennart at karssen.org
Thu Feb 14 17:40:33 CET 2013


Thanks for these pointers, this looks like a good start for
understanding the filvector internals.



Best,

Lennart.

On 13/02/13 08:50, Yurii Aulchenko wrote:
> 
>     I tried to dig into the fvlib a bit and it seems that readVariableAs()
>     performs a cast based on the data type stored in the fv file. From the
>     DatABEL manual I gathered that you can specify a data type for fv files.
>     Does someone know how I can read the header of an fv file to check the
>     data type used in a give fv file?
> 
> 
> Hope this info may be useful:
> 
> index file contains information about dimensions of
> the data file, data type used, and columns/rows names
> 
> The beginning is (frutil.h)
> 
> 	unsigned short int type;
> 	// should change that to long!!!
> 	unsigned int nelements;
> 	unsigned int numObservations;
> 	unsigned int numVariables;
> 	unsigned int bytesPerRecord;
> 	unsigned int bitsPerRecord;
> 	unsigned int namelength;
> 	unsigned int reserved[RESERVEDSPACE];
> 
> then names...
> 
> where (const.h)
> 
> #define RESERVEDSPACE      5
> 
> // internal format data types
> #define UNSIGNED_SHORT_INT 1
> #define SHORT_INT          2
> #define UNSIGNED_INT       3
> #define INT                4
> #define FLOAT              5
> #define DOUBLE             6
> #define SIGNED_CHAR        7
> #define UNSIGNED_CHAR      8
> 
> // number of chars used to keep var/obs names
> #define NAMELENGTH        32
> 

-- 
-----------------------------------------------------------------
L.C. Karssen
Utrecht
The Netherlands

lennart at karssen.org
http://blog.karssen.org

Stuur mij aub geen Word of Powerpoint bestanden!
Zie http://www.gnu.org/philosophy/no-word-attachments.nl.html
------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 230 bytes
Desc: OpenPGP digital signature
URL: <http://lists.r-forge.r-project.org/pipermail/genabel-devel/attachments/20130214/4857015a/attachment.sig>


More information about the genabel-devel mailing list