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];
 
   77 SourceOverzierPlus& CurrentGalaxy(){
 
   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);}
 
  101  void setTheta(
const Point_2d &p){galaxies[index].setTheta(p);}
 
  103 std::size_t getNumberOfGalaxies()
 const {
return galaxies.size();}
 
  105 void multiplier(PosType z,PosType mag_cut,
int Multiplicity,Utilities::RandomNumbers_NR &ran);
 
  110  PosType 
getFOV(){
return (rangex[1]-rangex[0])*(rangey[1]-rangey[0])*180*180/PI/PI;}
 
  117    searchtree->NearestNeighbor(theta,*radius,index);
 
 
  123  void findclosestonsky(PosType theta[],std::vector<PosType> &radius,std::vector<size_t> &indexes){
 
  124    indexes.resize(radius.size());
 
  125    searchtree->NearestNeighbors(theta,radius.size(),radius,indexes);
 
 
  130  void findonsky(PosType theta[],
float radius,std::list<size_t> &indexes){
 
  132    searchtree->PointsWithinCircle(theta,radius,indexes);
 
 
  137  void findnear(PosType theta[],
float radius,std::list<size_t> &indexes,PosType z_range[]){
 
  139    searchtree->PointsWithinCircle(theta,radius,indexes);
 
  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;
 
  165  TreeSimpleVec<SourceOverzierPlus> *searchtree;
 
  166 std::string input_gal_file;
 
  168 void readDataFileMillenn(std::map<Band,double> zeropoints,Utilities::RandomNumbers_NR &ran);
 
  169 void assignParams(InputParams& params);
 
  171  PosType rangex[2],rangey[2];
 
 
  184class SourceMultiShapelets: 
public Source{
 
  189  SourceMultiShapelets(
double mag_zero_point):
Source(0,
Point_2d(0,0),0,-1,mag_zero_point){};
 
  192  SourceMultiShapelets(
const std::string &my_shapelets_folder  
 
  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   
 
  212  ~SourceMultiShapelets();
 
  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);}
 
  235  void setTheta(
const Point_2d &p){galaxies[index].setTheta(p);}
 
  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();
 
  265 const SourceShapelets& 
operator[] (std::size_t i)
 const {
 
  266  if(i < galaxies.size())
 
  268  return galaxies[index];
 
  271 SourceShapelets& CurrentGalaxy(){
 
  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;
 
  295 void assignParams(InputParams& params);
 
  304 std::string shapelets_folder;
 
 
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
 
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
 
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