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

Andy's data file seems to break multiple data plots. #5

Closed
bnlawrence opened this issue Oct 17, 2014 · 2 comments
Closed

Andy's data file seems to break multiple data plots. #5

bnlawrence opened this issue Oct 17, 2014 · 2 comments

Comments

@bnlawrence
Copy link
Collaborator

import cf
import cfplot as cfp
#
# script generated by cfgui version 0.0.1
#
                    #
dataset=cf.read('/home/bnl/Data/ggap199006200600.nc')
#
fields=[dataset[i] for i in [9]]
sfield=fields[0]
kwargs={}
kwargs['dim2']=cf.wi(-89.1415,89.1415)
kwargs['dim3']=cf.wi(0.0,358.875)
kwargs['dim0']=cf.wi(0.0,0.0)
kwargs['dim1']=cf.wi(1.0,1000.0)
sfield=sfield.subspace(**kwargs)
plotOptions={'mapset': {'proj': 'cyl'}, 'gopen': {'rows': 1, 'columns': 2}, 'nup': 2, 'con': {'colorbar': None, 'blockfill': None, 'fill': True, 'ylog': None, 'negative_linestyle': None, 'xlog': None, 'colorbar_orientation': None, 'lines': True, 'ptype': None, 'line_labels': True}}
cfp.gopen(**plotOptions['gopen'])
plotOptions['con']['title']=sfield.file
cfp.gopen(**plotOptions['gopen'])
cfp.gpos(1)
plotOptions['con']['title']= long_name:p:1000.0 Traceback (most recent call last):
  File "/home/bnl/Code/CF-View/plotConfigWidgets.py", line 166, in _getConfig
    self.callback('Configured',config)
  File "cfgui.py", line 314, in _plot
    cfp.con(sfield.subspace(**slicer),**plotOptions['con'])
  File "/usr/lib/python2.7/site-packages/cf/field.py", line 5790, in __call__
    return field.subspace[field.indices(*arg, **kwargs)]
  File "/usr/lib/python2.7/site-packages/cf/field.py", line 2580, in indices
    repr(identity))
ValueError: Can't find indices: Ambiguous indentity: 'long_name:p'
slicer={'long_name:p': 1000.0}
cfp.con(sfield.subspace(**slicer),**plotOptions['con'])

Generates (when run in the gui):

Traceback (most recent call last):
  File "/home/bnl/Code/CF-View/plotConfigWidgets.py", line 166, in _getConfig
    self.callback('Configured',config)
  File "cfgui.py", line 314, in _plot
    cfp.con(sfield.subspace(**slicer),**plotOptions['con'])
  File "/usr/lib/python2.7/site-packages/cf/field.py", line 5790, in __call__
    return field.subspace[field.indices(*arg, **kwargs)]
  File "/usr/lib/python2.7/site-packages/cf/field.py", line 2580, in indices
    repr(identity))
ValueError: Can't find indices: Ambiguous indentity: 'long_name:p'
@bnlawrence
Copy link
Collaborator Author

Note that there is also a script bug, which may or may not be relevant:

python2.7 debug.py 
 File "debug.py", line 23
    plotOptions['con']['title']= long_name:p:1000.0 
                                          ^
SyntaxError: invalid syntax

@bnlawrence
Copy link
Collaborator Author

Fixed the script bug ... will appear in the commit for dealing with the data dependent error.

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

No branches or pull requests

1 participant