05-28-2020 03:27 AM
Hi
I am trying to read a DAT file into python.
The header file has been parsed, but the binary data (ex Test_I16.I16) is read, but the value is shown below.
Too large a value.
It seems that the original data value comes out only after calculating the Offset and Scaling Factor values.
What should I do?
Thanks.
Data read: -32767 -29318 -25869 -22420 -18971 -15522 -12073 -8624 -5175 -1726, 1724 5173 8622 12071 15520 18969 22418 25867 29316 32765
Original data:
0.100000000 0.199998474 0.299996948 0.399995422 0.499993896 0.59999237 0.699990844 0.799989318 0.899987792 0.999986266 1.100013734 1.200012208 1.300010682 1.400009156 1.50000763 1.600006104 1.700004578 1.800003052 1.900001526 2
Header file information
#BEGINCHANNELHEADER
200, Channel_Name
201, Description_Text
202, s
210, EXPLICIT
211, Test_I16.I16
213, CHANNEL
214, INT16
220,20
221,1
240,1.05002899346884
241,2.89934688396509E-05
250,0.1
251,2
252, No
253, increasing
260, Numeric
261,1
262,0
263,0
265,0
#ENDCHANNELHEADER
Solved! Go to Solution.
06-03-2020 08:16 AM
Hi albert2020,
I have attached a description of the DIAdem DAT file format. I’m pretty sure that you know that DAT is a very, very old file format.
Greetings
Walter
06-05-2020 11:28 PM
Hi albert,
It sounds like you need to scale the stored integers linearly with the offset and factor listed in the *.dat header. Walter's posted file format description should show you what all the header line IDs mean.
Brad Turpin
Senior Technical Support Engineer
National Instruments