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

DV3D/VCS plot error #1867

Open
durack1 opened this Issue Mar 3, 2016 · 21 comments

Comments

Projects
None yet
7 participants
@durack1
Member

durack1 commented Mar 3, 2016

The demo at http://uvcdat.llnl.gov/examples/vcs3D_cubed_sphere_volume.html returns the following error:

In [27]: x.plot( v, dv3d, grid_file="vcs3D_cubed_sphere_volume_grid.nc" )
---------------------------------------------------------------------------
vcsError                                  Traceback (most recent call last)
<ipython-input-27-6a265f659a04> in <module>()
----> 1 x.plot( v, dv3d, grid_file="vcs3D_cubed_sphere_volume_grid.nc" )

/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/vcs/Canvas.pyc in plot(self, *actual_args, **keyargs)
   2404         self.__last_plot_keyargs = keyargs
   2405         passed_var = keyargs.get("variable", None)
-> 2406         arglist = _determine_arg_list(None, actual_args)
   2407         if passed_var is not None:
   2408             arglist[0] = cdms2.asVariable(passed_var)

/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/vcs/Canvas.pyc in _determine_arg_list(g_name, actual_args)
    222         else:
    223             raise vcsError("Unknown type %s of argument to plotting command." %
--> 224                            type(args[i]))
    225     if g_name is not None:
    226         arglist[igraphics_method] = g_name

vcsError: Unknown type <type 'NoneType'> of argument to plotting command.

Following version info:

[duro@ocean ~/160302_pcmdi_metrics]$ env | grep UVCDAT
UVCDAT_PROMPT_STRING=v2.5.0-81-gf4493d2
UVCDAT_SETUP_PATH=/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS

@chaosphere2112 @mattben pinging you gentlemen here

@durack1 durack1 added VCS DV3D Bug labels Mar 3, 2016

@durack1 durack1 added this to the 2.6 milestone Mar 3, 2016

@aashish24 aashish24 assigned danlipsa and unassigned chaosphere2112 Mar 9, 2016

@aashish24

This comment has been minimized.

Contributor

aashish24 commented Mar 9, 2016

@durack1 let's Dan have a look at it. He is the one supposed to be taking care of DV3D plots.

@danlipsa

@aashish24 aashish24 closed this Mar 9, 2016

@aashish24 aashish24 reopened this Mar 9, 2016

@durack1

This comment has been minimized.

Member

durack1 commented Mar 9, 2016

@aashish24 ok great. @danlipsa let me know if you need any more info

@durack1

This comment has been minimized.

Member

durack1 commented Mar 9, 2016

@mattben there is also a typo in the gallery notes - the *.nc file has two filenames - these should be consistent with the file linked for download. Should this be a separate issue on https://github.com/UV-CDAT/uvcdat-site?

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Mar 9, 2016

cubed_sphere
@aashish24 @chaosphere2112 @durack1 @danlipsa works for me with fixes in:
#1874

@chaosphere2112

This comment has been minimized.

Contributor

chaosphere2112 commented Mar 9, 2016

@durack1 It isn't a typo; you need two different .nc files to make this one run.

@durack1

This comment has been minimized.

Member

durack1 commented Mar 9, 2016

@doutriaux1 the above looks different to the gallery:
cubed_sphere
@chaosphere2112 it'd be great if the gallery examples were pulled into the testing suite, obviously this is a lot of work, but aspiration-ally it'd be great..

@durack1

This comment has been minimized.

Member

durack1 commented Mar 9, 2016

@chaosphere2112 whoops, sorry I did see the two *.nc links, but missed that they were two separate files.. Sorry, my bad..

@durack1

This comment has been minimized.

Member

durack1 commented Mar 9, 2016

@chaosphere2112 I still hit the following error:

