The following keys allow the user to extract a set of BUFR subsets that pertain to a time interval:
To explain the use of these keys the following example using the bufr_filter is provided, but please note that these same keys can be set using the Fortran and Python interfaces as well and no special functions have been implemented in the bufr_filter for this feature.
The following file "extract.filter" with bufr_filter can be used to perform the extraction of subsets from a BUFR message:
In line 1 we record the current (original) number of subsets. In lines 3 to 8 we specify the start of the time period and in lines 10 to 15 we specify the end of the period.
Finally in lines 17 to 20 we do the actual extraction and write out the message to the output BUFR file. The output will have just those subsets whose date/time are included in the time range specification above.
The final print message informs the user how many subsets were actually extracted during this process out of the original set. No output BUFR is written (the "write" statement not executed) unless there was at least one extracted subset.
This example can be used on any multi-subset input file in compressed form as follows: