fujiisoup / sif_parser

A small package to read Andor Technology Multi-Channel files.
BSD 3-Clause "New" or "Revised" License
15 stars 5 forks source link

Sometimes the DetectorDimensions is smaller than size #36

Open hanqing0521 opened 6 months ago

hanqing0521 commented 6 months ago

For example

OrderedDict([('SifVersion', 65567),
             ('ExperimentTime', 1562059491),
             ('DetectorTemperature', -60.0),
             ('ExposureTime', 30.0),
             ('CycleTime', 30.0),
             ('AccumulatedCycleTime', 30.0),
             ('AccumulatedCycles', 3),
             ('StackCycleTime', 90.0),
             ('PixelReadoutTime', 6.75676e-07),
             ('GainDAC', 0.0),
             ('GateWidth', 1e-08),
             ('GratingBlaze', 3.213e-05),
             ('DetectorType', 'DR316B_LD,DD'),
             ('DetectorDimensions', (2000, 256)),
             ('ShutterTime', (0.0, 0.0)),
             ('spectrograph', '999'),
             ('SifCalbVersion', 65540),
             ('Calibration_data',
              [529.987976074219, 0.0120012005791068, 0.0, 0.0]),
             ('RamanExWavelength', 532.0),
             ('FrameAxis', b'Raman shift'),
             ('DataType', b'Counts'),
             ('ImageAxis', b'Pixel number'),
             ('NumberOfFrames', 1),
             ('NumberOfSubImages', 1),
             ('TotalLength', 10000),
             ('ImageLength', 10000),
             ('xbin', 1),
             ('ybin', 256),
             ('timestamp_of_0', 0),
             ('size', (10000, 1)),
             ('tile', [('raw', (0, 0, 10000, 1), 2839, ('F;32F', 0, 1))]),
             ('offset', 2839)])

For a Ramman spectrum, one might record data under different wavelength range than verb to one sif file. In the example sif, though the detecor only 2000, the full data size is 10000, which means the final data is verb from 5 simple data. Is there any good method to read this kind of sif file. Now I force change the info['DetectorDimensions'] = info'size'.

fujiisoup commented 6 months ago

Could you provide your sif file for this issue?

For a Raman spectrum, one might record data under different wavelength range than verb to one sif file.

Did you measure the spectrum at five different wavelengths and stored in one sif file? So what would be your expected output? Only is the metafile problem?

hanqing0521 commented 5 months ago

I am sorry. It is so busy during this month.

Did you measure the spectrum at five different wavelengths and stored in one sif file?

yes, the spectrum is binded by 5 2000 data Raman

We don’t support that file type.

Try again with GIF, JPEG, JPG, MOV, MP4, PNG, SVG, WEBM, CPUPROFILE, CSV, DMP, DOCX, FODG, FODP, FODS, FODT, GZ, JSON, JSONC, LOG, MD, ODF, ODG, ODP, ODS, ODT, PATCH, PDF, PPTX, TGZ, TXT, XLS, XLSX or ZIP. how can i send the sif file to you?

fujiisoup commented 5 months ago

Hi @hanqing0521

Could you upload the file compressed as a zip file?

Also, it would be great if you could indicate what particular metadata should be output.

hanqing0521 commented 5 months ago

anthracene-10mw-60s-1800l-full.sif.zip image

hanqing0521 commented 5 months ago

from the info1

OrderedDict([('SifVersion', 65567), ('ExperimentTime', 1527231064), ('DetectorTemperature', -60.0), ('ExposureTime', 60.0), ('CycleTime', 60.0), ('AccumulatedCycleTime', 60.0), ('AccumulatedCycles', 1), ('StackCycleTime', 60.0), ('PixelReadoutTime', 6.75676e-07), ('GainDAC', 0.0), ('GateWidth', 1e-08), ('GratingBlaze', 3.213e-05), ('DetectorType', 'DR316B_LD,DD'), ('DetectorDimensions', (2000, 256)), ('OriginalFilename', b'E:\20180525-anthracene\10mw-60s-1800l-full.sif'), ('ShutterTime', (0.0, 0.0)), ('spectrograph', '999'), ('SifCalbVersion', 65540), ('Calibration_data', [531.988220214844, 0.0118011804297566, 0.0, 0.0]), ('RamanExWavelength', 532.0), ('FrameAxis', b'Raman shift'), ('DataType', b'Counts'), ('ImageAxis', b'Pixel number'), ('NumberOfFrames', 1), ('NumberOfSubImages', 1), ('TotalLength', 10000), ('ImageLength', 10000), ('xbin', 1), ('ybin', 256), ('timestamp_of_0', 0), ('size', (10000, 1)), ('tile', [('raw', (0, 0, 10000, 1), 2833, ('F;32F', 0, 1))]), ('offset', 2833)])

fujiisoup commented 1 month ago

image

@hanqing0521 I apologize but I just realized that this issue is still open. I checked the file you have provided and compared with the result when we open with AndorSOLIS. I am not sure the reason why the spectra stored here is larger than the detector dimension, but it seems that this is what is stored here.

As SOLIS says that the spectrum was taken with full vertical binning, so the data size should have the vertical size 1.

My guess is that this might have been taken with a step_and_glue technique? Then the spectrum size can be bigger than the detector dimension.

We have recently resolved the issue related to step_and_glue in #39. I believe this might solve your issue as well.