[durack1@oceanonly ~/160302_pcmdi_metrics]$ env | grep UVCDAT
UVCDAT_PROMPT_STRING=v2.5.0-81-gf4493d2
UVCDAT_SETUP_PATH=/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS
In [1]: import vcs, cdms2, sys
In [2]: 
In [2]: x = vcs.init()
In [3]: f = cdms2.open( "vcs3D_cubed_sphere_volume.nc" )   
In [4]: v = f["RELHUM"] 
In [5]: dv3d = vcs.get3d_scalar()
In [6]: dv3d.ScaleTransferFunction = [ 78.7, 132.0 ]
In [7]: dv3d.ScaleColormap = [ 75.4, 100.0 ]
In [8]: dv3d.ScaleOpacity = [0.27, 1.0]
In [9]: dv3d.PointSize = [5, 2]
In [10]: dv3d.VerticalScaling = [ 1.7 ]
In [11]: dv3d.ToggleVolumePlot = vcs.on
In [12]: dv3d.ToggleSphericalProj = vcs.on
In [13]: dv3d.Camera = {'Position': (-108.11442471080369, -476.65927617219285, 84.45227482307195), 'ViewUp': ( 0.0, 0.0, 1.0), 'FocalPoint': (0, 0, 0)}                                                                                                                 
In [14]: x.plot( v, dv3d, grid_file="vcs3D_cubed_sphere_volume_grid.nc" )
/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/vcs/Canvas.py:3533: UserWarning: Unrecognized vcs plot keyword: grid_file, assuming backend (vtk) keyword                                                                                
  (keyarg, self.backend.type))                                                                                                      
CDMS system error: No such file or directory                                                                                        
CDMS I/O error: Opening file                                                                                                        
---------------------------------------------------------------------------                                                         
CDMSError                                 Traceback (most recent call last)                                                         
<ipython-input-14-6a265f659a04> in <module>()                                                                                       
----> 1 x.plot( v, dv3d, grid_file="vcs3D_cubed_sphere_volume_grid.nc")                                                            
/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/vcs/Canvas.pyc in plot(self, *actual_args, **keyargs)
   2422                                                                                                                             
   2423         # Plot the data                                                                                                     
-> 2424         a = self.__plot(arglist, keyargs)                                                                                   
   2425                                                                                                                             
   2426         if "continents_line" in keyargs:                                                                                    
/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/vcs/Canvas.pyc in __plot(self, arglist, keyargs)
   3745                         **keyargs)                                                                                     
   3746             else:                                                                                                      
-> 3747                 returned_kargs = self.backend.plot(*arglist, **keyargs)                                                
   3748                 if not keyargs.get("donotstoredisplay", False):                                                        
   3749                     nm, src = self.check_name_source(                                                                  
/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/vcs/VTKPlots.pyc in plot(self, data1, data2, template, gtype, gname, bg, *args, **kargs)                                                                                                 
    547                 gm.addPlotAttribute('filename', cdms_file)                                                                  
    548                 gm.addPlotAttribute('url', cdms_file)                                                                       
--> 549             returned.update(self.plot3D(data1, data2, tpl, gm, ren, **kargs))                                               
    550         elif gtype in ["text"]:                                                                                             
    551             if tt.priority != 0:                                                                                            
/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/vcs/VTKPlots.pyc in plot3D(self, data1, data2, tmpl, gm, ren, **kargs)                                                                                                                   
    679                 gmname=gm.g_name,                                                                                           
    680                 cm=gm.cfgManager,                                                                                           
--> 681                 **kargs)  # , plot_type = PlotType.List  )
    682             self.plotApps[gm] = g
    683             self.plotRenderers.add(g.plot.renderer)
/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/DV3D/Application.pyc in gminit(self, var1, var2, **args)
     70             if self.plot == None:
     71                 self.plot = CPCPlot(**args)
---> 72                 self.plot.gminit( var1, var2, **args  )
     73                 self.plot.ParameterValueChanged.connect(self.canvas.processParameterChange)
     74             else:
/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/DV3D/PointCloudViewer.pyc in gminit(self, var1, var2, **args)
   1359         if "cm" in args:
   1360             self.cfgManager = args["cm"]
-> 1361         self.init( init=init_args, **args )
   1362
   1363     def init(self, **args ):
/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/DV3D/PointCloudViewer.pyc in init(self, **args)
   1370         self.point_cloud_overview = vtkLocalPointCloud( 0, max_points=n_overview_points )
   1371         lut = self.getLUT('Slice')
