mass_to_shear.h File Reference

#include <iostream>
#include <fstream>
#include <math.h>
#include "DString.h"
#include "Double.h"
#include "DRandom.h"
#include "glshear.h"
#include "Complex.cpp"
#include "densityprofile.h"
#include "StringTokenizer.h"
#include "planecreator.cpp"
#include "mydaemon.cpp"
#include "DList.cpp"
#include "DNode.cpp"

Go to the source code of this file.

Defines

#define VERBOSE_PRINT(x)
#define DEBUG_PRINT

Functions

template<class T >
void buildSource (Plane< T > *, double *sourceParams, T)
 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.
int sub_main (int argc, char **argv)
 Main start method.
int super_main (int argc, char **argv)
 Intermediate Main Method.
bool writeParameters (double *params, double *lensParams, double **sourceParams, int numberOfSources)
 Writes Parameter info.
int simulation (Plane< Double > *lens, Plane< Double > *sources, DensityProfile *massDensity, int numberOfSources, int specificSource, int specificLens, int parameter1) throw (DavidException)
 The main simulation routine.
bool createLensParams (double *lensParams, int specificLens)
 Creates parameters for a lens to be used in the simulation.
int simulationSetup ()
int parseArgs (int argc, char **argv)
 Parses arguments sent from command line.
DString * paramParser (const char *fileName)
 Parses the Parameter DString Array.
void loadParameters (double *params, double *lensParams, double **sourceParams, int numParams, int numLensParams, int numberOfSources)
 Reads the Parameters from the Parameters file.
DList< Double > * parseList (const DString &fileName, double extraParameter=-42)
 Loads the mass density file.
DString getTime ()
 Returns a DString containing the current time.
void squarePlane (const char *fileName)
 Takes the largest dimension of a Plane and makes it square.
void saveDList (DList< Double > *list, const DString filename)
 Save the given DList.
void drawEllipse (const char *parameters)
void verbosePrint (DString string)
void verbosePrint (const char *string)
void verbosePrint (double string)

Variables

DString fileNamePrefix
 prefix of files created in the simulation
utils::DRandom * randy
 Random number Generator.
bool includeCricalCurveAndCaustic
 Whether Critical Curves and Caustics should be used.
Plane< math::Complex > * shearPlane
char * lensMassShearPlane
char * sourceBMPFilename
bool runExistingShear
bool createShear
bool runSim
DString mainPrefix
bool runAsDaemon
int gridSpace
double windowValue
double conversionFactor
int overallParamNumber
DString * parameterArray
Plane< Double > * lensMassDensity
int * glellipseBounds
bool useTimeStamp
bool drawRemovedArea
double * offset


Define Documentation

#define DEBUG_PRINT

#define VERBOSE_PRINT (  ) 


Function Documentation

template<class T >
void buildSource ( Plane< T > *  ,
double *  sourceParams,
 
) [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.

void drawEllipse ( const char *  parameters  ) 

DString getTime (  ) 

Returns a DString containing the current time.

Format: Wed May 16 16:44:42 2007

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.

DString* paramParser ( const char *  fileName  ) 

Parses the Parameter DString Array.

Parameters:
filename 
Returns:
DString*
See also:
loadParameters(double * params,double * lensParams,double ** sourceParams,int numParams, int numLensParams, int numberOfSources)
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)

int parseArgs ( int  argc,
char **  argv 
)

Parses arguments sent from command line.

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)

int simulationSetup (  ) 

void squarePlane ( const char *  fileName  ) 

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

Parameters:
fileName const char* name of file

int sub_main ( int  argc,
char **  argv 
)

Main start method.

Before this method is called arguments are parsed and then sent to sub_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

void verbosePrint ( double  string  ) 

References verbosePrint().

void verbosePrint ( const char *  string  ) 

void verbosePrint ( DString  string  ) 

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

Writes Parameter info.

Writes all of the parameters to two text files: one that the simulator can re-read and one that is better formatted for people.

Parameters:
params General Parameters.
lensParams Lens Parameters.
sourceParams Array of Parameters for each source
numberOfSources. 
Returns:
bool true if writing was successful.

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.


Variable Documentation

Referenced by parseList(), and super_main().

Referenced by parseArgs(), and simulation().

Referenced by parseArgs(), and super_main().

DString fileNamePrefix

prefix of files created in the simulation

Referenced by simulationSetup(), writeParameters(), and writeSourceInfo().

int gridSpace

Whether Critical Curves and Caustics should be used.

Referenced by simulation(), and writeParameters().

Plane<Double>* lensMassDensity

Referenced by parseArgs(), and simulation().

DString mainPrefix

double* offset

Referenced by parseArgs(), simulation(), and super_main().

Referenced by paramParser().

DString* parameterArray

utils::DRandom* randy

Random number Generator.

Referenced by Create_Cluster::resetRandom(), simulation(), and simulationSetup().

Referenced by parseArgs(), and simulation().

bool runSim

Referenced by parseArgs(), and simulation().

Plane<math::Complex>* shearPlane

Referenced by simulation(), and simulationSetup().

double windowValue

Referenced by parseArgs(), and super_main().


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