GLAMERDOC++
Gravitational Lensing Code Library
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 
16 enum GATE {unchecked,yes,no};
17 
18 
20 struct 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 
109 typedef struct OldImageInfo{
110 
111  OldImageInfo();
112  ~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 
134 } OldImageInfo;
135 
136 
137 #endif /* IMAGE_INFO_H_ */
OldImageInfo::centroid
PosType centroid[2]
Centroid of image.
Definition: image_info.h:123
OldImageInfo::area_error
PosType area_error
error on the estimate of area
Definition: image_info.h:127
ImageInfo::~ImageInfo
~ImageInfo()
Definition: Tree.cpp:812
ImageInfo::ConcaveHullImageArea
PosType ConcaveHullImageArea(bool useborder)
Area of the image using the concave hull of the points on the image plane.
Definition: TreeDriver.cpp:1605
ImageInfo::highestSurfaceBrightnessRay
RAY highestSurfaceBrightnessRay()
finds the ray in the image that has the highest surface brightness
Definition: TreeDriver.cpp:1500
ImageInfo::imagekist
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
ImageInfo::aveInvMag
KappaType aveInvMag()
Computes the inverse magnification averaged over the image, WARNING: This is not always a good measur...
Definition: TreeDriver.cpp:1416
OldImageInfo::points
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
ImageInfo::closestRay
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
ImageInfo::uniform_mag
GATE uniform_mag
Flag for showing when the distortion of an image can be considered linear.
Definition: image_info.h:65
ImageInfo::area
PosType area
area of image or, when using map_images(), the total brightness of the image
Definition: image_info.h:53
OldImageInfo::Npoints
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
ImageInfo::FindArc
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
Point_2d
Class for representing points or vectors in 2 dimensions. Not that the dereferencing operator is over...
Definition: point.h:48
ImageInfo::closestPoint
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
ImageInfo::constant
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
ImageInfo::aveTimeDelay
KappaType aveTimeDelay()
Computes the time delay averaged over the image.
Definition: TreeDriver.cpp:1435
OldImageInfo::area
PosType area
area of image or, when using map_images(), the total brightness of the image
Definition: image_info.h:125
ImageInfo::copy
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
ImageInfo::Empty
void Empty()
return to original state after construction
Definition: Tree.cpp:819
RAY
Simple representaion of a light path giving position on the image and source planes and lensing quant...
Definition: point.h:510
ImageInfo::ShouldNotRefine
short ShouldNotRefine
Flag for stopping refinement but also used for other temporary purposes.
Definition: image_info.h:63
ImageInfo::ConcaveHullSourceArea
PosType ConcaveHullSourceArea(bool useborder)
Area of the image using the concave hull of the points on the image plane.
Definition: TreeDriver.cpp:1634
OldImageInfo::innerborder
Kist< Point > * innerborder
the points on the inner border of the image
Definition: image_info.h:129
ImageInfo::IsMergedImages
bool IsMergedImages()
returns true if image is the merger of two or more images of opposite parity
Definition: TreeDriver.cpp:1665
ImageInfo::ImageInfo
ImageInfo()
Definition: Tree.cpp:777
ImageInfo::innerborder
Kist< Point > * innerborder
the points on the inner border of the image
Definition: image_info.h:57
ImageInfo::PrintImageInfo
void PrintImageInfo()
Print information about the image.
Definition: TreeDriver.cpp:1562
ImageInfo::centroid
PosType centroid[2]
Centroid of image.
Definition: image_info.h:51
ImageInfo::ArcInfo
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
ImageInfo::gridrange
PosType gridrange[3]
gridrange[2] minimum grid size in image, gridrange[0] maximum grid size in outerborder,...
Definition: image_info.h:49
OldImageInfo::gridrange
PosType gridrange[3]
later addition, holds all points in image, will replace points eventually
Definition: image_info.h:121
OldImageInfo
This is an old version that should not be used anymore in favor of ImageInfo.
Definition: image_info.h:109
OldImageInfo::outerborder
Kist< Point > * outerborder
the points on the outer border of the image, i.e. not in the image
Definition: image_info.h:131
Point
A point on the source or image plane that contains a position and the lensing quantities.
Definition: point.h:414
ImageInfo::area_error
PosType area_error
error on the estimate of area
Definition: image_info.h:55
LensingVariable
LensingVariable
output lensing variables
Definition: standard.h:89
ImageInfo::outerborder
Kist< Point > * outerborder
the points on the outer border of the image, i.e. not in the image
Definition: image_info.h:59
ImageInfo
Structure for storing information about images or curves.
Definition: image_info.h:20
ImageInfo::getNimagePoints
unsigned long getNimagePoints()
returns number of points currently in the image
Definition: image_info.h:68