예제 #1
0
파일: data.py 프로젝트: robintw/glue
 def _create_pixel_and_world_components(self):
     for i in range(self.ndim):
         comp = CoordinateComponent(self, i)
         label = pixel_label(i, self.ndim)
         cid = self.add_component(comp, "Pixel %s" % label, hidden=True)
         self._pixel_component_ids.append(cid)
     if self.coords:
         for i in range(self.ndim):
             comp = CoordinateComponent(self, i, world=True)
             label = self.coords.axis_label(i)
             cid = self.add_component(comp, label, hidden=True)
             self._world_component_ids.append(cid)
예제 #2
0
 def _update_pixel_components(self, ndim):
     for i in range(ndim):
         comp = CoordinateComponent(self, i)
         label = pixel_label(i, ndim)
         cid = PixelComponentID(i, "Pixel Axis %s" % label, parent=self)
         self.add_component(comp, cid)
         self._pixel_component_ids.append(cid)
예제 #3
0
파일: data.py 프로젝트: harshalkokate/glue
    def _create_pixel_and_world_components(self, ndim):

        for i in range(ndim):
            comp = CoordinateComponent(self, i)
            label = pixel_label(i, ndim)
            cid = PixelComponentID(i, "Pixel Axis %s" % label, parent=self)
            self.add_component(comp, cid)
            self._pixel_component_ids.append(cid)

        if self.coords:
            for i in range(ndim):
                comp = CoordinateComponent(self, i, world=True)
                label = self.coords.axis_label(i)
                cid = self.add_component(comp, label)
                self._world_component_ids.append(cid)
            self._set_up_coordinate_component_links(ndim)
예제 #4
0
 def _update_world_components(self, ndim):
     for cid in self._world_component_ids[:]:
         self.remove_component(cid)
         self._world_component_ids.remove(cid)
     if self.coords:
         for i in range(ndim):
             comp = CoordinateComponent(self, i, world=True)
             label = self.coords.axis_label(i)
             cid = self.add_component(comp, label)
             self._world_component_ids.append(cid)
         self._set_up_coordinate_component_links(ndim)