code: def set_calibration(self, datakey, calf=None, frange=None):
          
          if datakey is None:
              calibration_vector, calibration_freqs = None, None
          else:
              if calf is None:
                  raise Exception('calibration reference frequency must be specified')    
              try:
                  cal = self.datafile.get_calibration(datakey, calf)
              except:
                  print "Error: unable to load calibration data from: ", datakey
                  raise
              calibration_vector, calibration_freqs = cal
          # clear one cache -- affects all StimulusModels
          StimulusModel.clearCache()
          logger = logging.getLogger('main')
          logger.debug('clearing cache')
          logger.debug('setting explore calibration')
          self.explorer.set_calibration(calibration_vector, calibration_freqs, frange, datakey)
          logger.debug('setting protocol calibration')
          self.protocoler.set_calibration(calibration_vector, calibration_freqs, frange, datakey)
          logger.debug('setting chart calibration')
          self.charter.set_calibration(calibration_vector, calibration_freqs, frange, datakey)
          logger.debug('setting calibrator calibration')
          self.bs_calibrator.stash_calibration(calibration_vector, calibration_freqs, frange, datakey)
          logger.debug('setting tone calibrator calibration')
          self.tone_calibrator.stash_calibration(calibration_vector, calibration_freqs, frange, datakey)
docs: Sets a calibration for all of the acquisition operations,
          from an already gathered calibration data set.
  
          :param datakey: name of the calibration to set. This key must be present in the current data file. A value of ``None`` clears calibration.
          :type datakey: str
          :param calf: Calibration frequency for the attenuation vector to be in relation to. All other frequencies will be in attenutaion from this frequency.
          :type calf: int
          :param frange: Frequency range, low and high, for which to restrict the calibration to
          :type frange: (int, int)