code: def sampleLOS(self,los,n=1,deg=True,maxd=None,nsigma=None,
                    targetSurfmass=True,targetSigma2=True):
          
          if _APY_LOADED and isinstance(los,units.Quantity):
              l= los.to(units.rad).value
          elif deg:
              l= los*_DEGTORAD
          else:
              l= los
          out= []
          #sample distances
          ds= self.sampledSurfacemassLOS(l,n=n,maxd=maxd,target=targetSurfmass,
                                         use_physical=False)
          for ii in range(int(n)):
              #Calculate R and phi
              thisR,thisphi= _dlToRphi(ds[ii],l)
              #sample velocities
              vv= self.sampleVRVT(thisR,n=1,nsigma=nsigma,target=targetSigma2,
                                  use_physical=False)[0]
              if self._roSet and self._voSet:
                  out.append(Orbit([thisR,vv[0],vv[1],thisphi],ro=self._ro,
                                   vo=self._vo))
              else:
                  out.append(Orbit([thisR,vv[0],vv[1],thisphi]))
          return out
docs: NAME:
  
             sampleLOS
  
          PURPOSE:
  
             sample along a given LOS
  
          INPUT:
  
             los - line of sight (in deg, unless deg=False; can be Quantity)
  
             n= number of desired samples
  
             deg= los in degrees? (default=True)
  
             targetSurfmass, targetSigma2= if True, use target surface mass and sigma2 profiles, respectively (there is not much point to doing the latter)
                     (default=True)
  
          OUTPUT:
  
             returns list of Orbits
  
          BUGS:
             target=False uses target distribution for derivatives (this is a detail)
  
          HISTORY:
  
             2011-03-24 - Started  - Bovy (NYU)