def zero_correct(dim_over, dim_detc):
    """
    This short function calculates the correction for the change 
    in the location of the origin pixel (the very first, or "0"), 
    which is applied to the calculation of centroid computed for 
    a grid that has been downsampled.
    """
    
    factor = dim_over / dim_detc
    corr = factor / 2. - 0.5
    
    return corr/factor