docs: def int_imf_dm(m1,m2,m,imf,bywhat='bymass',integral='normal'):
      ''' 
      Integrate IMF between m1 and m2.
  
      Parameters
      ----------
      m1 : float
          Min mass
      m2 : float
          Max mass
      m : float
          Mass array
      imf : float
          IMF array
      bywhat : string, optional
          'bymass' integrates the mass that goes into stars of
          that mass interval; or 'bynumber' which integrates the number
          of stars in that mass interval.  The default is 'bymass'.
      integrate : string, optional
          'normal' uses sc.integrate.trapz; 'cum' returns cumulative
          trapezoidal integral.  The default is 'normal'.
  
      '''
  
  
      ind_m = (m >= min(m1,m2)) & (m <= max(m1,m2))
      if integral is 'normal':
          int_func = sc.integrate.trapz
      elif integral is 'cum':
          int_func = sc.integrate.cumtrapz
      else:
          print("Error in int_imf_dm: don't know how to integrate")
          return 0
         
      if bywhat is 'bymass':
          return int_func(m[ind_m]*imf[ind_m],m[ind_m])
      elif bywhat is 'bynumber':
          return int_func(imf[ind_m],m[ind_m])
      else:
          print("Error in int_imf_dm: don't know by what to integrate")
          return 0