(points, georef)
return points_converted
Converts world projected coordinates (X,Y) to image coordinates 
    (pixel row and column) performing an affine transformation.
    
    KV WRL 2018

    Arguments:
    -----------
    points: np.array or list of np.array
        array with 2 columns (X,Y)
    georef: np.array
        vector of 6 elements [Xtr, Xscale, Xshear, Ytr, Yshear, Yscale]
                
    Returns:    
    -----------
    points_converted: np.array or list of np.array 
        converted coordinates (pixel row and column)
Converts world projected coordinates (X,Y) to image coordinates 
    (pixel row and column) performing an affine transformation.
    
    KV WRL 2018
Converts world projected coordinates ( X Y ) to image coordinates ( pixel row and column ) performing an affine transformation . KV WRL 2018
def convert_world2pix(points, georef):
    """
    Converts world projected coordinates (X,Y) to image coordinates 
    (pixel row and column) performing an affine transformation.
    
    KV WRL 2018

    Arguments:
    -----------
    points: np.array or list of np.array
        array with 2 columns (X,Y)
    georef: np.array
        vector of 6 elements [Xtr, Xscale, Xshear, Ytr, Yshear, Yscale]
                
    Returns:    
    -----------
    points_converted: np.array or list of np.array 
        converted coordinates (pixel row and column)
    
    """
    
    # make affine transformation matrix
    aff_mat = np.array([[georef[1], georef[2], georef[0]],
                       [georef[4], georef[5], georef[3]],
                       [0, 0, 1]])
    # create affine transformation
    tform = transform.AffineTransform(aff_mat)
    
    # if list of arrays
    if type(points) is list:
        points_converted = []
        # iterate over the list
        for i, arr in enumerate(points): 
            points_converted.append(tform.inverse(points))
            
    # if single array    
    elif type(points) is np.ndarray:
        points_converted = tform.inverse(points)
        
    else:
        print('invalid input type')
        raise
        
    return points_converted
def convert_world2pix ( points , georef ) : # make affine transformation matrix aff_mat = np . array ( [ [ georef [ 1 ] , georef [ 2 ] , georef [ 0 ] ] , [ georef [ 4 ] , georef [ 5 ] , georef [ 3 ] ] , [ 0 , 0 , 1 ] ] ) # create affine transformation tform = transform . AffineTransform ( aff_mat ) # if list of arrays if type ( points ) is list : points_converted = [ ] # iterate over the list for i , arr in enumerate ( points ) : points_converted . append ( tform . inverse ( points ) ) # if single array     elif type ( points ) is np . ndarray : points_converted = tform . inverse ( points ) else : print ( 'invalid input type' ) raise return points_converted