def scale_timings(timelist, input_units, output_units, time_repetition):
 if (input_units == output_units):
  _scalefactor = 1.0
 if ((input_units == u'scans') and (output_units == u'secs')):
  _scalefactor = time_repetition
 if ((input_units == u'secs') and (output_units == u'scans')):
  _scalefactor = (1.0 / time_repetition)
 timelist = [np.max([0.0, (_scalefactor * t)]) for t in timelist]
 return timelist

def scale_timings ( timelist , input_units , output_units , time_repetition ) : if ( input_units == output_units ) : _scalefactor = 1.0 if ( ( input_units == u'scans' ) and ( output_units == u'secs' ) ) : _scalefactor = time_repetition if ( ( input_units == u'secs' ) and ( output_units == u'scans' ) ) : _scalefactor = ( 1.0 / time_repetition ) timelist = [ np . max ( [ 0.0 , ( _scalefactor * t ) ] ) for t in timelist ] return timelist
scales timings given input and output units parameters timelist: list of times to scale input_units: secs or scans output_units: ibid .