NASA - Jet Propulsion Laboratory
    + View the NASA Portal
Search JPL
Jet Propulsion Laboratory Home Earth Solar System Stars & Galaxies Technology
Introduction Background Software Links

simparams.h

00001 /*
00002  *  This file is part of Healpix_cxx.
00003  *
00004  *  Healpix_cxx is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  Healpix_cxx is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with Healpix_cxx; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00017  *
00018  *  For more information about HEALPix, see http://healpix.jpl.nasa.gov
00019  */
00020 
00021 /*
00022  *  Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik
00023  *  and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
00024  *  (DLR).
00025  */
00026 
00027 /*
00028  *  Class for storing parameter information for later use
00029  *
00030  *  Copyright (C) 2003 Max-Planck-Society
00031  *  Authors: Reinhard Hell, Martin Reinecke
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

Generated on Fri Jun 18 16:12:29 2010 for LevelS C++ support library
Privacy / Copyright
FIRST GOV Contact: NASA Home Page Site Manager:
Webmaster:

CL 03-2650