CDAT / cdat

Community Data Analysis Tools
Other
175 stars 68 forks source link

DV3D/VCS plot error #1867

Open durack1 opened 8 years ago

durack1 commented 8 years ago

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

aashish24 commented 8 years ago

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

@danlipsa

durack1 commented 8 years ago

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

durack1 commented 8 years ago

@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 commented 8 years ago

cubed_sphere @aashish24 @chaosphere2112 @durack1 @danlipsa works for me with fixes in: https://github.com/UV-CDAT/uvcdat/pull/1874

chaosphere2112 commented 8 years ago

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

durack1 commented 8 years ago

@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 commented 8 years ago

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

durack1 commented 8 years ago

@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
import vcs, cdms2, sys

x = vcs.init()
f = cdms2.open( "vcs3D_cubed_sphere_volume.nc" )   
v = f["RELHUM"] 
dv3d = vcs.get3d_scalar()
dv3d.ScaleTransferFunction = [ 78.7, 132.0 ]
dv3d.ScaleColormap = [ 75.4, 100.0 ]
dv3d.ScaleOpacity = [0.27, 1.0]
dv3d.PointSize = [5, 2]
dv3d.VerticalScaling = [ 1.7 ]
dv3d.ToggleVolumePlot = vcs.on
dv3d.ToggleSphericalProj = vcs.on
dv3d.Camera = {'Position': (-108.11442471080369, -476.65927617219285, 84.45227482307195), 'ViewUp': ( 0.0, 0.0, 1.0), 'FocalPoint': (0, 0, 0)}                                                                                                                 
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 commented 8 years ago

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.com<mailto:notifications@github.com> Reply-To: UV-CDAT/uvcdat reply@reply.github.com<mailto:reply@reply.github.com> Date: Wednesday, March 9, 2016 at 12:18 PM To: UV-CDAT/uvcdat uvcdat@noreply.github.com<mailto: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/UV-CDAT/uvcdat/issues/1867#issuecomment-194408435.

durack1 commented 8 years ago

@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 commented 8 years ago

@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 commented 8 years ago

@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 commented 8 years ago

@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 commented 8 years ago

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

durack1 commented 8 years ago

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

aashish24 commented 8 years ago

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

aashish24 commented 8 years ago

@durack1 re-opening it.

durack1 commented 8 years ago

@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?

Rex-Diego commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

@chaosphere2112 Thank you so much!