LSSTDESC / cosmodc2

Python package creating the cosmoDC2 synthetic galaxy catalog for LSST-DESC
Other
7 stars 1 forks source link

Adjustments for z=0 numerical issues #99

Closed evevkovacs closed 4 years ago

evevkovacs commented 4 years ago

The integration warning from scipy was happening in the loop to add the required number of synthetics in the z=0 - 0.02 snapshot. I observed the code was running through many iterations of this loop because it was generating too few trial positions that survived the selection enforcing that the position be inside the healpixel. I also noticed that nan redshift values resulted. I added the following changes to the code to prevent the problem: 1) Set a lower limit of 3000 trial positions generated per loop iteration. Once the mask is applied, about 1 % survive the cut for the lowest z shell, and this is enough to satisfy the number of synthetics required in that shell. 2) Set the octant boundaries to small +ve and small -ve values for (x,y) and z directions to avoid generating a position exactly at (0., 0. 0.) ( would be a problem for redshift interpolation) 3) Set a minimum of 1e-10 for the grid used to interpolate redshift values from comoving distances 4) Added an assert statement to check that all interpolated redshifts are finite. I have rerun a couple of healpixels to test the above changes and did not reproduce the problem.