code: def lnlike(self, pardict, use_cache=True):
          
  
          mag, dmag = self.value
          if np.isnan(dmag):
              return 0
          if self.relative:
              # If this *is* the reference, just return
              if self.reference is None:
                  return 0
              mod = (self.model_mag(pardict, use_cache=use_cache) -
                     self.reference.model_mag(pardict, use_cache=use_cache))
              mag -= self.reference.value[0]
          else:
              mod = self.model_mag(pardict, use_cache=use_cache)
  
          lnl = -0.5*(mag - mod)**2 / dmag**2
  
          # logging.debug('{} {}: mag={}, mod={}, lnlike={}'.format(self.instrument,
          #                                                         self.band,
          #                                                         mag,mod,lnl))
          return lnl
docs: returns log-likelihood of this observation
  
          pardict is a dictionary of parameters for all leaves
          gets converted back to traditional parameter vector