NR800 - SP2 file format
Below the description of the file format for the sp2 files
produced by the Yokogawa NR800 Near Infrared Analyzer. The description
below is only based on a limited set of samples and was made
by comparing a set op sp2 files with csv and jdx files. The
csv files seem to contain more data.
- 0-3 long (= 1)
- 4-5 short: Year of file creation time
- 6-7 short: Month of file creation time
- 8-9 short: Day of file creation time
- 10-11 short: Hour of file creation time
- 12-13 short: Minute of file creation time
- 14-15 short: Seconds of file creation time
- 16-27 text 'YSPCTL0n.SP8', where n is equal to "Stream number" in csv file
- 28-79 zeros
- 80-83 long (= 1)
- 84-87 long: "Average number" in csv file
- 88-89 short (= 3)
- 90-91 short (= 80)
- 92-95 long: "AD Gain S" in csv file
- 96-99 long: "AD Gain R" in csv file
- 100-103 long: "IV Gain S" in csv file
- 104-107 long: "IV Gain R" in csv file
- 108-111 long: "Coefficient for Wave Number Correction" in csv file
- 112-115 long (= 8)
- 116-119 long (= 4 for "Resolution" = 8, 5 for "Resolution" = 4)
- 120-123 long: "Stream number" in csv file
- 124-127 long: "Stream number" in csv file
- 128-143 zeros
- 144-145 short: Year of "Date" in csv file (of measurement time?)
- 146-147 short: Month of "Date" in csv file
- 148-149 short: Day of "Date" in csv file
- 150-151 short: Hour of "Time" in csv file
- 152-153 short: Minute of "Time" in csv file
- 154-155 short: Seconds of "Time" in csv file
- 156-163 string (zero terminated): "Sample Name" in csv file
- 164-188 ???: random date, possibly 156-188 contains the sample name (up to 31 characters, zero terminated)
- 188-239 zeros
- 240-243 long = 12
- 244-291 12 floats: "Property Value" in csv file
- 292-315 12 shorts: "Model" in csv file
- 316-339 12 shorts: "Model" in csv file
- 340-343 long = 12
- 344-391 12 floats: "Property Value" in csv file
- 392-415 12 shorts: 1 means property has value, 0 means property not set
- 416-439 12 shorts: "Model" in csv file
- 440-443 long = 12
- 444-539 12 times 8 character string (zero terminated): "Unit" in csv file
- 539-579 zeros
- 580-583 text 'ABSD'
- 584-587 long (= 11552)
- 588-591 long: (= x: 58.2^x + 1 = number points in data)
- 592-595 long: number points in data
- 596-603 zeros
- 604-607 text 'ABDT'
- 608-end floats: data
The number of floats in the data is equal to the number points in data (592-595).
The wave length seems not to be stored in the sp2 file. In all data files
the wave length ranged from 11138.866 to 3980.370 with an equal distance
between all points. The step can be calculated by dividing the difference
between the start and end point with the number of points minus one.
The parse_sp2.cpp C+ program is the program that
I used to parse the sp2 files. If the program fails to read your sp2 file
correctly, please send me the sp2 file with the csv file, and I will try
to modify the program to match your data.
How to crack a Binary File Format |
My life as a hacker |
home and e-mailaddress