8 #include <countedref.h>
32 class PhotomModel :
public RefCount
35 virtual ~PhotomModel() {}
37 virtual bool isRef(
CcdImage const&)
const=0;
38 virtual unsigned int NScaleFactors()
const=0;
39 virtual unsigned int PhotFactIndex(
CcdImage const&)
const=0;
40 virtual double GetPhotFact(
CcdImage const&)
const=0;
41 virtual std::vector<double> GetPhotFactors()
const = 0;
42 virtual std::vector<double> GetPhotFactErrors()
const = 0;
44 virtual double GetPhotFact(
unsigned int index)
const=0;
45 virtual void SetPhotFact(
unsigned int index,
double fact,
double efact)=0;
46 virtual unsigned int CcdNum(
unsigned int index)
const=0;
53 class OneGlobalScalePerCCD :
public PhotomModel
56 OneGlobalScalePerCCD(std::map<unsigned int,double>& refscales);
57 virtual ~OneGlobalScalePerCCD() {}
59 virtual bool isRef(
CcdImage const&)
const;
60 virtual unsigned int NScaleFactors()
const;
61 virtual unsigned int PhotFactIndex(
CcdImage const&)
const;
62 virtual double GetPhotFact(
CcdImage const&)
const;
63 virtual std::vector<double> GetPhotFactors()
const;
64 virtual std::vector<double> GetPhotFactErrors()
const;
66 virtual double GetPhotFact(
unsigned int index)
const;
67 virtual void SetPhotFact(
unsigned int index,
double fact,
double efact);
68 virtual unsigned int CcdNum(
unsigned int index)
const;
72 unsigned int nscfact_;
73 std::vector<unsigned int> refccds_;
74 std::map<unsigned int,double> refscales_;
75 std::vector<double> scalefactors_;
76 std::vector<double> scalefacterrors_;
77 std::map<unsigned int, unsigned int> ccd_;
78 std::map<unsigned int, unsigned int> indexes_;
91 bool Minimize(
const int MaxIter);
94 void RemoveOutliers(
const double NSigCut);
97 CcdImageList
const& GetCcdImageList()
const {
return ccdImageList_; }
103 double ComputeChi2();
106 PhotomModel& Model() {
return model_; }
107 PhotomModel
const& Model()
const {
return model_; }
111 int NValidFittedStars()
const {
return nfstars_; }
114 void DumpFluxScales(
const std::string& pattern)
const;
117 void SaveResults(
const std::string& pattern)
const;
123 void update_star_fluxes();
126 void update_scale_factors();
129 int used_fittedstars();
133 void loop_on_measurements(CcdImageList&, Op& );
140 CcdImageList refCcds_;
141 CcdImageList otherCcds_;
142 CcdImageList ccdImageList_;
144 unsigned int nfstars_;
145 unsigned int nfmeasurements_;
146 unsigned int nrefmeasurements_;
147 unsigned int nfluxscales_;
150 double measuredChi2_;
A list of FittedStar s. Such a list is typically constructed by Associations.
Definition: fittedstar.h:158
The class that implements the relations between MeasuredStar and FittedStar.
Definition: associations.h:17
handler of an actual image from a single CCD
Definition: ccdimage.h:21