def on_save(self): if self.current_wavedec is None: return file = uiutils.select_file() if file is not None: new_hdul = pyfits.HDUList() for scale, img in zip(range(self.scale.get_min(), self.scale.get_max() + 1), self.current_wavedec): hdu = img.build_hdu() hdu.header.set('EXTNAME', "Scale %s" % scale) new_hdul.append(hdu) new_hdul.writeto(file)
def on_save(self): if self.current_wavedec is None: return file = uiutils.select_file() if file is not None: new_hdul = pyfits.HDUList() for scale, img in zip( range(self.scale.get_min(), self.scale.get_max() + 1), self.current_wavedec): hdu = img.build_hdu() hdu.header.set('EXTNAME', "Scale %s" % scale) new_hdul.append(hdu) new_hdul.writeto(file)
def on_save_clicked(self, bn): filename = uiutils.select_file(parent=self, current_folder=self.current_folder) if filename is not None: vertices = self.poly.xy color = self.color_entry.get_text() title = self.title_entry.get_text() poly_region = imgutils.PolyRegion(vertices, color=color, title=title) try: poly_region.to_file(filename, self.img.get_coordinate_system()) except: msg = "Failed to save region %s" % filename print msg uiutils.error_msg(msg, self)
def on_save_clicked(self, bn): filename = uiutils.select_file(parent=self, current_folder=self.current_folder) if filename is not None: vertices = self.poly.xy color = self.color_entry.get_text() title = self.title_entry.get_text() poly_region = imgutils.PolyRegion(vertices, color=color, title=title) try: poly_region.to_file(filename, self.img.get_coordinate_system()) except Exception: msg = "Failed to save region %s" % filename print msg uiutils.error_msg(msg, self)