Returns a one dimension array with the Place where the points 
        belong.
        
        :returns: The ``pyny.Place`` where the points belong.
        :rtype: list of int
771048
def get_sets_index(self):
        
        index = []
        for i, place in enumerate(self):
            index.append(np.ones(place.set_of_points.shape[0])*i)
        return np.concatenate(index).astype(int)
133131
def array(self):
        
        return np.arange(self.start, self.stop, self.step)
758824
def get_normed_points(point_array, norm): # good to go
    
    norm = float(norm)
    #floated_array = []
    #for p in point_array: # need to make sure each point is a float
        #floated_array.append(float(p))
    points = old_div(numpy.array(point_array), norm)
    return points
1230072
def get_element_centroids(self):
        
        centroids = np.vstack((
            np.mean(self.grid['x'], axis=1), np.mean(self.grid['z'], axis=1)
        )).T

        return centroids
62544
def get_point_index(point, all_points, eps = 1e-4):
        
        inds = np.where(np.linalg.norm(point - all_points, axis=1) < eps)
        if inds[0].shape[0] == 0:
            return -1
        return inds[0][0]
1323159
def example_point(self):
        
        return np.array([([self.n_meas] + [0] * (self.n_elements-1),)], dtype=self.dtype)
170058
def xy_positions(self):
        """"""
        if self._xy_positions is None or len(self._xy_positions) == 0:
            xy_pos = []
            for dom_id, pos in self.dom_positions.items():
                if self.domid2floor(dom_id) == 1:
                    xy_pos.append(np.array([pos[0], pos[1]]))
            self._xy_positions = np.array(xy_pos)
        return self._xy_positions
658411
def get_location(self):
        
        image_string = self.__dict__['location']['image']
        image_ints = list(map(int, image_string.split(",")))
        return Location(*image_ints)
17523
def get_llur(self):
        
        points = np.array([obj.get_llur() for obj in self.objects])
        t_ = points.T
        x1, y1 = t_[0].min(), t_[1].min()
        x2, y2 = t_[2].max(), t_[3].max()
        return (x1, y1, x2, y2)
1289470
def get_data_point(self, n):
        
        # loop over the columns and pop the data
        point = []
        for k in self.ckeys: point.append(self[k][n])
        return point
733684
def midpoint(self):
        
        midpoints = []
        for segment in self:
            if len(segment) < 2:
                midpoints.append([])
            else:
                midpoints.append(segment.midpoint())
        return midpoints
1209715
def to_array(self):
        
        array = super(Location, self).to_array()
        array['longitude'] = float(self.longitude)  # type float
        array['latitude'] = float(self.latitude)  # type float
        return array
489456
def match_positions(shape, list_of_coords):
    
    match_array = np.zeros(shape)
    try:
        # excpetion hit on this line if nothing in list_of_coords- i.e. no matches
        match_array[list_of_coords[:,0],list_of_coords[:,1]] = 1
        labelled = label(match_array)
        objects = find_objects(labelled[0])
        coords = [{'x':(slice_x.start, slice_x.stop),'y':(slice_y.start, slice_y.stop)} for (slice_y,slice_x) in objects]
        final_positions = [(int(np.mean(coords[i]['x'])),int(np.mean(coords[i]['y']))) for i in range(len(coords))]
        return final_positions
    except IndexError:
        print 'no matches found'
        # this error occurs if no matches are found
        return []
930092
def end_coordsys(self):
        
        coordsys = copy(self.location)
        coordsys.origin = self.end_point
        return coordsys
936348
def all_locations(self):
        '''
        
        '''
        qs = self.assoc_locations.all()
        for node in self.get_descendants():
            qs2 = node.assoc_locations.all()
            qs = qs.union(qs2).distinct('pk')
        return qs
106372
def getCoords(self):
        '''
        
        '''

        if DEBUG_COORDS:
            print >>sys.stderr, "getCoords(%s %s ## %s)" % (self.getClass(), self.getId(), self.getUniqueId())

        (x, y) = self.getXY();
        w = self.getWidth()
        h = self.getHeight()
        return ((x, y), (x+w, y+h))
586172
def center(self):
        ''''''
        points = np.array(self._points)
        return np.mean(points[:, COLS.XYZ], axis=0)