Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Wrong values in .data numpy array #9

Open
mraspaud opened this issue Dec 12, 2014 · 6 comments
Open

Wrong values in .data numpy array #9

mraspaud opened this issue Dec 12, 2014 · 6 comments

Comments

@mraspaud
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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 :-)

mraspaud pushed a commit that referenced this issue Dec 12, 2014
1. Added a convenience property 'num_subsets' to the _BUFRFile.BUFRFile class to indicate the number of subsets in the BUFR message (same as the length of the data array for a single _BUFRFile.BUFRFileEntry)
2. For version 0.2-5, fixed the bug that only the data for the first subset was filled in (the rest was 0)  (ticket #9 and #14)
3. Added a 'descriptor' property to _BUFRFile.BUFRFileEntry that contains the descriptor ID (ticket #10)
4. Added a 'cdata' property to _BUFRFile.BUFRFileEntry that contains the character data for entries with unit 'CCITTIA5' (ticket #11). For other entries it is set to None. Currently the code assumes that the character data is limited to 80 chars. For larger data the data is cut off at 80 (..or the code may fail..) but I have not yet bumped into that problem.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant