Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get list of variables defined from putdata #64

Open
PBrockmann opened this issue Dec 10, 2018 · 1 comment
Open

Get list of variables defined from putdata #64

PBrockmann opened this issue Dec 10, 2018 · 1 comment

Comments

@PBrockmann
Copy link

PBrockmann commented Dec 10, 2018

I cannot list the python variables defined by previous pyferret.putdata commands without loading first a dataset

import numpy as np
import pyferret

b = {}
b['name']='myvar1'
x=np.linspace(-np.pi*4, np.pi*4, 500)
b['data']=np.sin(x)/x
b.keys()

pyferret.start()

# Why to do need the following line to load a dataset and to get the list of python variables
pyferret.run('use levitus_climatology')

pyferret.putdata(b)
pyferret.run('show data')

I get

     currently SET data sets:
    1> /opt/ferret_dsets/data/levitus_climatology.cdf  (default)
 name     title                             I         J         K         L
 TEMP     TEMPERATURE                      1:360     1:180     1:20      ...
 SALT     SALINITY                         1:360     1:180     1:20      ...
 ------ Python Variables ------
 MYVAR1   myvar1                           1:500     ...       ...       ...       ...       ...

I would like to get only (without any load command)

 ------ Python Variables ------
 MYVAR1   myvar1                           1:500     ...       ...       ...       ...       ...
@karlmsmith
Copy link
Contributor

The current code only adds variables to the default existing dataset. Code needs to be added to allow the data to be added to any existing dataset, or to create a dataset and add it to that new dataset. Thus, marking it as both an enhancement that is needed as well as a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants