docs: def _locate_bar_gen(icut, epos, transform1, transform2):
      """Generic function for the fine position of the CSU"""
  
      epos_pix = coor_to_pix_1d(epos)
  
      # transform ->
      epos_pix_s = transform1(epos_pix)
      icut2 = transform2(icut)
      #
  
      try:
          res = position_half_h(icut2, epos_pix_s)
  
          xint_s, next_peak_s, wpos1_s, wpos2_s, background_level, half_height = res
          #
  
          xint = transform1(xint_s)
  
          #
          epos_f = xint
          error = 0
      except ValueError:
          error = 2
          epos_f = epos
  
      return epos_pix, epos_f, error