lsst.jointcal  16.0-6-gf89f2d9
BaseStar.cc
Go to the documentation of this file.
1 #include <assert.h>
2 #include <fstream>
3 #include <string.h> // strstr
4 
7 #include "lsst/pex/exceptions.h"
8 
10 
11 namespace lsst {
12 namespace jointcal {
13 
14 bool decreasingFlux(BaseStar const *star1, BaseStar const *star2) {
15  return (star1->getFlux() > star2->getFlux());
16 }
17 
18 bool increasingMag(BaseStar const *star1, BaseStar const *star2) {
19  return (star1->getFlux() < star2->getFlux());
20 }
21 
22 /**************** BaseStarList ******************/
23 
24 int decodeFormat(char const *formatLine, char const *starName) {
25  if (!formatLine || !starName) return 0;
26  const char *p = strstr(formatLine, starName);
27  if (!p) return 0;
28  return atoi(p + strlen(starName));
29 }
30 } // namespace jointcal
31 } // namespace lsst
T atoi(T... args)
int decodeFormat(char const *formatLine, char const *starName)
Definition: BaseStar.cc:24
The base class for handling stars. Used by all matching routines.
Definition: BaseStar.h:22
Class for a simple mapping implementing a generic Gtransfo.
T strlen(T... args)
double getFlux() const
Definition: BaseStar.h:60
bool decreasingFlux(BaseStar const *star1, BaseStar const *star2)
enables to sort easily a starList (of anything that derives from BaseStar)
Definition: BaseStar.cc:14
bool increasingMag(BaseStar const *star1, BaseStar const *star2)
Definition: BaseStar.cc:18
T strstr(T... args)