ecmwf / eccodes-python

Python interface to the ecCodes GRIB/BUFR decoder/encoder
Apache License 2.0
115 stars 33 forks source link

Issue with codes_grib_find_nearest not working #49

Closed ComputerU closed 1 year ago

ComputerU commented 3 years ago

Hi,

My system: Ubuntu 20.04 Eccodes 1.1.0 Eccodes-python 0.9.9

I'm trying to read a grib file and use the following. It seems to fail with the following:

image

Code: from future import print_function import traceback import sys from eccodes import *

INPUT = '/home/james/Desktop/File' VERBOSE = 1 # verbose error reporting

lat=55.1 lon=-3.1 f = open(INPUT, 'rb') gid = codes_grib_new_from_file(f)

nearest = codes_grib_find_nearest(gid, lat, lon)

ComputerU commented 3 years ago

I took this example from the examples page on ECMWF: https://confluence.ecmwf.int/display/ECC/grib_nearest

Could this because I'm using python 3 and not python 2?

shahramn commented 1 year ago

Can you share your input file with me? so I can reproduce this error?