version, coadd, season=args.season, patch=args.patch, array=args.array, mkdir=True, overwrite=args.overwrite, mask_patch=mask_patch) # Get data model mask = sints.get_act_mr3_crosslinked_mask(mask_patch, version=args.mask_version, kind=args.mask_kind, season=args.season, array=args.array + "_f150", pad=args.mask_pad) if args.debug: noise.plot(pout + "_mask", mask, grid=True) dm = sints.models[args.model](region=mask, calibrated=args.calibrated) # Get a NoiseGen model if args.extract_mask is not None: emask = sints.get_act_mr3_crosslinked_mask(mask_patch, version=args.extract_mask, kind=args.mask_kind, season=args.season, array=args.array + "_f150") eshape, ewcs = emask.shape, emask.wcs else: emask = mask ngen = noise.NoiseGen(version=version, model=args.model, extract_region=emask,
print("Sim %d of %d ..." % (i + 1, nsims)) with bench.show("simgen"): sims = ngen.generate_sim(season=season, patch=patch, array=array, seed=i, mask_patch=mask_patch) print(sims.nbytes / 1024. / 1024. / 1024., " GB", sims.shape, sims.dtype) if args.extract_mask is not None: ivars2 = enmap.extract(ivars, eshape, ewcs) modlmap = enmap.modlmap(eshape, ewcs) else: ivars2 = ivars if args.debug and i == 0: noise.plot(pout + "_sims", sims) if not (args.no_write): ngen.save_sims(i, sims, season, patch, array, coadd=coadd, mask_patch=mask_patch) n2d_sim = noise.get_n2d_data(sims, ivars2, emask, coadd_estimator=coadd, flattened=False, plot_fname=pout + "_n2d_sim" if (args.debug and i == 0) else None,
array=args.array, mkdir=True, overwrite=True, mask_patch=mask_patch) # Get data model mask = sints.get_act_mr3_crosslinked_mask(mask_patch, version=mask_version, kind="binary_apod", season=season, array=args.array + "_f150", pad=args.mask_pad) # print(mask.shape) mask = mask[400:-400, 5000:-5000] mask *= enmap.apod(mask, 400) # print(mask.shape) noise.plot(pout + "_mask", mask, grid=True) dm = sints.models[model](region=mask) # Get a NoiseGen model emask = mask ngen = noise.NoiseGen(version=version, model=model, extract_region=emask, ncache=1, verbose=True) # Get arrays from array splits = dm.get_splits(season=season, patch=patch, arrays=dm.array_freqs[args.array],