mass_to_shear.cpp File Reference

#include "mass_to_shear.h"

Functions

int main (int argc, char **argv)
 Created By David Coss, 2007.
int super_main (int argc, char **argv)
 Intermediate Main Method.
int sub_main (int argc, char **argv)
 Main start method.
int simulationSetup ()
int simulation (Plane< Double > *lens, Plane< Double > *sources, DensityProfile *massDensity, int numberOfSources, int specificSource, int specificLens, int parameter1) throw (DavidException)
 The main simulation routine.
template<class T >
void buildSource (Plane< T > *source, double *sourceParams, T newValue)
 constructs the source plane.
template<class T >
void constructLens (Plane< T > *source, Plane< T > *lens, T valueOfSource, T lensValue)
 constructs the lens plane.
bool writeSourceInfo (double **sourceParams, int specificSource, int numberOfSources, utils::DRandom *randy, bool useRandom, int numberOfPixels)
 writes the source info(eg location) to a text file.
bool writeParameters (double *params, double *lensParams, double **sourceParams, int numberOfSources)
 writeParameters writes the parameters to 2 files: "human readable" file and a file which can be parsed by ray_trace
bool createLensParams (double *lensParams, int specificLens)
 Creates parameters for a lens to be used in the simulation.
int parseArgs (int argc, char **argv)
 Parses arguments sent from command line.
DString * paramParser (const char *fileName)
 This Method Parses Parameters from a text file and returns them as an entry in a DString Array.
void loadParameters (double *params, double *lensParams, double **sourceParams, int numParams, int numLensParams, int numberOfSources)
 Reads the Parameters from the Parameters file.
void drawEllipse (const char *parameters)
void createSurfaceMassDensity (DString parameters, DString fileName)
 Creates a 2 Dimensional Mass Array from lens parameters.
DString getTime ()
 Returns a DString containing the current time.
void verbosePrint (DString printString)
void squarePlane (const char *fileName)
 Takes the largest dimension of a Plane and makes it square.
DList< Double > * parseList (const DString &fileName, double extraParameter)
 Loads the mass density file.
void saveDList (DList< Double > *list, const DString filename)
 Save the given DList.

Function Documentation

template<class T >
void buildSource ( Plane< T > *  source,
double *  sourceParams,
newValue 
) [inline]

constructs the source plane.

template<class T >
void constructLens ( Plane< T > *  source,
Plane< T > *  lens,
valueOfSource,
lensValue 
) [inline]

constructs the lens plane.

bool createLensParams ( double *  lensParams,
int  specificLens 
)

Creates parameters for a lens to be used in the simulation.

Parameters:
lensParams double array of parameters to use in the simulation
specificLens int specific lens to use
Returns:
bool true (always, don't ask why) Sets the lens parameters.

Referenced by simulation().

void createSurfaceMassDensity ( DString  parameters,
DString  fileName 
)

Creates a 2 Dimensional Mass Array from lens parameters.

Referenced by parseArgs().

void drawEllipse ( const char *  parameters  ) 

Referenced by parseArgs().

DString getTime (  ) 

Returns a DString containing the current time.

Format: Wed May 16 16:44:42 2007

Referenced by verbosePrint().

void loadParameters ( double *  params,
double *  lensParams,
double **  sourceParams,
int  numParams,
int  numLensParams,
int  numberOfSources 
)

Reads the Parameters from the Parameters file.

Parameters:
array of general parameters.
lensParams Lens parameters.
sourceParams Array of Parameters for each Source.
numParams Number of General Lens parameters.
numLensParams Number of Lens parameters.
numberOfSources Number of Sources.

Referenced by createSurfaceMassDensity(), and simulation().

int main ( int  argc,
char **  argv 
)

Created By David Coss, 2007.

References DEBUG_PRINT, and super_main().

DString* paramParser ( const char *  fileName  ) 

This Method Parses Parameters from a text file and returns them as an entry in a DString Array.

Parses the Parameter DString Array.

The first three entries are the Number of General Parameters, Number of Lens Parameters and Number of Sources, respectively. So the total array size is (Number of General Parameters) + (Number of Lens Parameters) + 7*(Number of Sources)

Referenced by createSurfaceMassDensity(), and parseArgs().

int parseArgs ( int  argc,
char **  argv 
)

Parses arguments sent from command line.

Referenced by super_main().

DList<Double>* parseList ( const DString &  fileName,
double  extraParameter = -42 
)

Loads the mass density file.

Positions are in arcseconds.

References conversionFactor, and DEBUG_PRINT.

void saveDList ( DList< Double > *  list,
const DString  filename 
)

Save the given DList.

int simulation ( Plane< Double > *  lens,
Plane< Double > *  sources,
DensityProfile *  massDensity,
int  numberOfSources,
int  specificSource,
int  specificLens,
int  parameter1 
) throw (DavidException)

The main simulation routine.

This is the meat of the program. The actually does the ray tracing.

Parameters:
lens Plane<Double> representing the lens plane
sources Plane<Double> containing the source background images
massDensity DensityProfile containing the 2D mass density
numberOfSources int number of source planes to be lensed
specificSource int source to be run if only one source is used
specificLens int specific lens to be used if only one is used
parameter1 int option parameter (as of now, not used give it anything)
Returns:
int zero if successful
Exceptions:
DavidException Exception thrown upon error (if you're lucky)

Referenced by simulationSetup().

int simulationSetup (  ) 

Referenced by sub_main().

void squarePlane ( const char *  fileName  ) 

Takes the largest dimension of a Plane and makes it square.

Parameters:
fileName const char* name of file

Referenced by parseArgs().

int sub_main ( int  argc,
char **  argv 
)

Main start method.

Before this method is called arguments are parsed and then sent to sub_main

Referenced by super_main().

int super_main ( int  argc,
char **  argv 
)

Intermediate Main Method.

This method is called before sub_main. It acts as a way to route information whether it comes from main(int,char**) or BOINC

Referenced by main().

void verbosePrint ( DString  printString  ) 

bool writeParameters ( double *  params,
double *  lensParams,
double **  sourceParams,
int  numberOfSources 
)

writeParameters writes the parameters to 2 files: "human readable" file and a file which can be parsed by ray_trace

Writes Parameter info.

Referenced by simulation().

bool writeSourceInfo ( double **  sourceParams,
int  specificSource,
int  numberOfSources,
utils::DRandom *  randy,
bool  useRandom,
int  numberOfPixels 
)

writes the source info(eg location) to a text file.

Referenced by simulation().


Generated on Sat Feb 6 13:04:49 2010 by  doxygen 1.5.7.1