GLShear Class Reference

General Lensing Algorithm. More...

#include <glshear.h>


Public Member Functions

 GLShear ()
 Default Constructor.
 GLShear (double *observationParameters, double *lensParameters, double *sourceParameters, DensityProfile *density, Plane< Double > *_sourcePlane, int *glellipseBounds=0, double *offset=0)
 Parameter based constructor.
 GLShear (DensityProfile *density, double *sourceParameters, Plane< Double > *_sourcePlane, int *glellipseBounds=0, double *offset=0)
 Lens Density and Source based constructor.
 GLShear (Plane< math::Complex > *newDeflectionMap, double *observationParameters, double *sourceParameters, Plane< Double > *_sourcePlane)
 Deflection angle array based constructor.
 ~GLShear ()
 Destructor.
double * newLocation (double x, double y)
 Gives the point in the source frame the point (x,y) would be lensed to.
math::Complex shear (double x, double y, double *offset)
 Gives the amount of deflection.
Double mapsToSource (double x, double y)
 Checks to see whether the point (x,y) maps to a source, if so, returns it's mass.
bool isAtEinsteinRadius (double x, double y)
 Determines whether the location is at the Einstein Radius.
double massInElement (const double x, const double y) const
 Reads the source plane and give the mass in that space.
bool isLensMassElement (const double x, const double y) const
 Determines whether there is lens mass at the point (x,y).
bool createShearMapPlane (int _leftBound=-1, int _rightBound=-1, int _lowerBound=-1, int _upperBound=-1, double *offset=0)
 Creates a plane creating the deflection angles.
Plane< math::Complex > * getShearPlane ()
 Returns a pointer to the deflection plane.
 GLShear ()
 Default Constructor.
 GLShear (double *observationParameters, double *lensParameters, double *sourceParameters, DList< Double > *density, Plane< Double > *_sourcePlane, int *glellipseBounds=0, double *offset=0)
 Parameter based constructor.
 GLShear (DList< Double > *density, double *_observationParameters, double *lensParameters, double *sourceParameters, Plane< Double > *_sourcePlane, int *glellipseBounds=0, double *offset=0, bool createShearMap=true, double windowValue=1, DList< Double > *optionalSource=0)
 Lens Density and Source based constructor.
 GLShear (DList< Double > *newShearMap, double *observationParameters, double *sourceParameters, Plane< Double > *_sourcePlane)
 Shear Map based constructor.
 ~GLShear ()
 Destructor.
math::Complex shear (double x, double y, double *offset=0)
 Gives the amount of shear The Shear is given as Complex numbers with the horizontal and vertical deflections as the Real and Imaginary Parts, respectively.
bool isAtEinsteinRadius (double x, double y)
 Determines whether the location is at the Einstein Radius.
bool createShearMapPlane (double *offset=0)
 Creates a plane creating the shear values.
DList< Double > * getShearPlane ()
 Returns a pointer to the shear map plane.
void createConvergencePlane (DList< Double > *convergence, double *offset)
 Returns a pointer to a new convergence plane.
double conv (double x, double y, double *offset=0)

Static Public Member Functions

static double abs (const double x)
 Absolute value of x.
static double abs (const double x)
 Absolute value of x.

Private Attributes

double * observationParameters
double * lensParameters
double * sourceParameters
DensityProfilemassDensity
Plane< math::Complex > * shearMap
Plane< Double > * sourcePlane
double windowValue
DList< Double > * massDensity
DList< Double > * shearMap


Detailed Description

General Lensing Algorithm.

General Shear Algorithm for use with SPL.

This class handles lensing information and calculations. Created By David Coss, 2007

This class handles lensing information and calculations. Created By David Coss, 2009


Constructor & Destructor Documentation

GLShear::GLShear (  ) 

Default Constructor.

All pointers set to null.

References lensParameters, massDensity, observationParameters, shearMap, sourceParameters, and sourcePlane.

GLShear::GLShear ( double *  observationParameters,
double *  lensParameters,
double *  sourceParameters,
DensityProfile density,
Plane< Double > *  _sourcePlane,
int *  glellipseBounds = 0,
double *  offset = 0 
)

Parameter based constructor.

This constructor should be used if the deflection angles have not yet been calculated.

Parameters:
observationParameters Set of General paramters (eg speed of light, solar mass).
lensParameters Lens Parameters (eg size, location).
sourceParameters Source parameters.
density DensityProfile (usually to be calculated by this constructor).
_sourcePlane Plane containing the sources.

References createShearMapPlane(), massDensity, shearMap, and sourcePlane.

GLShear::GLShear ( DensityProfile density,
double *  sourceParameters,
Plane< Double > *  _sourcePlane,
int *  glellipseBounds = 0,
double *  offset = 0 
)

Lens Density and Source based constructor.

This is used if the density profile has already been calculated.

Parameters:
density DensityProfile of the lens.
sourceParameters Parameters of the source.
_sourcePlane The sources.

References createShearMapPlane(), DensityProfile::getLensParameters(), DensityProfile::getObservationParameters(), lensParameters, massDensity, observationParameters, shearMap, sourceParameters, and sourcePlane.

GLShear::GLShear ( Plane< math::Complex > *  newDeflectionMap,
double *  observationParameters,
double *  sourceParameters,
Plane< Double > *  _sourcePlane 
)

Deflection angle array based constructor.

This constructor should be used the most. It is suggested (for speed of simulation) that he deflection angles be calculated, saved, and then reused as need. This construct provides deflection planes, via newDeflectionMap, to be used once calculated. Note: the 2 dimensional deflections are stored as Complex numbers with the horizontal and vertical deflections as the Real and Imaginary Parts, respectively.

Parameters:
newDeflectionMap Complex Deflections Plane
observationParameters General observation Parameters.
sourceParameters Source Parameters.
_sourcePlane Source Plane.

References lensParameters, massDensity, shearMap, and sourcePlane.

GLShear::~GLShear (  ) 

Destructor.

This destructor only sets the pointers to null, since they may be used in other parts of the program. So if they should be deleted, delete the outside of glalgorithm.

References lensParameters, massDensity, observationParameters, sourceParameters, and sourcePlane.

GLShear::GLShear (  ) 

Default Constructor.

All pointers set to null.

GLShear::GLShear ( double *  observationParameters,
double *  lensParameters,
double *  sourceParameters,
DList< Double > *  density,
Plane< Double > *  _sourcePlane,
int *  glellipseBounds = 0,
double *  offset = 0 
)

Parameter based constructor.

This constructor should be used if the shear quantities have not yet been calculated.

Parameters:
observationParameters Set of General paramters (eg speed of light, solar mass).
lensParameters Lens Parameters (eg size, location).
sourceParameters Source parameters.
density DList<Double> particle distribution for use with SPL

References createShearMapPlane(), massDensity, shearMap, and sourcePlane.

GLShear::GLShear ( DList< Double > *  density,
double *  _observationParameters,
double *  lensParameters,
double *  sourceParameters,
Plane< Double > *  _sourcePlane,
int *  glellipseBounds = 0,
double *  offset = 0,
bool  createShearMap = true,
double  windowValue = 1,
DList< Double > *  optionalSource = 0 
)

Lens Density and Source based constructor.

This is used if the density profile has already been calculated.

Parameters:
density DensityProfile of the lens.
sourceParameters Parameters of the source.
_sourcePlane The sources.

References createShearMapPlane(), lensParameters, massDensity, observationParameters, shearMap, sourceParameters, and sourcePlane.

GLShear::GLShear ( DList< Double > *  newShearMap,
double *  observationParameters,
double *  sourceParameters,
Plane< Double > *  _sourcePlane 
)

Shear Map based constructor.

This constructor should be used the most. It is suggested (for speed of simulation) that the shear be calculated, saved, and then reused as need. This construct provides shear planes, via newShearMap, to be used once calculated. Note: the 2 dimensional shear is stored as Complex numbers with the horizontal and vertical shear as the Real and Imaginary Parts, respectively.

Parameters:
newShearMap Complex Shear Map
observationParameters General observation Parameters.
sourceParameters Source Parameters.
_sourcePlane Source Plane.

References lensParameters, massDensity, shearMap, and sourcePlane.

GLShear::~GLShear (  ) 

Destructor.

This destructor only sets the pointers to null, since they may be used in other parts of the program. So if they should be deleted, delete the outside of glalgorithm.


Member Function Documentation

static double GLShear::abs ( const double  x  )  [inline, static]

Absolute value of x.

static double GLShear::abs ( const double  x  )  [inline, static]

Absolute value of x.

Referenced by mapsToSource().

double GLShear::conv ( double  x,
double  y,
double *  offset = 0 
)

speed of light should be provied in parameters file. This way units are "guaranteed" to match.

References Cosmology::arcsecondsToCentimeters(), Cosmology::criticalDensity(), lensParameters, massDensity, observationParameters, SPL::smoothConvergence(), sourceParameters, and windowValue.

Referenced by createConvergencePlane().

void GLShear::createConvergencePlane ( DList< Double > *  convergence,
double *  offset 
)

Returns a pointer to a new convergence plane.

Note: the point is not stored anywhere else. Therefore, you must delete it if you ever want to see that memory again.

References conv(), DEBUG_PRINT, lensParameters, massDensity, observationParameters, sourceParameters, VERBOSE_PRINT, and windowValue.

bool GLShear::createShearMapPlane ( double *  offset = 0  ) 

Creates a plane creating the shear values.

If the plane was created correctly, true is returned. X and Y bounds were added to allow for parallel computing. The shear map can be calculated a portion at a time. Then those portions may be added together to form a final grid.

