code: def change_ref(self, gm=None, r0=None, lmax=None):
          
          if lmax is None:
              lmax = self.lmax
  
          clm = self.pad(lmax)
  
          if gm is not None and gm != self.gm:
              clm.coeffs *= self.gm / gm
              clm.gm = gm
              if self.errors is not None:
                  clm.errors *= self.gm / gm
  
          if r0 is not None and r0 != self.r0:
              for l in _np.arange(lmax+1):
                  clm.coeffs[:, l, :l+1] *= (self.r0 / r0)**l
                  if self.errors is not None:
                      clm.errors[:, l, :l+1] *= (self.r0 / r0)**l
              clm.r0 = r0
  
          return clm
docs: Return a new SHGravCoeffs class instance with a different reference gm
          or r0.
  
          Usage
          -----
          clm = x.change_ref([gm, r0, lmax])
  
          Returns
          -------
          clm : SHGravCoeffs class instance.
  
          Parameters
          ----------
          gm : float, optional, default = self.gm
              The gravitational constant time the mass that is associated with
              the gravitational potential coefficients.
          r0 : float, optional, default = self.r0
              The reference radius of the spherical harmonic coefficients.
          lmax : int, optional, default = self.lmax
              Maximum spherical harmonic degree to output.
  
          Description
          -----------
          This method returns a new class instance of the gravitational
          potential, but using a difference reference gm or r0. When
          changing the reference radius r0, the spherical harmonic coefficients
          will be upward or downward continued under the assumption that the
          reference radius is exterior to the body.