Skip to content

Commit 2d98070

Browse files
committed
Don't write fisher samples
1 parent 780b079 commit 2d98070

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

lya_2pt/interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,12 @@ def run(self, healpix_ids=None, mpi_size=1, mpi_rank=0):
300300
results = list(pool.imap_unordered(compute_xi_and_fisher, local_hp_ids))
301301

302302
for hp_id, res in results:
303-
self.optimal_xi_output[hp_id] = res
303+
self.optimal_xi_output[hp_id] = res[0]
304304
self.xi_est += res[0]
305305
self.fisher_est += res[1]
306306
else:
307307
for healpix_id in healpix_ids:
308-
self.optimal_xi_output[healpix_id] = compute_xi_and_fisher(healpix_id)[1]
308+
self.optimal_xi_output[healpix_id] = compute_xi_and_fisher(healpix_id)[1][0]
309309

310310
self.xi_est += self.optimal_xi_output[healpix_id][0]
311311
self.fisher_est += self.optimal_xi_output[healpix_id][1]

lya_2pt/output.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import fitsio
2+
import numpy as np
23

34
from lya_2pt.utils import check_dir, parse_config, find_path
45

@@ -225,14 +226,15 @@ def write_optimal_cf(
225226
filename = self.healpix_dir / f"opt-corr-samples{proc_string}.fits"
226227
output_fits = fitsio.FITS(filename, 'rw', clobber=True)
227228

228-
for healpix_id, result in output.items():
229-
output_fits.write(
230-
[result[0], result[1]],
231-
names=[correlation_name, "FISHER_MATRIX"],
232-
comment=['unnormalized correlation', 'Fisher matrix'],
233-
header=header,
234-
extname=str(healpix_id)
235-
)
229+
correlation_samples = np.array([result for result in output.values()])
230+
231+
output_fits.write(
232+
[correlation_samples],
233+
names=[correlation_name],
234+
comment=['unnormalized correlation'],
235+
header=header,
236+
extname='SAMPLES'
237+
)
236238

237239
output_fits.close()
238240

0 commit comments

Comments
 (0)