GLAMERDOC++
Gravitational Lensing Code Library
Loading...
Searching...
No Matches
gridmap.h
1//
2// gridmap.h
3// GLAMER
4//
5// Created by bmetcalf on 8/19/14.
6//
7//
8
9#ifndef __GLAMER__gridmap__
10#define __GLAMER__gridmap__
11
12#include <iostream>
13#include <memory>
14#include "lens.h"
15#include "point.h"
16#include "concave_hull.h"
17#include "Tree.h"
18#include "source.h"
19#include <mutex>
20
30
31struct GridMap{
32
33 friend class Lens;
34
35 GridMap(LensHndl lens,unsigned long N1d,const double center[2],double range);
36 GridMap(LensHndl lens ,unsigned long Nx ,const PosType center[2] ,PosType rangeX ,PosType rangeY);
38 GridMap(unsigned long N1d,const double center[2],double range);
39 ~GridMap();
40
42 GridMap ReInitialize(LensHndl lens);
43
45 void deLens();
55 double RefreshSurfaceBrightnesses(Source* source);
61 double AdaptiveRefreshSurfaceBrightnesses(Lens &lens,Source &source);
62
69 double AddSurfaceBrightnesses(Source* source);
70
72 Point_2d image_point(size_t index){return i_points[index];}
74 Point_2d source_point(size_t index){return s_points[index];}
76 RAY ray(size_t index){return i_points[index];}
77
78 void ClearSurfaceBrightnesses();
79 void assertNAN(); // check for nan in surface prightness
80 size_t getNumberOfPoints() const {return Ngrid_init*Ngrid_init2;}
81
83 int getInitNgrid() const {return Ngrid_init;}
85 double getXRange() const {return x_range;}
86 double getYRange() const {return x_range*axisratio;}
88 double getResolution() const {return x_range/(Ngrid_init-1);}
89
91 template<typename T>
94 template <typename T>
95 void writeFits(LensingVariable lensvar,std::string filensame);
96
97 template<typename T>
99 template <typename T>
100 void writeFitsUniform(const PosType center[],size_t Nx,size_t Ny,LensingVariable lensvar,std::string filename);
101 template<typename T>
102 PixelMap<T> writePixelMapUniform(const PosType center[],size_t Nx,size_t Ny,LensingVariable lensvar);
103
105 template<typename T>
107 LensingVariable lensvar
108 ,std::string filename
109 ){
110 PixelMap<T> map = writePixelMap<T>(lensvar);
111 map.printFITS(filename);
112 }
113
115 template<typename T>
117
121 template<typename T>
122 void getPixelMapFlux(PixelMap<T> &map) const;
123
125 PosType EinsteinArea() const;
126
129 //PosType magnification_invmag() const;
130 //PosType magnification2() const;
131
133 Point_2d centroid() const;
134
135 Point_2d getCenter(){return center;}
136
137 Point * operator[](size_t i){return i_points.data() + i;};
138
139 GridMap(GridMap &&grid){
140
141 Ngrid_init = grid.Ngrid_init;
142 Ngrid_init2 = grid.Ngrid_init2;
143 pointID = grid.pointID;
144 axisratio = grid.axisratio;
145 x_range = grid.x_range;
146
147 std::swap(i_points,grid.i_points);
148 std::swap(s_points,grid.s_points);
149
150 center = grid.center;
151 }
152
153 GridMap(GridMap &grid){
154
155 Ngrid_init = grid.Ngrid_init;
156 Ngrid_init2 = grid.Ngrid_init2;
157 pointID = grid.pointID;
158 axisratio = grid.axisratio;
159 x_range = grid.x_range;
160
161 i_points = grid.i_points;
162 s_points = grid.s_points;
163
164 center = grid.center;
165 }
166
167 GridMap & operator=(GridMap &&grid){
168 Ngrid_init = grid.Ngrid_init;
169 Ngrid_init2 = grid.Ngrid_init2;
170 pointID = grid.pointID;
171 axisratio = grid.axisratio;
172 x_range = grid.x_range;
173
174 std::swap(i_points,grid.i_points);
175 std::swap(s_points,grid.s_points);
176
177 center = grid.center;
178
179 return *this;
180 }
181
182 struct Triangle{
183 Triangle(size_t i,size_t j,size_t k){
184 index[0] = i;
185 index[1] = j;
186 index[2] = k;
187 }
188 Triangle(){
189 index[0] = 0;
190 index[1] = 0;
191 index[2] = 0;
192 }
193 Triangle(const Triangle &tri){
194 index[0] = tri[0];
195 index[1] = tri[1];
196 index[2] = tri[2];
197 }
198 Triangle & operator=(const Triangle &tri){
199 index[0] = tri[0];
200 index[1] = tri[1];
201 index[2] = tri[2];
202 return *this;
203 }
204 ~Triangle(){};
205 std::vector<long> index = {0,0,0};
206 long & operator[](int i){return index[i];}
207 long operator[](int i) const {return index[i];}
208 };
209 struct Rectangle{
210 Rectangle(size_t i,size_t j){
211 index[0] = i;
212 index[1] = j;
213 }
214 Rectangle(){
215 index[0] = 0;
216 index[1] = 0;
217 }
218 Rectangle(const Rectangle &rec){
219 index[0] = rec[0];
220 index[1] = rec[1];
221 }
222 Rectangle & operator=(Rectangle &rec){
223 index[0] = rec[0];
224 index[1] = rec[1];
225 return *this;
226 }
227 ~Rectangle(){};
228 std::vector<long> index = {0,0};
229 long & operator[](int i){return index[i];}
230 long operator[](int i) const {return index[i];}
231 };
232
233 // determines if two rectangles touch
234 inline bool touch(const Rectangle &tr1,const Rectangle &tr2) const;
235
236 // returns a vector of rectangles that encompase all triangles with one rectangle for each touching group
237 std::vector<Rectangle> merge_boxes(
238 std::list<Triangle> &triangles
239 ) const;
240 std::vector<Rectangle> merge_boxes(
241 std::vector<Triangle> &triangles
242 ) const;
243
254 std::list<RAY> find_images(std::vector<Point_2d> &ys
255 ,std::vector<int> &multiplicity
256 ) const;
257
264 void find_images(Point_2d y
265 ,std::vector<Point_2d> &image_points
266 ,std::vector<Triangle> &triangles
267 ) const ;
268
269
278 void find_boundaries_of_caustics(std::vector<std::vector<Point_2d> > &boundaries
279 ,std::vector<bool> &hits_edge
280 ){
281
282 size_t N=Ngrid_init*Ngrid_init2;
283 std::vector<Point_2d> source_points(N);
284 for(size_t i=0 ; i<N ; ++i) source_points[i] = i_points[i];
285
286 std::vector<int> multiplicities(N);
287 find_images(source_points,multiplicities);
288
289 std::vector<bool> bitmap(N,false);
290 for(size_t i=0 ; i<N ; ++i){
291 if(multiplicities[i] > 1) bitmap[i] = true;
292 }
293
294 Utilities::find_boundaries<Point_2d>(bitmap,Ngrid_init,boundaries,hits_edge);
295 }
296
300 PosType magnificationFlux(Source &source) const ;
301
309 double magnificationTr() const ;
310
313 double magnificationTr(std::vector<size_t> &pixels) const ;
314
316 double AreaCellOnSourcePlane(size_t k) const;
317
318
319// depricated version of PixalMap::magnificationTr()
320// double magnificationTr2() const {
321//
322// size_t k;
323// size_t k1;
324// size_t k2;
325//
326// double flux_source=0.0,flux_image=0.0;
327// for(size_t i=1 ; i< Ngrid_init-1 ; i++){
328// for(size_t j=1 ; j< Ngrid_init2-1 ; j++){
329//
330// k = i + j*Ngrid_init;
331//
332// assert( s_points[k].surface_brightness == i_points[k].surface_brightness);
333// double sb = s_points[k].surface_brightness;
334//
335// if(sb !=0.0){
336// flux_source += AreaCellOnSourcePlane(k) *sb;
337// flux_source += AreaCellOnSourcePlane(k-1) *sb;
338// flux_source += AreaCellOnSourcePlane(k-1-Ngrid_init) *sb;
339// flux_source += AreaCellOnSourcePlane(k-Ngrid_init) *sb;
340// }
341//
342// flux_image += sb;
343// }
344// }
345//
346// return flux_image * getResolution() * getResolution() * 4 / flux_source;
347// }
348
355 double AddPointSource(const Point_2d &y,double flux);
356
362 void find_crit(std::vector<std::vector<Point_2d> > &points
363 ,std::vector<bool> &hits_boundary
364 ,std::vector<CritType> &crit_type
365 );
366
371 std::vector<std::vector<Point_2d> > &curves
372 ,std::vector<bool> &hits_boundary
373 ,double invmag
374 );
375
376// void find_crit_boundary(std::vector<std::vector<Point_2d> > &points
377// ,std::vector<bool> &hits_boundary
378// ) const;
379 int getNx(){return Ngrid_init;}
380 int getNy(){return Ngrid_init2;}
381private:
382 GridMap & operator=(GridMap &grid);
383
384 // curve must be in pixel units
385 bool incurve(long k,std::vector<Point_2d> &curve) const;
386
387 // cluge to make compatible with old method of producing points
388 std::vector<Point> NewPointArray(size_t N){
389 std::vector<Point> p(N);
390 p[0].head = N;
391 return p;
392 }
393
394 void xygridpoints(Point *points,double range,const double *center,long Ngrid
395 ,short remove_center);
396
398 int Ngrid_init;
399 int Ngrid_init2;
400
401 unsigned long pointID;
402 PosType axisratio;
403 PosType x_range;
404 template<typename T>
405 void writePixelMapUniform_(Point* points,size_t size,PixelMap<T> *map,LensingVariable val);
406
407 std::vector<Point> i_points;
408 std::vector<Point> s_points;
409 Point_2d center;
410
411 bool to_refine(long i,long j,double total,double f) const ;
412 static std::mutex grid_mutex;
413
414 void _find_images_(Point_2d *ys,int *multiplicity,long Nys,std::list<RAY> &rays) const;
415 void _find_images2_(size_t j1
416 ,size_t j2
417 ,std::list<Point_2d> &image_points
418 ,std::list<Triangle> &triangles
419 ,Point_2d y
420 ) const;
421
422 // find if there are images of y in specific cells
423 void limited_image_search(Point_2d &y
424 ,std::vector<size_t> &cell_numbers
425 ,std::vector<Triangle> &triangles
426 ) const;
427};
428
430template<typename T>
432
433 // The number of pixels on a side of the new map will be
434 // N = (Ngrid_init-1)/resf + 1;
435 // so that the resolution is resf x the GridMap resolution
436
437 PixelMap<T> map(center.x
438 ,Ngrid_init
439 ,Ngrid_init2
440 ,x_range/(Ngrid_init-1));
441
442 size_t index;
443 size_t n = Ngrid_init*Ngrid_init2;
444 for(size_t i=0 ; i<n ; ++i){
445 index = map.find_index(i_points[i].x);
446 map.data()[index] = i_points[i].surface_brightness;
447 }
448
449 //for(size_t i = 0 ; i < Ngrid_init ; ++i){
450 // for(size_t j = 0 ; j < Ngrid_init2 ; ++j){
451 // map.data()[i/resf + map.getNx() * (j / resf)] +=
452 // i_points[ i + Ngrid_init * j].surface_brightness/factor;
453 // }
454 //}
455
456 map.Renormalize(map.getResolution()*map.getResolution());
457
458 return map;
459}
460
462template<typename T>
464
465 //int resf = (Ngrid_init-1)/(map.getNx()-1);
466
467 if(map.getNx() != Ngrid_init) throw std::invalid_argument("PixelMap does not match GripMap! Use the other GridMap::getPixelMapFlux() to contruct a PixelMap.");
468 if(map.getNy() != Ngrid_init2) throw std::invalid_argument("PixelMap does not match GripMap! Use the other GridMap::getPixelMapFlux() to contruct a PixelMap.");
469 //if(map.getResolution() != x_range*resf/(Ngrid_init-1)) throw std::invalid_argument("PixelMap does not match GripMap resolution! Use the other GridMap::getPixelMapFlux() to contruct a PixelMap.");
470
471 if(map.getCenter()[0] != center[0]) throw std::invalid_argument("PixelMap does not match GripMap!");
472 if(map.getCenter()[1] != center[1]) throw std::invalid_argument("PixelMap does not match GripMap!");
473
474 double res = getResolution();
475 if((map.getResolution()-res) < 1.0e-6*res ) throw std::invalid_argument("PixelMap resolution does not match GripMap!");
476
477 map.Clean();
478
479 //long nx = map.getNx();
480 //for(size_t i = 0 ; i < Ngrid_init ; ++i){
481 // for(size_t j = 0 ; j < Ngrid_init2 ; ++j){
482 // size_t k = i + nx * j;
483 // map.data()[k] += i_points[k].surface_brightness;
484 // }
485 //}
486
487 size_t index;
488 size_t n = Ngrid_init*Ngrid_init2;
489 for(size_t i=0 ; i<n ; ++i){
490 index = map.find_index(i_points[i].x);
491 map.data()[index] = i_points[i].surface_brightness;
492 }
493
494
495 map.Renormalize(map.getResolution()*map.getResolution());
496}
497
505template<typename T>
507 const PosType center[]
508 ,size_t Nx
509 ,size_t Ny
510 ,LensingVariable lensvar
511){
512
513 if(getNumberOfPoints() == 0 ) return PixelMap<T>();
514 PixelMap<T> map(center, Nx, Ny,x_range/(Nx-1));
515
516 map.Clean();
517
518 writePixelMapUniform(map,lensvar);
519
520 return map;
521}
522
523template<typename T>
525 LensingVariable lensvar
526 ,std::string filename
527 ){
528 PixelMap<T> map = writePixelMap<T>(lensvar);
529 map.printFITS(filename);
530}
531
532template<typename T>
534 LensingVariable lensvar
535){
536 size_t Nx = Ngrid_init;
537 size_t Ny = Ngrid_init2;
538
539 PixelMap<T> map( center.x, Nx, Ny,x_range/(Nx-1) );
540
541 size_t N = map.size();
542 assert(N == Nx*Ny);
543
544 double tmp2[2];
545 switch (lensvar) {
547 for(size_t i=0 ; i<N ; ++i){
548 tmp2[0] = i_points[i].x[0] - i_points[i].image->x[0];
549 tmp2[1] = i_points[i].x[1] - i_points[i].image->x[1];
550 map[i] = sqrt(tmp2[0]*tmp2[0] + tmp2[1]*tmp2[1]);
551 }
552 break;
554 for(size_t i=0 ; i<N ; ++i)
555 map[i] = (i_points[i].x[0] - i_points[i].image->x[0]);
556 break;
558 for(size_t i=0 ; i<N ; ++i)
559 map[i] = (i_points[i].x[1] - i_points[i].image->x[1]);
560 break;
562 for(size_t i=0 ; i<N ; ++i)
563 map[i] = i_points[i].kappa();
564 break;
566 for(size_t i=0 ; i<N ; ++i){
567 tmp2[0] = i_points[i].gamma1();
568 tmp2[1] = i_points[i].gamma2();
569 map[i] = sqrt(tmp2[0]*tmp2[0] + tmp2[1]*tmp2[1]);
570 }
571 break;
573 for(size_t i=0 ; i<N ; ++i)
574 map[i] = i_points[i].gamma1();
575 break;
577 for(size_t i=0 ; i<N ; ++i)
578 map[i] = i_points[i].gamma2();
579 break;
581 for(size_t i=0 ; i<N ; ++i)
582 map[i] = i_points[i].gamma3();
583 break;
585 for(size_t i=0 ; i<N ; ++i)
586 map[i] = i_points[i].invmag();
587 break;
589 for(size_t i=0 ; i<N ; ++i)
590 map[i] = i_points[i].dt;
591 break;
593 for(size_t i=0 ; i<N ; ++i)
594 map[i] = i_points[i].surface_brightness;
595 break;
596 default:
597 std::cerr << "GridMap::writePixelMapUniform() does not work for the input LensingVariable" << std::endl;
598 throw std::runtime_error("GridMap::writePixelMapUniform() does not work for the input LensingVariable");
599 break;
600 // If this list is to be expanded to include ALPHA or GAMMA take care to add them as vectors
601 }
602 return map;
603}
604template <typename T>
606 PixelMap<T> &map
607 ,LensingVariable lensvar
608){
609
610 if(getNumberOfPoints() ==0 ) return;
611
612 map.Clean();
613
614 //writePixelMapUniform_(i_points,getNumberOfPoints(),&map,lensvar);
615 //return;
616
617 std::vector<std::thread> thr;
618 int nthreads = Utilities::GetNThreads();
619
620 int chunk_size;
621 do{
622 chunk_size = getNumberOfPoints()/nthreads;
623 if(chunk_size == 0) nthreads /= 2;
624 }while(chunk_size == 0);
625
626 size_t size = chunk_size;
627 for(int ii = 0; ii < nthreads ;++ii){
628 if(ii == nthreads-1)
629 size = getNumberOfPoints() - (nthreads-1)*chunk_size;
630 thr.push_back(std::thread(&GridMap::writePixelMapUniform_<T>,this,&(i_points[ii*chunk_size]),size,&map,lensvar));
631 }
632 for(auto &t : thr) t.join();
633}
634
635template <typename T>
636void GridMap::writePixelMapUniform_(Point* points,size_t size,PixelMap<T> *map,LensingVariable val){
637 double tmp;
638 PosType tmp2[2];
639 long index;
640
641 for(size_t i = 0; i< size; ++i){
642 switch (val) {
644 tmp2[0] = points[i].x[0] - points[i].image->x[0];
645 tmp2[1] = points[i].x[1] - points[i].image->x[1];
646 tmp = sqrt(tmp2[0]*tmp2[0] + tmp2[1]*tmp2[1]);
647 break;
649 tmp = (points[i].x[0] - points[i].image->x[0]);
650 break;
652 tmp = (points[i].x[1] - points[i].image->x[1]);
653 break;
655 tmp = points[i].kappa();
656 break;
658 tmp2[0] = points[i].gamma1();
659 tmp2[1] = points[i].gamma2();
660 tmp = sqrt(tmp2[0]*tmp2[0] + tmp2[1]*tmp2[1]);
661 break;
663 tmp = points[i].gamma1();
664 break;
666 tmp = points[i].gamma2();
667 break;
669 tmp = points[i].gamma3();
670 break;
672 tmp = points[i].invmag();
673 break;
675 tmp = points[i].dt;
676 break;
678 tmp = points[i].surface_brightness;
679 break;
680 default:
681 std::cerr << "PixelMap<T>::AddGrid() does not work for the input LensingVariable" << std::endl;
682 throw std::runtime_error("PixelMap<T>::AddGrid() does not work for the input LensingVariable");
683 break;
684 // If this list is to be expanded to include ALPHA or GAMMA take care to add them as vectors
685 }
686
687 index = map->find_index(points[i].x);
688 if(index != -1)(*map)[index] = tmp;
689 }
690}
691
692template <typename T>
694 const PosType center[]
695 ,size_t Nx
696 ,size_t Ny
697 ,LensingVariable lensvar
698 ,std::string filename
699){
700 std::string tag;
701
702 switch (lensvar) {
704 tag = ".dt.fits";
705 break;
707 tag = ".alpha1.fits";
708 break;
710 tag = ".alpha2.fits";
711 break;
713 tag = ".alpha.fits";
714 break;
716 tag = ".kappa.fits";
717 break;
719 tag = ".gamma1.fits";
720 break;
722 tag = ".gamma2.fits";
723 break;
725 tag = ".gamma3.fits";
726 break;
728 tag = ".gamma.fits";
729 break;
731 tag = ".invmag.fits";
732 break;
734 tag = ".surfbright.fits";
735 break;
736 default:
737 break;
738 }
739
740 PixelMap<T> map = writePixelMapUniform<T>(center,Nx,Ny,lensvar);
741 map.printFITS(filename + tag);
742}
743
744#endif // defined(__GLAMER__gridmap__)
Image structure that can be manipulated and exported to/from fits files.
Definition pixelmap.h:42
void Renormalize(T factor)
Multiplies the whole map by a scalar factor.
Definition pixelmap.cpp:509
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:2227
void printFITS(std::string filename, bool Xflip=false, bool ctype=false, bool verbose=false)
Output the pixel map as a fits file.
Definition pixelmap.cpp:1318
Base class for all sources.
Definition source.h:44
void find_boundaries(std::vector< bool > &bitmap, long nx, std::vector< std::vector< P > > &points, std::vector< bool > &hits_edge, bool add_to_vector=false, bool outer_only=false)
finds ordered boundaries to regions where bitmap == true
Definition concave_hull.h:201
int GetNThreads()
returns the compiler variable N_THREADS that is maximum number of threads to be used.
Definition utilities.cpp:553
LensingVariable
output lensing variables
Definition standard.h:89
@ ALPHA
magnitude of deflection in radians
Definition standard.h:91
@ GAMMA2
second component of shear
Definition standard.h:97
@ DELAYT
time delay
Definition standard.h:90
@ GAMMA3
third component of shear
Definition standard.h:98
@ ALPHA2
y component of deflection
Definition standard.h:93
@ SurfBrightness
Surface brightness.
Definition standard.h:101
@ GAMMA1
first component of shear
Definition standard.h:96
@ GAMMA
magnitude of shear
Definition standard.h:95
@ KAPPA
convergence
Definition standard.h:94
@ ALPHA1
x component of deflection
Definition standard.h:92
@ INVMAG
inverse of magnification
Definition standard.h:99
PixelMap< T > getPixelMapFlux() const
returns a PixelMap with the flux in pixels at a resolution of res times the original resolution
Definition gridmap.h:431
double AddSurfaceBrightnesses(Source *source)
Recalculate surface brightness just like GridMap::RefreshSurfaceBrightness but the new source is adde...
Definition gridmap.cpp:260
Point_2d image_point(size_t index)
get the image point for a index number
Definition gridmap.h:72
std::list< RAY > find_images(std::vector< Point_2d > &ys, std::vector< int > &multiplicity) const
Returns a list of RAYs from a set of source positions.
Definition gridmap.cpp:927
PosType EinsteinArea() const
returns the area (radians^2) of the region with negative magnification at resolution of fixed grid
Definition gridmap.cpp:323
RAY ray(size_t index)
get the image point for a index number
Definition gridmap.h:76
double getXRange() const
return initial range of gridded region. This is the distance from the first ray in a row to the last ...
Definition gridmap.h:85
double RefreshSurfaceBrightnesses(Source *source)
Recalculate surface brightness at every point without changing the positions of the gridmap or any le...
Definition gridmap.cpp:174
double AddPointSource(const Point_2d &y, double flux)
add flux to the rays that are nearest to the source on the source plane for each image
Definition gridmap.cpp:466
Point_2d source_point(size_t index)
get the image point for a index number
Definition gridmap.h:74
void find_magnification_contour(std::vector< std::vector< Point_2d > > &curves, std::vector< bool > &hits_boundary, double invmag)
Find image-plane contours of magnification. This is usually only used within ImageFinding:: functio...
Definition gridmap.cpp:494
PixelMap< T > writePixelMap(LensingVariable lensvar)
make pixel map of lensing quantities at the resolution of the GridMap
Definition gridmap.h:533
void writeFitsUniform(const PosType center[], size_t Nx, size_t Ny, LensingVariable lensvar, std::string filename)
Definition gridmap.h:693
void writeFitsUniform(LensingVariable lensvar, std::string filename)
this will make a fits map of the grid as is.
Definition gridmap.h:106
double getResolution() const
resolution in radians, this is range / (N-1)
Definition gridmap.h:88
GridMap ReInitialize(LensHndl lens)
reshoot the rays for example when the source plane has been changed
Definition gridmap.cpp:148
double AdaptiveRefreshSurfaceBrightnesses(Lens &lens, Source &source)
Definition gridmap.cpp:189
double magnificationTr() const
calculate the LOCAL magnification by triangel method weighted by interpolated surface brightness
Definition gridmap.cpp:355
void writePixelMapUniform(PixelMap< T > &map, LensingVariable lensvar)
Definition gridmap.h:605
PosType magnificationFlux(Source &source) const
Definition gridmap.cpp:344
int getInitNgrid() const
return initial number of grid points in each direction
Definition gridmap.h:83
GridMap(LensHndl lens, unsigned long N1d, const double center[2], double range)
Constructor for initializing square grid.
Definition gridmap.cpp:93
void find_boundaries_of_caustics(std::vector< std::vector< Point_2d > > &boundaries, std::vector< bool > &hits_edge)
finds the boundary of the region on the source plane where there are more than one image
Definition gridmap.h:278
double AreaCellOnSourcePlane(size_t k) const
area of a cell (pixel size region with its lower left at point k) on source plane - calculated by tri...
Definition gridmap.cpp:452
void writeFits(LensingVariable lensvar, std::string filensame)
fits output of lensing quantities at the resolution of the GridMap
Definition gridmap.h:524
Point_2d centroid() const
returns centroid of flux on the grid
Definition gridmap.cpp:915
void find_crit(std::vector< std::vector< Point_2d > > &points, std::vector< bool > &hits_boundary, std::vector< CritType > &crit_type)
Find critical curves. This is usually not used outside of ImageFinding::find_crit()
Definition gridmap.cpp:527
void deLens()
resets to state without lensing
Definition gridmap.cpp:162
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:421
Simple representaion of a light path giving position on the image and source planes and lensing quant...
Definition point.h:517