def simulate(self): for tsname, simconf in self.simulations.items(): ts = self.timestreams[tsname] if os.path.exists(ts._ffile(0)): print("Looks like timestream already exists. Skipping....") else: m = manager.ProductManager.from_config(simconf["product_directory"]) timestream.simulate(m, ts.directory, **simconf)
def simulate(self): for tsname, simconf in self.simulations.items(): ts = self.timestreams[tsname] if os.path.exists(ts._ffile(0)): print "Looks like timestream already exists. Skipping...." else: m = manager.ProductManager.from_config(simconf['product_directory']) timestream.simulate(m, ts.directory, **simconf)
from drift.pipeline import timestream from simplearray import DishArray ### Make the analysis products for the telescope. This examples focuses only ### on the m-mode products for mapmaking # Create telescope object and set zenith tel = DishArray(latitude=30.0, longitude=0.0) # Create Beam Transfer manager, and generate products bt = beamtransfer.BeamTransfer("pydriver/btdir/", telescope=tel) bt.generate() ### Simulate and make a map froma timestream # Create an empty ProductManager m = manager.ProductManager() # Set the Beam Transfers m.beamtransfer = bt # Create a timestream with no noise (ndays=0) from a given map (could be a list of maps) ts = timestream.simulate(m, "pydriver/ts1/", ["simulated_map.hdf5"], ndays=0) # Make m-mode from the timestream ts.generate_mmodes() # Make a Healpix map from the m-modes (with NSIDE=256) ts.mapmake_full(256, "observed_map.hdf5")
### Make the analysis products for the telescope. This examples focuses only ### on the m-mode products for mapmaking # Create telescope object and set zenith tel = DishArray() tel.zenith = np.radians(np.array([30.0, 0.0])) # Must be in radians # Create Beam Transfer manager, and generate products bt = beamtransfer.BeamTransfer('pydriver/btdir/', telescope=tel) bt.generate() ### Simulate and make a map froma timestream # Create an empty ProductManager m = manager.ProductManager() # Set the Beam Transfers m.beamtransfer = bt # Create a timestream with no noise (ndays=0) from a given map (could be a list of maps) ts = timestream.simulate(m, 'pydriver/ts1/', ['simulated_map.hdf5'], ndays=0) # Make m-mode from the timestream ts.generate_mmodes() # Make a Healpix map from the m-modes (with NSIDE=256) ts.mapmake_full(256, 'observed_map.hdf5')
import argparse from drift.core import manager from drift.pipeline import timestream ## Read arguments in. parser = argparse.ArgumentParser(description="Create the visibility timeseries corresponding to a map.") parser.add_argument("teldir", help="The telescope directory to use.") parser.add_argument("outdir", help="Output directory for timeseries.") parser.add_argument("--map", help="Each map argument is a map which contributes to the timeseries.", action='append') parser.add_argument("--noise", help="Number of days of co-added data (affects noise amplitude).", metavar='NDAYS', default=None, type=int) parser.add_argument("--resolution", help="Approximate time resolution in seconds.", metavar='NSEC', default=0, type=float) args = parser.parse_args() m = manager.ProductManager.from_config(args.teldir) timestream.simulate(m, args.outdir, args.map, ndays=args.noise, resolution=args.resolution)
from simplearray import DishArray ### Make the analysis products for the telescope. This examples focuses only ### on the m-mode products for mapmaking # Create telescope object and set zenith tel = DishArray() tel.zenith = np.radians(np.array([30.0, 0.0])) # Must be in radians # Create Beam Transfer manager, and generate products bt = beamtransfer.BeamTransfer('pydriver/btdir/', telescope=tel) bt.generate() ### Simulate and make a map froma timestream # Create an empty ProductManager m = manager.ProductManager() # Set the Beam Transfers m.beamtransfer = bt # Create a timestream with no noise (ndays=0) from a given map (could be a list of maps) ts = timestream.simulate(m, 'pydriver/ts1/', ['simulated_map.hdf5'], ndays=0) # Make m-mode from the timestream ts.generate_mmodes() # Make a Healpix map from the m-modes (with NSIDE=256) ts.mapmake_full(256, 'observed_map.hdf5')