Skip to content

大佬能帮我看下这种格式的雷达数据为啥读取不了嘛 #137

@Novangelion-00

Description

@Novangelion-00

代码:
import cinrad
from cinrad.io import CinradReader, StandardData
from cinrad.visualize import PPI, Section

f = CinradReader("E:/z_radar/Z_RADR_I_ZM216_20250830143928_O_DOR_YLD5-D_CAP_FMT.bin")
报错信息:
File f:\anaconda\Lib\site-packages\cinrad\io\level2.py:143, in CinradReader.init(self, file, radar_type)
142 f.seek(0)
--> 143 self._SAB_reader(f, dtype="special")
144 except:

File f:\anaconda\Lib\site-packages\cinrad\io\level2.py:173, in CinradReader._SAB_reader(self, f, dtype)
172 _header_size = 132
--> 173 data = np.frombuffer(f.read(), dtype=radar_dtype)
174 deltday = datetime.timedelta(days=int(data["day"][0]))

ValueError: buffer size must be a multiple of element size

During handling of the above exception, another exception occurred:

RadarDecodeError Traceback (most recent call last)
Cell In[4], line 1
----> 1 f = CinradReader("E:/z_radar/Z_RADR_I_ZM216_20250830143928_O_DOR_YLD5-D_CAP_FMT.bin")

File f:\anaconda\Lib\site-packages\cinrad\io\level2.py:145, in CinradReader.init(self, file, radar_type)
143 self._SAB_reader(f, dtype="special")
144 except:
--> 145 raise err
146 self._update_radar_info()
...
139 # SC/CC files, so catch the exception of normal decoding process
140 # and try this one if possible
141 try:

RadarDecodeError: Unrecognized data

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