-> 1372         self.point_cloud_overview.initialize( init_args, lut = lut, maxStageHeight=self.maxStageHeight  )
   1373         nInputPoints = self.point_cloud_overview.getNumberOfInputPoints()
   1374         if ( n_subproc_points > nInputPoints ): n_subproc_points = nInputPoints
/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/DV3D/DistributedPointCollections.pyc in initialize(self, init_args, **args)
    692
    693     def initialize(self, init_args = None, **args ):
--> 694         if init_args: self.point_collection.initialize( init_args, **args )
    695         else: self.point_collection.initPoints()
    696         self.np_points_data = self.point_collection.getPoints()
/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/DV3D/MultiVarPointCollection.pyc in initialize(self, args, **cfg_args)
    499         self.roi = ROI
    500         self.gf = cdms2.open( grid_file ) if grid_file else None
--> 501         self.df = cdms2.open( data_file ) if data_file else None
    502         self.grid_vars = grd_vars if ( grd_vars <> None ) else self.df.variables[0]
    503         self.grid_coords = grd_coords
/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/cdms2/dataset.pyc in openDataset(uri, mode, template, dods, dpath, hostObj)
    294             ##Ok mpi has issues with bellow we need to test this only with 1 rank
    295             if not os.path.exists(path):
--> 296                 return CdmsFile(path,mode,mpiBarrier=CdMpi)
    297             elif mode=="w":
    298                 try:
/export/durack1/160302_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/cdms2/dataset.pyc in __init__(self, path, mode, hostObj, mpiBarrier)
    983             _fileobj_ = Cdunif.CdunifFile (path, mode)
    984         except Exception,err:
--> 985             raise CDMSError('Cannot open file %s (%s)'%(path,err))
    986         self._file_ = _fileobj_   # Cdunif file object
    987         self.variables = {}
CDMSError: Cannot open file  (Variable not found)

In [15]: import os
In [16]: os.listdir('.')
Out[16]:
['PCMDI_METRICS',
 'install_metrics.bash',
 'vcs3D_cubed_sphere_volume_grid.nc',
 'vcs3D_cubed_sphere_volume.nc',
 'install_metrics.bash~']
@ThomasMaxwell

This comment has been minimized.

Contributor

ThomasMaxwell commented Mar 9, 2016

Paul,
Do you have both the files vcs3D_cubed_sphere_volume.nc and vcs3D_cubed_sphere_volume_grid.nc in the same directory as the python script?

— Tom

