Skip to content

Traceback error using Level2File opening a start L2 radar chunk file #3413

@nevets963

Description

@nevets963

What went wrong?

I get a traceback error when trying to opening the start file of a L2 chunk of a volume for specific radar towers: KJKL, KCCX, KMBX, KDDC, KTYX and potentially others too.

Most towers work fine and I'm not familiar enough with the msg formats to know why/how these sites are different.

Operating System

Linux

Version

1.6.1

Python Version

3.10.13

Code to Reproduce

# Download: https://unidata-nexrad-level2-chunks.s3.amazonaws.com/KJKL/160/20240227-102059-001-S

from metpy.io import Level2File
l2file = Level2File("20240227-102059-001-S")

Errors, Traceback, and Logs

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/conda/lib/python3.10/site-packages/metpy/io/nexrad.py", line 193, in __init__
    self._read_data()
  File "/opt/conda/lib/python3.10/site-packages/metpy/io/nexrad.py", line 255, in _read_data
    getattr(self, decoder)(msg_hdr)
  File "/opt/conda/lib/python3.10/site-packages/metpy/io/nexrad.py", line 551, in _decode_msg18
    els.append(self.vcp_el_fmt.unpack_from(dat, off))
  File "/opt/conda/lib/python3.10/site-packages/metpy/io/_tools.py", line 97, in unpack_from
    return self._create(super().unpack_from(buff, offset))
struct.error: unpack_from requires a buffer of at least 1218 bytes for unpacking 46 bytes at offset 1172 (actual buffer size is 1172)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: IOPertains to reading dataType: BugSomething is not working like it should

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions