code: def rebin_coord_transform(factor, x_at_radec_0, y_at_radec_0, Mpix2coord, Mcoord2pix):
      
      factor = int(factor)
      Mcoord2pix_resized = Mcoord2pix / factor
      Mpix2coord_resized = Mpix2coord * factor
      x_at_radec_0_resized = (x_at_radec_0 + 0.5) / factor - 0.5
      y_at_radec_0_resized = (y_at_radec_0 + 0.5) / factor - 0.5
      ra_at_xy_0_resized, dec_at_xy_0_resized = util.map_coord2pix(-x_at_radec_0_resized, -y_at_radec_0_resized, 0, 0, Mpix2coord_resized)
      return ra_at_xy_0_resized, dec_at_xy_0_resized, x_at_radec_0_resized, y_at_radec_0_resized, Mpix2coord_resized, Mcoord2pix_resized
docs: adopt coordinate system and transformation between angular and pixel coordinates of a re-binned image
      :param bin_size:
      :param ra_0:
      :param dec_0:
      :param x_0:
      :param y_0:
      :param Matrix:
      :param Matrix_inv:
      :return: