CARMA C++
PtSrcGen.h
Go to the documentation of this file.
1 // $Id: PtSrcGen.h,v 1.1 2010/12/13 21:06:31 eml Exp $
2 
3 #ifndef SZA_UTIL_PTSRCGEN_H
4 #define SZA_UTIL_PTSRCGEN_H
5 
15 #include "carma/szautil/Angle.h"
16 #include "carma/szautil/Flux.h"
18 
19 #include <vector>
20 
21 namespace sza {
22  namespace util {
23 
24  class PtSrcGen {
25  public:
26 
30  PtSrcGen();
31 
35  virtual ~PtSrcGen();
36 
37  //------------------------------------------------------------
38  // Set the dN/dS to use, as a power law.
39  //
40  // Note I use the convention:
41  //
42  // dN -gamma
43  // --------- = k S
44  // dS dOmega
45 
46  void setDnDs(double k, double gamma, Flux fu, SolidAngle au);
47 
48  // Set the dN/dS to use, as a user-specified function x = flux, y = num
49 
50  void setDnDs(std::vector<double> flux, std::vector<double> num,
51  const Flux::Jansky& fluxUnit,
52  const SolidAngle::Steradians& angleUnit);
53 
54  unsigned getNSrc(Flux& fluxMin, SolidAngle& area, bool doRand=true);
55  unsigned getNSrc(Flux& fluxMin, Flux& fluxMax, SolidAngle& area, bool doRand=true);
56 
57  // Generate a list of sources drawn from the specified
58  // distribution, within the specified solid angle
59 
60  std::vector<Flux> generateSources(Flux fluxMin, SolidAngle sr, bool doRand=true);
61  std::vector<Flux> generateSources(Flux fluxMin, Flux fluxMax, SolidAngle sr, bool doRand=true);
62 
63  // Generate a list of source fluxes and positions within the
64  // specified x/y box
65 
66  void generateSources(Flux fluxMin, Angle x, Angle y,
67  std::vector<Flux>& srcFlux,
68  std::vector<Angle>& srcX,
69  std::vector<Angle>& srcY,
70  bool doRand=true);
71 
72  void generateSources(Flux fluxMin, Flux fluxMax, Angle x, Angle y,
73  std::vector<Flux>& srcFlux,
74  std::vector<Angle>& srcX,
75  std::vector<Angle>& srcY,
76  bool doRand=true);
77 
78 
79  private:
80 
81  bool dNdSIsSet_;
82  double k_;
83  double gamma_;
84 
85  SolidAngle au_;
86  Flux fu_;
87 
88  }; // End class PtSrcGen
89 
90  } // End namespace util
91 } // End namespace sza
92 
93 
94 
95 #endif // End #ifndef SZA_UTIL_PTSRCGEN_H
Tagged: Wed Sep 14 17:52:22 PDT 2005.
Tagged: Wed Sep 14 17:14:39 PDT 2005.