ImageFitterResults.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef IMAGEANALYSIS_IMAGEFITTERRESULTS_H
00027 #define IMAGEANALYSIS_IMAGEFITTERRESULTS_H
00028
00029 #include <casa/Quanta/Quantum.h>
00030 #include <components/ComponentModels/ComponentList.h>
00031
00032 #include <imageanalysis/ImageTypedefs.h>
00033
00034 namespace casa {
00035
00036 template<class T> class Vector;
00037
00038 class ImageFitterResults {
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 public:
00062
00063 enum CompListWriteControl {
00064 NO_WRITE,
00065 WRITE_NO_REPLACE,
00066 OVERWRITE
00067 };
00068
00069 ImageFitterResults() = delete;
00070
00071 ImageFitterResults(SPCIIF image, SHARED_PTR<LogIO> log);
00072
00073 ~ImageFitterResults();
00074
00075 void setChannels(Vector<uInt> chans) { _channels = chans; }
00076
00077 void setConvolvedList(const ComponentList& list) {
00078 _convolvedList = list;
00079 }
00080
00081 void setDeconvolvedList(const ComponentList& list) {
00082 _deconvolvedList = list;
00083 }
00084
00085 void setPeakIntensities(const Vector<Quantity>& p) {
00086 _peakIntensities.assign(p);
00087 }
00088
00089 void setPeakIntensityErrors(const Vector<Quantity>& m) {
00090 _peakIntensityErrors.assign(m);
00091 }
00092 void setMajorAxes(const Vector<Quantity>& m) {
00093 _majorAxes = m;
00094 }
00095
00096 void setMinorAxes(const Vector<Quantity>& m) {
00097 _minorAxes = m;
00098 }
00099
00100 void setPositionAngles(const Vector<Quantity>& m) {
00101 _positionAngles = m;
00102 }
00103
00104 void setFluxDensities(const Vector<Quantity>& m) {
00105 _fluxDensities.assign(m);
00106 }
00107
00108 void setFluxDensityErrors(const Vector<Quantity>& m) {
00109 _fluxDensityErrors.assign(m);
00110 }
00111
00112 void writeNewEstimatesFile(const String& filename) const;
00113
00114 void writeCompList(
00115 ComponentList& list, const String& compListName,
00116 CompListWriteControl writeControl
00117 ) const;
00118
00119 String resultsHeader(
00120 const String& chans, const Vector<uInt>& chanVec,
00121 const String& region, const String& mask,
00122 SHARED_PTR<std::pair<Float, Float> > includePixelRange,
00123 SHARED_PTR<std::pair<Float, Float> > excludePixelRange,
00124 const String& estimates
00125 ) const;
00126
00127 static vector<String> unitPrefixes(Bool includeC);
00128
00129 void setStokes(const String& s) { _stokes = s; }
00130
00131 String fluxToString(uInt compNumber, Bool hasBeam) const;
00132
00133 void setFixed(const Vector<String>& s) { _fixed = s; }
00134
00135 void writeSummaryFile(const String& filename, const CoordinateSystem& csys) const;
00136
00137 private:
00138 SPCIIF _image;
00139 SHARED_PTR<LogIO> _log;
00140 ComponentList _convolvedList{}, _deconvolvedList{};
00141 Vector<Quantity> _peakIntensities, _peakIntensityErrors,
00142 _majorAxes, _minorAxes,
00143 _positionAngles, _fluxDensities, _fluxDensityErrors;
00144 String _bUnit, _stokes;
00145 Vector<String> _fixed;
00146 Vector<uInt> _channels{};
00147 const static String _class;
00148 static std::vector<String> _prefixes, _prefixesWithCenti;
00149 };
00150 }
00151
00152 #endif