BUFR files: Difference between revisions
New page: == Determining file marker type == |
No edit summary |
||
Line 1: | Line 1: | ||
== Determining file marker type == | |||
You can tell what kind of file markers are being used in a BUFR file by using the Unix command 'od -c', and looking at the first line of output. | |||
BUFR files without file markers begin with the text "BUFR": | |||
<code> % od -c gdas1.111202.t12z.prepbufr | head -2 | |||
0000000 B U F R \0 & 310 003 \0 \0 022 \0 003 \a \0 \0 | |||
0000020 \v 001 \r 001 \0 \0 \0 \0 \0 \0 \0 \0 & \0 \0 001 </code> | |||
If a BUFR file has file markers, they show up as the four characters before the "BUFR". The following example is for "big-endian" file markers - you can see the smaller number is at the beginning of the file marker and the bigger number is at the end: | |||
<code> % od -c gdas1.111202.t12z.1bamua.tm00.bufr_d | head -2 | |||
0000000 \0 \0 & 270 B U F R \0 & 260 003 \0 \0 022 \0 | |||
0000020 003 \a \0 \0 \v 001 \r 001 \0 \0 \0 \0 \0 \0 \0 \0 </code> | |||
The second example shows "little-endian" file markers - the numbers are reversed from what is in the previous example: | |||
<code> % od -c d5_merra_jan98.prepbufr.20111117.t00z.blk | head -2 | |||
0000000 370 & \0 \0 B U F R \0 & 364 003 \0 \0 022 \0 | |||
0000020 003 \a \0 \0 \v 001 \f 001 \0 \0 \0 \0 \0 \0 \0 \0 </code> | |||
== 'obsys.rc' convention for BUFR file marker type == | |||
The pertinent suffix here is if the file has '.blk' or '.ublk' at the end, in the name given in the header of your 'obsys.rc' file. | |||
BEGIN ncep_prep_bufr => gdas1.%y4%m2%d2.t%h2z.prepbufr.ublk | |||
= | the '.ublk' denotes that these files have no f77 file markers, and the assimilation will automatically run 'block' to add the little-endian file markers to these files | ||
BEGIN gmao_airs_bufr => gmaoairs.%y4%m2%d2.t%h2z.bufr.blk | |||
the '.blk' denotes big-endian f77 file markers, and the assimilation will automatically run 'reblock' to convert the file markers from big-endian to little endian (or vice-versa, so be careful with the file name endings!) | |||
Note that all of the files listed under a section in the 'obsys.rc' need to have the same kind of file markers. If you are combining files from different sources, you may need to 'unblock', 'reblock' or 'block' the files to make them all consistent. |
Revision as of 14:38, 2 December 2011
Determining file marker type
You can tell what kind of file markers are being used in a BUFR file by using the Unix command 'od -c', and looking at the first line of output.
BUFR files without file markers begin with the text "BUFR":
% od -c gdas1.111202.t12z.prepbufr | head -2
0000000 B U F R \0 & 310 003 \0 \0 022 \0 003 \a \0 \0
0000020 \v 001 \r 001 \0 \0 \0 \0 \0 \0 \0 \0 & \0 \0 001
If a BUFR file has file markers, they show up as the four characters before the "BUFR". The following example is for "big-endian" file markers - you can see the smaller number is at the beginning of the file marker and the bigger number is at the end:
% od -c gdas1.111202.t12z.1bamua.tm00.bufr_d | head -2
0000000 \0 \0 & 270 B U F R \0 & 260 003 \0 \0 022 \0
0000020 003 \a \0 \0 \v 001 \r 001 \0 \0 \0 \0 \0 \0 \0 \0
The second example shows "little-endian" file markers - the numbers are reversed from what is in the previous example:
% od -c d5_merra_jan98.prepbufr.20111117.t00z.blk | head -2
0000000 370 & \0 \0 B U F R \0 & 364 003 \0 \0 022 \0
0000020 003 \a \0 \0 \v 001 \f 001 \0 \0 \0 \0 \0 \0 \0 \0
'obsys.rc' convention for BUFR file marker type
The pertinent suffix here is if the file has '.blk' or '.ublk' at the end, in the name given in the header of your 'obsys.rc' file.
BEGIN ncep_prep_bufr => gdas1.%y4%m2%d2.t%h2z.prepbufr.ublk
the '.ublk' denotes that these files have no f77 file markers, and the assimilation will automatically run 'block' to add the little-endian file markers to these files
BEGIN gmao_airs_bufr => gmaoairs.%y4%m2%d2.t%h2z.bufr.blk
the '.blk' denotes big-endian f77 file markers, and the assimilation will automatically run 'reblock' to convert the file markers from big-endian to little endian (or vice-versa, so be careful with the file name endings!)
Note that all of the files listed under a section in the 'obsys.rc' need to have the same kind of file markers. If you are combining files from different sources, you may need to 'unblock', 'reblock' or 'block' the files to make them all consistent.