code: def subtract_water(w_sig, w_supp_sig):
      
      mean_nw = np.mean(w_supp_sig,0)
      water_only = np.mean(w_sig - mean_nw, 0)
      mean_water = np.mean(w_sig, 0)
  
      scale_factor = water_only/mean_nw
  
      corrected = w_supp_sig - water_only/scale_factor[...,0,np.newaxis]
      return corrected
docs: Subtract the residual water signal from the 
      Normalize the water-suppressed signal by the signal that is not
      water-suppressed, to get rid of the residual water peak.
  
      Parameters
      ----------
      w_sig : array with shape (n_reps, n_echos, n_points)
         A signal with water unsupressed
  
      w_supp_sig :array with shape (n_reps, n_echos, n_points)
         A signal with water suppressed.
  
      Returns
      -------
      The water suppressed signal with the additional subtraction of a scaled
      version of the signal that is presumably just due to water.