code: def select_configuration(self, obresult):
          logger = logging.getLogger(__name__)
          logger.debug('calling default configuration selector')
          ref = obresult.get_sample_frame()
          extr = self.datamodel.extractor_map['fits']
          if ref:
              result = extr.extract('insconf', ref)
              if result:
                  logger.debug('found insconf config uuid=%s', result)
                  if result in self.configurations:
                      return self.configurations[result]
                  else:
                      for conf in self.configurations.values():
                          if conf.name == result:
                              return conf
                      else:
                          raise KeyError('insconf {} does not match any config'.format(result))
              date_obs = extr.extract('observation_date', ref)
              for key, conf in self.configurations.items():
                  if key == 'default':
                      continue
                  if conf.date_end is not None:
                      upper_t = date_obs < conf.date_end
                  else:
                      upper_t = True
                  if upper_t and (date_obs >= conf.date_start):
                      logger.debug('found date match, config uuid=%s', key)
                      return conf
          else:
              logger.debug('no match, using default configuration')
              return self.configurations['default']