Ejemplo n.º 1
0
            print "postnosie"
            filters2.append(filter)
        else:
            filters.append(filter)
    # If any filters were added, append a gapfilling operation, since the filters may have
    # put large values in the gaps, and these may not be representable by our cut model
    if len(filters) > 0:
        filters.append(mapmaking.FilterGapfill())
    if len(filters2) > 0:
        filters2.append(mapmaking.FilterGapfill())

    # Initialize weights. Done in a hacky manner for now. This and the above needs
    # to be reworked.
    weights = []
    if config.get("tod_window"):
        weights.append(mapmaking.FilterWindow(config.get("tod_window")))

    L.info("Initializing equation system")
    eqsys = mapmaking.Eqsys(myscans,
                            signals,
                            filters=filters,
                            filters2=filters2,
                            weights=weights,
                            dtype=dtype,
                            comm=comm)

    L.info("Initializing RHS")
    eqsys.calc_b()

    noise_stats = build_noise_stats(myscans, comm)
    if comm.rank == 0: write_noise_stats(root + "noise.txt", noise_stats)
Ejemplo n.º 2
0
         scan = scan[:, ::config.get("downsample")]
         scans.append(scan)
     except errors.DataMissing as e:
         L.debug("Skipped %s (%s)" % (id, str(e)))
         continue
 # Count how many scans we actually managed to read
 nscan = comm_world.allreduce(len(scans))
 if nscan == 0:
     L.debug("Skipped group %d (failed to read scans)" % gind)
     continue
 # Record which ids went into this map
 with open(proot + "ids.txt", "w") as f:
     for ind in group:
         f.write("%s\n" % ids[ind])
 # Set up mapmaking for this group
 weights = [mapmaking.FilterWindow(config.get("tod_window"))
            ] if config.get("tod_window") else []
 signal_cut = mapmaking.SignalCut(scans, dtype, comm_sub)
 signal_phase = mapmaking.SignalPhase(scans,
                                      pids=[0] * len(scans),
                                      patterns=pboxes[pid:pid + 1],
                                      array_shape=(args.nrow, args.ncol),
                                      res=daz,
                                      dtype=dtype,
                                      comm=comm_sub,
                                      cuts=signal_cut,
                                      ofmt="phase")
 signal_cut.precon = mapmaking.PreconCut(signal_cut, scans)
 signal_phase.precon = mapmaking.PreconPhaseBinned(signal_phase, signal_cut,
                                                   scans, weights)
 filters = []
Ejemplo n.º 3
0
                if isday:
                    planet9.cut_bright_srcs_daytime(
                        scan,
                        scan.srcparam,
                        alim_include=args.srclim_day,
                        errbox=dayerr)
                else:
                    planet9.cut_bright_srcs(scan,
                                            scan.srcparam,
                                            alim_include=args.srclim)
        if asteroids:
            for scan in myscans:
                planet9.cut_asteroids_scan(scan, asteroids)

        #### 3. Process our tods ####
        apply_window = mapmaking.FilterWindow(config.get("tod_window"))
        if not use_dmap: area = enmap.zeros(wshape, wcs, dtype)
        else:
            geo = dmap.DGeometry(wshape,
                                 wcs,
                                 dtype=dtype,
                                 bbox=mybbox,
                                 comm=comm)
            area = dmap.zeros(geo)

        # Set up our signal. We do this instead of building the pmat manually
        # to make it easy to support both maps and dmaps
        if not use_dmap: signal = mapmaking.SignalMap(myscans, area, comm)
        else: signal = mapmaking.SignalDmap(myscans, mysubs, area, comm)

        # Get the input sky map that we will subtract. We do this because the CMB+CIB