wmo-im / bufr2geojson

Python package to transform WMO BUFR data into GeoJSON
Apache License 2.0
2 stars 4 forks source link

bufr2geojson crash in get_time() when year is a list #30

Open maaikelimper opened 6 months ago

maaikelimper commented 6 months ago

For this file:

https://www.wis-jma.go.jp/d/o/WSSS/BUFR/Climate/CLIMAT/20240506/000000/A_ISCG01WSSS060000_C_RJTD_20240506001917_47.bufr

In this part of the bufr2geojson-code:

def get_time(self) -> str:
        """
        Function to get time from qualifiers and to apply any displacements or
        increments.

        :returns: ISO 8601 formatted date/time string
        """

        # class is always 04
        xx = "04"
        # get year
        year = self.get_qualifier(xx, "year")

The value of year is [1991, 2020]

which causes the error: unsupported format string passed to list.__format__ when creating the string:

time_ = f"{year:04d}-{month:02d}-{day:02d} {hour:02d}:{minute:02d}:{second:02d}"