simparams.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef PLANCK_SIMPARAMS_H
00035 #define PLANCK_SIMPARAMS_H
00036
00037 #include <string>
00038 #include <vector>
00039 #include <iostream>
00040 #include "cxxutils.h"
00041 class fitshandle;
00042
00043 class simparams
00044 {
00045 private:
00046 class Param
00047 {
00048 public:
00049 std::string key, shortkey, value, comment;
00050
00051 Param (const std::string &Key, const std::string &Shortkey,
00052 const std::string &Value, const std::string &Comment)
00053 : key(Key), shortkey(Shortkey), value(Value), comment(Comment) {}
00054 };
00055
00056 std::vector<Param> paramMap;
00057 std::vector<std::string> source_files;
00058 std::vector<int> hdus;
00059
00060 public:
00061 void add_comment (const std::string &comment)
00062 { paramMap.push_back(Param("","","",comment)); }
00063 template<typename T> void add(const std::string &key,
00064 const std::string &shortkey, const T &value, const std::string &comment)
00065 {
00066 paramMap.push_back(Param(key, shortkey, dataToString(value), comment));
00067 }
00068 template<typename T> void add(const std::string &key,
00069 const std::string &shortkey, const T &value)
00070 {
00071 paramMap.push_back(Param(key, shortkey, dataToString(value), ""));
00072 }
00073
00074 void add_source_file (const std::string &filename, int hdu=2)
00075 {
00076 source_files.push_back(filename);
00077 hdus.push_back(hdu);
00078 }
00079
00080 void add_keys (std::ostream &os) const;
00081 void add_keys (fitshandle &out) const;
00082 };
00083
00084 #endif