NASA-DEVELOP / VOCAL

Visualization of CALIPSO (VOCAL). A CALIPSO Cross Cutting tool for visualizing data
http://nasa-develop.github.io/VOCAL/
Other
38 stars 14 forks source link

Extracting Shape Data: ValueError: Negative Dimensions are not allowed #29

Open Syntaf opened 9 years ago

Syntaf commented 9 years ago

Sometimes when extracting shape data using the extract button, a shape becomes invalidated upon extraction due to some negative dimensions being calculated. Here is the trace

The cause seems to be that interpolation_search returns 0 as the max, which will end up causing negative dimensions

To Reproduce:

[2015-07-21 14:48:55,108] [    INFO] --- Extracting data for shape112... (Calipso.py:432)
[2015-07-21 14:48:55,108] [    INFO] --- Opening ExtractDialog... (exctractdialog.py:41)
[2015-07-21 14:48:55,187] [    INFO] --- Reading shape data... (exctractdialog.py:65)
[2015-07-21 14:48:55,210] [    INFO] --- Applying search algorithm to determine shape bounds... (exctractdialog.py:133)
[2015-07-21 14:48:55,210] [    INFO] --- Setting bounds for new subplot... (exctractdialog.py:137)
Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\gamercer\Anaconda\lib\lib-tk\Tkinter.py", line 1532, in __call__
    return self.func(*args)
  File "C:\Users\gamercer\Anaconda\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 398, in button_press_event
    FigureCanvasBase.button_press_event(self, x, y, num, dblclick=dblclick, guiEvent=event)
  File "C:\Users\gamercer\Anaconda\lib\site-packages\matplotlib\backend_bases.py", line 1887, in button_press_event
    self.callbacks.process(s, mouseevent)
  File "C:\Users\gamercer\Anaconda\lib\site-packages\matplotlib\cbook.py", line 540, in process
    proxy(*args, **kwargs)
  File "C:\Users\gamercer\Anaconda\lib\site-packages\matplotlib\cbook.py", line 415, in __call__
    return mtd(*args, **kwargs)
  File "C:\Users\gamercer\Anaconda\lib\site-packages\matplotlib\backend_bases.py", line 1773, in pick
    self.figure.pick(mouseevent)
  File "C:\Users\gamercer\Anaconda\lib\site-packages\matplotlib\artist.py", line 369, in pick
    a.pick(mouseevent)
  File "C:\Users\gamercer\Anaconda\lib\site-packages\matplotlib\axes\_base.py", line 3237, in pick
    martist.Artist.pick(self, args[0])
  File "C:\Users\gamercer\Anaconda\lib\site-packages\matplotlib\artist.py", line 369, in pick
    a.pick(mouseevent)
  File "C:\Users\gamercer\Anaconda\lib\site-packages\matplotlib\artist.py", line 355, in pick
    self.figure.canvas.pick_event(mouseevent, self, **prop)
  File "C:\Users\gamercer\Anaconda\lib\site-packages\matplotlib\backend_bases.py", line 1853, in pick_event
    self.callbacks.process(s, event)
  File "C:\Users\gamercer\Anaconda\lib\site-packages\matplotlib\cbook.py", line 540, in process
    proxy(*args, **kwargs)
  File "C:\Users\gamercer\Anaconda\lib\site-packages\matplotlib\cbook.py", line 415, in __call__
    return mtd(*args, **kwargs)
  File "C:/Users/gamercer/Documents/CALIPSO_Visualization/calipso/Calipso.py", line 433, in extract_window
    ExtractDialog(self.__root, shape, self.__file, self.xrange, self.yrange).\
  File "C:\Users\gamercer\Documents\CALIPSO_Visualization\calipso\exctractdialog.py", line 66, in __init__
    self.create_subplot()
  File "C:\Users\gamercer\Documents\CALIPSO_Visualization\calipso\exctractdialog.py", line 150, in create_subplot
    h2, h1, nz)
  File "algorithms.pyx", line 39, in ccplot.algorithms.interp2d_12 (ccplot\algorithms.c:1610)
ValueError: negative dimensions are not allowed
[2015-07-21 14:49:02,594] [ WARNING] --- Unsaved shapes found... (Calipso.py:511)
[2015-07-21 14:49:03,780] [    INFO] --- Dumping unsaved shapes... (Calipso.py:519)
[2015-07-21 14:49:03,802] [    INFO] --- Terminated CALIPSO program... (Calipso.py:544)
stapleCamel commented 9 years ago

Unable to reproduce.

stapleCamel commented 9 years ago

Added exception handling into extractdialog as a precaution. f89239b9414727e6eb5084515caf45bb3c42882e

stapleCamel commented 9 years ago

This bug may be caused when x1 is greater than x2, although I can't come up with when that would happen.