Implementation of reduced shear in source selection for clusters#398
Implementation of reduced shear in source selection for clusters#398eduardojsbarroso wants to merge 12 commits intomasterfrom
Conversation
|
In this code. We set a maximum radius of search for galaxies around a cluster. Given the cluster redshift and a fiducial cosmology, we can transform this distance into an angle that changes for each cluster given their redshift. If I do not want to assume any fiducial cosmology and search the galaxies by angle directly, should I use the same search angle for all clusters? Or is there some other approach to reescale this distance with redshift without using cosmology? @marina-ricci @joezuntz |
|
There's definitely no way to convert a distance to an angle without knowing the cosmology. So I guess you would have to use the same angle, and make sure it's large enough. Why don't you want to use a fiducial cosmology? It shouldn't have a significant impact on the results at this level. |
Thank you for the reply Joe. I just wanted to know if there was any other way around it since we do not need the cosmology for the tangential signal. But ok, then I think I will leave this untouched and maybe add an option to use a constant angle if wanted |
|
@eduardojsbarroso for this special case I don't think it is a problem. Indeed we can use a fiducial cosmology just to define theta_max, it doesn't (should't) interfer with the "scientific" measurements. And even having radial binning in Mpc is not as much of a problem as having e.g. sigma_crit. |
|
Also, note for ourselves : we should through an error message when our binning is larger than the search radius (in case it's not hapening already) |
|
We decided it makes no sense to implement the N(z) method in source_compute_select, as it will be done more cleanly with the NG correlation. |
|
@marina-ricci I have cleaned the option of Nz, as as discussed with @combet, we can implement this in another pull request, and a third one for the treecor option. Could you take a look at the code and check what you think? |
I think this is already done in the |
|
@marina-ricci I added a pipeline file to test this new functionalities and a notebook if you want to explore the results. Everything seems into place for me |
joezuntz
left a comment
There was a problem hiding this comment.
In general I don't know enough to comment on the clusters code, so I will just review to make sure that things look structurally correct and don't cause any issues with the wider code.
This looks fine from that perspective, though I've added a note about a change you'll need to make because of other changes in the rest of the imports. I'm happy for you to merge it whenever the CL people are happy!
| name: mini | ||
| interval: 3.0 | ||
| modules: > | ||
| txpipe |
There was a problem hiding this comment.
You will need to add txpipe.extensions here because of changes in the structuring of the code.
| nzbins: 301 | ||
| columns_file: ./data/bpz_riz.columns | ||
| data_path: ./data/example/rail-bpz-inputs | ||
| columns_file: /sps/lsst/groups/clusters/cl_pipeline_project/TXPipe_data/bpz_riz.columns |
There was a problem hiding this comment.
Maybe avoid hard-coded paths (this is for cc-in2p3 only) so users may more easily use the examples. Or at least add a comment to explain how they should change it to match their setup.
|
|
||
| output_dir: ./data/cosmodc2/outputs-20deg2-CL | ||
| config: ./examples/cosmodc2/Cluster_pipelines/config-20deg2-CL.yml | ||
| output_dir: /sps/lsst/users/ebarroso/TXPipe/data/cosmodc2/outputs-20deg2-CL |
There was a problem hiding this comment.
Same as above regarding path
| "r_min" : 0.2, #in Mpc | ||
| "r_max" : 5.0, #in Mpc | ||
| #distance bin definition | ||
| "d_min" : 0.5, #in Mpc or acrmin |
There was a problem hiding this comment.
To me, r_min and r_max is more intuitive than d_min, d_max. And 'radial bin' is more used I think, even when thinking of angular separation. Just a suggestion.
| radius_edges = np.logspace(np.log10(rmin), np.log10(rmax), len(radius_centers) + 1) | ||
| for i in range(len(radius_edges) - 1): | ||
| bin_radius_dict[f'radius_{i}'] = (radius_edges[i], radius_edges[i+1], radius_centers[i]) | ||
| distance_centers = np.array(data['bin_zbin_0_richbin_0']['clmm_cluster_ensemble'].stacked_data['radius']) |
There was a problem hiding this comment.
Similar comment as above. distance_centers is a bit cryptic. Maybe radial_bin_centers instead, or something along those lines?
| def add_deltasigma_data(self, sacc_obj, data: dict, survey_name: str): | ||
| def add_shear_data(self, sacc_obj, data: dict, survey_name: str, profile_type: str): | ||
| """ | ||
| Adds cluster shear (delta sigma) data to the SACC object. |
There was a problem hiding this comment.
Adds cluster reduced shear or delta sigma (depending on profile_type) profile to the SACC object.
| self.radial_bins = clmm.dataops.make_bins(self.config["r_min"], self.config["r_max"], nbins=self.config["nbins"], method="evenlog10width") | ||
| print (self.radial_bins) | ||
| import clmm.cosmology.ccl | ||
| if self.config["units"].lower() == "arcmin": |
There was a problem hiding this comment.
I find it a bit counter-intuitive to have a units keywords decide the type of radial binning (angular or in physical distance). Maybe there should be another keyword radial_bin_type (e.g. 'radius' or 'angle' ) or something like this to control it?
Good to keep the units information though, maybe to save it later as metadata in the sacc file?
|
|
||
| if (clmm.utils.convert_units(np.max(bg_cat["distance_arcmin"]), 'arcmin', 'Mpc', z_cl, self.clmm_cosmo)< self.radial_bins[-1]): | ||
| print ("!!! maximum radial distance of source smaller than radial_bins") | ||
| cat_max_distance = (clmm.utils.convert_units(np.max(bg_cat["distance_arcmin"]), "arcmin", "Mpc", z_cl, self.clmm_cosmo) if shear_units == "mpc" else np.max(bg_cat["distance_arcmin"])) |
There was a problem hiding this comment.
Need to find another name for shear_units. "shear" in this code is either dimensionless or surface mass density if working with DeltaSigma.
| gc_object.make_radial_profile( | ||
| "Mpc", | ||
| bins=self.radial_bins, | ||
| shear_units, |
So far, the cluster code only measures Delta Sigma from the select source galaxies around a cluster. We need to implement the same for gamma and we are also interested in using N(z) to select the galaxies behind the cluster instead of redshift PDF or zmode or zmean.