def _get_frequency_grid(frequency, assume_regular_frequency=False):
 frequency = np.asarray(frequency)
 if (frequency.ndim != 1):
  raise ValueError('frequency grid must be 1 dimensional')
 elif (len(frequency) == 1):
  return (frequency[0], frequency[0], 1)
 elif (not (assume_regular_frequency or _is_regular(frequency))):
  raise ValueError('frequency must be a regular grid')
 return (frequency[0], (frequency[1] - frequency[0]), len(frequency))

def _get_frequency_grid ( frequency , assume_regular_frequency = False ) : frequency = np . asarray ( frequency ) if ( frequency . ndim != 1 ) : raise ValueError ( 'frequency grid must be 1 dimensional' ) elif ( len ( frequency ) == 1 ) : return ( frequency [ 0 ] , frequency [ 0 ] , 1 ) elif ( not ( assume_regular_frequency or _is_regular ( frequency ) ) ) : raise ValueError ( 'frequency must be a regular grid' ) return ( frequency [ 0 ] , ( frequency [ 1 ] - frequency [ 0 ] ) , len ( frequency ) )
utility to get grid parameters from a frequency array parameters frequency : array_like or quantity input frequency grid assume_regular_frequency : bool if true .