Closed rbmetcalf closed 7 years ago
Addressing issue #137
Added a function Lens::GenerateFieldHalos() so that the light cone can be filled with a realisation of the expected halos without a parameter file.
Lens::GenerateFieldHalos()
Here is some sample code using it:
#include <slsimlib.h> #include <sstream> #include <iomanip> #include <omp.h> #include <thread> #include <mutex> #include "gridmap.h" using namespace std; int main(int arg,char **argv){ long seed = -189273; COSMOLOGY cosmo; Lens lens(&seed,2); double minimum_mass = 1.0e10; // solar masses double field_of_view = 0.01; // in deg^2 int number_of_lens_planes = 20; lens.GenerateFieldHalos(minimum_mass,ShethTormen,field_of_view ,number_of_lens_planes,nfw_lens); auto sph_center = lens.getCenter(); Point_2d center(sph_center.phi,sph_center.theta); lens.ResetSourcePlane(3); GridMap grid(&lens,512,center.x,degreesTOradians*2*sqrt(lens.getfov()/pi)); PixelMap map = grid.writePixelMapUniform(KAPPA); map.printFITS("!test0.fits"); for(int i=1 ; i < 2 ; ++i){ lens.resetFieldHalos(); GridMap grid(&lens,512,center.x,degreesTOradians*2*sqrt(lens.getfov()/pi)); grid.writePixelMapUniform(map,KAPPA); map.printFITS("!test" + std::to_string(i) + ".fits"); } return 0; }
@jwhsueh I fixed the default constructor for LensHaloNFW so that a vector of them can be made of properly initialised objects.
LensHaloNFW
I assume these changes are working well. I'll merge.
Addressing issue #137
Added a function
Lens::GenerateFieldHalos()
so that the light cone can be filled with a realisation of the expected halos without a parameter file.Here is some sample code using it: