[Thread Prev][Thread Next][Index]

[ferret_users] Fwd: pyferret.putdata not putting data



Dear Ferret/PyFerret community,

I'm using PyFerret as a Python module to take adavantage of Ferret's scat2gridgauss_xy external function, but, I've probably misunderstood the use of pyferret.putdata command. I'm not an experienced Python programmer.

The lon,lat,val triple is currently in my Python session as distinct lists which I convert to numpy arrays when I create python dictionaries to use as putdata arguments:

    lon_dict = {'name': 'lons', 'data': np.asarray(lon), 'title': 'Longitudes'}
    lat_dict = {'name': 'lats', 'data': np.asarray(lat), 'title': 'Latitudes'}
    val_dict = {'name': 'prec', 'data': np.asarray(val), 'title': 'INMET Prec'}

When I send these variables to Ferret's session, I notice any variable were passed:

    pyferret.start()
    pyferret.putdata(lon_dict)
    pyferret.putdata(lat_dict)
    pyferret.putdata(val_dict)
    pyferret.run('show data')

The code snippet above returns messages showing that Ferret session started but no data were loaded:

     NOAA/PMEL TMAP
     FERRET v6.82 (PyFerret 0.0.9)
     Linux 3.2.0-27-generic - 08/06/12
     16-Apr-14 18:42    

     currently SET data sets:

I'm following the examples provided here
http://ferret.pmel.noaa.gov/Ferret/documentation/pyferret/data-dictionaries/
and here
http://ferret.pmel.noaa.gov/Ferret/documentation/pyferret/example-sessions-python/

My question is: what am I doing wrong?

Thanks!


--
Paulo Santiago
Ph.D. Student in Meteorology
Brazilian National Institute for Space Research
Tel.: +55 (12) 3186 8637

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement