05-29-2008 07:06 AM - edited 05-29-2008 07:08 AM
05-29-2008 10:01 AM
Byte Position Format Name
3 char fexp
4 DWORD fnpts
8 double ffirst
16 double flast
Using a cluster of correctly ordered elements, each in the correct representation is a nice shortcut, useful if all the values are adjacent.
Maybe you even want to start at zero with a string of 24 elements and add three more U8 (or one U16 and one U8) at the beginning of the cluster.
It is possible that there is e.g. information on the file version so you can validate that you're dealing with a galactic file and not some other random file type.
05-29-2008 10:04 AM
09-03-2019 05:43 AM
@altenbach wrote:
I don't quite get where the "exponent" comes from. Is this the same for the entire datafile?
Anyway, to get the data, you need to unflatten it from string as little endian I32 and then divide by 2^32 and multiply by the exponent.
File position 4 has a 4 byte number that seems to represent the data size in # of points (6453 in your case). The data starts at 544.
There is a lot of other information in the file, I am sure the exponent is somewhere. You need the full file specification.
Here's a quick attempt at reading the file assuming an exponent of 1. See if it get's you any closer. Good luck! 🙂
(the code is very crude. Typically you would want to take the subset with length 4x6456 before unflattening the data.)
Can't you juse Type cast to FXP instead of dividing? And to get the Exponent change FXP setting accordingly, so if it's 3 (2^3) the FXP format is 3.28?
/Y