
import toast

# Split COMM_WORLD into groups of 4 processes each
cm = toast.Comm(world=MPI.COMM_WORLD, groupsize=4)

# Create the distributed data object
dd = toast.Data(comm=cm)

# Each process group appends some observations.
# For this example, each observation is going to have the same
# number of samples, and the same list of detectors.  We just
# use the base TOD class, which contains the data directly as 
# numpy arrays.

obs_samples = 100
obs_dets = ['detA', 'detB', 'detC']

for i in range(10):
    tod = TOD(mpicomm=cm.comm_group, detectors=obs_dets, samples=obs_samples)
    ob = {}
    ob['id'] = '{}'.format(i)
    ob['tod'] = tod
    ob['intervals'] = None
    ob['baselines'] = None
    ob['noise'] = None
    dd.obs.append(ob)

# Now at the end we have 4 process groups, each of which is assigned
# 10 observations.  Each of these observations has 3 detectors and 100
# samples.  So the Data object contains a total of 40 observations and
# 12000 samples.



import mpi4py.MPI as MPI

import toast

# Split COMM_WORLD into groups of 4 processes each
cm = toast.Comm(world=MPI.COMM_WORLD, groupsize=4)

# Create the distributed data object
dd = toast.Data(comm=cm)

# Each process group appends some observations.
# For this example, each observation is going to have the same
# number of samples, and the same list of detectors.  We just
# use the base TOD class, which contains the data directly as 
# numpy arrays.

obs_samples = 100
obs_dets = ['detA', 'detB', 'detC']

for i in range(10):
    tod = TOD(mpicomm=cm.comm_group, detectors=obs_dets, samples=obs_samples)
    ob = {}
    ob['id'] = '{}'.format(i)
    ob['tod'] = tod
    ob['intervals'] = None
    ob['baselines'] = None
    ob['noise'] = None
    dd.obs.append(ob)

# Now at the end we have 4 process groups, each of which is assigned
# 10 observations.  Each of these observations has 3 detectors and 100
# samples.  So the Data object contains a total of 40 observations and
# 12000 samples.


Fix typo, even though this example is not used for anything.
Fix typo, even though this example is not used for anything.

+ 
+ import mpi4py.MPI as MPI
  
  import toast
  
  # Split COMM_WORLD into groups of 4 processes each
  cm = toast.Comm(world=MPI.COMM_WORLD, groupsize=4)
  
  # Create the distributed data object
  dd = toast.Data(comm=cm)
  
  # Each process group appends some observations.
  # For this example, each observation is going to have the same
  # number of samples, and the same list of detectors.  We just
  # use the base TOD class, which contains the data directly as 
  # numpy arrays.
  
  obs_samples = 100
  obs_dets = ['detA', 'detB', 'detC']
  
  for i in range(10):
      tod = TOD(mpicomm=cm.comm_group, detectors=obs_dets, samples=obs_samples)
      ob = {}
      ob['id'] = '{}'.format(i)
      ob['tod'] = tod
      ob['intervals'] = None
      ob['baselines'] = None
      ob['noise'] = None
      dd.obs.append(ob)
  
  # Now at the end we have 4 process groups, each of which is assigned
  # 10 observations.  Each of these observations has 3 detectors and 100
  # samples.  So the Data object contains a total of 40 observations and
  # 12000 samples.
  
  
Fix typo, even though this example is not used for anything.
## Code Before:

import toast

# Split COMM_WORLD into groups of 4 processes each
cm = toast.Comm(world=MPI.COMM_WORLD, groupsize=4)

# Create the distributed data object
dd = toast.Data(comm=cm)

# Each process group appends some observations.
# For this example, each observation is going to have the same
# number of samples, and the same list of detectors.  We just
# use the base TOD class, which contains the data directly as 
# numpy arrays.

obs_samples = 100
obs_dets = ['detA', 'detB', 'detC']

for i in range(10):
    tod = TOD(mpicomm=cm.comm_group, detectors=obs_dets, samples=obs_samples)
    ob = {}
    ob['id'] = '{}'.format(i)
    ob['tod'] = tod
    ob['intervals'] = None
    ob['baselines'] = None
    ob['noise'] = None
    dd.obs.append(ob)

# Now at the end we have 4 process groups, each of which is assigned
# 10 observations.  Each of these observations has 3 detectors and 100
# samples.  So the Data object contains a total of 40 observations and
# 12000 samples.


## Instruction:
Fix typo, even though this example is not used for anything.
## Code After:

import mpi4py.MPI as MPI

import toast

# Split COMM_WORLD into groups of 4 processes each
cm = toast.Comm(world=MPI.COMM_WORLD, groupsize=4)

# Create the distributed data object
dd = toast.Data(comm=cm)

# Each process group appends some observations.
# For this example, each observation is going to have the same
# number of samples, and the same list of detectors.  We just
# use the base TOD class, which contains the data directly as 
# numpy arrays.

obs_samples = 100
obs_dets = ['detA', 'detB', 'detC']

for i in range(10):
    tod = TOD(mpicomm=cm.comm_group, detectors=obs_dets, samples=obs_samples)
    ob = {}
    ob['id'] = '{}'.format(i)
    ob['tod'] = tod
    ob['intervals'] = None
    ob['baselines'] = None
    ob['noise'] = None
    dd.obs.append(ob)

# Now at the end we have 4 process groups, each of which is assigned
# 10 observations.  Each of these observations has 3 detectors and 100
# samples.  So the Data object contains a total of 40 observations and
# 12000 samples.

