Returns any single point guaranteed to be in the domain, but
        no other guarantees; useful for testing purposes.
        This is given as a size 1 ``np.array`` of type ``dtype``.

        :type: ``np.ndarray``
350339
def example_point(self):
        
        if not np.isinf(self.min):
            return np.array([self.min], dtype=self.dtype)
        if not np.isinf(self.max):
            return np.array([self.max], dtype=self.dtype)
        else:
            return np.array([0], dtype=self.dtype)
20068
def point_stokes(self, context):
        
        stokes = np.empty(context.shape, context.dtype)
        stokes[:,:,0] = 1
        stokes[:,:,1:4] = 0
        return stokes
590902
def size(self):
        """"""
        # Since np.prod(()) == 1.0 we need to handle that by ourselves
        return (0 if self.shape == () else
                int(np.prod(self.shape, dtype='int64')))
444654
def X(self):
             
        if self.ar == 1:
            return np.array([self.data_full[(self.max_lag-1):-1]])
        else:
            for i in range(0,self.ar):
                datapoint = self.data_full[(self.max_lag-i-1):-i-1]         
                if i == 0:
                    X = datapoint
                else:
                    X = np.vstack((X,datapoint))
        return X
1248973
def pointInside(self, point):
        
        point = normalizers.normalizeCoordinateTuple(point)
        return self._pointInside(point)
700135
def is_filled(self, point):
        
        index = self.point_to_index(point)
        in_range = (np.array(index) < np.array(self.shape)).all()
        if in_range:
            is_filled = self.matrix[index]
        else:
            is_filled = False
        return is_filled
1291191
def get(self, point):
        
        if not (isinstance(point, GeoVector) and point.type == 'Point'):
            raise TypeError('expect GeoVector(Point), got %s' % (point,))

        target = self.to_raster(point)
        return self.image[:, int(target.y), int(target.x)]
502616
def distance_from_point(self, pt):
        
        return np.linalg.norm(np.array(pt) - self.coords)
1247479
def _get_dtype_and_shape(self):
        
        npy_dtype = self._get_image_numpy_dtype()

        if self._info['ndims'] != 0:
            shape = self._info['dims']
        else:
            raise IOError("no image present in HDU")

        return npy_dtype, shape
1365264
def zero2d(self):
        
        return type(self)(x=np.atleast_2d(np.zeros((self.shape[0],self.shape[1]))),
                   row_names=self.row_names,
                   col_names=self.col_names,
                   isdiagonal=False)
1275014
def P(self):
        
        P = np.r_[np.c_[self.S, self.t], np.array([0,0,0,1])]
        return P
851510
def points(self, points):
        
        if not isinstance(points, np.ndarray):
            raise TypeError('Points must be a numpy array')
        # get the unique coordinates along each axial direction
        x = np.unique(points[:,0])
        y = np.unique(points[:,1])
        z = np.unique(points[:,2])
        nx, ny, nz = len(x), len(y), len(z)
        # TODO: this needs to be tested (unique might return a tuple)
        dx, dy, dz = np.unique(np.diff(x)), np.unique(np.diff(y)), np.unique(np.diff(z))
        ox, oy, oz = np.min(x), np.min(y), np.min(z)
        # Build the vtk object
        self._from_specs((nx,ny,nz), (dx,dy,dz), (ox,oy,oz))
        #self._point_ref = points
        self.Modified()
865409
def points(self):
        
        vtk_data = self.GetPoints().GetData()
        arr = vtk_to_numpy(vtk_data)
        return vtki_ndarray(arr, vtk_data)
695069
def upoint2bddpoint(upoint):
    
    point = dict()
    for uniqid in upoint[0]:
        point[_VARS[uniqid]] = 0
    for uniqid in upoint[1]:
        point[_VARS[uniqid]] = 1
    return point
47893
def is_valid(self):
        
        valid = np.any((self.points - self.points[0]) != 0)
        return valid
1096621
def scalars(self, name_or_idx=None, datatype="point"):
        
        poly = self.polydata(False)

        if name_or_idx is None:  # get mode behaviour
            ncd = poly.GetCellData().GetNumberOfArrays()
            npd = poly.GetPointData().GetNumberOfArrays()
            nfd = poly.GetFieldData().GetNumberOfArrays()
            arrs = []
            for i in range(npd):
                print(i, "PointData", poly.GetPointData().GetArrayName(i))
                arrs.append(["PointData", poly.GetPointData().GetArrayName(i)])
            for i in range(ncd):
                print(i, "CellData", poly.GetCellData().GetArrayName(i))
                arrs.append(["CellData", poly.GetCellData().GetArrayName(i)])
            for i in range(nfd):
                print(i, "FieldData", poly.GetFieldData().GetArrayName(i))
                arrs.append(["FieldData", poly.GetFieldData().GetArrayName(i)])
            return arrs
        else:  # set mode
            if "point" in datatype.lower():
                data = poly.GetPointData()
            elif "cell" in datatype.lower():
                data = poly.GetCellData()
            elif "field" in datatype.lower():
                data = poly.GetFieldData()
            else:
                colors.printc("~times Error in scalars(): unknown datatype", datatype, c=1)
                exit()

            if isinstance(name_or_idx, int):
                name = data.GetArrayName(name_or_idx)
                if name is None:
                    return None
                data.SetActiveScalars(name)
                return vtk_to_numpy(data.GetArray(name))
            elif isinstance(name_or_idx, str):
                arr = data.GetArray(name_or_idx)
                if arr is None:
                    return None
                data.SetActiveScalars(name_or_idx)
                return vtk_to_numpy(arr)

            return None
283416
def in_domain(self, points):
        
        return all([
            domain.in_domain(array)
            for domain, array in
                zip(self._domains, separate_struct_array(points, self._dtypes))
        ])