ecmwf / pdbufr

High-level BUFR interface for ecCodes
Apache License 2.0
23 stars 8 forks source link

Support the count ecCodes key #6

Closed sandorkertesz closed 3 years ago

sandorkertesz commented 3 years ago

The count key is a generated by ecCodes and it tells us the actual index (1-based) of a given message in the BUFR file. With this working we would be able to extract data only from a given message. E.g. we could use this code to get values only from the first message:

columns = ["airTemperature"]
filters = {"count": 1}
res = pdbufr.read_bufr(path, columns=columns, filters=filters)

Alternatively we would just need a separate option to specify the index of the messages we want to read with pdbufr. This option would be quite important for testing and for probing the BUFR contents.

alexamici commented 3 years ago

Looks like the feature is already presente even if the count variable is really generated by pdbufr not take from ecCodes. The result should be the same.

Closing.