Skip to content

Mapbased param#27

Open
damonge wants to merge 1422 commits intomasterfrom
mapbased_param
Open

Mapbased param#27
damonge wants to merge 1422 commits intomasterfrom
mapbased_param

Conversation

@damonge
Copy link
Collaborator

@damonge damonge commented Feb 13, 2020

Just created this on behalf of @josquin-e to make code review a bit easier

Copy link
Collaborator Author

@damonge damonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @josquin-e
Just reviewed the Cl_estimation part and let a few general comments about stuff related to namaster (mostly). I haven't really commented on the pipeline itself. I think it mostly looks good, so most of what I've written is advice.

noise_cov=hp.read_map(self.get_input('noise_cov'),verbose=False, field=None)
# reorganization of noise covariance
instrument = {'frequencies':np.array(self.config['frequencies'])}
ind = 0
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should be able to do this as:

noise_cov = noise_cov.reshape([len(instrument['frequencies']),
                                                3, frequency_maps.shape[-1]])

That way you also wouldn't have to store both noise_cov and noise_cov_ in memory.

b = binning_definition(self.config['nside'], lmin=self.config['lmin'], lmax=self.config['lmax'],\
nlb=self.config['nlb'], custom_bins=self.config['custom_bins'])

print('building mask ... ')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did we land on this one? You only need the apodization here because you're using Galactic coordinates, right? As long as you've checked the final mask has sensible derivatives it should be fine. Apodization can take annoyingly long sometimes, so you could get an apodized mask separately and just read it in here.

obs_pix = np.where(mask!=0)[0]


if self.config['mask_apo'] != '':
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see you already have that option. nvm


#Read power spectrum and provide function to generate simulated skies
cltt,clee,clbb,clte = hp.read_cl(self.config['Cls_fiducial'])[:,:4000]
mp_t_sim,mp_q_sim,mp_u_sim=hp.synfast([cltt,clee,clbb,clte], nside=nside_map, new=True, verbose=False)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Humm, why are you simulating anything here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's just to create a fake NmtField to compute the mode-coupling matrix, you could just make these np.zeros and save on synfast.


#This wraps up the two steps needed to compute the power spectrum
#once the workspace has been initialized
def compute_master(f_a,f_b,wsp) :
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can also just write w.decouple_cell(nmt.compute_coupled_cell(f_a, f_b)) every time if you don't want to have to define this here.

hp.fitsfunc.write_cl(self.get_output('Cl_noise'), np.array(Cl_noise), overwrite=True)
hp.fitsfunc.write_cl(self.get_output('Cl_cov_clean'), np.array(Cl_cov_clean), overwrite=True)
hp.fitsfunc.write_cl(self.get_output('Cl_cov_freq'), np.array(Cl_cov_freq), overwrite=True)
hp.fitsfunc.write_cl(self.get_output('Cl_noise_bias'), np.array(Cl_noise_bias), overwrite=True)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, at some point I think you should start using sacc. The main reason for this is that later on you're gonna want to convolve the theory with the same bandpower window functions that are in the data, and sacc allows you to save that concurrently with the power spectra and the covariance easily. Especially with purification at low ell, the bandpower convolution can be quite important to avoid biases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants