Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
    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)