Skip to content

Commit

Permalink
added a user option to specify+implement lmin.
Browse files Browse the repository at this point in the history
  • Loading branch information
humnaawan committed Jan 30, 2024
1 parent 57668b7 commit b27664b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions deepcmbsim/camb_power_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ def get_cls(self, save_to_dict=None, user_params=True):
else:
raise ValueError('somethings wrong.')

# see if lmin is specified - if so, discard the ells < lmin
if self.UserParams['lmin'] != 0:
ell_inds = np.where(outdict['l'] >= self.UserParams['lmin'])[0]
if bool(self.UserParams["verbose"]):
print(f'## discarding {len(outdict["l"]) - len(ell_inds)} ells given lmin specification.')
for key in outdict.keys():
outdict[key] = outdict[key][ell_inds]

if bool(self.UserParams["verbose"]):
time_end = dt.now()
print('from', dt.strftime(time_start, '%H:%M:%S.%f %P'), 'to', dt.strftime(time_end, '%H:%M:%S.%f %P'),
Expand Down
4 changes: 4 additions & 0 deletions deepcmbsim/settings/user_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ extra_l: 300
max_l_use: 10000 # max_l_use will differ from max_l and max_l_tensor by "extra_l" because
# according to the CAMB documentation errors affect the last "100 or so" multipoles
# ---
# decide on lmin: CAMB will still be called with lmin=0 but
# you may limit the lmin for the output spectra
lmin: 0
# ---
# decide on what to output; either 'all' or a subset list of
# ['clTT', 'clEE', 'clBB', 'clTE', 'clPP', 'clPT', 'clPE']
cls_to_output: 'all'

0 comments on commit b27664b

Please sign in to comment.