Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More configurable TXTwoPointFourier #341

Merged
merged 19 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1b06636
Can now specify which components of 3x2pt to run
tmcornish Feb 23, 2024
9dfd892
TXTwoPointFourier now successfully runs for 1x2pt analysis (tested on…
tmcornish Feb 27, 2024
786febb
updated analytic noise calculation
tmcornish Mar 7, 2024
9383714
Ensured mask threshold is applied before NmtFields are made
tmcornish Mar 13, 2024
a2e5093
Added optional argument to read_mask so that a mask threshold can be …
tmcornish Mar 15, 2024
b51e14c
TXTwoPointFourier now makes use of updated read_mask
tmcornish Mar 15, 2024
48786aa
TXDensityMaps also now makes use of updated read_mask
tmcornish Mar 15, 2024
65c7c8a
Modified method of normalising systematics maps for NaMaster, account…
tmcornish Mar 19, 2024
3a44153
cl_guess is now computed from the data
tmcornish Mar 19, 2024
0a23055
TXDensityMaps no longer encounters an error if mask_threshold not pre…
tmcornish Mar 19, 2024
a2c09ef
Less hacky solution to previous issue with TXDensityMaps
tmcornish Mar 19, 2024
d471aa4
Now circumvents IndexError encountered if trying to run SHEAR-SHEAR only
tmcornish Mar 20, 2024
0ef7de3
New TXTwoPointFourier config options added explicitly to metadetect e…
tmcornish Mar 22, 2024
ecddb5e
New TXTwoPointFourier config options added explicitly to metacal exam…
tmcornish Mar 22, 2024
94a8e43
Tidied up some comments and homogenised treatment of the mask
tmcornish Apr 2, 2024
7c54d25
Reset config parameters to default behaviour in metacal example config
tmcornish Apr 11, 2024
4885be1
Removed loading of tomographic info since not actually needed
tmcornish Apr 11, 2024
e8c02c1
theory_ell is now computed across range from user-specified ell_min t…
tmcornish Apr 30, 2024
437c6ea
Merge branch 'master' into fourier_configure
tmcornish May 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions examples/metacal/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ TXTwoPointFourier:
ell_max: 150
bandwidth: 20
cache_dir: ./cache/workspaces
do_shear_shear: True
do_shear_pos: True
do_pos_pos: True
compute_theory: True

TXSimpleMask:
depth_cut : 23.5
Expand Down
4 changes: 4 additions & 0 deletions examples/metadetect/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ TXTwoPointFourier:
ell_max: 100
bandwidth: 20
cache_dir: ./cache/workspaces
do_shear_shear: True
do_shear_pos: True
do_pos_pos: True
compute_theory: True

TXSimpleMaskFrac:
supreme_map_file: data/example/inputs/supreme_dc2_dr6d_v2_g_nexp_sum_1deg2.hs
Expand Down
4 changes: 2 additions & 2 deletions txpipe/data_types/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ def read_map(self, map_name):
raise ValueError(f"Unknown map pixelization type {pixelization}")
return m

def read_mask(self):
def read_mask(self, thresh=0):
mask = self.read_map("mask")
mask[mask < 0] = 0
mask[mask <= thresh] = 0
return mask

def write_map(self, map_name, pixel, value, metadata):
Expand Down
16 changes: 6 additions & 10 deletions txpipe/maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,22 +425,18 @@ class TXDensityMaps(PipelineStage):
("density_maps", MapsFile),
]
config_options = {
'weight_thresh': 0.
"mask_threshold": 0.0
}

def run(self):
import healpy

# Read the mask
# Read the mask and set all pixels below the threshold to 0
with self.open_input("mask", wrapper=True) as f:
mask = f.read_map("mask")

# set unseen pixels to weight zero
mask[mask == healpy.UNSEEN] = 0
mask[np.isnan(mask)] = 0
mask = mask.flatten()
#identify pixels to keep (i.e. mask value above specified threshold)
pix_keep = mask > self.config['weight_thresh']
mask = f.read_mask(thresh=self.config["mask_threshold"])

#identify unmasked pixels
pix_keep = mask > 0.
pix = np.where(pix_keep)[0]

# Read the count maps
Expand Down
Loading
Loading