Skip to content

Commit

Permalink
Remove stale, commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
tskisner committed Nov 15, 2024
1 parent 1188aa1 commit 81568f7
Showing 1 changed file with 0 additions and 137 deletions.
137 changes: 0 additions & 137 deletions src/toast/tests/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -968,143 +968,6 @@ def create_fake_wcs_scanned_tod(
del ob[buf]


# def create_fake_sky(data, dist_key, map_key, hpix_out=None):
# np.random.seed(987654321)
# dist = data[dist_key]
# pix_data = PixelData(dist, np.float64, n_value=3, units=defaults.det_data_units)
# # Just replicate the fake data across all local submaps
# off = 0
# for submap in range(dist.n_submap):
# I_data = 0.3 * np.random.normal(size=dist.n_pix_submap)
# Q_data = 0.03 * np.random.normal(size=dist.n_pix_submap)
# U_data = 0.03 * np.random.normal(size=dist.n_pix_submap)
# if submap in dist.local_submaps:
# pix_data.data[off, :, 0] = I_data
# pix_data.data[off, :, 1] = Q_data
# pix_data.data[off, :, 2] = U_data
# off += 1
# data[map_key] = pix_data
# if hpix_out is not None:
# write_healpix_fits(
# pix_data,
# hpix_out,
# nest=True,
# comm_bytes=10000000,
# report_memory=False,
# single_precision=False,
# )


# def create_fake_healpix_sky(
# data,
# dist_key,
# map_key,
# fwhm=10.0 * u.arcmin,
# lmax=256,
# hpix_out=None,
# ):
# npix = data[dist_key].npix
# map_vals = np.array(
# rng.random(
# npix,
# key=(12345, 6789),
# counter=(0, 0),
# sampler="gaussian",
# ),
# dtype=np.float64,
# )
# map_vals = hp.smoothing(
# map_vals, fwhm=self.fwhm.to_value(u.radian), lmax=self.lmax
# ).astype(dtype)
# sss_map /= np.std(sss_map)

# dist = data[dist_key]
# pix_data = PixelData(dist, np.float64, n_value=3, units=defaults.det_data_units)
# # Just replicate the fake data across all local submaps
# off = 0
# for submap in range(dist.n_submap):
# I_data = 0.3 * np.random.normal(size=dist.n_pix_submap)
# Q_data = 0.03 * np.random.normal(size=dist.n_pix_submap)
# U_data = 0.03 * np.random.normal(size=dist.n_pix_submap)
# if submap in dist.local_submaps:
# pix_data.data[off, :, 0] = I_data
# pix_data.data[off, :, 1] = Q_data
# pix_data.data[off, :, 2] = U_data
# off += 1
# data[map_key] = pix_data
# if hpix_out is not None:
# write_healpix_fits(
# pix_data,
# hpix_out,
# nest=True,
# comm_bytes=10000000,
# report_memory=False,
# single_precision=False,
# )


# def create_fake_sky_tod(
# data,
# pixel_pointing,
# stokes_weights,
# map_vals=(1.0, 1.0, 1.0),
# det_data=defaults.det_data,
# randomize=False,
# ):
# """Fake sky signal with constant I/Q/U"""
# np.random.seed(987654321)

# # Build the pixel distribution
# build_dist = ops.BuildPixelDistribution(
# pixel_dist="fake_map_dist",
# pixel_pointing=pixel_pointing,
# )
# build_dist.apply(data)

# # Create a fake sky
# map_key = "fake_map"
# dist_key = build_dist.pixel_dist
# dist = data[dist_key]
# pix_data = PixelData(dist, np.float64, n_value=3, units=u.K)
# off = 0
# for submap in range(dist.n_submap):
# if submap in dist.local_submaps:
# if randomize:
# pix_data.data[off, :, 0] = map_vals[0] * np.random.normal(
# size=dist.n_pix_submap
# )
# pix_data.data[off, :, 1] = map_vals[1] * np.random.normal(
# size=dist.n_pix_submap
# )
# pix_data.data[off, :, 2] = map_vals[2] * np.random.normal(
# size=dist.n_pix_submap
# )
# else:
# pix_data.data[off, :, 0] = map_vals[0]
# pix_data.data[off, :, 1] = map_vals[1]
# pix_data.data[off, :, 2] = map_vals[2]
# off += 1
# data[map_key] = pix_data

# # Scan map into timestreams
# scanner = ops.ScanMap(
# det_data=defaults.det_data,
# pixels=pixel_pointing.pixels,
# weights=stokes_weights.weights,
# map_key=map_key,
# )
# scan_pipe = ops.Pipeline(
# detector_sets=["SINGLE"],
# operators=[
# pixel_pointing,
# stokes_weights,
# scanner,
# ],
# )
# scan_pipe.apply(data)
# return map_key


def create_fake_mask(data, dist_key, mask_key):
np.random.seed(987654321)
dist = data[dist_key]
Expand Down

0 comments on commit 81568f7

Please sign in to comment.