Skip to content

Commit 873bc2d

Browse files
committed
Add separate weight paths for the two tracers if they have the same name
1 parent 3ae855a commit 873bc2d

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

vega/correlation_item.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ def __init__(self, config, model_pk=False):
4848

4949
self.new_metals = config['model'].getboolean('new_metals', False)
5050
if self.new_metals:
51-
self.tracer1['delta-stack'] = config['data'].get(f'delta_stack_{self.tracer1["name"]}')
52-
self.tracer2['delta-stack'] = config['data'].get(f'delta_stack_{self.tracer2["name"]}')
51+
self.tracer1['weights-path'] = config['data'].get('weights-tracer1')
52+
self.tracer2['weights-path'] = config['data'].get('weights-tracer2', None)
53+
if self.tracer2['weights-path'] is None:
54+
self.tracer2['weights-path'] = self.tracer1['weights-path']
5355

5456
self.test_flag = config['data'].getboolean('test', False)
5557

vega/metals.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,11 @@ def __init__(self, corr_item, fiducial, scale_params, PktoXi_obj, data=None):
7474
blinding='none'
7575
)
7676

77-
with fits.open(self._corr_item.tracer1['delta-stack']) as hdul:
77+
with fits.open(self._corr_item.tracer1['weights-path']) as hdul:
7878
self.stack_table_1 = hdul[1].data
7979

80-
if self._corr_item.tracer1['name'] == self._corr_item.tracer2['name']:
81-
self.stack_table_2 = self.stack_table_1
82-
else:
83-
with fits.open(self._corr_item.tracer2['delta-stack']) as hdul:
84-
self.stack_table_2 = hdul[1].data
80+
with fits.open(self._corr_item.tracer2['weights-path']) as hdul:
81+
self.stack_table_2 = hdul[1].data
8582

8683
# Initialize metals
8784
self.Pk_metal = None

0 commit comments

Comments
 (0)