python-bufr icon indicating copy to clipboard operation
python-bufr copied to clipboard

Version 0.2-5: Can't read entire bufr data set, only first entry

Open mraspaud opened this issue 11 years ago • 0 comments

From [email protected] on December 11, 2014 12:40:28

Hi Kristian,

I am Andreas and currently working on a project to convert bufr data into a more handy format (for our purposes). So far, I haven't worked with the bufr format and thus not with the python reader. To be able to use the python reader I followed the steps described on http://python-bufr.googlecode.com/svn/trunk/doc/build/html/install.html . I got the latest version of ECMWF's bufr software (000401, dated to 18.06.2014), added the -fPIC flags when I compiled it and ran the tests successfully. I attached the original bufr synop file (EBUM10021305.b) and the ascii output I got back from the ECMWF fortran program (test.txt). Next, I installed the python-bufr package (version 0.2-5). I had to adjust the setup.py a little, since I chose for real 64, when I compiled the ECMWF library, which then gives you an " R64 " in your library name: I changed libraries = ['bufr','gfortran'] into libraries = ['bufrR64','gfortran'] and then ran LDFLAGS=-L/usr/local/lib python setup.py install as root. That also went down nicely. I wrote a small python script to read the synop data in bufr format (also attached). And this is where I am stuck at the moment. I followed the example given on https://code.google.com/p/python-bufr/wiki/InstallationAndUsageNewVersion under "Reading and Inspecting BUFR data" The full output is in output_read_bufr.txt and I repeat the most interesting lines of both the python script and the output: n = bfr.next() print len(n)

111 print n[13] %Zd: %s print n[13].name PRESSURE print n[13].unit PA print n[13].index 13 print n[13].data [ 101110. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] The the synop file contains data from 12 stations (according to the Fortran output (test.txt)). Also the numpy array n[13].data has a dimension of 12. However, I only catch the pressure for the first station.

The above message I posted in the pytroll google group. I now installed version 0.2-2 and this version works! Cheers, Andreas

Attachment: test.txt EBUM10021305.b test_read_bufr.py ouput_read_bufr.txt

Original issue: http://code.google.com/p/python-bufr/issues/detail?id=14

mraspaud avatar Dec 12 '14 15:12 mraspaud