DP3
SkyModel.h
Go to the documentation of this file.
1 // Copyright (C) 2021 ASTRON (Netherlands Institute for Radio Astronomy)
2 // SPDX-License-Identifier: GPL-3.0-or-later
3 
4 #ifndef DP3_PARMDB_SKY_MODEL_H
5 #define DP3_PARMDB_SKY_MODEL_H
6 
7 #include <string>
8 
9 #include "../parmdb/ParmValue.h"
10 #include "PatchInfo.h"
11 #include "Source.h"
12 
13 namespace dp3::sky_model {
14 
15 class SkyModel {
16  public:
17  void addSource(
18  const SourceInfo& source_info, const std::string& patch_name,
19  int cat_type, double apparent_brightness,
20  const std::map<std::string, parmdb::ParmValue>& default_parameters,
21  double ra, double dec, bool check);
22 
23  void addSource(
24  const SourceInfo& source_info, const std::string& patch_name,
25  const std::map<std::string, parmdb::ParmValue>& default_parameters,
26  double ra, double dec, bool check);
27 
31  unsigned addPatch(const std::string& patch_name, int cat_type,
32  double apparent_brightness, double ra, double dec,
33  bool check);
34 
35  void updatePatch(unsigned patch_id, double apparent_brightness, double ra,
36  double dec);
37 
38  std::vector<std::string> FindPatches(const std::string& pattern) const;
39  std::vector<std::string> GetPatchNames() const;
40  const std::vector<PatchInfo>& GetPatches() const { return patches_; }
41 
42  const PatchInfo& GetPatch(const std::string& patch_name) const;
43  const std::vector<Source>& GetSources() const { return sources_; }
44 
45  private:
46  std::vector<PatchInfo> patches_;
47 
48  std::map<std::string, unsigned> patches_lut_;
49 
50  void ValidatePatchName(const std::string& patch_name) const;
51  unsigned GetPatchRowId(const std::string& patch_name) const;
52 
53  std::vector<Source> sources_;
54 };
55 
56 } // namespace dp3::sky_model
57 
58 #endif
Info about a patch.
Base class for a table holding sources and their parameters.
Info about a patch.
Definition: PatchInfo.h:19
Definition: SkyModel.h:15
void updatePatch(unsigned patch_id, double apparent_brightness, double ra, double dec)
const std::vector< Source > & GetSources() const
Definition: SkyModel.h:43
const PatchInfo & GetPatch(const std::string &patch_name) const
void addSource(const SourceInfo &source_info, const std::string &patch_name, int cat_type, double apparent_brightness, const std::map< std::string, parmdb::ParmValue > &default_parameters, double ra, double dec, bool check)
std::vector< std::string > GetPatchNames() const
std::vector< std::string > FindPatches(const std::string &pattern) const
const std::vector< PatchInfo > & GetPatches() const
Definition: SkyModel.h:40
void addSource(const SourceInfo &source_info, const std::string &patch_name, const std::map< std::string, parmdb::ParmValue > &default_parameters, double ra, double dec, bool check)
unsigned addPatch(const std::string &patch_name, int cat_type, double apparent_brightness, double ra, double dec, bool check)
Definition: SourceInfo.h:14
Definition: Patch.h:14