original_docstring: Create the timestreams.
  
          This loops over all observations and detectors and uses the pointing,
          the telescope motion, and the solar system motion to compute the
          observed dipole.
  
          Args:
              data (toast.Data): The distributed data.
  
          
docstring: Create the timestreams.
  This loops over all observations and detectors and uses the pointing,
  the telescope motion, and the solar system motion to compute the
  observed dipole.
docstring_tokens: Create the timestreams . This loops over all observations and detectors and uses the pointing the telescope motion and the solar system motion to compute the observed dipole .
code: def exec(self, data):
          """Create the timestreams.
  
          This loops over all observations and detectors and uses the pointing,
          the telescope motion, and the solar system motion to compute the
          observed dipole.
  
          Args:
              data (toast.Data): The distributed data.
  
          """
          env = Environment.get()
          comm = data.comm
          # the global communicator
          cworld = comm.comm_world
          # the communicator within the group
          cgroup = comm.comm_group
          # the communicator with all processes with
          # the same rank within their group
          crank = comm.comm_rank
  
          nullquat = np.array([0, 0, 0, 1], dtype=np.float64)
  
          for obs in data.obs:
              tod = obs["tod"]
  
              offset, nsamp = tod.local_samples
  
              vel = None
              sol = None
  
              if (self._mode == "solar") or (self._mode == "total"):
                  sol = self._solar_vel
  
              if (self._mode == "orbital") or (self._mode == "total"):
                  if self._keep_vel:
                      vel = tod.local_velocity()
                  else:
                      vel = tod.read_velocity()
  
              common = tod.local_common_flags() & self._common_flag_mask
  
              for det in tod.local_dets:
  
                  flags = tod.local_flags(det) & self._flag_mask
                  totflags = flags | common
                  del flags
  
                  pdata = None
                  if self._keep_quats:
                      # We are keeping the detector quaternions, so cache
                      # them now for the full sample range.
                      pdata = tod.local_pointing(det)
  
                  # Set up output cache
                  cachename = "{}_{}".format(self._out, det)
                  if not tod.cache.exists(cachename):
                      tod.cache.create(cachename, np.float64, (nsamp,))
                  ref = tod.cache.reference(cachename)
  
                  buf_off = 0
                  buf_n = env.tod_buffer_length()
                  while buf_off < nsamp:
                      if buf_off + buf_n > nsamp:
                          buf_n = nsamp - buf_off
                      bslice = slice(buf_off, buf_off + buf_n)
  
                      detp = None
                      if pdata is None:
                          # Read and discard
                          detp = tod.read_pntg(detector=det, local_start=buf_off, n=buf_n)
                      else:
                          # Use cached version
                          detp = pdata[bslice, :]
  
                      # Make sure that flagged pointing is well defined
                      detp[(totflags[bslice] != 0), :] = nullquat
  
                      vslice = None
                      if vel is not None:
                          vslice = vel[bslice]
  
                      dipoletod = dipole(
                          detp, vel=vslice, solar=sol, cmb=self._cmb, freq=self._freq
                      )
                      if self._subtract:
                          ref[bslice] -= dipoletod
                      else:
                          ref[bslice] += dipoletod
                      buf_off += buf_n
  
                  del pdata
                  del ref
  
              del vel
              del common
  
          return
code_tokens: def exec ( self , data ) : env = Environment . get ( ) comm = data . comm cworld = comm . comm_world cgroup = comm . comm_group crank = comm . comm_rank nullquat = np . array ( [ 0 , 0 , 0 , 1 ] , dtype = np . float64 ) for obs in data . obs : tod = obs [ "tod" ] offset , nsamp = tod . local_samples vel = None sol = None if ( self . _mode == "solar" ) or ( self . _mode == "total" ) : sol = self . _solar_vel if ( self . _mode == "orbital" ) or ( self . _mode == "total" ) : if self . _keep_vel : vel = tod . local_velocity ( ) else : vel = tod . read_velocity ( ) common = tod . local_common_flags ( ) & self . _common_flag_mask for det in tod . local_dets : flags = tod . local_flags ( det ) & self . _flag_mask totflags = flags | common del flags pdata = None if self . _keep_quats : pdata = tod . local_pointing ( det ) cachename = "{}_{}" . format ( self . _out , det ) if not tod . cache . exists ( cachename ) : tod . cache . create ( cachename , np . float64 , ( nsamp , ) ) ref = tod . cache . reference ( cachename ) buf_off = 0 buf_n = env . tod_buffer_length ( ) while buf_off < nsamp : if buf_off + buf_n > nsamp : buf_n = nsamp - buf_off bslice = slice ( buf_off , buf_off + buf_n ) detp = None if pdata is None : detp = tod . read_pntg ( detector = det , local_start = buf_off , n = buf_n ) else : detp = pdata [ bslice , : ] detp [ ( totflags [ bslice ] != 0 ) , : ] = nullquat vslice = None if vel is not None : vslice = vel [ bslice ] dipoletod = dipole ( detp , vel = vslice , solar = sol , cmb = self . _cmb , freq = self . _freq ) if self . _subtract : ref [ bslice ] -= dipoletod else : ref [ bslice ] += dipoletod buf_off += buf_n del pdata del ref del vel del common return
short_docstring: Create the timestreams.
short_docstring_tokens: Create the timestreams .
comment: """Create the timestreams.
  
          This loops over all observations and detectors and uses the pointing,
          the telescope motion, and the solar system motion to compute the
          observed dipole.
  
          Args:
              data (toast.Data): The distributed data.
  
          """$SEP$# the global communicator$SEP$# the communicator within the group$SEP$# the communicator with all processes with$SEP$# the same rank within their group$SEP$# We are keeping the detector quaternions, so cache$SEP$# them now for the full sample range.$SEP$# Set up output cache$SEP$# Read and discard$SEP$# Use cached version$SEP$# Make sure that flagged pointing is well defined