def METHOD_NAME(data, meta, m):
    '''Takes the median frame (in time) and finds the
    center of mass (COM) in pixels for each column. It then returns the needed
    shift to apply to each column to bring the COM to the center
    Parameters
    ----------
    data : ndarray (2D)
        The median of all data frames
    meta : eureka.lib.readECF.MetaClass
        The metadata object.
    m : int
        The file number.
    Returns
    -------
    shifts : ndarray (2D)
        The shifts to apply to each column to straighten the trace.
    new_center : int
        The central row of the detector where the trace is moved to.
    '''
    # get the dimensions of the data
    nb_rows = data.shape[0]
    # define an array of pixel positions (in their centers)
    pix_centers = np.arange(nb_rows) + 0.5
    # Compute the center of mass of each column
    column_coms = (np.sum(pix_centers[:, None]*data, axis=0) /
                   np.sum(data, axis=0))
    # Smooth CoM values to get rid of outliers
    smooth_coms = smooth.medfilt(column_coms, 11)
    # if a value in smooth coms is nan, set it to the last non-nan value
    smooth_coms[np.isnan(smooth_coms)] = \
        smooth_coms[~np.isnan(smooth_coms)][-1]
    # Convert to interget pixels
    int_coms = np.around(smooth_coms - 0.5).astype(int)
    if meta.isplots_S3 >= 1:
        plots_s3.curvature(meta, column_coms, smooth_coms, int_coms, m)
    # define the new center (where we will align the trace) in the
    # middle of the detector
    new_center = int(nb_rows/2) - 1
    # define an array containing the needed shift to bring the COMs to the
    # new center for each column of each integration
    shifts = new_center - int_coms
    # ensure columns of zeros or nans are not moved and dont induce bugs
    shifts[column_coms < 0] = 0
    shifts[column_coms > nb_rows] = 0
    return shifts, new_center