Changeset 960 for trunk/src/STFit.h


Ignore:
Timestamp:
03/31/06 17:07:57 (18 years ago)
Author:
mar637
Message:

c++ side of Ticket #7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STFit.h

    r898 r960  
    1 //#---------------------------------------------------------------------------
    2 //# SDFitTable.h: A wrapper for fit parameters
    3 //#---------------------------------------------------------------------------
    4 //# Copyright (C) 2004
    5 //# ATNF
    6 //#
    7 //# This program is free software; you can redistribute it and/or modify it
    8 //# under the terms of the GNU General Public License as published by the Free
    9 //# Software Foundation; either version 2 of the License, or (at your option)
    10 //# any later version.
    11 //#
    12 //# This program is distributed in the hope that it will be useful, but
    13 //# WITHOUT ANY WARRANTY; without even the implied warranty of
    14 //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
    15 //# Public License for more details.
    16 //#
    17 //# You should have received a copy of the GNU General Public License along
    18 //# with this program; if not, write to the Free Software Foundation, Inc.,
    19 //# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
    20 //#
    21 //# Correspondence concerning this software should be addressed as follows:
    22 //#        Internet email: Malte.Marquarding@csiro.au
    23 //#        Postal address: Malte Marquarding,
    24 //#                        Australia Telescope National Facility,
    25 //#                        P.O. Box 76,
    26 //#                        Epping, NSW, 2121,
    27 //#                        AUSTRALIA
    28 //#
    29 //# $Id:
    30 //#---------------------------------------------------------------------------
    31 #ifndef SDFITTABLE_H
    32 #define SDFITTABLE_H
     1//
     2// C++ Interface: STFit
     3//
     4// Description:
     5//
     6//
     7// Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2006
     8//
     9// Copyright: See COPYING file that comes with this distribution
     10//
     11//
     12#ifndef ASAPSTFIT_H
     13#define ASAPSTFIT_H
    3314
    3415#include <casa/aips.h>
    35 #include <casa/Arrays/Vector.h>
    3616#include <casa/BasicSL/String.h>
    37 #include <vector>
    38 #include <string>
     17#include <tables/Tables/Table.h>
     18#include <tables/Tables/ScalarColumn.h>
     19#include <tables/Tables/ArrayColumn.h>
    3920
     21#include "STSubTable.h"
    4022namespace asap {
    4123
    42 class SDFitTable {
     24class STFitEntry;
     25/**
     26The Fit subtable of the Scantable
     27
     28@author Malte Marquarding
     29*/
     30class STFit : public STSubTable {
    4331public:
    44   SDFitTable() : nfits_(0) {;};
    45   ~SDFitTable() {;};
    46   SDFitTable(const SDFitTable& other);
     32  STFit() {;}
     33  STFit(casa::Table tab);
     34  STFit( const Scantable& parent);
    4735
    48   void addFit(const casa::Vector<casa::Double>& p,
    49               const casa::Vector<casa::Bool>& m,
    50               const casa::Vector<casa::String>& f,
    51               const casa::Vector<casa::Int>& c,
    52               const casa::Vector<casa::String>& fi);
    53  
    54   void addSTLFit(const std::vector<double>& p,
    55                  const std::vector<bool>& m,
    56                  const std::vector<std::string>& f,
    57                  const std::vector<int>& c,
    58                  const std::vector<std::string>& fi);
    59  
    60   int STLlength() const { return nfits_; };
    61  
    62   casa::uInt length() const { return casa::uInt(nfits_); };
    63  
    64   std::vector<double> getSTLParameters(int which) const;
    65   std::vector<bool> getSTLParameterMask(int which) const;
    66   std::vector<std::string> getSTLFunctions(int which) const;
    67   std::vector<int> getSTLComponents(int which) const;
    68   std::vector<std::string> getSTLFrameInfo(int which) const;
     36  virtual ~STFit();
    6937
    70   casa::Vector<casa::Double> getParameters(casa::uInt which) const;
    71   casa::Vector<casa::Bool> getParameterMask(casa::uInt which) const;
    72   casa::Vector<casa::String> getFunctions(casa::uInt which) const;
    73   casa::Vector<casa::Int> getComponents(casa::uInt which) const;
    74   casa::Vector<casa::String> getFrameInfo(casa::uInt which) const;
     38  STFit& operator=(const STFit& other);
    7539
     40  casa::uInt addEntry( const STFitEntry& fit, casa::Int id=-1 );
     41  void getEntry( STFitEntry& fit, casa::uInt id );
     42
     43  const casa::String& name() const { return name_; }
    7644
    7745private:
    78   int nfits_;
    79   std::vector<std::vector<double> > pars_;
    80   std::vector<std::vector<bool> > mask_;
    81   std::vector<std::vector<std::string> > funcs_;
    82   std::vector<std::vector<int> > comps_;
    83   std::vector<std::vector<std::string> > frameinfo_;
     46  void setup();
     47  static const casa::String name_;
     48  //casa::Table table_;
     49  casa::ArrayColumn<casa::String> funcCol_;
     50  casa::ArrayColumn<casa::Int> compCol_;
     51  casa::ArrayColumn<casa::Double> parCol_;
     52  casa::ArrayColumn<casa::Bool> maskCol_;
     53  casa::ArrayColumn<casa::String> frameCol_;
    8454};
    8555
    86 }//
     56}
    8757
    8858#endif
Note: See TracChangeset for help on using the changeset viewer.