def __init__(self, scans, area, comm, cuts=None, name="main", ofmt="{name}", output=True, ext="fits", pmat_order=None, sys=None, nuisance=False, data=None): Signal.__init__(self, name, ofmt, output, ext) self.area = area self.cuts = cuts self.dof = zipper.ArrayZipper(area, comm=comm) self.dtype = area.dtype if data is not None: self.data = data else: self.data = { scan: pmat.PmatMap(scan, area, order=pmat_order, sys=sys) for scan in scans }
def __init__(self, scans, area, comm, cuts=None, name="main", ofmt="{name}", output=True, ext="fits", pmat_order=None, sys=None, nuisance=False): Signal.__init__(self, name, ofmt, output, ext) self.area = area self.cuts = cuts self.dof = zipper.ArrayZipper(area, comm=comm) self.dtype = area.dtype self.comm = comm self.data = { scan: [ pmat.PmatMap(scan, area, order=pmat_order, sys=sys), pmat.PmatMapMultibeam(scan, area, scan.buddy_offs, scan.buddy_comps, order=pmat_order, sys=sys) ] for scan in scans }
def __init__(self, name, ofmt, output, ext): self.ext = ext self.dof = zipper.ArrayZipper(np.zeros([0])) self.precon = PreconNull() self.prior = PriorNull() self.post = [] self.name = name self.ofmt = ofmt self.output = output
def __init__(self, scans, dtype, comm, name="cut", ofmt="{name}_{rank:02}", output=False, cut_type=None): Signal.__init__(self, name, ofmt, output, ext="hdf") self.data = {} self.dtype = dtype cutrange = [0,0] for scan in scans: mat = pmat.PmatCut(scan, cut_type) cutrange = [cutrange[1], cutrange[1]+mat.njunk] self.data[scan] = [mat, cutrange] self.njunk = cutrange[1] self.dof = zipper.ArrayZipper(np.zeros(self.njunk, self.dtype), shared=False, comm=comm)
def __init__(self, scans, pids, patterns, array_shape, res, dtype, comm, cuts=None, name="phase", ofmt="{name}_{pid:02}_{az0:.0f}_{az1:.0f}_{el:.0f}", output=True, ext="fits", col_major=True, hysteresis=True): Signal.__init__(self, name, ofmt, output, ext) nrow, ncol = array_shape ndet = nrow * ncol self.pids = pids self.patterns = patterns self.comm = comm self.dtype = dtype self.col_major = col_major self.cuts = cuts self.data = {} self.areas = [] # Set up an area for each scanning pattern. We assume that these are constant # elevation scans, so only azimuth matters. This setup is ugly and would be # nicer if passed in, but then the ugliness would only be moved to the calling # code instead. for pattern in patterns: az0, az1 = utils.widen_box(pattern)[:, 1] naz = int(np.ceil((az1 - az0) / res)) az1 = az0 + naz * res det_unit = nrow if col_major else ncol shape, wcs = enmap.geometry( pos=[[0, az0], [ndet / det_unit * utils.degree, az1]], shape=(ndet, naz), proj="car") if hysteresis: area = enmap.zeros((2, ) + shape, wcs, dtype=dtype) else: area = enmap.zeros(shape, wcs, dtype=dtype) self.areas.append(area) for pid, scan in zip(pids, scans): dets = scan.dets if col_major: dets = utils.transpose_inds(dets, nrow, ncol) mat = pmat.PmatScan(scan, self.areas[pid], dets) self.data[scan] = [pid, mat] self.dof = zipper.MultiZipper( [zipper.ArrayZipper(area, comm=comm) for area in self.areas], comm=comm)
def __init__(self, scans, areas, pids, comm, cuts=None, name="phase", ofmt="{name}", output=True, ext="fits"): Signal.__init__(self, name, ofmt, output, ext) self.areas = areas # template PhaseMaps defining scan patterns and pixelizations self.pids = pids # index of each scan into scanning patterns self.comm = comm self.cuts = cuts self.dtype = areas.maps[0].dtype self.data = {} # Set up the detector mapping for each scan for pid, scan in zip(pids,scans): inds = utils.find(areas.dets, scan.dets) mat = pmat.PmatScan(scan, areas.maps[pid], inds) self.data[scan] = [pid, mat] self.dof = zipper.MultiZipper([ zipper.ArrayZipper(map, comm=comm) for map in self.areas.maps], comm=comm)