GLAMERDOC++
Gravitational Lensing Code Library
Loading...
Searching...
No Matches
image_info.h
1/*
2 * image_info.h
3 *
4 * Created on: Jun 26, 2012
5 * Author: mpetkova
6 */
7
8#ifndef IMAGE_INFO_H_
9#define IMAGE_INFO_H_
10
11#include "Kist.h"
12#include "pointlist.h"
13#include "Tree.h"
14//#include <grid_maintenance.h>
15
16enum GATE {unchecked,yes,no};
17
18
20struct ImageInfo{
21
22 ImageInfo();
23 ImageInfo(const ImageInfo & rhs){
24 imagekist = new Kist<Point>;
25 innerborder = new Kist<Point>;
26 outerborder = new Kist<Point>;
27
28 copy(rhs,true);
29 }
30 ~ImageInfo();
31
32 ImageInfo & operator=(const ImageInfo & rhs){
33 if(this == &rhs) return *this;
34 copy(rhs,true);
35 return *this;
36 }
37
38 void Empty();
39
40 ImageInfo & operator+=(ImageInfo & rhs);
41
43 //Point *points;
45 //unsigned long Npoints;
47 Kist<Point> * imagekist;
49 PosType gridrange[3];
51 PosType centroid[2];
53 PosType area;
55 PosType area_error;
57 Kist<Point> * innerborder;
59 Kist<Point> * outerborder;
60 //short Nencircled;
61
66
68 unsigned long getNimagePoints(){return imagekist->Nunits();}
70 KappaType aveTimeDelay();
72 KappaType aveInvMag();
74 RAY closestRay(const Point_2d &y);
76 Point * closestPoint(const Point_2d &y);
80 void PrintImageInfo();
81 void copy(const ImageInfo & image,bool copykists = true);
82
83 bool IsMergedImages();
84
85 void ArcInfo(PosType *area,PosType *area_circ,PosType theta);
86 void FindArc(PosType &radius,PosType *xc,PosType *arc_c,PosType &arclength,PosType &width
87 ,PosType resolution,PosType threshold);
88 bool constant(LensingVariable lenvar,PosType tol);
89
95 PosType ConcaveHullImageArea(bool useborder);
101 PosType ConcaveHullSourceArea(bool useborder);
102};
103
109typedef struct OldImageInfo{
110
111 OldImageInfo();
113
117 unsigned long Npoints;
119 //Kist<Point> * imagekist;
121 PosType gridrange[3];
123 PosType centroid[2];
125 PosType area;
127 PosType area_error;
129 Kist<Point> * innerborder;
131 Kist<Point> * outerborder;
132 short ShouldNotRefine;
133
135
136
137#endif /* IMAGE_INFO_H_ */
LensingVariable
output lensing variables
Definition standard.h:89
Structure for storing information about images or curves.
Definition image_info.h:20
RAY closestRay(const Point_2d &y)
finds the ray in the image that is closest to the point y on the source plane
Definition TreeDriver.cpp:1453
void PrintImageInfo()
Print information about the image.
Definition TreeDriver.cpp:1562
void FindArc(PosType &radius, PosType *xc, PosType *arc_c, PosType &arclength, PosType &width, PosType resolution, PosType threshold)
Treating the image as an arc, find its parameters, THIS HAS NOT BEEN FINISHED YET!...
Definition TreeDriver.cpp:1351
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
GATE uniform_mag
Flag for showing when the distortion of an image can be considered linear.
Definition image_info.h:65
PosType area
area of image or, when using map_images(), the total brightness of the image
Definition image_info.h:53
bool constant(LensingVariable lenvar, PosType tol)
checks if all the points within the image have the same lensvar with the tolarence
Definition TreeDriver.cpp:1572
void Empty()
return to original state after construction
Definition Tree.cpp:819
void copy(const ImageInfo &image, bool copykists=true)
Copy all information about the image including making copies of the imagekist, innerborder and outerb...
Definition Tree.cpp:834
bool IsMergedImages()
returns true if image is the merger of two or more images of opposite parity
Definition TreeDriver.cpp:1665
ImageInfo()
Definition Tree.cpp:777
PosType gridrange[3]
gridrange[2] minimum grid size in image, gridrange[0] maximum grid size in outerborder,...
Definition image_info.h:49
PosType ConcaveHullSourceArea(bool useborder)
Area of the image using the concave hull of the points on the image plane.
Definition TreeDriver.cpp:1634
unsigned long getNimagePoints()
returns number of points currently in the image
Definition image_info.h:68
short ShouldNotRefine
Flag for stopping refinement but also used for other temporary purposes.
Definition image_info.h:63
Kist< Point > * innerborder
the points on the inner border of the image
Definition image_info.h:57
PosType centroid[2]
Centroid of image.
Definition image_info.h:51
KappaType aveTimeDelay()
Computes the time delay averaged over the image.
Definition TreeDriver.cpp:1435
PosType ConcaveHullImageArea(bool useborder)
Area of the image using the concave hull of the points on the image plane.
Definition TreeDriver.cpp:1605
KappaType aveInvMag()
Computes the inverse magnification averaged over the image, WARNING: This is not always a good measur...
Definition TreeDriver.cpp:1416
Point * closestPoint(const Point_2d &y)
finds the point in the image that is closest to the point y on the source plane
Definition TreeDriver.cpp:1477
void ArcInfo(PosType *area, PosType *area_circ, PosType theta)
Treating the image as an arc, find its parameters, THIS HAS NOT BEEN FINISHED YET!...
Definition TreeDriver.cpp:1284
RAY highestSurfaceBrightnessRay()
finds the ray in the image that has the highest surface brightness
Definition TreeDriver.cpp:1500
PosType area_error
error on the estimate of area
Definition image_info.h:55
Kist< Point > * outerborder
the points on the outer border of the image, i.e. not in the image
Definition image_info.h:59
~ImageInfo()
Definition Tree.cpp:812
This is an old version that should not be used anymore in favor of ImageInfo.
Definition image_info.h:109
Point * points
Array of points in image, SHOULD NOT BE USED IN FAVOR OF imagekist! Still used by caustic finding rou...
Definition image_info.h:115
PosType centroid[2]
Centroid of image.
Definition image_info.h:123
PosType area_error
error on the estimate of area
Definition image_info.h:127
PosType area
area of image or, when using map_images(), the total brightness of the image
Definition image_info.h:125
Kist< Point > * innerborder
the points on the inner border of the image
Definition image_info.h:129
Kist< Point > * outerborder
the points on the outer border of the image, i.e. not in the image
Definition image_info.h:131
PosType gridrange[3]
later addition, holds all points in image, will replace points eventually
Definition image_info.h:121
unsigned long Npoints
Number of points in image, SHOULD NOT BE USED IN FAVOR OF imagekist->Nunits(). Still used by caustic ...
Definition image_info.h:117
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
Simple representaion of a light path giving position on the image and source planes and lensing quant...
Definition point.h:510