Changeset 108 for trunk


Ignore:
Timestamp:
12/01/04 10:59:21 (20 years ago)
Author:
mar637
Message:

added fixed parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDFitter.cc

    r91 r108  
    8484    SpectralEstimate estimator(n);
    8585    estimator.setQ(5);
     86    Int mn,mx;
     87    mn = 0;
     88    mx = m_.nelements()-1;
     89    for (uInt i=0; i<m_.nelements();++i) {
     90      if (m_[i]) {
     91        mn = i;
     92        break;
     93      }
     94    }
     95    for (uInt j=m_.nelements()-1; j>=0;--j) {
     96      if (m_[j]) {
     97        mx = j;
     98        break;
     99      }
     100    }
     101    //mn = 0+x_.nelements()/10;
     102    //mx = x_.nelements()-x_.nelements()/10;
     103    estimator.setRegion(mn,mx);
    86104    //estimator.setWindowing(True);
    87105    SpectralList listGauss = estimator.estimate(x_, y_);
     
    89107    parameters_.resize(n*3);
    90108    uInt count = 0;
    91     cout << "n = " << n << endl;
    92109    for (uInt i=0; i<n;i++) {
    93110        g = dynamic_cast<Gaussian1D<Float>* >(funcs_[i]);
     
    242259
    243260std::vector<bool> SDFitter::getFixedParameters() const {
    244     if (fixedpar_.nelements() == 0)
    245         throw (AipsError("No parameter mask set."));
    246     Vector<Bool> out = fixedpar_;
    247     std::vector<bool> stlout;
    248     out.tovector(stlout);
    249     return stlout;
     261  Vector<Bool> out(parameters_.nelements());
     262  if (fixedpar_.nelements() == 0) {
     263    out = False;
     264    //throw (AipsError("No parameter mask set."));
     265  } else {
     266    out = fixedpar_;
     267  }
     268  std::vector<bool> stlout;
     269  out.tovector(stlout);
     270  return stlout;
    250271}
    251272
Note: See TracChangeset for help on using the changeset viewer.