def show_spec_layer(self, title, data): plot = PlotWindow(title) plt.sca(plot.axis) plt.imshow(data, origin='lower') plt.subplots_adjust(top=0.975, bottom=0.025, left=0.025, right=0.975) plt.draw() plot.setWindowFlag(Qt.WindowStaysOnTopHint, False) plot.show() padding = 32 display = QApplication.desktop() current_screen = display.screenNumber(self.view) geom = display.screenGeometry(current_screen) width = geom.width() - 2 * padding height = geom.height() - 2 * padding plot.setGeometry(geom.left() + padding, geom.top() + padding, width, height) plt.close()
def show_all_layers(self): title = f'All Layers of {self.spec.id}' horizontal = self.rect().width() > self.rect().height() subplot_grid_shape = (7, 1) if horizontal else (1, 7) plot = PlotWindow(title, shape=subplot_grid_shape) plt.sca(plot.axis[0]) plt.imshow(self.spec.contamination + self.spec.science, origin='lower') plt.title('Original') plt.draw() plt.sca(plot.axis[1]) plt.imshow(self.spec.contamination, origin='lower') plt.title('Contamination') plt.draw() plt.sca(plot.axis[2]) plt.imshow(self.spec.science, origin='lower') plt.title('Decontaminated') plt.draw() plt.sca(plot.axis[3]) if self.model is not None: plt.imshow(self.model, origin='lower') plt.title('Model') else: plt.title('N/A') plt.draw() plt.sca(plot.axis[4]) if self.model is not None: plt.imshow(self.spec.science - self.model, origin='lower') plt.title('Residual') else: plt.title('N/A') plt.draw() plt.sca(plot.axis[5]) plt.imshow(self.spec.variance, origin='lower') plt.title('Variance') plt.draw() plt.sca(plot.axis[6]) data = (flag['ZERO'] & self.spec.mask) == flag['ZERO'] plt.imshow(data, origin='lower') plt.title('Zeroth Orders') plt.draw() if horizontal: plt.subplots_adjust(top=0.97, bottom=0.025, left=0.025, right=0.975, hspace=0, wspace=0) else: plt.subplots_adjust(top=0.9, bottom=0.03, left=0.025, right=0.975, hspace=0, wspace=0) plt.draw() plot.setWindowFlag(Qt.WindowStaysOnTopHint, False) plot.show() padding = 50 display = QApplication.desktop() current_screen = display.screenNumber(self.view) geom = display.screenGeometry(current_screen) width = geom.width() - 2 * padding height = geom.height() - 2 * padding plot.setGeometry(geom.left() + padding, geom.top() + padding, width, height) plt.close()