LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
home
lsstsw
stack
Linux64
meas_algorithms
11.0-2-gb8b8ce7
include
lsst
meas
algorithms
PcaPsf.h
Go to the documentation of this file.
1
// -*- lsst-c++ -*-
2
/*
3
* LSST Data Management System
4
* Copyright 2008-2013 LSST Corporation.
5
*
6
* This product includes software developed by the
7
* LSST Project (http://www.lsst.org/).
8
*
9
* This program is free software: you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation, either version 3 of the License, or
12
* (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
18
*
19
* You should have received a copy of the LSST License Statement and
20
* the GNU General Public License along with this program. If not,
21
* see <http://www.lsstcorp.org/LegalNotices/>.
22
*/
23
24
#ifndef LSST_MEAS_ALGORITHMS_PcaPsf_h_INCLUDED
25
#define LSST_MEAS_ALGORITHMS_PcaPsf_h_INCLUDED
26
27
#include "
lsst/meas/algorithms/KernelPsf.h
"
28
29
namespace
lsst {
namespace
meas {
namespace
algorithms {
30
34
class
PcaPsf
:
public
lsst::afw::table::io::PersistableFacade
<PcaPsf>,
public
KernelPsf
{
35
public
:
36
43
explicit
PcaPsf
(
44
PTR
(
afw::math::LinearCombinationKernel
) kernel,
45
afw::geom::Point2D
const
&
averagePosition
=
afw::geom::Point2D
()
46
);
47
49
virtual
PTR
(
afw::detection::Psf
)
clone
()
const
;
50
52
PTR
(
afw::math::LinearCombinationKernel
const
)
getKernel
()
const
;
53
54
private
:
55
56
// Name used in table persistence; the rest of is implemented by KernelPsf.
57
virtual
std::string
getPersistenceName
()
const
{
return
"PcaPsf"
; }
58
59
friend
class
boost::serialization::access
;
60
61
template
<
class
Archive>
62
void
serialize
(Archive&,
unsigned
int
const
) {
63
boost::serialization::void_cast_register<
PcaPsf
,
64
lsst::afw::detection::Psf
>(
static_cast<
PcaPsf*
>
(0), static_cast<lsst::afw::detection::Psf*>(0));
65
}
66
67
};
68
69
}}}
70
71
namespace
boost {
72
namespace
serialization {
73
74
template
<
class
Archive>
75
inline
void
save_construct_data
(
76
Archive& ar,
lsst::meas::algorithms::PcaPsf
const
* p,
77
unsigned
int
const
) {
78
lsst::afw::math::LinearCombinationKernel
const
* kernel = p->
getKernel
().get();
79
ar << make_nvp(
"kernel"
, kernel);
80
lsst::afw::geom::Point2D
averagePosition
= p->
getAveragePosition
();
81
ar << make_nvp(
"averagePositionX"
, averagePosition.getX());
82
ar << make_nvp(
"averagePositionY"
, averagePosition.getY());
83
}
84
85
template
<
class
Archive>
86
inline
void
load_construct_data
(
87
Archive& ar,
lsst::meas::algorithms::PcaPsf
* p,
88
unsigned
int
const
) {
89
lsst::afw::math::LinearCombinationKernel
* kernel;
90
ar >> make_nvp(
"kernel"
, kernel);
91
double
x
=0.0,
y
=0.0;
92
ar >> make_nvp(
"averagePositionX"
, x);
93
ar >> make_nvp(
"averagePositionY"
,
y
);
94
::new(p)
lsst::meas::algorithms::PcaPsf
(
PTR
(
lsst::afw::math::LinearCombinationKernel
)(kernel),
95
lsst::afw::geom::Point2D
(x,
y
));
96
}
97
98
}}
// namespace boost::serialization
99
100
#endif // !LSST_MEAS_ALGORITHMS_PcaPsf_h_INCLUDED
y
int y
Definition:
GaussianCentroid.cc:36
lsst::meas::algorithms::PcaPsf::getPersistenceName
virtual std::string getPersistenceName() const
Return the unique name used to persist this object and look up its factory.
Definition:
PcaPsf.h:57
lsst::meas::algorithms::KernelPsf
A Psf defined by a Kernel.
Definition:
KernelPsf.h:33
PTR
#define PTR(...)
Definition:
base.h:41
lsst::meas::algorithms::PcaPsf::access
friend class boost::serialization::access
Definition:
PcaPsf.h:59
lsst::meas::algorithms::PcaPsf
Represent a PSF as a linear combination of PCA (== Karhunen-Loeve) basis functions.
Definition:
PcaPsf.h:34
lsst::afw::geom::Point< double, 2 >
lsst::meas::algorithms::PcaPsf::getKernel
boost::shared_ptr< afw::math::LinearCombinationKernel const > getKernel() const
PcaPsf always has a LinearCombinationKernel, so we can override getKernel to make it more useful...
lsst::afw::math::LinearCombinationKernel
A kernel that is a linear combination of fixed basis kernels.
Definition:
Kernel.h:814
boost::serialization::load_construct_data
void load_construct_data(Archive &ar, lsst::afw::math::DeltaFunctionKernel *k, unsigned int const file_version)
Definition:
Kernel.h:1174
x
double x
Definition:
ChebyshevBoundedField.cc:305
KernelPsf.h
lsst::meas::algorithms::KernelPsf::getAveragePosition
virtual afw::geom::Point2D getAveragePosition() const
Return average position of stars; used as default position.
Definition:
KernelPsf.cc:24
lsst::meas::algorithms::PcaPsf::serialize
void serialize(Archive &, unsigned int const)
Definition:
PcaPsf.h:62
averagePosition
tbl::PointKey< double > averagePosition
Definition:
CoaddPsf.cc:328
lsst::meas::algorithms::PcaPsf::clone
virtual boost::shared_ptr< afw::detection::Psf > clone() const
Polymorphic deep copy; should usually be unnecessary as Psfs are immutable.x.
lsst::afw::detection::Psf
A polymorphic base class for representing an image's Point Spread Function.
Definition:
Psf.h:68
lsst::meas::algorithms::PcaPsf::PcaPsf
PcaPsf(boost::shared_ptr< afw::math::LinearCombinationKernel > kernel, afw::geom::Point2D const &averagePosition=afw::geom::Point2D())
Constructor for a PcaPsf.
lsst::afw::table::io::PersistableFacade
A CRTP facade class for subclasses of Persistable.
Definition:
Persistable.h:182
boost::serialization::save_construct_data
void save_construct_data(Archive &ar, lsst::afw::math::DeltaFunctionKernel const *k, unsigned int const file_version)
Definition:
Kernel.h:1160
Generated on Thu Sep 24 2015 02:29:20 for LSSTApplications by
1.8.5