LSSTApplications
10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
home
lsstsw
stack
Linux64
meas_algorithms
11.0.rc2+3
include
lsst
meas
algorithms
shapelet
FittedPsf.h
Go to the documentation of this file.
1
#ifndef FitPsf_H
2
#define FitPsf_H
3
4
#include <vector>
5
#include <iostream>
6
#include <memory>
7
8
#include "
lsst/meas/algorithms/shapelet/BVec.h
"
9
#include "
lsst/meas/algorithms/shapelet/Bounds.h
"
10
#include "
lsst/meas/algorithms/shapelet/ConfigFile.h
"
11
#include "
lsst/meas/algorithms/shapelet/dbg.h
"
12
13
namespace
lsst {
14
namespace
meas {
15
namespace
algorithms {
16
namespace
shapelet {
17
18
class
FittedPsfAtXY;
19
20
class
FittedPsf
{
21
22
public
:
23
24
#if 0
25
// Make from PsfCatalog
26
FittedPsf
(PsfCatalog& psfcat,
const
ConfigFile
& params, PsfLog&
log
);
27
#endif
28
29
// Setup FittedPsf, but don't assign to the values yet.
30
// Should be followed by either read or calculate.
31
FittedPsf
(
const
ConfigFile
& params);
32
33
int
getPsfOrder
()
const
{
return
_psfOrder
; }
34
int
getPsfSize
()
const
{
return
(
_psfOrder
+1)*(
_psfOrder
+2)/2; }
35
int
getFitOrder
()
const
{
return
_fitOrder
; }
36
int
getFitSize
()
const
{
return
_fitSize
; }
37
int
getNpca
()
const
{
return
_nPca
; }
38
double
getSigma
()
const
{
return
_sigma
; }
39
void
setSigma
(
double
sigma
) {
_sigma
=
sigma
; }
40
41
double
getXMin
()
const
{
return
_bounds
.
getXMin
(); }
42
double
getXMax
()
const
{
return
_bounds
.
getXMax
(); }
43
double
getYMin
()
const
{
return
_bounds
.
getYMin
(); }
44
double
getYMax
()
const
{
return
_bounds
.
getYMax
(); }
45
const
Bounds
&
getBounds
()
const
{
return
_bounds
; }
46
47
#if 0
48
void
write()
const
;
49
void
writeAscii(std::string
file
)
const
;
50
void
writeFits(std::string
file
)
const
;
51
void
writeFitsOld(std::string
file
)
const
;
52
53
void
read();
54
void
read(std::string
file
);
55
void
readAscii(std::string
file
);
56
void
readFits(std::string
file
);
57
#endif
58
59
void
calculate
(
60
const
std::vector<Position>& pos,
61
const
std::vector<BVec>& psf,
62
const
std::vector<double>& nu,
63
std::vector<long>& flags);
64
65
void
interpolate
(
Position
pos,
BVec
&
b
)
const
66
{
67
Assert
(
_avePsf
.get());
68
//Assert(_mV.get());
69
Assert
(b.
getOrder
() ==
_psfOrder
);
70
Assert
(static_cast<int>(b.
size
()) ==
_avePsf
->size());
71
b.
setSigma
(
_sigma
);
72
interpolateVector
(pos,
TMV_vview
(b.
vec
()));
73
}
74
75
double
interpolateSingleElement
(
Position
pos,
int
i)
const
;
76
77
// This next construct with FittedPsfAtXY allows you to write:
78
// b = psf(pos);
79
// instead of:
80
// psf.interpolate(pos,b);
81
// Both do the same thing. I just like the first notation better.
82
friend
class
FittedPsfAtXY
;
83
inline
FittedPsfAtXY
operator()
(
Position
pos)
const
;
// below...
84
85
BVec
getMean
()
const
;
86
87
private
:
88
89
void
interpolateVector
(
Position
pos,
DVectorView
b
)
const
;
90
91
const
ConfigFile
&
_params
;
92
93
int
_psfOrder
;
94
double
_sigma
;
95
int
_fitOrder
;
96
int
_fitSize
;
97
int
_nPca
;
98
Bounds
_bounds
;
99
std::auto_ptr<DVector>
_avePsf
;
100
#if USE_TMV
101
std::auto_ptr<tmv::Matrix<double,tmv::RowMajor> > _mV;
102
#else
103
std::auto_ptr<DMatrix>
_mV_transpose
;
104
#endif
105
std::auto_ptr<DMatrix>
_f
;
106
};
107
108
class
FittedPsfAtXY
:
public
AssignableToBVec
109
{
110
111
public
:
112
113
FittedPsfAtXY
(
const
FittedPsf
& psf,
Position
pos) :
114
_psf
(psf),
_pos
(pos)
115
{}
116
117
size_t
size
()
const
{
return
_psf
.
_avePsf
->size(); }
118
int
getOrder
()
const
{
return
_psf
.
getPsfOrder
(); }
119
double
getSigma
()
const
{
return
_psf
.
getSigma
(); }
120
121
void
assignTo
(
BVec
&
b
)
const
122
{
_psf
.
interpolate
(
_pos
,b); }
123
124
private
:
125
126
const
FittedPsf
&
_psf
;
127
Position
_pos
;
128
};
129
130
inline
FittedPsfAtXY
FittedPsf::operator()
(
Position
pos)
const
131
{
return
FittedPsfAtXY
(*
this
,pos); }
132
133
}}}}
134
135
#endif
lsst::meas::algorithms::shapelet::DVectorView
Eigen::Block< DVector, Eigen::Dynamic, 1 > DVectorView
Definition:
MyMatrix.h:130
lsst::meas::algorithms::shapelet::FittedPsf::setSigma
void setSigma(double sigma)
Definition:
FittedPsf.h:39
lsst::meas::algorithms::shapelet::FittedPsfAtXY::assignTo
void assignTo(BVec &b) const
Definition:
FittedPsf.h:121
lsst::meas::algorithms::shapelet::BVec::getOrder
int getOrder() const
Definition:
BVec.h:64
TMV_vview
#define TMV_vview(v)
Definition:
MyMatrix.h:202
lsst::meas::algorithms::shapelet::FittedPsf::getYMin
double getYMin() const
Definition:
FittedPsf.h:43
lsst::meas::algorithms::shapelet::FittedPsf::calculate
void calculate(const std::vector< Position > &pos, const std::vector< BVec > &psf, const std::vector< double > &nu, std::vector< long > &flags)
Definition:
FittedPsf.cc:83
lsst::meas::algorithms::shapelet::FittedPsf::_params
const ConfigFile & _params
Definition:
FittedPsf.h:91
lsst::meas::algorithms::shapelet::BVec::vec
DVector & vec()
Definition:
BVec.h:59
lsst::meas::algorithms::shapelet::FittedPsf::getBounds
const Bounds & getBounds() const
Definition:
FittedPsf.h:45
lsst::meas::algorithms::shapelet::BVec::size
size_t size() const
Definition:
BVec.h:67
lsst::meas::algorithms::shapelet::FittedPsf::getXMin
double getXMin() const
Definition:
FittedPsf.h:41
lsst::meas::algorithms::shapelet::FittedPsfAtXY::getOrder
int getOrder() const
Definition:
FittedPsf.h:118
lsst::meas::algorithms::shapelet::FittedPsf::FittedPsf
FittedPsf(const ConfigFile ¶ms)
Definition:
FittedPsf.cc:309
lsst::meas::algorithms::shapelet::Bounds
Definition:
Bounds.h:84
lsst::meas::algorithms::shapelet::FittedPsf::getMean
BVec getMean() const
lsst::meas::algorithms::shapelet::FittedPsf::FittedPsfAtXY
friend class FittedPsfAtXY
Definition:
FittedPsf.h:82
lsst::meas::algorithms::shapelet::FittedPsfAtXY::_psf
const FittedPsf & _psf
Definition:
FittedPsf.h:126
lsst::meas::algorithms::shapelet::FittedPsf::interpolate
void interpolate(Position pos, BVec &b) const
Definition:
FittedPsf.h:65
lsst::meas::algorithms::shapelet::FittedPsf::_avePsf
std::auto_ptr< DVector > _avePsf
Definition:
FittedPsf.h:99
lsst::meas::algorithms::shapelet::FittedPsf::interpolateSingleElement
double interpolateSingleElement(Position pos, int i) const
Definition:
FittedPsf.cc:315
sigma
afw::table::Key< double > sigma
Definition:
GaussianPsf.cc:43
dbg.h
lsst::meas::algorithms::shapelet::Bounds::getYMin
double getYMin() const
Definition:
Bounds.h:116
lsst::meas::algorithms::shapelet::FittedPsf::operator()
FittedPsfAtXY operator()(Position pos) const
Definition:
FittedPsf.h:130
lsst.log.log.log
def log
Definition:
log.py:85
lsst::meas::algorithms::shapelet::BVec
Definition:
BVec.h:25
BVec.h
lsst::meas::algorithms::shapelet::Bounds::getYMax
double getYMax() const
Definition:
Bounds.h:118
Bounds.h
lsst::meas::algorithms::shapelet::Position
Definition:
Bounds.h:12
lsst::meas::algorithms::shapelet::FittedPsf::_nPca
int _nPca
Definition:
FittedPsf.h:97
lsst::meas::algorithms::shapelet::FittedPsfAtXY::getSigma
double getSigma() const
Definition:
FittedPsf.h:119
lsst::meas::algorithms::shapelet::BVec::setSigma
void setSigma(double sigma)
Definition:
BVec.h:69
lsst::meas::algorithms::shapelet::Bounds::getXMin
double getXMin() const
Definition:
Bounds.h:112
lsst::meas::algorithms::shapelet::FittedPsf
Definition:
FittedPsf.h:20
lsst::meas::algorithms::shapelet::FittedPsf::_f
std::auto_ptr< DMatrix > _f
Definition:
FittedPsf.h:105
ConfigFile.h
lsst::meas::algorithms::shapelet::FittedPsf::getXMax
double getXMax() const
Definition:
FittedPsf.h:42
lsst::meas::algorithms::shapelet::FittedPsf::interpolateVector
void interpolateVector(Position pos, DVectorView b) const
Definition:
FittedPsf.cc:332
lsst::meas::algorithms::shapelet::FittedPsf::getPsfSize
int getPsfSize() const
Definition:
FittedPsf.h:34
lsst::meas::algorithms::shapelet::FittedPsfAtXY::size
size_t size() const
Definition:
FittedPsf.h:117
lsst::meas::algorithms::shapelet::FittedPsf::_mV_transpose
std::auto_ptr< DMatrix > _mV_transpose
Definition:
FittedPsf.h:103
lsst::meas::algorithms::shapelet::FittedPsf::_sigma
double _sigma
Definition:
FittedPsf.h:94
lsst::meas::algorithms::shapelet::FittedPsf::_fitOrder
int _fitOrder
Definition:
FittedPsf.h:95
lsst::meas::algorithms::shapelet::FittedPsf::getPsfOrder
int getPsfOrder() const
Definition:
FittedPsf.h:33
lsst::meas::algorithms::shapelet::FittedPsf::getYMax
double getYMax() const
Definition:
FittedPsf.h:44
lsst::meas::algorithms::shapelet::FittedPsf::_bounds
Bounds _bounds
Definition:
FittedPsf.h:98
lsst::meas::algorithms::shapelet::Bounds::getXMax
double getXMax() const
Definition:
Bounds.h:114
b
afw::table::Key< double > b
Definition:
DoubleGaussianPsf.cc:49
lsst::meas::algorithms::shapelet::FittedPsf::getFitSize
int getFitSize() const
Definition:
FittedPsf.h:36
lsst::meas::algorithms::shapelet::FittedPsf::getNpca
int getNpca() const
Definition:
FittedPsf.h:37
lsst::meas::algorithms::shapelet::FittedPsfAtXY::_pos
Position _pos
Definition:
FittedPsf.h:127
lsst::meas::algorithms::shapelet::FittedPsfAtXY::FittedPsfAtXY
FittedPsfAtXY(const FittedPsf &psf, Position pos)
Definition:
FittedPsf.h:113
lsst::meas::algorithms::shapelet::FittedPsfAtXY
Definition:
FittedPsf.h:108
lsst::meas::algorithms::shapelet::FittedPsf::_fitSize
int _fitSize
Definition:
FittedPsf.h:96
lsstimport.file
file
Definition:
lsstimport.py:116
lsst::meas::algorithms::shapelet::FittedPsf::getFitOrder
int getFitOrder() const
Definition:
FittedPsf.h:35
lsst::meas::algorithms::shapelet::FittedPsf::getSigma
double getSigma() const
Definition:
FittedPsf.h:38
Assert
#define Assert(x)
Definition:
dbg.h:73
lsst::meas::algorithms::shapelet::ConfigFile
Definition:
ConfigFile.h:239
lsst::meas::algorithms::shapelet::AssignableToBVec
Definition:
BVec.h:16
lsst::meas::algorithms::shapelet::FittedPsf::_psfOrder
int _psfOrder
Definition:
FittedPsf.h:93
Generated on Wed Sep 16 2015 13:35:30 for LSSTApplications by
1.8.5