Returns:
bool.
See also:
getShearMap()

References lensParameters, massDensity, observationParameters, shear(), shearMap, sourceParameters, VERBOSE_PRINT, and windowValue.

bool GLShear::createShearMapPlane ( int  _leftBound = -1,
int  _rightBound = -1,
int  _lowerBound = -1,
int  _upperBound = -1,
double *  offset = 0 
)

Creates a plane creating the deflection angles.

If the plane was created correctly, true is returned. X and Y bounds were added to allow for parallel computing. The deflection map can be calculated a portion at a time. Then those portions may be added together to form a final grid.

Returns:
bool.
See also:
getDeflectionPlane()

References lensParameters, massDensity, observationParameters, Plane< T >::setValue(), shear(), shearMap, sourceParameters, and VERBOSE_PRINT.

Referenced by GLShear().

DList<Double>* GLShear::getShearPlane (  )  [inline]

Returns a pointer to the shear map plane.

Returns:
Plane<math::Complex>*
See also:
createShearMapPlane()

References shearMap.

Plane<math::Complex>* GLShear::getShearPlane (  )  [inline]

Returns a pointer to the deflection plane.

Returns:
Plane<math::Complex>*
See also:
createDeflectionMapPlane()

References shearMap.

bool GLShear::isAtEinsteinRadius ( double  x,
double  y 
) [inline]

Determines whether the location is at the Einstein Radius.

Returns:
bool.

bool GLShear::isAtEinsteinRadius ( double  x,
double  y 
) [inline]

Determines whether the location is at the Einstein Radius.

Returns:
bool.

bool GLShear::isLensMassElement ( const double  x,
const double  y 
) const

Determines whether there is lens mass at the point (x,y).

Parameters:
x horizontal position.
y vertical position.
Returns:
bool.

References DensityProfile::isMassAtPoint(), and massDensity.

Referenced by shear().

Double GLShear::mapsToSource ( double  x,
double  y 
)

Checks to see whether the point (x,y) maps to a source, if so, returns it's mass.

x and y in arcseconds.

Parameters:
x horizontal location
y vertical location.
Returns:
Double mass at source location.

References abs(), Plane< T >::getValue(), newLocation(), observationParameters, sourceParameters, and sourcePlane.

double GLShear::massInElement ( const double  x,
const double  y 
) const

Reads the source plane and give the mass in that space.

Parameters:
x horizontal position.
y vertical position.
Returns:
double mass at that position.

References DensityProfile::massAtPoint(), and massDensity.

Referenced by shear().

double * GLShear::newLocation ( double  x,
double  y 
)

Gives the point in the source frame the point (x,y) would be lensed to.

Parameters:
x horizontal position in pixels from corner (zero indexed).
y vertical position in pixels from corner (zero indexed).

References Plane< T >::getValue(), observationParameters, and shearMap.

Referenced by mapsToSource().

math::Complex GLShear::shear ( double  x,
double  y,
double *  offset = 0 
)

Gives the amount of shear The Shear is given as Complex numbers with the horizontal and vertical deflections as the Real and Imaginary Parts, respectively.

offset is a 2-D vector containing the x and y offsets respectively. If offset = 0, then there is no offset. So offset can be null. Offset is a pixel offset (ie must match x and y's units).

Parameters:
x horizontal position.
y vertical position.
Returns:
Complex

math::Complex GLShear::shear ( double  x,
double  y,
double *  offset 
)

Gives the amount of deflection.

The Deflection is given as Complex numbers with the horizontal and vertical deflections as the Real and Imaginary Parts, respectively.

offset is a 2-D vector containing the x and y offsets respectively. If offset = 0, then there is no offset. So offset can be null. Offset is a pixel offset (ie must match x and y's units).

Parameters:
x horizontal position in pixels from corner (zero indexed).
y vertical position in pixels from corner (zero indexed).
Returns:
Complex

These parameters are need from the file.

coefficient in "radians" not "arcseconds"

References Cosmology::arcsecondsToCentimeters(), Cosmology::criticalDensity(), isLensMassElement(), lensParameters, massInElement(), observationParameters, and sourceParameters.

Referenced by createShearMapPlane().


Field Documentation

double * GLShear::lensParameters [private]

DList<Double>* GLShear::massDensity [private]

double * GLShear::observationParameters [private]

DList<Double>* GLShear::shearMap [private]

Plane<math::Complex>* GLShear::shearMap [private]

double * GLShear::sourceParameters [private]

Plane< Double > * GLShear::sourcePlane [private]

Referenced by GLShear(), mapsToSource(), and ~GLShear().

double GLShear::windowValue [private]


The documentation for this class was generated from the following files:

Generated on Sat Feb 6 12:43:20 2010 by  doxygen 1.5.7.1