ARPA-SIMC / arkimet

A set of tools to organize, archive and distribute data files.
Other
15 stars 5 forks source link

error scanning bufr with only constant station data #226

Closed pat1 closed 1 year ago

pat1 commented 4 years ago

I do not know if is possible to arkive such type of bufr but before python scanner I do not receive error rotto.zip

dbamsg dump /tmp/rotto.bufr
#0 BUFR message: 112 bytes, origin 200:0, category 0 255:255:0, bufr edition 4, tables 14:1, subsets 1, values: 5/11:
Subset 0:
001194 Report mnemonic(CCITTIA5): mobile
004001 YEAR(YEAR): (undef)
004002 MONTH(MONTH): (undef)
004003 DAY(DAY): (undef)
004004 HOUR(HOUR): (undef)
004005 MINUTE(MINUTE): (undef)
004006 SECOND(SECOND): (undef)
001011 SHIP OR MOBILE LAND STATION IDENTIFIER(CCITTIA5): pat1
001213 AIRBASE AIR QUALITY OBSERVING STATION CODE(CCITTIA5): error01
005001 LATITUDE (HIGH ACCURACY)(DEGREE): 44.48913
006001 LONGITUDE (HIGH ACCURACY)(DEGREE): 11.37000
cat  /tmp/rotto.bufr | arki-query --stdin=bufr  --yaml ""
ERROR scanner function failed
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/arkimet/scan/bufr.py", line 30, in scan
    if scan(msg, md) is False:
  File "/etc/arkimet/scan/bufr_generic.py", line 57, in scan
    md["timerange"] = read_timerange(msg)
  File "/etc/arkimet/scan/bufr_generic.py", line 7, in read_timerange
    p1_list = {d["trange"].p1 for d in msg.query_data()}
  File "/etc/arkimet/scan/bufr_generic.py", line 7, in <setcomp>
    p1_list = {d["trange"].p1 for d in msg.query_data()}
RuntimeError: cannot access values on a cursor before or after iteration
Source: INLINE(bufr,112)
Origin: BUFR(200, 000)
Product: BUFR(255, 255, 000, t=mobile)
Area: GRIB(type=mob, x=11, y=44)
Proddef: GRIB(id=pat1)
cat  /tmp/rotto.bufr | arki-query --stdin=bufr --inline ""| arki-xargs -n 1 |dbamsg dump
<nulla>
edigiacomo commented 4 years ago

The scanner should work with BUFR without data: when the list of timeranges is empty, it considers the message as an observation, i.e. p1 = 0s (see https://github.com/ARPA-SIMC/arkimet/blob/v1.25-1/conf/scan/bufr_generic.py#L13).

The error is raised by dballe, I have opened an issue arpa-simc/dballe#213

spanezz commented 4 years ago

arpa-simc/dballe#213 should now be fixed

edigiacomo commented 4 years ago

ARPA-SIMC/dballe#213 is fixed in dballe v8.12-1, now available on simc/stable Copr repository. @pat1 please check and close this issue if the problem is solved.

edigiacomo commented 1 year ago

Questa issue è stata chiusa per inattività. Nel caso in cui sia un argomento ancora rilevante, si prega di riaprirla con una motivazione che tenga conto delle modifiche applicate nel corso degli anni al progetto.