12#include "overzier_source.h"
13#include "simpleTreeVec.h"
34 SourceMultiAnaGalaxy(PosType mag,PosType mag_bulge,
Band band,PosType zero_point, PosType Reff, PosType Rdisk, PosType PA, PosType inclination,PosType my_z,PosType *my_theta
42 PosType sb = galaxies[index].SurfaceBrightness(x);
43 if (sb < sb_limit)
return 0.;
48 PosType
getTotalFlux()
const {
return mag_to_flux(galaxies[index].getMag(),mag_zero_point);}
58 if(i < galaxies.size())
60 return galaxies[index];
66 if(i < galaxies.size())
68 return galaxies[index];
72 if(i < galaxies.size())
74 return galaxies[index];
78 return galaxies[index];
83 PosType
getZ()
const {
return galaxies[index].getZ();}
85 PosType getRadius()
const {
return galaxies[index].getRadius();}
87 void setZ(PosType my_z){ galaxies[index].setZ(my_z);}
88 void resetBand(
Band my_band){
89 for(
size_t i=0;i<galaxies.size();++i) galaxies[i].changeBand(my_band);
93 unsigned long getID(){
return galaxies[index].getID();}
99 void setTheta(PosType my_theta[2]){galaxies[index].setTheta(my_theta);}
100 void setTheta(PosType my_x,PosType my_y){galaxies[index].setTheta(my_x, my_y);}
103 std::size_t getNumberOfGalaxies()
const {
return galaxies.size();}
110 PosType
getFOV(){
return (rangex[1]-rangex[0])*(rangey[1]-rangey[0])*180*180/PI/PI;}
123 void findclosestonsky(PosType theta[],std::vector<PosType> &radius,std::vector<size_t> &indexes){
124 indexes.resize(radius.size());
130 void findonsky(PosType theta[],
float radius,std::list<size_t> &indexes){
137 void findnear(PosType theta[],
float radius,std::list<size_t> &indexes,PosType z_range[]){
143 for(std::list<size_t>::iterator itt = indexes.begin();
144 itt != indexes.end(); ++itt){
145 z = galaxies[*itt].getZ();
146 if(z < z_range[0] || z > z_range[1]){
148 if(itt != indexes.begin()) --itt;
164 std::vector<SourceOverzierPlus> galaxies;
166 std::string input_gal_file;
171 PosType rangex[2],rangey[2];
194 ,
double my_max_mag_limit
195 ,
double my_min_mag_limit
198 ,
double maximum_radius
202 void input(
const std::string &my_shapelets_folder
204 ,
double my_max_mag_limit
205 ,
double my_min_mag_limit
208 ,
double maximum_radius
217 PosType sb = galaxies[index].SurfaceBrightness(x);
218 if (sb < sb_limit)
return 0.;
223 std::size_t getNumberOfGalaxies()
const {
return galaxies.size();}
225 std::size_t
size()
const {
return galaxies.size();}
228 PosType
getTotalFlux()
const {
return mag_to_flux(galaxies[index].getMag(),mag_zero_point);}
233 void setTheta(PosType my_theta[2]){galaxies[index].setTheta(my_theta);}
234 void setTheta(PosType my_x,PosType my_y){galaxies[index].setTheta(my_x, my_y);}
238 PosType
getZ()
const {
return galaxies[index].getZ();}
240 PosType getRadius()
const {
return galaxies[index].getRadius();}
246 if(i < galaxies.size())
248 return galaxies[index];
250 size_t getIndex()
const {
return index;}
256 if(i < galaxies.size())
258 return galaxies[index];
262 return galaxies.back();
266 if(i < galaxies.size())
268 return galaxies[index];
272 return galaxies[index];
278 for (
int i = 0; i < galaxies.size(); i++)
279 galaxies[i].setActiveBand(band);
280 return galaxies[index];
289 return galaxies[index].id;
292 std::vector<SourceShapelets> galaxies;
304 std::string shapelets_folder;
Base class for all sources.
Definition source.h:44
PosType getZ() const
Redshift of source.
Definition source.h:100
Source(PosType r, Point_2d x, PosType z, PosType SBlimit, PosType zero_point)
shell constructor
Definition source.h:48
Source that represents an analytic galaxy surface brightness model. It encapsulates a OverzierSource ...
Definition sourceAnaGalaxy.h:32
void findonsky(PosType theta[], float radius, std::list< size_t > &indexes)
finds objects within radios of theta[] on umlensed sky.
Definition sourceAnaGalaxy.h:130
Point_2d getTheta() const
Return angular position of current source.
Definition sourceAnaGalaxy.h:97
void setTheta(PosType my_theta[2])
Set angular position of current source.
Definition sourceAnaGalaxy.h:99
PosType getTotalFlux() const
Total flux coming from the current galaxy in erg/sec/Hz/cm^2.
Definition sourceAnaGalaxy.h:48
SourceMultiAnaGalaxy(PosType mag, PosType mag_bulge, Band band, PosType zero_point, PosType Reff, PosType Rdisk, PosType PA, PosType inclination, PosType my_z, PosType *my_theta, Utilities::RandomNumbers_NR &ran)
Source model for a single analytic galaxy model.
Definition sourceAnaGalaxy.cpp:15
void sortInMag(Band tmp_band)
Sort the sources by magnitude in assending order.
Definition sourceAnaGalaxy.cpp:391
void findnear(PosType theta[], float radius, std::list< size_t > &indexes, PosType z_range[])
finds objects within radios of theta[] on unlensed sky and within a redshift range.
Definition sourceAnaGalaxy.h:137
void printSource()
Print info on current source parameters.
Definition sourceAnaGalaxy.cpp:430
void multiplier(PosType z, PosType mag_cut, int Multiplicity, Utilities::RandomNumbers_NR &ran)
Artificially increase the number of sources to increase the incidence of strong lenses.
Definition sourceAnaGalaxy.cpp:336
SourceOverzierPlus & operator[](std::size_t i)
The indexing operator can be used to change the "current" source that is returned when the surface br...
Definition sourceAnaGalaxy.h:65
void setZ(PosType my_z)
Set redshift of current source. Only changes the redshift while leaving position fixed.
Definition sourceAnaGalaxy.h:87
PosType SurfaceBrightness(const PosType *x) const
Surface brightness of current galaxy.
Definition sourceAnaGalaxy.h:41
PosType getZ() const
Return redshift of current source.
Definition sourceAnaGalaxy.h:83
PosType getFOV()
returns field-of-view in deg^2 assuming region is square
Definition sourceAnaGalaxy.h:110
void sortInRedshift()
Sort the sources by redshift in assending order.
Definition sourceAnaGalaxy.cpp:380
SourceOverzierPlus & setIndex(std::size_t i)
Used to change the "current" source that is returned when the surface brightness is subsequently call...
Definition sourceAnaGalaxy.h:57
std::size_t findclosestonsky(PosType theta[], PosType *radius)
Finds the closest source to the position theta[] on the sky in Cartesian distance....
Definition sourceAnaGalaxy.h:115
void sortInID()
Sort the sources by magnitude in assending order.
Definition sourceAnaGalaxy.cpp:413
void findclosestonsky(PosType theta[], std::vector< PosType > &radius, std::vector< size_t > &indexes)
finds closest sources to theta on umlensed sky. "radius" should have a size equal ti the number wante...
Definition sourceAnaGalaxy.h:123
Class for reading in and handling an array of SourceShapelets, made on the model of SourceMultiAnaGal...
Definition sourceAnaGalaxy.h:184
int locateZ(PosType z) const
If the sources are already sorted by redshift this will find the index of the first galaxy with redsh...
Definition sourceAnaGalaxy.h:284
SourceShapelets & operator[](std::size_t i)
Definition sourceAnaGalaxy.h:255
void printSource()
Print info on current source parameters.
Definition source.cpp:922
void sortInMag()
Sort the sources by magnitude in assending order.
Definition source.cpp:935
void sortInRedshift()
Sort the sources by redshift in assending order.
Definition source.cpp:927
PosType getTotalFlux() const
Total flux coming from the current galaxy in erg/sec/Hz/cm^2.
Definition sourceAnaGalaxy.h:228
void setTheta(PosType my_theta[2])
Set angular position of current source.
Definition sourceAnaGalaxy.h:233
std::size_t size() const
number of galaxies
Definition sourceAnaGalaxy.h:225
SourceShapelets & setIndex(std::size_t i)
Definition sourceAnaGalaxy.h:245
PosType getZ() const
Return redshift of current source.
Definition sourceAnaGalaxy.h:238
PosType SurfaceBrightness(const PosType *x) const
Surface brightness of current galaxy.
Definition sourceAnaGalaxy.h:216
Point_2d getTheta() const
Return angular position of current source.
Definition sourceAnaGalaxy.h:231
SourceShapelets & setBand(Band b, double zeropoint)
Sets the active band for all the objects.
Definition sourceAnaGalaxy.h:276
void input(const std::string &my_shapelets_folder, Band my_band, double my_max_mag_limit, double my_min_mag_limit, double my_z_max, double my_sb_limit, double maximum_radius, double zero_point)
Definition source.cpp:751
Adds some extra features to the SourceOverzier source like spiral arms, and randomizations.
Definition overzier_source.h:155
Class for sources described by shapelets.
Definition source.h:365
A tree for doing quick searches in multidimensional space. A pointer to an array of objects type T is...
Definition simpleTreeVec.h:22
void NearestNeighbor(D *ray, D &radius, IndexType &neighbor)
finds the nearest neighbors in whatever dimensions tree is defined in
Definition simpleTreeVec.h:531
void NearestNeighbors(D *ray, int Nneighbors, std::vector< D > &radii, std::vector< IndexType > &neighbors)
Finds the nearest N neighbors and puts their index numbers in an array, also returns the distance to ...
Definition simpleTreeVec.h:464
void PointsWithinCircle(D center[2], float radius, std::list< unsigned long > &neighborkist)
Finds the points within a circle around center and puts their index numbers in a list.
Definition simpleTreeVec.h:316
This is a class for generating random numbers. It simplifies and fool proofs initialization and allow...
Definition utilities_slsim.h:1059
long locate(const std::vector< T > &v, const T x)
Definition utilities.h:76
Class for representing points or vectors in 2 dimensions. Not that the dereferencing operator is over...
Definition point.h:48