GLAMERDOC++
Gravitational Lensing Code Library
Loading...
Searching...
No Matches
pixelmap.h
1//
2// pixelmap.h
3// GLAMER
4//
5// Created by Robert Benton Metcalf on 26/04/24.
6//
7
8#ifndef pixelmap_h
9#define pixelmap_h
10
11#include <vector>
12#include <tuple>
13#include <type_traits>
14
15#include "utilities_slsim.h"
16#include "point.h"
17#include "cpfits.h"
18
19struct Grid;
20struct GridMap;
21class Source;
22
23
25enum class PixelMapUnits {
26 ndef // not defined
27 ,surfb // ergs / s / cm**2
28 ,count_per_sec
29 ,ADU // Analogue-to-Digital Units
30 ,mass
31 ,mass_density
32};
33
34std::string to_string(PixelMapUnits unit);
35
40template <typename T=double>
42{
43
44 static_assert( std::is_same<T, float>::value || std::is_same<T, double>::value
45 , "PixeMap can only be instantated with a double or float template argument");
46
47public:
48 PixelMap(const PixelMap<T>& pmap, double res_ratio);
49 PixelMap();
50 PixelMap(const PixelMap<T>& other);
51 PixelMap(PixelMap<T>&& other);
52 PixelMap(const PixelMap<T>& pmap, const double* center, std::size_t Npixels);
53 PixelMap(const PixelMap<T>& pmap,long nx,long ny, std::size_t Npixels);
54 PixelMap(const double* center, std::size_t Npixels, double resolution,PixelMapUnits u = PixelMapUnits::ndef);
55 PixelMap(const double* center, std::size_t Nx, std::size_t Ny, double resolution,PixelMapUnits u = PixelMapUnits::ndef);
56 PixelMap(std::string fitsfilename
57 ,double resolution = -1,PixelMapUnits u = PixelMapUnits::ndef);
58
59 // for conversion from double to float
60 template<typename OtherT>
62
63 ~PixelMap(){
64 map.resize(0);
65 };
66
67
68 PixelMap<T>& operator=(const PixelMap<T> &other);
69 PixelMap<T>& operator=(PixelMap<T> &&other);
70
71 void ChangeUnits(PixelMapUnits u){units=u;}
72 PixelMapUnits getUnits() const {return units;}
73
74 inline bool valid() const { return map.size(); };
75 inline std::size_t size() const { return map.size(); };
76
77 inline std::size_t getNx() const { return Nx; }
78 inline std::size_t getNy() const { return Ny; }
79 inline double getRangeX() const { return rangeX; }
80 inline double getRangeY() const { return rangeY; }
81 //inline double* getCenter() const{ return &center[0]; }
82 void const getCenter(Point_2d &c) const{ c[0]=center[0]; c[1]=center[1];}
83 Point_2d getCenter() const{
84 Point_2d c(center[0],center[1]);
85 return c;
86 }
87 inline double getResolution() const { return resolution; }
88
89 // coordinates of lower left corner
90 inline Point_2d getLLBoundary() const{ return Point_2d(map_boundary_p1[0],map_boundary_p1[1]); }
91
93 double getRA(){return RA;}
95 double getDEC(){return DEC;}
96
98 void setRAandDec(double RAin,double DECin){
99 RA = RAin;
100 DEC = DECin;
101 }
102
103 // Zero the whole map
104 void Clean(){for(auto &a : map) a = 0;}
105
106 void AddImages(ImageInfo *imageinfo,int Nimages,float rescale = 1.);
107 void AddImages(std::vector<ImageInfo> &imageinfo,int Nimages,float rescale = 1.);
109 void AddGridBrightness(Grid &grid);
111 void AddGridMapBrightness(const GridMap &grid);
112 void AddUniformImages(ImageInfo *imageinfo,int Nimages,T value);
113 PosType AddSource(Source &source);
115 PosType AddSource(Source &source,int oversample);
116 void AddPointSource(const Point_2d &x,T flux);
117
124 void copy_in(const PixelMap& pmap);
125
134 void paste(const PixelMap& pmap);
135
137 void paste(const PixelMap& pmap,long nx,long ny);
138
146 PixelMap<T> convolve(const PixelMap<T> &kernel);
147 PixelMap<T> convolve2(const PixelMap<T> &kernel);
148
149
155 PixelMap<T> cutout(long xmin,long xmax,long ymin,long ymax);
156
161 void duplicate(const PixelMap& pmap);
162
164 template <typename S>
165 PosType AddSource_parallel(S &source,int oversample){
166 Point_2d s_center;
167 source.getTheta(s_center);
168
169 if( (s_center[0] + source.getRadius() ) < map_boundary_p1[0] ) return 0.0;
170 if( (s_center[0] - source.getRadius() ) > map_boundary_p2[0] ) return 0.0;
171 if( (s_center[1] + source.getRadius() ) < map_boundary_p1[1] ) return 0.0;
172 if( (s_center[1] - source.getRadius() ) > map_boundary_p2[1] ) return 0.0;
173
174 int nthreads = Utilities::GetNThreads();
175 PosType totals[nthreads];
176 std::vector<std::thread> thr;
177
178 size_t block = map.size()/nthreads;
179 for(int i = 0; i < nthreads ;++i){
180 thr.push_back(std::thread(&PixelMap<T>::addsource_<S>,this
181 ,i*block,std::min((i+1)*block-1,map.size()-1)
182 ,oversample,std::ref(source)
183 ,std::ref(totals[i])));
184 }
185
186 for(int ii=0;ii < nthreads;++ii) thr[ii].join();
187
188 PosType total =0;
189 for(int ii=0;ii < nthreads;++ii) total += totals[ii];
190
191 return total;
192 }
193
194 void AddCurve(ImageInfo *curve,T value);
195 void AddCurve(Kist<Point> *imagekist,T value);
196 void AddCurve(std::vector<Point_2d> &curve,T value);
197 void AddCurve(std::vector<RAY> &curve,T value);
198
200 void drawline(double x1[],double x2[],T value,bool add);
202 void DrawLine(long x0,long x1,long y0,long y1,T value,bool add);
203 void DrawLineGS(long x0,long x1,long y0,long y1,T value,bool add);
204 void drawcircle(PosType r_center[],PosType radius,PosType value);
205 void drawdisk(PosType r_center[],PosType radius,PosType value,int Nstrip);
206 void AddGrid(const Grid &grid,T value = 1.0);
207 void AddGrid(const Grid &grid,LensingVariable val);
208
209 void Renormalize(T factor);
210 void AddValue(std::size_t i, T value);
211 void AssignValue(std::size_t i, T value);
212 void printASCII() const;
213 void printASCIItoFile(std::string filename) const;
214 void printFITS(std::string filename,bool Xflip = false, bool verbose = false);
215 void printFITS(std::string filename,std::vector< std::tuple<std::string,double,std::string> > &extra_header_info, bool verbose);
216
218 void printFITS(std::string filename
219 ,std::vector<std::string> &headercards
220 );
221
222 void smooth(double sigma);
223
224 inline T getValue(std::size_t i) const { return map[i]; }
225 inline T & operator[](std::size_t i) { return map[i]; };
226 inline T operator[](std::size_t i) const { return map[i]; };
227 inline T & operator()(std::size_t i) { return map[i]; };
228 inline T operator()(std::size_t i) const { return map[i]; };
229 inline T operator()(std::size_t i,std::size_t j) const { return map[i + Nx*j]; };
230 inline T & operator()(std::size_t i,std::size_t j) { return map[i + Nx*j]; };
231
232 PixelMap& operator+=(const PixelMap& rhs);
233 void operator+=(float f){map +=f;};
234 void operator+=(double f){map +=f;};
235 //friend PixelMap operator+(const PixelMap&, const PixelMap&);
236 PixelMap operator+(const PixelMap&) const;
237
238 PixelMap& operator-=(const PixelMap& rhs);
239 //friend PixelMap operator-(const PixelMap&, const PixelMap&);
240 PixelMap operator-(const PixelMap&) const;
241 void operator-=(float f){map -=f;};
242 void operator-=(double f){map -=f;};
243
244 PixelMap& operator*=(const PixelMap& rhs);
245 //friend PixelMap operator*(const PixelMap&, const PixelMap&);
246 PixelMap operator*(const PixelMap& a) const;
247 PixelMap operator/(const PixelMap& a) const;
248
249 PixelMap& operator*=(PosType b);
250 PixelMap operator*(PosType b) const;
251
252 std::valarray<T>& data() { return map; }
253
255 bool agrees(const PixelMap& other) const;
256
257 //friend void swap(PixelMap&, PixelMap&);
258 static void swap(PixelMap<T>&, PixelMap<T>&);
259
261 PosType ave() const {return map.sum()/map.size();}
263 PosType sum() const {return map.sum();};
265 size_t size(){return map.size();}
266 T max() const{ return map.max(); }
267 T min() const{ return map.min(); }
268
269 void FindArc(PosType &radius,PosType *xc,PosType *arc_center,PosType &arclength,PosType &width
270 ,PosType threshold);
271
273 long find_index(PosType const x[],long &ix,long &iy) const;
275 long find_index(PosType const x[]) const;
276
278 long find_index(PosType x,PosType y,long &ix,long &iy) const;
280 long find_index(PosType x,PosType y) const;
281
283 void find_position(PosType x[],std::size_t const index) const;
285 void find_position(PosType x[],std::size_t const ix,std::size_t const iy) const;
286
289 PosType theta
290 ,T scale=1
291 );
292
294 T linear_interpolate(PosType x[]);
295
297 void drawgrid(int N,PosType value);
298 void drawPoints(std::vector<Point *> points,PosType size,PosType value);
299
300 void drawPoints(std::vector<Point> points,PosType size,PosType value);
301
302 void drawCurve(std::vector<Point *> points,PosType value){
303 for(int i=0;i<points.size()-1;++i) drawline(points[i]->x,points[i+1]->x,value,false);
304 }
305 void drawCurve(std::vector<Point> points,PosType value){
306 for(int i=0;i<points.size()-1;++i) drawline(points[i].x,points[i+1].x,value,false);
307 }
308 void drawPoints(std::vector<Point_2d> points,PosType size,PosType value);
309 void drawCurve(std::vector<Point_2d> points,PosType value){
310 for(int i=0;i<points.size()-1;++i) drawline(points[i].x,points[i+1].x,value,false);
311 }
313 void drawSquare(PosType p1[],PosType p2[],PosType value);
314 void drawBox(PosType p1[],PosType p2[],PosType value,int Nstrip);
315
317 void PowerSpectrum(std::vector<PosType> &power_spectrum
318 ,std::vector<PosType> &lvec
319 ,bool overwrite = true
320 );
321
323 void PowerSpectrum(std::vector<PosType> &power_spectrum
324 ,const std::vector<PosType> &lbins
325 ,std::vector<PosType> &lave
326 ,bool overwrite = true
327 );
328
329 void AdaptiveSmooth(PosType value);
330
332 void find_contour(T level
333 ,std::vector<std::vector<Point_2d> > &points
334 ,std::vector<bool> &hits_edge
335 ) const;
342 void find_islands_holes(T level,
343 std::vector<std::vector<size_t> > &points
344 ) const;
345
358 void lens_definition(T min_sn_per_image
359 ,T pixel_threshold
360 ,int &Nimages
361 ,T &total_sig_noise_source
362 ,std::vector<size_t> &maxima_indexes
363 ,std::vector<std::vector<size_t> > &image_points
364 ,bool &lens_TF
365 ,T &level
366 ,size_t &n_pix_in_source
367 ,bool verbose = false
368 );
369
370
372 std::vector<size_t> maxima(T minlevel) const;
373
380 //int count_islands(std::list<size_t> &pixel_index,std::vector<std::list<size_t>::iterator> &heads) const;
381 int count_islands(std::vector<size_t> &pixel_index) const;
382
384 size_t threshold(std::list<size_t> &pixel_index,PosType value){
385 for(size_t i=0;i<map.size();++i) if(value < map[i]) pixel_index.push_back(i);
386 return pixel_index.size();
387 }
388
390 void flipY(){
391 for(size_t i=0;i<Nx;++i){
392 for(size_t j=0;j<(Ny-1)/2;++j){
393 std::swap( map[i + Nx*j],map[i + Nx*(Ny-j-1)] );
394 }
395 }
396 }
398 void flipX(){
399 for(size_t i=0;i<(Nx-1)/2;++i){
400 for(size_t j=0;j<Ny;++j){
401 std::swap( map[i + Nx*j],map[Nx-i-1 + Nx*j] );
402 }
403 }
404 }
407 flipX();
408 flipY();
409 }
410
412
413 void recenter(PosType newcenter[2]
414 );
415 void recenter(Point_2d newcenter
416 );
417
418 /* \brief convolve the image with a kernel.
419
420 It is assumed that the size of the kernel is much smaller than the image and
421 that the kernal has the same pixel size as the image.
422 **/
423 //void convolve(PixelMap &kernel,long center_x = 0,long center_y = 0);
424
429 PixelMap<T> downsize(int n
430 );
431
436 PixelMap interpolate(int n);
437
439 void addheader(std::string label,long value,std::string comment){
440 bool found = false;
441 for(auto &a : headers_long){
442 if(std::get<0>(a) == label){
443 std::get<1>(a)=value;
444 std::get<2>(a)=comment;
445 found = true;
446 break;
447 }
448 }
449 if(!found) headers_long.push_back(std::make_tuple(label,value,comment));
450 }
451 void addheader(std::string label,size_t value,std::string comment){
452 bool found = false;
453 for(auto &a : headers_long){
454 if(std::get<0>(a) == label){
455 std::get<1>(a)=value;
456 std::get<2>(a)=comment;
457 found = true;
458 break;
459 }
460 }
461 if(!found) headers_long.push_back(std::make_tuple(label,value,comment));
462 }
463 void addheader(std::string label,float value,std::string comment){
464 bool found = false;
465 for(auto &a : headers_float){
466 if(std::get<0>(a) == label){
467 std::get<1>(a)=value;
468 std::get<2>(a)=comment;
469 found=true;
470 break;
471 }
472 }
473 if(!found) headers_float.push_back(std::make_tuple(label,value,comment));
474 }
475 void addheader(std::string label,double value,std::string comment){
476 bool found = false;
477 for(auto &a : headers_float){
478 if(std::get<0>(a) == label){
479 std::get<1>(a)=value;
480 std::get<2>(a)=comment;
481 found=true;
482 break;
483 }
484 }
485 if(!found) headers_float.push_back(std::make_tuple(label,value,comment));
486 }
487 void addheader(std::string label,std::string value,std::string comment){
488 bool found = false;
489 for(auto &a : headers_string){
490 if(std::get<0>(a) == label){
491 std::get<1>(a)=value;
492 std::get<2>(a)=comment;
493 found=true;
494 break;
495 }
496 }
497 if(!found) headers_string.push_back(std::make_tuple(label,value,comment));
498 }
499
500private:
501 std::vector<std::tuple<std::string,float,std::string> > headers_float;
502 std::vector<std::tuple<std::string,long,std::string> > headers_long;
503 std::vector<std::tuple<std::string,std::string,std::string> > headers_string;
504
505 std::valarray<T> map;
506 long Nx;
507 long Ny;
508 double resolution,rangeX,rangeY,center[2];
509 double RA=0,DEC=0; // optional coordinates of center
510 double map_boundary_p1[2],map_boundary_p2[2];
511 PixelMapUnits units= PixelMapUnits::ndef;
512
513 void AddGrid_(const PointList &list,LensingVariable val);
514
515 double LeafPixelArea(IndexType i,Branch * branch1);
516 void PointsWithinLeaf(Branch * branch1, std::list <unsigned long> &neighborlist);
517 bool inMapBox(Branch * branch1) const;
518 bool inMapBox(double * branch1) const;
519
521 bool pixels_are_neighbors(size_t i,size_t j) const;
525 void _count_islands_(size_t current,std::list<size_t> &reservoir
526 ,std::list<size_t>::iterator &group) const;
527
528 //void addsource_(size_t i1,size_t i2,int oversample,Source source,PosType &total);
529 //void addsource_(size_t i1,size_t i2,int oversample,Po,
530 // PosType &total);
531
532 template <typename S>
533 void addsource_(size_t i1,size_t i2,int oversample,
534 S &source,
535 PosType &total){
536 PosType tmp_res = resolution*1.0/oversample;
537 PosType tmp = tmp_res*tmp_res;
538 PosType bl = resolution /2 - 0.5*tmp_res;
539 PosType y[2],x[2];
540
541 total = 0;
542
543 for(size_t index = i1 ;index <= i2; ++index){
544 find_position(y,index);
545 y[0] -= bl;
546 y[1] -= bl;
547 for(int i = 0 ; i < oversample ; ++i){
548 x[0] = y[0] + i*tmp_res;
549 for(int j=0; j < oversample;++j){
550 x[1] = y[1] + j*tmp_res;
551 map[index] += source.SurfaceBrightness(x)*tmp;
552 total += source.SurfaceBrightness(x)*tmp;
553 }
554 }
555 }
556 }
557
558 // find if pixel k is in the curve which must be in pixel units, meant to be used in conjunction with Utilities::find_boundaries<>
559 bool incurve(long k,std::vector<Point_2d> &curve) const;
560};
561
562template<typename T>
563void swap(PixelMap<T>& x, PixelMap<T>& y)
564{
565 using std::swap;
566
567 swap(x.map,y.map);
568
569 swap(x.Nx, y.Nx);
570 swap(x.Ny, y.Ny);
571 swap(x.resolution, y.resolution);
572 swap(x.rangeX, y.rangeX);
573 swap(x.rangeY, y.rangeY);
574
575 swap(x.center[0], y.center[0]);
576 swap(x.center[1], y.center[1]);
577
578 swap(x.map_boundary_p1[0], y.map_boundary_p1[0]);
579 swap(x.map_boundary_p1[1], y.map_boundary_p1[1]);
580 swap(x.map_boundary_p2[0], y.map_boundary_p2[0]);
581 swap(x.map_boundary_p2[1], y.map_boundary_p2[1]);
582}
583
584#endif /* pixelmap_h */
Image structure that can be manipulated and exported to/from fits files.
Definition pixelmap.h:42
void flipY()
reflects the image about the horizontal mid-line
Definition pixelmap.h:390
void find_contour(T level, std::vector< std::vector< Point_2d > > &points, std::vector< bool > &hits_edge) const
returns a vector of contour curves
Definition pixelmap.cpp:852
void duplicate(const PixelMap &pmap)
copy a PixelMap that must be the same without creating a new one..
Definition pixelmap.cpp:2456
void FindArc(PosType &radius, PosType *xc, PosType *arc_center, PosType &arclength, PosType &width, PosType threshold)
Find arcs in image WARNING: THIS IS UNDER CONSTRUCTION!
Definition pixelmap.cpp:2070
double getRA()
returns right accention of center
Definition pixelmap.h:93
double getDEC()
returns declination of center
Definition pixelmap.h:95
void AddUniformImages(ImageInfo *imageinfo, int Nimages, T value)
Add images with uniform surface brightness set by input parameter value.
Definition pixelmap.cpp:764
void copy_in(const PixelMap &pmap)
copy a PixelMap into this one.
Definition pixelmap.cpp:2468
PixelMap< T > rotate(PosType theta, T scale=1)
rotate and scale the image while keeping pixels, resoluiton
Definition pixelmap.cpp:2293
void AddGridBrightness(Grid &grid)
Add an image from a the surface brightnesses of a Grid to the PixelMap.
Definition pixelmap.cpp:682
PixelMap & operator-=(const PixelMap &rhs)
Subtract the values of another PixelMap from this one.
Definition pixelmap.cpp:563
PixelMap & operator+=(const PixelMap &rhs)
Add the values of another PixelMap to this one.
Definition pixelmap.cpp:539
void drawSquare(PosType p1[], PosType p2[], PosType value)
Draw a rectangle.
Definition pixelmap.cpp:1771
void drawdisk(PosType r_center[], PosType radius, PosType value, int Nstrip)
Draws a disk.
Definition pixelmap.cpp:1669
void drawline(double x1[], double x2[], T value, bool add)
simple line
Definition pixelmap.cpp:1519
PosType AddSource_parallel(S &source, int oversample)
Adds source to map. This version breaks pixels up into blocks and does them in seporate threads.
Definition pixelmap.h:165
PixelMap interpolate(int n)
Makes a PixelMap with resolution 1/n of the original with the values linearly interpolated.
Definition pixelmap.cpp:396
void doubleFlip()
rotate the image by 180deg or equivalently reflect it through the origin
Definition pixelmap.h:406
void printFITS(std::string filename, bool Xflip=false, bool verbose=false)
Output the pixel map as a fits file.
Definition pixelmap.cpp:1309
PixelMap & operator*=(const PixelMap &rhs)
Multiply the values of another PixelMap by this one.
Definition pixelmap.cpp:586
void AddCurve(ImageInfo *curve, T value)
Draws a closed curve through the points in curve->imagekist.
Definition pixelmap.cpp:1857
void printASCIItoFile(std::string filename) const
Print an ASCII table of all the pixel values.
Definition pixelmap.cpp:1288
PixelMap< T > convolve(const PixelMap< T > &kernel)
convolve the image with a kernel.
Definition pixelmap.cpp:2592
void AddImages(ImageInfo *imageinfo, int Nimages, float rescale=1.)
Add an image to the map.
Definition pixelmap.cpp:638
void AssignValue(std::size_t i, T value)
Assigns a value to the i-th pixel.
Definition pixelmap.cpp:520
PosType ave() const
return average pixel value
Definition pixelmap.h:261
PixelMap operator*(const PixelMap &a) const
Multiply two PixelMaps.
Definition pixelmap.cpp:615
PixelMap operator-(const PixelMap &) const
Subtract two PixelMaps.
Definition pixelmap.cpp:575
void AddValue(std::size_t i, T value)
Adds a value to the i-th pixel.
Definition pixelmap.cpp:513
int count_islands(std::vector< size_t > &pixel_index) const
For a list of pixel indexes this will count and separated islands that are not connected.
Definition pixelmap.cpp:1141
void recenter(PosType newcenter[2])
recenter the map without changing anything else.
Definition pixelmap.cpp:2680
void find_islands_holes(T level, std::vector< std::vector< size_t > > &points) const
Definition pixelmap.cpp:872
size_t threshold(std::list< size_t > &pixel_index, PosType value)
get a list of pixels above value
Definition pixelmap.h:384
void printASCII() const
Print an ASCII table of all the pixel values.
Definition pixelmap.cpp:1277
void flipX()
reflects the image about the vertical mid-line
Definition pixelmap.h:398
PixelMap< T > downsize(int n)
Creates a PixelMap with a lower resolution. The value of the pixels are added for the new pixels....
Definition pixelmap.cpp:369
PixelMap operator+(const PixelMap &) const
Add two PixelMaps.
Definition pixelmap.cpp:552
void PowerSpectrum(std::vector< PosType > &power_spectrum, std::vector< PosType > &lvec, bool overwrite=true)
Find the power spectrum of the map.
Definition pixelmap.cpp:2703
void drawBox(PosType p1[], PosType p2[], PosType value, int Nstrip)
Draws a box (filling the inside with horizontal lines, starting from the top)
Definition pixelmap.cpp:1803
PixelMap operator/(const PixelMap &a) const
Multiply two PixelMaps.
Definition pixelmap.cpp:624
void setRAandDec(double RAin, double DECin)
set the coordinates of center
Definition pixelmap.h:98
PosType sum() const
return sum of all pixel values
Definition pixelmap.h:263
void AddGridMapBrightness(const GridMap &grid)
Add an image from a the surface brightnesses of a GridMap to the PixelMap.
Definition pixelmap.cpp:717
void Renormalize(T factor)
Multiplies the whole map by a scalar factor.
Definition pixelmap.cpp:506
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 paste(const PixelMap &pmap)
Replace overlaping pixel values with those of the input map.
Definition pixelmap.cpp:2526
size_t size()
Total number of pixels.
Definition pixelmap.h:265
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
void find_position(PosType x[], std::size_t const index) const
get the index for a position, returns -1 if out of map
Definition pixelmap.cpp:2266
PixelMap< T > cutout(long xmin, long xmax, long ymin, long ymax)
cut out a part of the PixelMap
Definition pixelmap.cpp:2662
void smooth(double sigma)
Smoothes a map with a Gaussian kernel of width sigma (in arcseconds)
Definition pixelmap.cpp:1453
void drawcircle(PosType r_center[], PosType radius, PosType value)
Draws a circle.
Definition pixelmap.cpp:1645
T linear_interpolate(PosType x[])
interpolate to point x[]
Definition pixelmap.cpp:2328
bool agrees(const PixelMap &other) const
Check whether two PixelMaps agree in their physical dimensions.
Definition pixelmap.cpp:526
std::vector< size_t > maxima(T minlevel) const
find maxima that are above minlevel
Definition pixelmap.cpp:935
void lens_definition(T min_sn_per_image, T pixel_threshold, int &Nimages, T &total_sig_noise_source, std::vector< size_t > &maxima_indexes, std::vector< std::vector< size_t > > &image_points, bool &lens_TF, T &level, size_t &n_pix_in_source, bool verbose=false)
Definition pixelmap.cpp:975
void addheader(std::string label, long value, std::string comment)
add a heaader keyword that will appear in fits output
Definition pixelmap.h:439
void DrawLine(long x0, long x1, long y0, long y1, T value, bool add)
line by Bresenham's line algorithm
Definition pixelmap.cpp:1566
void drawgrid(int N, PosType value)
draw a grid on the image that divides the each demension into N cells
Definition pixelmap.cpp:1705
Base class for all sources.
Definition source.h:44
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
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
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
Class for representing points or vectors in 2 dimensions. Not that the dereferencing operator is over...
Definition point.h:48
link list for points, uses the linking pointers within the Point type unlike Kist
Definition point.h:755