#!/usr/bin/env python import sacc import numpy as np s = sacc.Sacc.load_fits("hsc_y3_fourier_space_data_vector.sacc") for bin1_index in range(0,4): for bin2_index in range(bin1_index,4): l, cl, cov = s.get_ell_cl('cl_ee', 'wl_'+str(bin1_index), 'wl_'+str(bin2_index), return_cov=True) full_covariance_matrix = s.covariance.covmat z={} nz={} for bin_index in range(4): z[f"{bin_index}"], nz[f"{bin_index}"] = s.tracers['wl_'+str(bin_index)].z, s.tracers['wl_'+str(bin_index)].nz #For further examples of reading and writing information with sacc files, please refer to the example notebooks at https://github.com/LSSTDESC/sacc/tree/master/examples #Load PSF systematics: data = np.load('ppcorr_psf_all_ells_lmax_1800_catalog2.npz') # Here the correlations are given in the following order: # [pp, pq, pp4, pq4], [qp, qq, qp4, qq4], [pp4, qp4, p4p4, p4q4], [pq4, qq4, p4q4, q4q4] # where p represents the second moment leakage, q represents the second moment # modeling error, p4 represents the fourth moment leakage, and q4 represents # the fourth moment modeling error. ell_bins, correlations = data['arr_0'], data["arr_1"] #Load PSF transform matrix: data = np.load('psf_transform_matrix_lmax_1800_catalog2.npz') transformation_matrix, mean_values = data['arr_0'], data["arr_1"]