def convert_geographic_coordinate_to_pixel_value(refpx, refpy, transform):
    """
    Converts a lat/long coordinate to a pixel coordinate given the 
    geotransform of the image.

    Args:
        refpx: The longitude of the coordinate.
        refpx: The latitude of the coordinate.
        transform: The geotransform array of the image.

    Returns:
        Tuple of refpx, refpy in pixel values.
    """
    # transform = ifg.dataset.GetGeoTransform()

    xOrigin = transform[0]
    yOrigin = transform[3]
    pixelWidth = transform[1]
    pixelHeight = -transform[5]

    refpx = int((refpx - xOrigin) / pixelWidth)
    refpy = int((yOrigin - refpy) / pixelHeight)

    return int(refpx), int(refpy)