From: "Paul J. Durack" <notifications@github.commailto:notifications@github.com>
Reply-To: UV-CDAT/uvcdat <reply@reply.github.commailto:reply@reply.github.com>
Date: Wednesday, March 9, 2016 at 12:18 PM
To: UV-CDAT/uvcdat <uvcdat@noreply.github.commailto:uvcdat@noreply.github.com>
Subject: Re: [uvcdat] DV3D/VCS plot error (#1867)

@chaosphere2112https://github.com/chaosphere2112 I still hit the following error:
...


Reply to this email directly or view it on GitHubhttps://github.com//issues/1867#issuecomment-194408435.

@durack1

This comment has been minimized.

Member

durack1 commented Mar 9, 2016

@ThomasMaxwell yep - as included at the bottom of the edited comment above:

In [16]: os.listdir('.')
Out[16]:
['PCMDI_METRICS',
 'install_metrics.bash',
 'vcs3D_cubed_sphere_volume_grid.nc',
 'vcs3D_cubed_sphere_volume.nc',
 'install_metrics.bash~']
@chaosphere2112

This comment has been minimized.

Contributor

chaosphere2112 commented Mar 9, 2016

@durack1 I'm thinking the issue is relative paths. Right now we're just slamming file:// on the front of whatever path you pass in; if there's no leading /, that will make what is technically an invalid file URI and urlparse will think the first element is the netloc. I've updated @doutriaux1's PR that addresses these issues.

@durack1

This comment has been minimized.

Member

durack1 commented Mar 9, 2016

@chaosphere2112 thanks for the heads up - was #1874 a pronto merge, I'm wondering whether I should try and rebuild master or that branch specifically..

@durack1

This comment has been minimized.

Member

durack1 commented Mar 14, 2016

@chaosphere2112 @doutriaux1 I now get a plot from master but also this error:

In [34]: x.clear()
 saved state data to file  <closed file '/export/durack1/160314_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/DV3D/data/state.txt', mode 'w' at 0x7fbe96792030>
In [35]: x.close()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-35-c592cc0d4005> in <module>()
----> 1 x.close()
/export/durack1/160314_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/vcs/Canvas.pyc in close(self, *args, **kargs)
   3940         if self.configurator:
   3941             self.endconfigure()
-> 3942         a = self.backend.close(*args, **kargs)
   3943         self.animate_info = []
   3944
/export/durack1/160314_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/vcs/VTKPlots.pyc in close(self)
    477         if self.renWin is None:
    478             return
--> 479         self.clear()
    480         self.renWin.Finalize()
    481         self.renWin = None
/export/durack1/160314_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/vcs/VTKPlots.pyc in clear(self, render)
    284         for gm in self.plotApps:
    285             app = self.plotApps[gm]
--> 286             app.plot.quit()
    287
    288         self.hideGUI()
/export/durack1/160314_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/DV3D/DV3DPlot.pyc in quit(self, **args)
    339
    340     def quit( self, **args ):
--> 341         self.saveState()
    342         self.onClosing(None)
    343         eventArgs = args.get( 'args', None )
/export/durack1/160314_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/DV3D/DV3DPlot.pyc in saveState(self, **args)
    413
    414     def saveState(self, **args):
--> 415         self.recordCamera()
    416         self.cfgManager.saveState()
    417
/export/durack1/160314_pcmdi_metrics/PCMDI_METRICS/lib/python2.7/site-packages/DV3D/DV3DPlot.pyc in recordCamera(self)
   1285
   1286     def recordCamera( self ):
-> 1287         c = self.renderer.GetActiveCamera()
   1288         self.cameraOrientation[ self.topo ] = ( c.GetPosition(), c.GetFocalPoint(), c.GetViewUp() )
   1289         cameraSpecs = self.cameraOrientation[ self.topo ]
AttributeError: 'NoneType' object has no attribute 'GetActiveCamera'

@durack1 durack1 reopened this Mar 14, 2016

@durack1

This comment has been minimized.

Member

durack1 commented Mar 15, 2016

@chaosphere2112 @doutriaux1 there still appears to be an unresolved issue here - so have reopened the issue

@durack1

This comment has been minimized.

Member

durack1 commented Mar 17, 2016

@aashish24 is there a reason this was closed when there's a problem remaining?

@aashish24

This comment has been minimized.

Contributor

aashish24 commented Mar 17, 2016

@durack1 it got closed automatically as I meged @doutriaux1 file:// branch.

@aashish24 aashish24 reopened this Mar 17, 2016

@aashish24

This comment has been minimized.

Contributor

aashish24 commented Mar 17, 2016

@durack1 re-opening it.

@durack1

This comment has been minimized.

Member

durack1 commented Mar 17, 2016

@aashish24 no problem, when there's another branch that fixes the issue above I'd be happy to test this..

And @aashish24 while I have you here, want to take a peek at: #1839 and #1817 please?

@aashish24 aashish24 modified the milestones: 3.0, 2.6 May 25, 2016

@Rex-Diego

This comment has been minimized.

Rex-Diego commented Nov 15, 2016

Could anyone tell me where can I get vcs3D_cubed_sphere_volume.nc ?I've searched the github and the Internet, and can not find it.

@chaosphere2112

This comment has been minimized.

Contributor

chaosphere2112 commented Nov 16, 2016

@Rex-Diego Sorry about that! We migrated the site to a new server and lost track of the file temporarily. The two files for that example are available here and here. The link to the second should be up on that example as soon as our server updates the website automatically.

@Rex-Diego

This comment has been minimized.

Rex-Diego commented Nov 17, 2016

@chaosphere2112 Thank you so much!

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