-
Notifications
You must be signed in to change notification settings - Fork 4
Mask validation #60
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
base: main
Are you sure you want to change the base?
Mask validation #60
Conversation
Scans a directory for analysis masks, applies them to CMB sims, and passes the masked maps into NaMaster to obtain the power spectra. Outputs plots in directory specified in pipeline/get_analysis_mask.py
Cls have units temp^2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! This will be super useful to be run alongside the mask generation script. Just a few comments.
| BBmeta.make_dir(plot_dir) | ||
|
|
||
| # Check mask directory for masks | ||
| mask_basename = "analysis_mask" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the default option to analyze only the mask at meta.mask["analysis_mask"], and only if that is null, look for the masks in the mask directory? The reason is that soopercool will by default compute power spectra from the former, and in general {mask_dir}/analysis_mask.fits may differ from meta.mask["analysis_mask"].
| plt.plot(ells[tag], (means_bb[tag]-cbbb)/std_bb[tag], label=labels[tag]) | ||
| plt.xlabel(r"Multipole $\ell$") | ||
| plt.ylabel(r"$(\^{C}_b - C_b^{\mathrm{th}})/\sigma(\^{C}_b)$") | ||
| plt.savefig(os.path.join(plot_dir, "mask_validation_sigmas.png"), bbox_inches='tight') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add the same quantity for EE to the same plot? It would be useful to see if EE is biased too.
| parser = argparse.ArgumentParser() | ||
| parser.add_argument("--globals", required=True, help="Path to paramfile") | ||
| parser.add_argument("--fwhm", default=30, help="Beam size (arcmin). Default: 30") | ||
| parser.add_argument("--puretype", default='cmbTEB', help="Input sim pure type (T/E/B). Default: 'cmbTEB'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit peaky comment: can we not call this puretype, but maybe something like simtype? The reason is that pure_type is being used for the transfer function estimation sims, which are not CMB sims (containing B, EB, or TEB, etc.) but power-law Gaussian sims that carry only one type of polarization.
| plt.plot(ells[tag], std_bb[tag]/std_bb_bonly[tag], label=labels[tag]) | ||
| plt.xlabel(r"Multipole $\ell$") | ||
| plt.ylabel(r"$\sigma(C_b^{\mathrm{CMB}})/\sigma(C_b^{\mathrm{B\ only}})$") | ||
| plt.savefig(os.path.join(plot_dir, "mask_validation_compare_bonly.png"), bbox_inches='tight') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here a log-scale for y could help seeing the deviation from 1 more clearly, especially if the variance ratio becomes very large for small ell.
Only if that mask is not found, look for masks in the mask directory. Print plot directory on screen.
since 'puretype' refers to power-law Gaussian sims whereas mask validation uses CMB sims as input.
For a set of analysis masks (in the same directory), plot their effects on power spectra on the same plot for easy comparison.
Includes options for: