Skip to content

Wrong datatype for SpeFile.nframes leads to incorrect data loading #13

@david-k-gibbs-4499

Description

@david-k-gibbs-4499

I have worked with spe2py (more specifically with the tool-loader-split branch) for a while and noticed that for larger files, meaning files that contained a lot of frames, there would be an issue with the amount of frames that were read from the file.

After inspecting both the code for the SpeFile class and the SPE 3.0 file format specifications, I located the culprit. In the init of SpeFile, nframes is defined as:

self.nframes = read_at(file, 1446, 2, np.uint16)[0]

indicating that the datatype is an unsigned 16-bit integer. However, in the file specifications (Table 3), it states that the number of frames should is a signed 32-bit integer:

Image

I have since resorted to manually overriding the init of SpeFile, but would suggest making this a permanent change.

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