pytroll / python-bufr

Generic BUFR file reader written in python. File support is similar to the ECMWF BUFR library.
GNU General Public License v3.0
18 stars 13 forks source link

Wrong values in .data numpy array #9

Open mraspaud opened 9 years ago

mraspaud commented 9 years ago

From cpau...@gmail.com on February 18, 2013 16:25:48

What steps will reproduce the problem? 1.Reading Attached BUFR file with python-bufr 2.looking at the .data attribute of e.g. YEAR or LATITUDE (HIGH RESOLUTION) What is the expected output? What do you see instead? a numpy array filled with values but I only see the first value followed by 0. or the BUFR fill value What version of the product are you using? On what operating system? I am using python-bufr 0.2-5 in python 2.7 on Linux Mint 14 - 64 bit Please provide any additional information below. I'm trying to read ASCAT data with the python-bufr library. I checked the file with the ECMWF BUFR checker http://www.ecmwf.int/products/data/d/check/ and am also able to read it with our other BUFR readers.

I am no expert on any of this so maybe I compiled something wrong but I tried several times and it works but I can't read the data.

Best Regards, Christoph

Attachment: W_XX-EUMETSAT-Darmstadt,SOUNDING+SATELLITE,METOPA+ASCAT_C_EUMP_20130201000001_32623_eps_o_125_ssm_l2.bin

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

mraspaud commented 9 years ago

From cpau...@gmail.com on February 19, 2013 08:42:25

The same thing happens when I compile it in cygwin on windows 7. Could this be python 2.7 related or does it only work on ubuntu 10.04?

Best Regards, Christoph

mraspaud commented 9 years ago

From marjolai...@gmail.com on May 24, 2013 02:27:50

Has this issue been resolved? I am having the same problem. I am running python 2.7.3 with python-bufr 0.2-5 installed on a 64bit machine (Ubuntu 12.10).

mraspaud commented 9 years ago

From cpau...@gmail.com on May 28, 2013 03:41:15

The issue has not been resolved for me when compiling from source but I found a workaround:

Install the .deb package as explained here: https://code.google.com/p/python-bufr/wiki/InstallationUbuntu It works even though it is for an older ubuntu version. I tested it on Linux Mint 14 and Ubuntu 12.04.

I'm currently using it with python 2.7 even though the package was compiled for python 2.6.

mraspaud commented 9 years ago

From rnbokho...@gmail.com on November 19, 2014 05:20:14

The bug occurs for BUFR messages with multiple subsets. I digged into the code (_BUFRFile.c) and fixed it. Find the fixed source file attached and a patch file.

To install:

  1. download python-bufr-0.2-5.tar.gz (from Downloads)
  2. untar and cd python-bufr-0.2-5
  3. replace bufr/_BUFRFile.c with the attched one
  4. python setup.py install

It hasn't been fully tested but it works for my BUFR's...

Attachment: _BUFRFile.c-0.2-6 patch.txt

mraspaud commented 9 years ago

From cpau...@gmail.com on November 19, 2014 05:38:28

Wow Thank you. I will try this fix as soon as possible.

Unfortunately it seems that the development of this project is kind of stuck.

mraspaud commented 9 years ago

From rnbokho...@gmail.com on November 19, 2014 07:58:34

Yes so it seems..unfortunately. However, this Python module is just a thin wrapper around the ECMWF BUFR decoder which is very alive. That's why I found it worthwhile to put energy in this :-)