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.cc

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 #include "fitshandle.h"
00035 #include "simparams.h"
00036 
00037 using namespace std;
00038 
00039 void simparams::add_keys (ostream &os) const
00040   {
00041   for (unsigned int m=0; m<source_files.size(); ++m)
00042     {
00043     os << "ancestor"+dataToString(m+1)+"="+source_files[m] << endl;
00044     }
00045   vector<Param>::const_iterator iter = paramMap.begin();
00046   while (iter!=paramMap.end())
00047     {
00048     if (iter->comment != "")
00049       os << "# "+iter->comment << endl;
00050     if (iter->key != "")
00051       os << iter->key << "=" << iter->value << endl;
00052     ++iter;
00053     }
00054   }
00055 
00056 void simparams::add_keys (fitshandle &out) const
00057   {
00058   fitshandle inp;
00059   for (unsigned int m=0; m<source_files.size(); ++m)
00060     {
00061     inp.open(source_files[m]);
00062     inp.goto_hdu(hdus[m]);
00063     out.add_comment("imported from HDU "+dataToString(hdus[m])+" of");
00064     out.add_comment(source_files[m]);
00065     out.copy_header(inp);
00066     out.add_comment("End of imported HDU");
00067     inp.close();
00068     }
00069 
00070   vector<Param>::const_iterator iter = paramMap.begin();
00071   while (iter!=paramMap.end())
00072     {
00073     if (iter->shortkey != "")
00074       out.add_key (iter->shortkey, iter->value, iter->comment);
00075     else
00076       out.add_comment (iter->comment);
00077     ++iter;
00078     }
00079   }

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