casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
ListConverter.h
Go to the documentation of this file.
00001 //# MSContinuumSubtractor.h: Fit & subtract continuum from spectral line data
00002 //# Copyright (C) 2004
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id$
00027 //#
00028 #ifndef SPLAT_LISTCONVERTER_H
00029 #define SPLAT_LISTCONVERTER_H
00030 
00031 #include <casa/aips.h>
00032 
00033 #include <casa/Arrays/Vector.h>
00034 #include <casa/BasicSL/String.h>
00035 #include <casa/Logging/LogIO.h>
00036 #include <casa/OS/RegularFile.h>
00037 #include <spectrallines/Splatalogue/SplatalogueTable.h>
00038 
00039 namespace casa {
00040 
00041 // <summary>Converts a list or lists dumped from the splatalogue web interface to a casa table.</summary>
00042 // <use visibility=export>
00043 // 
00044 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00045 // </reviewed>
00046 // 
00047 
00048 // <etymology>
00049 // Converts a splatalogue line list to a CASA table.
00050 // </etymology>
00051 //
00052 // <synopsis>
00053 // It is a requirement that users be able to convert splatalogue line
00054 // lists to CASA tables for manipulation of these data within CASA.
00055 // </synopsis>
00056 //
00057 // <example>
00058 // <srcBlock>
00059 // Vector<String> files(2);
00060 // files[0] = "myfile1";
00061 // files[1] = "myfile2";
00062 // Converter converter(files, "mytable");
00063 // converter.convert();
00064 // </srcBlock>
00065 // </example>
00066 //
00067 // <motivation>
00068 // A class to for splatalogue list conversion.
00069 // </motivation>
00070 //
00071 // <todo asof="">
00072 // </todo>
00073  
00074 
00075 class ListConverter {
00076 public:
00077         // Constructor
00078         ListConverter(const Vector<String>& filename, const String& table);
00079 
00080         //destuctor
00081         ~ListConverter();
00082 
00083         // load the lists into the table. It is the caller's responsibility to
00084         // delete the returned pointer.
00085         SplatalogueTable* load();
00086 
00087 private:
00088         LogIO *_log;
00089         ListConverter();
00090         Vector<RegularFile> _listFiles;
00091         String _tableName, _freqUnit, _smu2Unit, _elUnit, _euUnit;
00092         Vector<String> _species, _chemName, _qns, _lineList;
00093         Vector<Bool> _recommended;
00094         Vector<Double> _frequency;
00095         Vector<Float> _intensity, _smu2, _logA, _eL, _eU;
00096 
00097         void _parseLists();
00098         SplatalogueTable* _defineTable(const uInt nrows);
00099         void _addData(const SplatalogueTable* table) const;
00100 };
00101 
00102 
00103 } //# NAMESPACE CASA - END
00104 
00105 #endif