DP3
SkymodelToSourceDB.h
Go to the documentation of this file.
1 // Skymodel.h:
2 //
3 // Copyright (C) 2021 ASTRON (Netherlands Institute for Radio Astronomy)
4 // SPDX-License-Identifier: GPL-3.0-or-later
5 
10 
11 #ifndef DP3_SKYMODEL_TO_SOURCEDB_H
12 #define DP3_SKYMODEL_TO_SOURCEDB_H
13 
14 #include "SourceDB.h"
15 #include "SourceDBSkymodel.h"
16 
17 #include "common/StringTools.h"
18 #include "common/StreamUtil.h"
19 
20 #include <string>
21 #include <iostream>
22 #include <fstream>
23 #include <sstream>
24 
25 #include <casacore/casa/OS/Path.h>
26 #include <casacore/casa/Quanta/MVAngle.h>
27 #include <casacore/casa/Inputs/Input.h>
28 #include <casacore/casa/BasicSL/Constants.h>
29 #include <casacore/casa/Utilities/Regex.h>
30 
31 struct SearchInfo {
32  double ra;
33  double dec;
34  double sinDec;
35  double cosDec;
36  double cosRadius;
37  double raStart;
38  double raEnd;
39  double decStart;
40  double decEnd;
41  bool search; // false no search info given
42  bool asCone; // true is search in a cone, otherwise a box
43 };
44 
45 namespace dp3 {
46 
47 namespace parmdb {
48 
49 namespace skymodel_to_source_db {
50 
51 SourceDB MakeSourceDb(const std::string& in, const std::string& out,
52  const std::string& outType, const std::string& format,
53  const std::string& prefix, const std::string& suffix,
54  bool append, bool average, bool check,
55  const SearchInfo& search_info);
56 
57 SourceDBSkymodel MakeSourceDBSkymodel(const std::string& filename,
58  const std::string& format);
59 
60 SearchInfo GetSearchInfo(const std::string& center, const std::string& radius,
61  const std::string& width);
62 
63 std::string ReadFormat(std::string file, const std::string& cat_file);
64 
65 } // namespace skymodel_to_source_db
66 } // namespace parmdb
67 } // namespace dp3
68 
69 #endif
Base class for a table holding sources and their parameters.
Definition: SourceDBSkymodel.h:15
Envelope class for a table holding source parameters.
Definition: SourceDB.h:193
SearchInfo GetSearchInfo(const std::string &center, const std::string &radius, const std::string &width)
SourceDB MakeSourceDb(const std::string &in, const std::string &out, const std::string &outType, const std::string &format, const std::string &prefix, const std::string &suffix, bool append, bool average, bool check, const SearchInfo &search_info)
std::string ReadFormat(std::string file, const std::string &cat_file)
SourceDBSkymodel MakeSourceDBSkymodel(const std::string &filename, const std::string &format)
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53
Definition: SkymodelToSourceDB.h:31
double cosRadius
Definition: SkymodelToSourceDB.h:36
bool asCone
Definition: SkymodelToSourceDB.h:42
bool search
Definition: SkymodelToSourceDB.h:41
double dec
Definition: SkymodelToSourceDB.h:33
double sinDec
Definition: SkymodelToSourceDB.h:34
double cosDec
Definition: SkymodelToSourceDB.h:35
double raEnd
Definition: SkymodelToSourceDB.h:38
double decEnd
Definition: SkymodelToSourceDB.h:40
double raStart
Definition: SkymodelToSourceDB.h:37
double ra
Definition: SkymodelToSourceDB.h:32
double decStart
Definition: SkymodelToSourceDB.h:39