Skip to content

Frame exposureTime #28

@angeAnonyme

Description

@angeAnonyme

Hi, first thanks for the great work.
I work with a FLIR camera and .ptw that has presets, and have a rolling exposure time (think one frame at 25µs, then one frame at 50µs, then one frame at 100µs, and starting again). So the exposure time as currently defined from the main header is not good.

I wanted to access the expsosure time from the header of each frame. I got the following code working, but I don't know if there is a better way:

In the ryptw in the GetPTWFrameFromFile(header) function, after the definition of the FrameHeader:

#Add the exposure time
marker = b'\x80\x02\x00\x02' #it appears the the Integration Time is not always at the same position in absolute, but just after those 4 bytes
idx = FrameHeader.find(marker)
if idx == -1:
    raise ValueError("IntegrationTime marker not found")
    header.exposureTime = 0
else:
    raw = FrameHeader[idx+4 : idx+8]
    header.exposureTime = struct.unpack('<f', raw)[0]  # little-endian float32

Please check if this is interesting to integrate in the main function.

Thanks again

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions