LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Interpreting values supposedly in fixed-point format

Hello everyone, 

 

I'm trying to open a .spc with labview. I'm referring to yout explanation but your last exemple don't run with me. Can you help me please ? 

0 Kudos
Message 1 of 9
(2,410 Views)

Hi colapili,

 

I'm trying to open a .spc with labview.

When you want to read "unfamiliar" data files with obscure file suffixes you need to know their formatting.

Do you know the formatting of those "spc" data?

 

Can you provide an example file, including format description and expected content after conversion?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(2,398 Views)

Hello GerdW and Yamaeda,

I'm sorry but I'm not verry familiar with data structure of binary file... And sincerely I don't understand really this code. My datas.spc are from horiba, I'll contact them for more informations conserning .spc structure. 

I don't know where replace a division by a Type Cast, is it indead the multiplication at the end ? 

You will find in attachement a spc file. 

 

Thank you 

 

Nicolas

0 Kudos
Message 3 of 9
(2,375 Views)

@colapili wrote:

I'm sorry but I'm not verry familiar with data structure of binary file...


A binary file is just a collection of bytes and it is up to the original programmer to define what each bit means. Without knowing the data structure, there is no way to figure it out, so yes, contact the company that wrote the program that creates the file. In simple cases, we can guess the data structures with trial and error, but for more complicated cases, this is not possible.

 

I am curious why you would append to a 11+ year old thread about fixed-point format. Seems completely unrelated to your problem. You probably should have started a new thread instead. An spc extension can mean anything.

 

0 Kudos
Message 4 of 9
(2,368 Views)

Hi colapili,

 

something along this:

check.png

The first 0x200 bytes in the file contain some header data, the last ~0x400 bytes a lot of (readable) meta data:

ACQ. TIME (S) = 15
ACCUMULATIONS = 2 RANGE (CM-¹) = 400...3500 WINDOWS = 2 AUTOFOCUS = OFF SWIFT = OFF AUTOEXPOSURE = OFF SPIKE FILTER = MULTIPLE ACCUM. DELAY TIME (S) = 0 BINNING = 1 READOUT MODE = SIGNAL DENOISE = OFF ICS CORRECTION = OFF DARK CORRECTION = OFF INST. PROCESS = OFF DETECTOR TEMPERATURE (°C) = -69 INSTRUMENT = XPLORA DETECTOR = ANDOR CCD OBJECTIV = X100 GRATING = 1200T FILTR = 50% EXCIT_LINE = 532.17 SLIT = 100 HOLE = 100 LASER POL = NONE RAMAN POL = NONE OUTPUT = CAMERA STAGEXY = MARZHAUSER STAGEZ = MARZHAUSER X (µM) = -3787.15 Y (µM) = 937.8 Z (µM) = -1.3 FULL TIME(HH:MM) = 14:29 PROJECT = A SAMPLE = B SITE = C TITLE = D REMARK = DATE = 17.04.2018 14:06

 (Note: moved your messages and their replies into your own thread.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 9
(2,354 Views)

Obviously, it's a 2D dataset (between 512 header and ending metadata) with about 651 traces of 1249 points each. The first trace is the nonlinear cm-1 calibration from 400...3500. The second trace might be some background reference. The remaining 659 traces can be re-shaped into an intensity graph, but for each trace only about the first 1241 are valid data, so take the appropriate subset (the remaining 8 points (32bytes) might have other meaning)

 

Here are the the first 100 traces of 1241 points each. Nice spectra 😄

(note that the Y axis uses logarithmic mapping for better details because of the large dynamic range of the data)

 

first100traces.png

 

 

0 Kudos
Message 6 of 9
(2,327 Views)

Ok, thank you both for your help. 

 

I will try to move forward with the information you gave me

 

Nicolas 

0 Kudos
Message 7 of 9
(2,295 Views)

Bonjour à tous, 

 

Est-ce que qqn pourrait m'expliquer comment lire un fichier binaire en Labview? J'ai du mal à comprendre comment cela fonctionne. 

Le fichier en question (format galactic .spc) ci-joint contient des données spectroscopiques et d'autres informations. Mon but est d'en extraire les données d’intérêt (tableau de spectres 2D) et pour être sincère je ne sais pas comment faire... 

 

J'ai pu avoir en informations (même si j'ai du mal à les comprendre) que les premières 0x200 bytes contiennent des données entêtes et les derniers ~0x400 de nombreuses metadatas ou encore que ce jeux de données 2D qui m’intéresse se situe entre l'entête 512 et les métadonnées. Logiquement il devrait y avoir 651 spectres avec 1249 points chacun. 

 

En espérant que vous puissiez m'aider. 

 

Bonne journée à tous. 

 

Nicolas 

 

 

0 Kudos
Message 8 of 9
(2,286 Views)

Hi colapili,

 

please stick with your English thread instead of starting a French one in parallel!

(Or use the "le forum francophone" in the Regional communities…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 9
(2,276 Views)