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

    Arguments:
    -----------
    points: np.array or list of np.array
        array with 2 columns (row first and column second)
    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, first columns with X and second column with Y
Converts pixel coordinates (pixel row and column) to world projected 
    coordinates performing an affine transformation.
    
    KV WRL 2018
Converts pixel coordinates ( pixel row and column ) to world projected coordinates performing an affine transformation . KV WRL 2018
def convert_pix2world(points, georef):
    """
    Converts pixel coordinates (pixel row and column) to world projected 
    coordinates performing an affine transformation.
    
    KV WRL 2018

    Arguments:
    -----------
    points: np.array or list of np.array
        array with 2 columns (row first and column second)
    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, first columns with X and second column with Y
        
    """
    
    # 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): 
            tmp = arr[:,[1,0]]
            points_converted.append(tform(tmp))
          
    # if single array
    elif type(points) is np.ndarray:
        tmp = points[:,[1,0]]
        points_converted = tform(tmp)
        
    else:
        raise Exception('invalid input type')
        
    return points_converted
def convert_pix2world ( 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 ) : tmp = arr [ : , [ 1 , 0 ] ] points_converted . append ( tform ( tmp ) ) # if single array elif type ( points ) is np . ndarray : tmp = points [ : , [ 1 , 0 ] ] points_converted = tform ( tmp ) else : raise Exception ( 'invalid input type' ) return points_converted