8#ifndef _grid_maintenance_declare_
9#define _grid_maintenance_declare_
16#include <utilities_slsim.h>
17#include "concave_hull.h"
19class LensHaloBaseNSIE;
27 Grid(
LensHndl lens,
unsigned long N1d,
const double center[2],
double range);
28 Grid(
LensHndl lens ,
unsigned long Nx ,
const PosType center[2] ,PosType rangeX ,PosType rangeY);
53 ,std::vector<RAY> &images
64 double refine_on_surfacebrightness(
Lens &lens,
Source &source);
90 void writeFits(
const double center[],
size_t Nx,
size_t Ny,
double resolution,
LensingVariable lensvar,std::string filename);
102 ,std::string filename
104 template <
typename T>
106 template <
typename T>
108 template <
typename T>
112 template <
typename T>
122 template <
typename T>
125 template <
typename T>
130 template <
typename T>
137 ,std::vector<ImageInfo> &imageinfo
138 ,
unsigned long &Nimagepoints
145 ,std::vector<ImageInfo> &imageinfo
148 ,PosType initial_size
149 ,ExitCriterion criterion
155 *
this = std::move(grid);
158 Grid operator=(
Grid &grid) =
delete;
162 assert(&grid !=
this);
165 grid.i_tree =
nullptr;
167 grid.s_tree =
nullptr;
168 neighbors = grid.neighbors;
169 grid.neighbors =
nullptr;
173 Ngrid_init = grid.Ngrid_init;
174 Ngrid_init2 = grid.Ngrid_init2;
175 Ngrid_block = grid.Ngrid_block;
176 initialized = grid.initialized;
177 maglimit = grid.maglimit;
178 pointID = grid.pointID;
179 axisratio = grid.axisratio;
181 point_factory.clear();
182 point_factory=std::move(grid.point_factory);
189 PosType UnlensedFlux(
double sblimit=-1.0e12)
const;
190 PosType LensedFlux(
double sblimit=-1.0e12)
const;
198 void xygridpoints(
Point *points,
double range,
const double *center,
long Ngrid
199 ,
short remove_center);
211 Kist<Point> * neighbors;
214 bool uniform_mag_from_deflect(
double *a,
Point *point);
217 double mag_from_deflect(
Point *point)
const;
219 unsigned long pointID;
222 template <
typename T>
223 void writePixelMapUniform_(
Point *head,
size_t N
227 Point * NewPointArray(
size_t N){
228 Point * p = point_factory(N);
230 for(
size_t i=1; i < N ; ++i) p[i].head = 0;
234 static std::mutex grid_mutex;
240std::string to_string(CritType crit);
245 struct CriticalCurve{
248 critical_center[0] = critical_center[1] = 0.0;
249 caustic_center[0] = caustic_center[1] = 0.0;
256 caustic_intersections = -1;
257 touches_edge =
false;
260 CriticalCurve(
const CriticalCurve &p){
261 critcurve = p.critcurve;
263 caustic_curve_outline = p.caustic_curve_outline;
264 caustic_curve_intersecting = p.caustic_curve_intersecting;
265 critical_center = p.critical_center;
266 caustic_center = p.caustic_center;
267 critical_area = p.critical_area;
268 caustic_area = p.caustic_area;
269 ellipse_curve = p.ellipse_curve;
270 contour_ell = p.contour_ell;
271 ellipse_area = p.ellipse_area;
272 z_source = p.z_source;
274 caustic_intersections = p.caustic_intersections;
275 touches_edge = p.touches_edge;
278 CriticalCurve & operator=(
const CriticalCurve &p){
279 if(
this == &p)
return *
this;
281 critcurve = p.critcurve;
283 caustic_curve_outline = p.caustic_curve_outline;
284 caustic_curve_intersecting = p.caustic_curve_intersecting;
285 critical_center = p.critical_center;
286 caustic_center = p.caustic_center;
287 critical_area = p.critical_area;
288 caustic_area = p.caustic_area;
289 ellipse_curve = p.ellipse_curve;
290 contour_ell = p.contour_ell;
291 ellipse_area = p.ellipse_area;
292 z_source = p.z_source;
294 caustic_intersections = p.caustic_intersections;
295 touches_edge = p.touches_edge;
299 std::vector<RAY> critcurve;
300 std::vector<Point_2d> caustic_curve_outline;
301 std::vector<Point_2d> caustic_curve_intersecting;
302 std::vector<Point_2d> ellipse_curve;
308 int caustic_intersections;
316 PosType critical_area;
318 PosType caustic_area;
323 PosType ellipse_area;
331 return Utilities::inhull(x.x,caustic_curve_outline);
335 bool intersectingCausticCurve(
Point_2d &x,
double r){
346 bool EntirelyinCausticCurve(
Point_2d &x, PosType sourceRadius)
349 bool IsInCurve = Utilities::inCurve(x,caustic_curve_outline);
353 PosType DistSourceToCautic;
355 if(IsInCurve ==
true)
357 while(i<caustic_curve_outline.size())
359 DistSourceToCautic = sqrt((caustic_curve_outline[i].x[0] - x.x[0])*(caustic_curve_outline[i].x[0] - x.x[0]) + (caustic_curve_outline[i].x[1] - x.x[1])*(caustic_curve_outline[i].x[1] - x.x[1]));
360 if (DistSourceToCautic < sourceRadius)
return false ;
369 bool EntirelyinCriticalCurve(
Point_2d x, PosType sourceRadius)
372 bool IsInCurve = Utilities::inCurve(x,caustic_curve_outline);
376 PosType DistSourceToCritCurve;
378 if(IsInCurve ==
true)
380 while(i<critcurve.size())
382 DistSourceToCritCurve = sqrt((critcurve[i].x[0] - x.x[0])*(critcurve[i].x[0] - x.x[0]) + (critcurve[i].x[1] - x.x[1])*(critcurve[i].x[1] - x.x[1]));
383 if (DistSourceToCritCurve < sourceRadius)
return false ;
394 void RandomSourcesWithinCaustic(
396 ,std::vector<Point_2d> &y
406 void RandomSourcesNearCaustic(
double R
408 ,std::vector<Point_2d> &y
413 Point_2d RandomSourceNearCaustic(
double R
420 void RandomSourceStrictlyWithinCaustic(
int N
421 ,std::vector<Point_2d> &y
423 ,PosType sourceRadius
424 ,PosType distSourceToCaustic
432 void CriticalRadius(PosType &rmax,PosType &rmin,PosType &rave)
const{
433 if(critcurve.size() < 2){
434 rave = rmax = rmin = 0.0;
438 rave = rmin = rmax = (critical_center - critcurve[0].x).length();
441 for(
size_t ii=1; ii< critcurve.size(); ++ii){
442 rad = (critical_center - critcurve[ii].x).length();
445 if(rad < rmin) rmin = rad;
446 if(rad > rmax) rmax = rad;
449 rave /= critcurve.size();
452 void CausticRadius(PosType &rmax,PosType &rmin,PosType &rave)
const{
453 if(caustic_curve_outline.size() < 2){
454 rave = rmax = rmin = 0.0;
458 rave = rmin = rmax = (caustic_center - caustic_curve_outline[0]).length();
462 for(
size_t ii=1; ii< caustic_curve_outline.size(); ++ii){
463 rad = (caustic_center - caustic_curve_outline[ii]).length();
466 if(rad < rmin) rmin = rad;
467 if(rad > rmax) rmax = rad;
470 rave /= caustic_curve_outline.size();
474 double AreaNearCaustic(
double R
482 ,
int *Nimages,std::vector<ImageInfo> &imageinfo,
unsigned long *Nimagepoints
483 ,PosType initial_size,
bool splitimages,
short edge_refinement
484 ,
bool verbose =
false);
490 ,
int *Nimages,std::vector<ImageInfo> &imageinfo,
unsigned long *Nimagepoints
491 ,
double initial_size,
double mu_min,
bool splitimages,
short edge_refinement
495 ,
GridHndl grid,
int *Nimages,std::vector<ImageInfo> &imageinfo,
unsigned long *Nimagepoints,PosType initial_size ,PosType mu_min
496 ,
bool splitimages,
short edge_refinement,
bool verbose);
499 ,
int *Nimages,std::vector<ImageInfo> &imageinfo,
unsigned long *Nimagepoints
500 ,
short splitparities,
short true_images);
504 ,
double resolution,
double invmag_min = 0.0,
bool verbose =
false,
bool test=
false);
505 void find_crit(
Lens &lens,
GridMap &gridmap,std::vector<CriticalCurve> &crtcurves,
bool verbose =
false);
508 void find_magnification_contour(
512 ,std::vector<std::vector<RAY> > &contour
513 ,std::vector<bool> &hits_boundary
521 ,PosType resolution,Kist<Point> &paritypoints,
bool TEST=
false);
523 void find_contour(
LensHndl lens,
GridHndl grid,std::vector<CriticalCurve> &contour,
int *Ncrits,PosType resolution,
bool *orderingsuccess,
bool ordercurve,
bool dividecurves,
double contour_value,
LensingVariable contour_type,
bool verbose =
false);
530 PosType mindyfunc(PosType *x);
533 namespace IF_routines{
535 ,
int Nimages,
double res_target,
short criterion
536 ,Kist<Point> * newpointkist = NULL,
bool batch=
true);
539 void refine_crit_in_image(
LensHndl lens,
GridHndl grid,
double r_source,
double x_source[],
double resolution);
542 ,
unsigned long Nimages,
double res_target,
short criterion,
bool batch=
true);
545 ,
int Nimages,
double res_target,
short criterion
546 ,Kist<Point> * newpointkist = NULL,
bool batch=
true);
548 long refine_edges2(
LensHndl lens,
double *y_source,
double r_source,
GridHndl grid
549 ,
ImageInfo *imageinfo,
bool *image_overlap,
int Nimages,
double res_target
550 ,
short criterion,
bool batch=
true);
552 void sort_out_points(
Point *i_points,
ImageInfo *imageinfo,
double r_source,
double y_source[]);
556 void printCriticalCurves(std::string filename
557 ,
const std::vector<ImageFinding::CriticalCurve> &critcurves);
565 const std::vector<ImageFinding::CriticalCurve> &critcurves,
580std::ostream &operator<<(std::ostream &os,
const ImageFinding::CriticalCurve &p);
588 const PosType center[]
592 ,std::string filename
594 writeFits<T>(center,Npixels,Npixels,resolution,lensvar,filename);
599 const PosType center[]
604 ,std::string filename
614 tag =
".alpha1.fits";
617 tag =
".alpha2.fits";
626 tag =
".gamma1.fits";
629 tag =
".gamma2.fits";
632 tag =
".gamma3.fits";
638 tag =
".invmag.fits";
641 tag =
".surfbright.fits";
656 const PosType center[]
667 const PosType center[]
685 double resolution = (branch->boundary_p2[0] - branch->boundary_p1[0])/Ngrid_init;
686 PixelMap<T> map(branch->center, Ngrid_init, Ngrid_init2, resolution);
695 int Nx = (int)( (branch->boundary_p2[0] - branch->boundary_p1[0])/resolution );
696 int Ny = (int)( (branch->boundary_p2[1] - branch->boundary_p1[1])/resolution );
710 ,std::string filename
715 size_t Ny = (size_t)(Nx*axisratio);
716 writeFits<T>(center.x,Nx,Ny,resolution, lensvar, filename);
730 const PosType center[]
734 ,std::string filename
743 tag =
".alpha1.fits";
746 tag =
".alpha2.fits";
755 tag =
".gamma1.fits";
758 tag =
".gamma2.fits";
761 tag =
".gamma3.fits";
767 tag =
".invmag.fits";
770 tag =
".surfbright.fits";
789 const PosType center[]
804 std::vector<Point *> heads(Nblocks);
805 std::vector<size_t> sizes(Nblocks,0);
812 if((*i_tree_it)->level == 4){
814 heads[i] = (*i_tree_it)->points;
815 sizes[i] = (*i_tree_it)->npoints;
824 }
while(i_tree_it.
TreeWalkStep(allowDecent) && i < Nblocks);
826 std::vector<std::thread> thrs;
827 for(
int ii = 0; ii < i ;++ii){
831 thrs.push_back(std::thread(&Grid::writePixelMapUniform_<T>,
this,heads[ii],sizes[ii],&map,lensvar));
833 for(
int ii = 0; ii < i ;++ii) thrs[ii].join();
851 std::vector<Point *> heads(Nblocks);
852 std::vector<size_t> sizes(Nblocks,0);
859 if((*i_tree_it)->level == 4){
863 heads[i] = (*i_tree_it)->points;
864 sizes[i] = (*i_tree_it)->npoints;
871 }
while(i_tree_it.
TreeWalkStep(allowDecent) && i < Nblocks);
873 std::vector<std::thread> thr;
874 for(
int ii = 0; ii < i ;++ii){
875 thr.push_back(std::thread(&Grid::writePixelMapUniform_<T>,
this,heads[ii],sizes[ii],&map,lensvar));
877 for(
auto &t : thr) t.join();
886 Point *ppoint = head;
888 for(
size_t i = 0; i< N; ++i){
892 tmp2[0] = ppoint->x[0] - ppoint->image->x[0];
893 tmp2[1] = ppoint->x[1] - ppoint->image->x[1];
894 tmp = sqrt(tmp2[0]*tmp2[0] + tmp2[1]*tmp2[1]);
897 tmp = (ppoint->x[0] - ppoint->image->x[0]);
900 tmp = (ppoint->x[1] - ppoint->image->x[1]);
903 tmp = ppoint->kappa();
906 tmp2[0] = ppoint->gamma1();
907 tmp2[1] = ppoint->gamma2();
908 tmp = sqrt(tmp2[0]*tmp2[0] + tmp2[1]*tmp2[1]);
911 tmp = ppoint->gamma1();
914 tmp = ppoint->gamma2();
917 tmp = ppoint->gamma3();
920 tmp = ppoint->invmag();
926 tmp = ppoint->surface_brightness;
929 std::cerr <<
"PixelMap<T>::AddGrid() does not work for the input LensingVariable" << std::endl;
930 throw std::runtime_error(
"PixelMap<T>::AddGrid() does not work for the input LensingVariable");
936 if(index != -1)(*map)[index] = tmp;
938 ppoint = ppoint->next;
945 const PosType center[]
949 ,std::string filename
953 PosType range = Npixels*resolution,tmp_x[2];
961 std::vector<PosType> tmp_sb_vec(tmp_image.
imagekist->Nunits());
963 for(tmp_image.
imagekist->MoveToTop(),i=0;i<tmp_sb_vec.size();++i,tmp_image.
imagekist->Down()){
964 tmp_sb_vec[i] = tmp_image.
imagekist->getCurrent()->surface_brightness;
967 tmp_x[0] = tmp_image.
imagekist->getCurrent()->x[0]
968 - tmp_image.
imagekist->getCurrent()->image->x[0];
970 tmp_x[1] = tmp_image.
imagekist->getCurrent()->x[1]
971 - tmp_image.
imagekist->getCurrent()->image->x[1];
973 tmp_image.
imagekist->getCurrent()->surface_brightness = sqrt( tmp_x[0]*tmp_x[0] + tmp_x[1]*tmp_x[1]);
974 tmp_image_theta.
imagekist->getCurrent()->surface_brightness = atan2(tmp_x[1],tmp_x[0]);
976 tag =
".alphaV.fits";
980 tmp_x[0] = tmp_image.
imagekist->getCurrent()->gamma1();
981 tmp_x[1] = tmp_image.
imagekist->getCurrent()->gamma2();
983 tmp_image.
imagekist->getCurrent()->surface_brightness = sqrt( tmp_x[0]*tmp_x[0] + tmp_x[1]*tmp_x[1]);
984 tmp_image_theta.
imagekist->getCurrent()->surface_brightness = atan2(tmp_x[1],tmp_x[0])/2;
986 tag =
".gammaV.fits";
989 std::cout <<
"Grid::writeFitsVector() does not support the LensVariable you are using." << std::endl;
994 PixelMap<T> map_m(center, Npixels, resolution),map_t(center,Npixels,resolution);
997 map_m.AddImages(&tmp_image,1,-1);
1004 map_m.printFITS(filename + tag);
1006 for(tmp_image.
imagekist->MoveToTop(),i=0;i<tmp_sb_vec.size();++i,tmp_image.
imagekist->Down())
1007 tmp_image.
imagekist->getCurrent()->surface_brightness = tmp_sb_vec[i];
1010template <
typename T>
1013 size_t N1 = (size_t)(strech*Ngrid_init);
1014 size_t N2 = (size_t)(strech*Ngrid_init2);
A class to represents a lens with multiple planes.
Definition lens.h:71
Image structure that can be manipulated and exported to/from fits files.
Definition pixelmap.h:42
void AddGridBrightness(Grid &grid)
Add an image from a the surface brightnesses of a Grid to the PixelMap.
Definition pixelmap.cpp:682
void printFITS(std::string filename, bool Xflip=false, bool verbose=false)
Output the pixel map as a fits file.
Definition pixelmap.cpp:1309
void AddImages(ImageInfo *imageinfo, int Nimages, float rescale=1.)
Add an image to the map.
Definition pixelmap.cpp:638
long find_index(PosType const x[], long &ix, long &iy) const
get the index for a position, returns -1 if out of map, this version returns the 2D grid coordinates
Definition pixelmap.cpp:2215
void AddGrid(const Grid &grid, T value=1.0)
Fills in pixels where the image plane points in the grid are located with the value given.
Definition pixelmap.cpp:1924
Base class for all sources.
Definition source.h:44
A iterator class fore TreeStruct that allows for movement through the tree without changing anything ...
Definition Tree.h:47
bool TreeWalkStep(bool allowDescent)
step for walking tree by iteration instead of recursion.
Definition tree_maintenance.cpp:1610
This is a class for generating random numbers. It simplifies and fool proofs initialization and allow...
Definition utilities_slsim.h:1059
The ImageFinding namespace is for functions related to finding and mapping images.
Definition grid_maintenance.h:243
PixelMap< T > mapCausticCurves(const std::vector< ImageFinding::CriticalCurve > &critcurves, int Nx)
Makes an image of the caustic curves. The map will encompose all curves found. The pixel values are t...
Definition Tree.cpp:1064
void find_images_microlens(LensHndl lens, double *y_source, double r_source, GridHndl grid, int *Nimages, std::vector< ImageInfo > &imageinfo, unsigned long *Nimagepoints, double initial_size, double mu_min, bool splitimages, short edge_refinement, bool verbose)
Finds images given a source position and size.
Definition image_finder_kist.cpp:465
void find_images_kist(LensHndl lens, PosType *y_source, PosType r_source, GridHndl grid, int *Nimages, std::vector< ImageInfo > &imageinfo, unsigned long *Nimagepoints, PosType initial_size, bool splitimages, short edge_refinement, bool verbose=false)
Finds images given a source position and size.
Definition image_finder_kist.cpp:41
PixelMap< T > mapCriticalCurves(const std::vector< ImageFinding::CriticalCurve > &critcurves, int Nx)
Makes an image of the critical curves. The map will encompose all curves found. The pixel values are ...
Definition Tree.cpp:1026
void image_finder_kist(LensHndl lens, PosType *y_source, PosType r_source, GridHndl grid, int *Nimages, std::vector< ImageInfo > &imageinfo, unsigned long *Nimagepoints, short splitparities, short true_images)
Finds images for a given source position and size. Not meant for high level user.
Definition image_finder_kist.cpp:1530
CritType find_pseudo(ImageInfo &pseudocurve, ImageInfo &negimage, PosType pseudolimit, LensHndl lens, GridHndl grid, PosType resolution, Kist< Point > &paritypoints, bool TEST=false)
Definition find_crit.cpp:1125
void find_contour(LensHndl lens, GridHndl grid, std::vector< CriticalCurve > &contour, int *Ncrits, PosType resolution, bool *orderingsuccess, bool ordercurve, bool dividecurves, double contour_value, LensingVariable contour_type, bool verbose=false)
Finds iso kappa contours.
Definition find_crit.cpp:1915
void find_images_microlens_exper(LensHndl lens, PosType *y_source, PosType r_source, GridHndl grid, int *Nimages, std::vector< ImageInfo > &imageinfo, unsigned long *Nimagepoints, PosType initial_size, PosType mu_min, bool splitimages, short edge_refinement, bool verbose)
experimental version of find_image_microlens()
Definition image_finder_kist.cpp:1027
void find_crit(LensHndl lens, GridHndl grid, std::vector< CriticalCurve > &crtcurve, int *Ncrits, double resolution, double invmag_min=0.0, bool verbose=false, bool test=false)
Finds critical curves and caustics.
Definition find_crit.cpp:37
bool inhull< RAY >(PosType x[], const std::vector< RAY > &H)
finds in x is within the curve discribed by the H[].x points ie image points
Definition concave_hull.h:1122
bool circleIntersetsCurve(const Point_2d &x, double r, const std::vector< Point_2d > &v)
returns true if a circle of radius r around the point x intersects with the curve v....
Definition curve_routines.cpp:3023
LensingVariable
output lensing variables
Definition standard.h:89
@ ALPHA
magnitude of deflection in radians
@ GAMMA2
second component of shear
@ GAMMA3
third component of shear
@ ALPHA2
y component of deflection
@ SurfBrightness
Surface brightness.
@ GAMMA1
first component of shear
@ GAMMA
magnitude of shear
@ ALPHA1
x component of deflection
@ INVMAG
inverse of magnification
The box representing a branch of a binary tree structure. Used specifically in TreeStruct for organiz...
Definition point.h:628
Structure to contain both source and image trees.
Definition grid_maintenance.h:25
void map_images(Lens *lens, Source *source, int *Nimages, std::vector< ImageInfo > &imageinfo, PosType xmax, PosType xmin, PosType initial_size, ExitCriterion criterion, bool FindCenter, bool divide_images)
Find images and refine them based on their surface brightness distribution.
Definition map_images.cpp:27
double RefreshSurfaceBrightnesses(Source *source)
Reshoot the rays with the same image postions.
Definition grid_maintenance.cpp:315
void zoom(LensHndl lens, double *center, double scale, Branch *top=NULL)
Test if point is in a region of uniform magnification using the kappa and gamma calculated from the r...
Definition grid_maintenance.cpp:1233
double ClearSurfaceBrightnesses()
Reset the surface brightness and in_image flag in every point on image and source planes to zero (fal...
Definition grid_maintenance.cpp:500
double AddSurfaceBrightnesses(Source *source)
Recalculate surface brightness just like Grid::RefreshSurfaceBrightness but the new source is added t...
Definition grid_maintenance.cpp:344
PosType EinsteinArea() const
area of region with negative magnification
Definition grid_maintenance.cpp:368
PixelMap< T > writePixelMap(const double center[], size_t Npixels, double resolution, LensingVariable lensvar)
Outputs a PixelMap of the lensing quantities of a fixed grid.
Definition grid_maintenance.h:655
int getInitNgrid()
return initial number of grid points in each direction
Definition grid_maintenance.h:76
~Grid()
Destructor for a Grid. Frees all memory.
Definition grid_maintenance.cpp:136
void ClearAllMarks()
Rest all in_image markers to False.
Definition grid_maintenance.cpp:984
void writeFitsUniform(const PosType center[], size_t Nx, size_t Ny, LensingVariable lensvar, std::string filename)
Output a fits map of the without distribution the pixels.
Definition grid_maintenance.h:729
void MapSurfaceBrightness(PixelMap< T > &map)
make image of surface brightness
Definition grid_maintenance.h:117
unsigned long getNumberOfPoints() const
Returns number of points on image plane.
Definition grid_maintenance.cpp:518
void find_point_source_images(Point_2d y_source, PosType r_source, PosType z_source, std::vector< RAY > &images, bool verbose=false)
This function finds all the images for a circular source of radius r_source, then finds the points wi...
Definition image_finder.cpp:1094
void writeFits(const double center[], size_t Npixels, double resolution, LensingVariable lensvar, std::string filename)
Outputs a fits image of a lensing variable of choice.
Definition grid_maintenance.h:587
Grid(LensHndl lens, unsigned long N1d, const double center[2], double range)
Constructor for initializing square grid.
Definition grid_maintenance.cpp:22
Point * RefineLeaves(LensHndl lens, std::vector< Point * > &points)
Same as RefineLeaf() but multiple points can be passed. The rays are shot all together so that more p...
Definition grid_maintenance.cpp:681
double mark_closest_point_source_images(Point_2d y_source, PosType r_source_max, PosType luminosity, bool verbose=false)
This function finds all the images for a circular source of radius r_source, then finds the points wi...
Definition image_finder.cpp:1061
Grid ReInitialize(LensHndl lens)
Returns a new grid that has not been refined but has the same intial image grid, but calculated with ...
Definition grid_maintenance.cpp:148
double getInitRange()
return initial range of gridded region
Definition grid_maintenance.h:80
void find_images(PosType *y_source, PosType r_source, int &Nimages, std::vector< ImageInfo > &imageinfo, unsigned long &Nimagepoints)
Finds images for a given source position and size. It seporates images of different pairities.
Definition image_finder.cpp:951
TreeHndl s_tree
tree on source plane
Definition grid_maintenance.h:73
PosType magnification(double sblimit=-1.0e12) const
flux weighted local magnification that does not take multiple imaging into effect
Definition grid_maintenance.cpp:398
TreeHndl i_tree
tree on image plane
Definition grid_maintenance.h:71
Point_2d centroid() const
centroid of flux
Definition grid_maintenance.cpp:456
void writePixelFits(size_t Nx, LensingVariable lensvar, std::string filename)
Make a fits map that is automatically centered on the grid and has approximately the same range as th...
Definition grid_maintenance.h:707
Point * RefineLeaf(LensHndl lens, Point *point)
Fundamental function used to divide a leaf in the tree into nine subcells.
Definition grid_maintenance.cpp:543
void writeFitsVector(const double center[], size_t Npixels, double resolution, LensingVariable lensvar, std::string filename)
Outputs a fits file for making plots of vector fields.
Definition grid_maintenance.h:944
PixelMap< T > writePixelMapUniform(const PosType center[], size_t Nx, size_t Ny, LensingVariable lensvar)
Make a Pixel map of the without distribution the pixels.
Definition grid_maintenance.h:788
int getNgrid_block()
return number of cells in each dimension into which each cell is divided when a refinement is made
Definition grid_maintenance.h:78
A simplified version of the Grid structure for making non-adaptive maps of the lensing quantities (ka...
Definition gridmap.h:31
Structure for storing information about images or curves.
Definition image_info.h:20
Kist< Point > * imagekist
Array of points in image, SHOULD NOT BE USED IN FAVOR OF imagekist! Still used by caustic finding rou...
Definition image_info.h:47
This is an old version that should not be used anymore in favor of ImageInfo.
Definition image_info.h:109
Class for representing points or vectors in 2 dimensions. Not that the dereferencing operator is over...
Definition point.h:48
A point on the source or image plane that contains a position and the lensing quantities.
Definition point.h:414
Tree: Exported struct.
Definition Tree.h:31
PointList pointlist
list of points
Definition Tree.h:125
PosType PointsWithinKist(const PosType *center, PosType rmax, Kist< Point > *neighborkist, short markpoints) const
Finds all points in tree that lie within rmax of the point ray[].
Definition KistDriver.cpp:263
Branch * getTop()
root branch
Definition Tree.h:122