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
src
shapelet
Params.cc
Go to the documentation of this file.
1
// -*- LSST-C++ -*-
2
3
/*
4
* LSST Data Management System
5
* Copyright 2008, 2009, 2010 LSST Corporation.
6
*
7
* This product includes software developed by the
8
* LSST Project (http://www.lsst.org/).
9
*
10
* This program is free software: you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation, either version 3 of the License, or
13
* (at your option) any later version.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
19
*
20
* You should have received a copy of the LSST License Statement and
21
* the GNU General Public License along with this program. If not,
22
* see <http://www.lsstcorp.org/LegalNotices/>.
23
*/
24
25
#include "
lsst/meas/algorithms/shapelet/Params.h
"
26
#include "
lsst/meas/algorithms/shapelet/ConfigFile.h
"
27
28
namespace
lsst {
29
namespace
meas {
30
namespace
algorithms {
31
namespace
shapelet {
32
33
void
PrintFlags
(
const
std::vector<long>& flags, std::ostream& os)
34
{
35
const
int
nObj = flags.size();
36
37
std::vector<long> nFlagCount(NFLAGS,0);
38
long
nNoFlag = 0;
39
40
for
(
int
i=0;i<nObj;++i) {
41
long
flag = flags[i];
42
if
(!flag) ++nNoFlag;
43
for
(
long
flagNum = 0; flagNum < NFLAGS; ++flagNum) {
44
if
(flag & (1 << flagNum)) ++nFlagCount[flagNum];
45
}
46
}
47
os<<
" Total N = "
<<nObj<<std::endl;
48
os<<
" # with no flags = "
<<nNoFlag<<std::endl;
49
for
(
long
flagNum = 0; flagNum < NFLAGS; ++flagNum) {
50
if
(nFlagCount[flagNum]) {
51
os<<
" # with "
<<flagName[flagNum]<<
" = "
<<
52
nFlagCount[flagNum]<<std::endl;
53
}
54
}
55
}
56
57
// Errors specific to the weak lensing code
58
const
char
*
Text
(
const
ExitCode
& code)
59
{
60
switch
(code) {
61
case
SUCCESS
:
62
return
"SUCCESS"
;
63
case
FAILURE
:
64
return
"FAILURE"
;
65
case
FAILURE_FILE_NOT_FOUND
:
66
return
"FAILURE_FILE_NOT_FOUND"
;
67
case
FAILURE_PARAMETER_ERROR
:
68
return
"FAILURE_PARAMETER_ERROR"
;
69
case
FAILURE_READ_ERROR
:
70
return
"FAILURE_READ_ERROR"
;
71
case
FAILURE_WRITE_ERROR
:
72
return
"FAILURE_WRITE_ERROR"
;
73
case
FAILURE_PROCESSING_ERROR
:
74
return
"FAILURE_PROCESSING_ERROR"
;
75
default
:
76
return
"UNKNOWN"
;
77
}
78
}
79
80
int
Status
(
ExitCode
code,
const
ConfigFile
& params)
81
{
82
switch
(code) {
83
case
SUCCESS
:
84
return
params.
read
(
"success_status"
,2);
85
case
FAILURE
:
86
return
params.
read
(
"failure_status"
,4);
87
case
FAILURE_FILE_NOT_FOUND
:
88
return
params.
read
(
"file_not_found_status"
,5);
89
case
FAILURE_PARAMETER_ERROR
:
90
return
params.
read
(
"parameter_error_status"
,5);
91
case
FAILURE_READ_ERROR
:
92
return
params.
read
(
"read_error_status"
,5);
93
case
FAILURE_WRITE_ERROR
:
94
return
params.
read
(
"write_error_status"
,4);
95
case
FAILURE_PROCESSING_ERROR
:
96
return
params.
read
(
"processing_error_status"
,4);
97
default
:
98
return
0;
99
}
100
}
101
}}}}
lsst::meas::algorithms::shapelet::FAILURE_PROCESSING_ERROR
Definition:
Params.h:146
lsst::meas::algorithms::shapelet::FAILURE_WRITE_ERROR
Definition:
Params.h:145
lsst::meas::algorithms::shapelet::Text
const char * Text(const ExitCode &code)
Definition:
Params.cc:58
lsst::meas::algorithms::shapelet::FAILURE_FILE_NOT_FOUND
Definition:
Params.h:142
lsst::meas::algorithms::shapelet::Status
int Status(ExitCode code, const ConfigFile ¶ms)
Definition:
Params.cc:80
lsst::meas::algorithms::shapelet::ExitCode
ExitCode
Definition:
Params.h:139
lsst::meas::algorithms::shapelet::FAILURE_PARAMETER_ERROR
Definition:
Params.h:143
lsst::meas::algorithms::shapelet::FAILURE
Definition:
Params.h:141
ConfigFile.h
Params.h
lsst::meas::algorithms::shapelet::PrintFlags
void PrintFlags(const std::vector< long > &flags, std::ostream &os)
Definition:
Params.cc:33
lsst::meas::algorithms::shapelet::SUCCESS
Definition:
Params.h:140
lsst::meas::algorithms::shapelet::ConfigFile::read
void read(std::istream &is)
Definition:
ConfigFile.cc:178
lsst::meas::algorithms::shapelet::FAILURE_READ_ERROR
Definition:
Params.h:144
lsst::meas::algorithms::shapelet::ConfigFile
Definition:
ConfigFile.h:239
Generated on Wed Sep 16 2015 13:35:31 for LSSTApplications by
1.8.5