lsst.jointcal
g29ae962dfc+02fd6c6d17
Toggle main menu visibility
Loading...
Searching...
No Matches
include
lsst
jointcal
BaseStar.h
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
#ifndef LSST_JOINTCAL_BASE_STAR_H
26
#define LSST_JOINTCAL_BASE_STAR_H
27
28
#include <iostream>
29
#include <iomanip>
30
#include <cstdio>
31
#include <string>
32
#include <sstream>
33
34
#include "
lsst/cpputils/Magnitude.h
"
35
#include "
lsst/jointcal/FatPoint.h
"
36
#include "
lsst/jointcal/StarList.h
"
37
38
namespace
lsst
{
39
namespace
jointcal
{
40
41
namespace
{
42
44
double
magErrFromFluxErr(
double
instFlux,
double
instFluxErr) {
45
return
2.5 /
std::log
(10) * (instFluxErr / instFlux);
46
}
47
48
}
// namespace
49
51
class
BaseStar
:
public
FatPoint
{
52
public
:
53
BaseStar
() {
54
x
= 0;
55
y
= 0;
56
_flux
= 0;
57
};
58
59
BaseStar
(
double
xx,
double
yy,
double
flux,
double
fluxErr)
60
:
FatPoint
(xx, yy),
61
_flux
(flux),
62
_fluxErr
(fluxErr),
63
_mag
(
cpputils
::nanojanskyToABMagnitude(flux)),
64
_magErr
(magErrFromFluxErr(flux, fluxErr)){};
65
BaseStar
(
Point
const
&point,
double
flux,
double
fluxErr,
double
mag,
double
magErr)
66
:
FatPoint
(point),
67
_flux
(flux),
68
_fluxErr
(fluxErr),
69
_mag
(
cpputils
::nanojanskyToABMagnitude(flux)),
70
_magErr
(magErrFromFluxErr(flux, fluxErr)){};
71
73
double
getX
()
const
{
return
x
; }
75
double
getY
()
const
{
return
y
; }
76
78
friend
std::ostream
&
operator<<
(
std::ostream
&stream,
BaseStar
const
&s) {
79
s.
print
(stream);
80
return
stream;
81
}
82
83
virtual
void
print
(
std::ostream
&out)
const
{
84
FatPoint::print
(out);
85
out <<
" flux: "
<<
std::setprecision
(9) <<
_flux
<<
" fluxErr: "
<<
_fluxErr
;
86
}
87
88
BaseStar
&
operator=
(
Point
const
&point) {
89
x
= point.
x
;
90
y
= point.
y
;
91
return
(*
this
);
92
};
93
94
static
const
char
*
typeName
() {
return
"BaseStar"
; }
95
96
virtual
~BaseStar
() =
default
;;
97
98
double
getFlux
()
const
{
return
_flux
; }
99
double
&
getFlux
() {
return
_flux
; }
100
void
setFlux
(
double
flux) {
_flux
= flux; }
101
102
double
getFluxErr
()
const
{
return
_fluxErr
; }
103
void
setFluxErr
(
double
fluxErr) {
_fluxErr
= fluxErr; }
104
105
double
getMag
()
const
{
return
_mag
; }
106
double
&
getMag
() {
return
_mag
; }
107
108
double
getMagErr
()
const
{
return
_magErr
; }
109
void
setMagErr
(
double
magErr) {
_magErr
= magErr; }
110
111
protected
:
112
// on-sky flux, in nanojansky
113
double
_flux
;
114
double
_fluxErr
{};
115
116
// on-sky magnitude
117
double
_mag
{};
118
double
_magErr
{};
119
};
120
121
using
BaseStarList
=
StarList<BaseStar>
;
122
123
using
BaseStarCIterator
= BaseStarList::const_iterator;
124
using
BaseStarIterator
= BaseStarList::iterator;
125
}
// namespace jointcal
126
}
// namespace lsst
127
128
#endif
// LSST_JOINTCAL_BASE_STAR_H
FatPoint.h
Magnitude.h
StarList.h
std::ostream
lsst::jointcal::BaseStar::_fluxErr
double _fluxErr
Definition
BaseStar.h:114
lsst::jointcal::BaseStar::getFlux
double & getFlux()
Definition
BaseStar.h:99
lsst::jointcal::BaseStar::_magErr
double _magErr
Definition
BaseStar.h:118
lsst::jointcal::BaseStar::getMagErr
double getMagErr() const
Definition
BaseStar.h:108
lsst::jointcal::BaseStar::_mag
double _mag
Definition
BaseStar.h:117
lsst::jointcal::BaseStar::typeName
static const char * typeName()
Definition
BaseStar.h:94
lsst::jointcal::BaseStar::BaseStar
BaseStar(Point const &point, double flux, double fluxErr, double mag, double magErr)
Definition
BaseStar.h:65
lsst::jointcal::BaseStar::getMag
double getMag() const
Definition
BaseStar.h:105
lsst::jointcal::BaseStar::getFlux
double getFlux() const
Definition
BaseStar.h:98
lsst::jointcal::BaseStar::_flux
double _flux
Definition
BaseStar.h:113
lsst::jointcal::BaseStar::getFluxErr
double getFluxErr() const
Definition
BaseStar.h:102
lsst::jointcal::BaseStar::operator=
BaseStar & operator=(Point const &point)
Definition
BaseStar.h:88
lsst::jointcal::BaseStar::BaseStar
BaseStar()
Definition
BaseStar.h:53
lsst::jointcal::BaseStar::operator<<
friend std::ostream & operator<<(std::ostream &stream, BaseStar const &s)
allows std::cout << aBaseStar;
Definition
BaseStar.h:78
lsst::jointcal::BaseStar::getX
double getX() const
access stuff.
Definition
BaseStar.h:73
lsst::jointcal::BaseStar::getMag
double & getMag()
Definition
BaseStar.h:106
lsst::jointcal::BaseStar::setMagErr
void setMagErr(double magErr)
Definition
BaseStar.h:109
lsst::jointcal::BaseStar::BaseStar
BaseStar(double xx, double yy, double flux, double fluxErr)
constructor
Definition
BaseStar.h:59
lsst::jointcal::BaseStar::setFluxErr
void setFluxErr(double fluxErr)
Definition
BaseStar.h:103
lsst::jointcal::BaseStar::~BaseStar
virtual ~BaseStar()=default
lsst::jointcal::BaseStar::setFlux
void setFlux(double flux)
Definition
BaseStar.h:100
lsst::jointcal::BaseStar::print
virtual void print(std::ostream &out) const
Definition
BaseStar.h:83
lsst::jointcal::BaseStar::getY
double getY() const
Definition
BaseStar.h:75
lsst::jointcal::FatPoint::print
void print(std::ostream &s=std::cout) const
Definition
FatPoint.h:49
lsst::jointcal::FatPoint::FatPoint
FatPoint()
Definition
FatPoint.h:38
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::StarList
std::lists of Stars.
Definition
StarList.h:58
std::log
T log(T... args)
lsst::cpputils
lsst::jointcal
Definition
Associations.h:50
lsst::jointcal::BaseStarCIterator
BaseStarList::const_iterator BaseStarCIterator
Definition
BaseStar.h:123
lsst::jointcal::BaseStarList
StarList< BaseStar > BaseStarList
Definition
BaseStar.h:121
lsst::jointcal::BaseStarIterator
BaseStarList::iterator BaseStarIterator
Definition
BaseStar.h:124
lsst
std::setprecision
T setprecision(T... args)
Generated on
for lsst.jointcal by
1.17.0