lsst.jointcal
g29ae962dfc+02fd6c6d17
Toggle main menu visibility
Loading...
Searching...
No Matches
src
ProperMotion.cc
Go to the documentation of this file.
1
// -*- LSST-C++ -*-
2
/*
3
* This file is part of jointcal.
4
*
5
* Developed for the LSST Data Management System.
6
* This product includes software developed by the LSST Project
7
* (https://www.lsst.org).
8
* See the COPYRIGHT file at the top-level directory of this distribution
9
* for details of code ownership.
10
*
11
* This program is free software: you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation, either version 3 of the License, or
14
* (at your option) any later version.
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
20
*
21
* You should have received a copy of the GNU General Public License
22
* along with this program. If not, see <https://www.gnu.org/licenses/>.
23
*/
24
25
#include <cmath>
26
#include <iostream>
27
#include "
lsst/geom/SpherePoint.h
"
28
#include "
lsst/jointcal/ProperMotion.h
"
29
#include "
lsst/jointcal/Point.h
"
30
31
namespace
lsst
{
32
namespace
jointcal
{
33
34
Point
ProperMotion::apply
(
const
Point
& star,
double
timeDeltaYears)
const
{
35
geom::SpherePoint
spherePoint(star.
x
, star.
y
,
geom::degrees
);
36
double
amount =
std::hypot
(_ra * timeDeltaYears, _dec * timeDeltaYears);
37
// If delta-time is negative, the correction is in the opposite direction.
38
amount = timeDeltaYears < 0 ? -amount : amount;
39
auto
result = spherePoint.offset(_offsetBearing *
geom::radians
, amount *
geom::radians
);
40
Point
newStar(star);
41
newStar.
x
= result.getRa().asDegrees();
42
newStar.
y
= result.getDec().asDegrees();
43
return
newStar;
44
}
45
46
std::ostream
&
operator<<
(
std::ostream
&stream,
ProperMotion
const
&pm) {
47
stream <<
"pm_ra*cos(dec)="
<< pm._ra <<
"rad/yr, pm_dec="
<< pm._dec <<
"rad/yr, pm_raErr="
<< pm._raErr
48
<<
"rad/yr, pm_decErr="
<< pm._decErr <<
"rad/yr, pm_raDecCov="
<< pm._raDecCov;
49
return
stream;
50
}
51
52
}
// namespace jointcal
53
}
// namespace lsst
Point.h
ProperMotion.h
SpherePoint.h
std::ostream
lsst::geom::SpherePoint
lsst::jointcal::Point
A point in a plane.
Definition
Point.h:37
lsst::jointcal::Point::x
double x
coordinate
Definition
Point.h:42
lsst::jointcal::Point::y
double y
Definition
Point.h:42
lsst::jointcal::ProperMotion::apply
Point apply(const Point &star, double timeDeltaYears) const
Apply proper motion correction to the input star, returning a star with PM-corrected coordinates.
Definition
ProperMotion.cc:34
lsst::jointcal::ProperMotion::ProperMotion
ProperMotion(double ra, double dec, double raErr, double decErr, double raDecCov=0)
Definition
ProperMotion.h:47
std::hypot
T hypot(T... args)
lsst::geom::degrees
AngleUnit constexpr degrees
lsst::geom::radians
AngleUnit constexpr radians
lsst::jointcal
Definition
Associations.h:50
lsst::jointcal::operator<<
std::ostream & operator<<(std::ostream &stream, AstrometryMapping const &mapping)
Definition
AstrometryMapping.h:78
lsst
Generated on
for lsst.jointcal by
1.17.0