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

added fast-metals option to picca_metal_dmat [minor] #1039

Merged
merged 4 commits into from
Sep 5, 2023
Merged
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions bin/picca_metal_dmat.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
from picca import constants, cf, utils, io
from picca.utils import userprint

#store the default silicon metals modelled in the CF/XCF
DEFAULT_SI_METALS = ['SiIII(1207)','SiII(1190)','SiII(1193)','SiII(1260)']

def calc_metal_dmat(abs_igm1, abs_igm2, healpixs):
"""Computes the metal distortion matrix.
Expand Down Expand Up @@ -279,6 +281,12 @@ def main(cmdargs):
help='Rebin factor for deltas. If not None, deltas will '
'be rebinned by that factor')

parser.add_argument('--fast-metals',
action='store_true',
required=False,
help='compute only the metal correlations used by Vega'
'i.e. 4 LyaxSi matrices and CIVxCIV')

args = parser.parse_args(cmdargs)

if args.nproc is None:
Expand Down Expand Up @@ -416,6 +424,12 @@ def main(cmdargs):
for index2, abs_igm2 in enumerate(abs_igm_2[index0:]):
if index1 == 0 and index2 == 0:
continue

if args.fast_metals:
if not (abs_igm1 == "LYA" and abs_igm2 in DEFAULT_SI_METALS) \
and not (abs_igm1 == "CIV(eff)" and abs_igm1 == abs_igm2):
continue

cf.counter.value = 0
calc_metal_dmat_wrapper = partial(calc_metal_dmat, abs_igm1,
abs_igm2)
Expand Down
Loading