diff --git a/sharppy/viz/SPCWindow.py b/sharppy/viz/SPCWindow.py index 4ce2e6be..aaa96dba 100644 --- a/sharppy/viz/SPCWindow.py +++ b/sharppy/viz/SPCWindow.py @@ -616,7 +616,6 @@ def advanceTime(self, direction): if prof_col.hasMeta('analogfile'): match = prof_col.getMeta('analogfile') dt = prof_col.getCurrentDate() - print("\n\nIN IF:", dt, match) if dt in match: self.insets['SARS'].setSelection(match[dt]) else: @@ -644,7 +643,6 @@ def swapProfCollections(self): if self.prof_collections[self.pc_idx].hasMeta('analogfile'): match = self.prof_collections[self.pc_idx].getMeta('analogfile') dt = prof_col.getCurrentDate() - print(dt, match) if dt in match: self.insets['SARS'].setSelection(match[dt]) else: @@ -754,7 +752,6 @@ class SPCWindow(QMainWindow): def __init__(self, **kwargs): parent = kwargs.get('parent', None) super(SPCWindow, self).__init__(parent=parent) - print("SPCWINDOW PARENT:", parent) logging.debug("Initialize SPCWindow...") self.menu_items = [] self.picker_window = parent diff --git a/sharppy/viz/analogues.py b/sharppy/viz/analogues.py index 41ef0b53..b2643432 100644 --- a/sharppy/viz/analogues.py +++ b/sharppy/viz/analogues.py @@ -468,10 +468,6 @@ def drawSARS(self, qp, **kwargs): self.ylast = self.tpad def mousePressEvent(self, e): - try: - print("PARENT1:", self.parentWidget()) - except: - print("Parent widget print failed") if self.prof is None or (len(self.sup_matches[0]) == 0 and len(self.hail_matches[0]) == 0): return @@ -508,7 +504,6 @@ def mousePressEvent(self, e): self.plotBackground() self.plotData() self.update() - print("PARENT2:", self.parentWidget()) #logging.debug("Calling plotAnaloges.parentWidget().setFocus()") self.parentWidget().setFocus() @@ -517,13 +512,16 @@ def setSelection(self, filematch): Load in the SARS analog you've clicked. """ match_name = os.path.basename(filematch) - print("\n\nSETSELECION:", match_name, filematch) - if match_name in self.sup_matches[0]: - idx = np.where(self.sup_matches[0] == match_name)[0][0] +# print("\n\nSETSELECION:", match_name, filematch, self.sup_matches[0], self.hail_matches[0]) + sup_matches = [sars.getSounding(f, 'supercell').split('/')[-1] for f in self.sup_matches[0]] + hail_matches = [sars.getSounding(f, 'hail').split('/')[-1] for f in self.hail_matches[0]] +# print(sup_matches, hail_matches) + if match_name in sup_matches: + idx = np.where(np.asarray(sup_matches, dtype=str) == match_name)[0][0] lbx = 0. ybounds = self.ybounds_sup - if match_name in self.hail_matches[0]: - idx = np.where(self.hail_matches[0] == match_name)[0][0] + if match_name in hail_matches: + idx = np.where(np.asarray(hail_matches, dtype=str) == match_name)[0][0] lbx = self.brx / 2. ybounds = self.ybounds_hail @@ -533,6 +531,7 @@ def setSelection(self, filematch): self.plotBackground() self.plotData() self.update() + self.parentWidget().setFocus() def clearSelection(self): self.selectRect = None