Ignore:
Timestamp:
02/16/10 16:21:26 (14 years ago)
Author:
WataruKawasaki
Message:

New Development: Yes

JIRA Issue: Yes (CAS-1800 + CAS-1807)

Ready to Release: Yes

Interface Changes: Yes

What Interface Changed: added parameters fitfunc for sdfit and clip, clipmaxmin, clipoutside for sdflag

Test Programs:

Put in Release Notes: No

Module(s): sdfit, sdflag

Description: Added a parameter for enabling Lorentzian line fitting with sdfit, and parameters for y-axis clipping with sdflag. Also 4 files for Lorentzian function class are (Lorentzian1D*) added.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/alma/src/STFitter.cpp

    r1616 r1700  
    3838#include <scimath/Functionals/CompoundFunction.h>
    3939#include <scimath/Functionals/Gaussian1D.h>
     40#include "Lorentzian1D.h"
    4041#include <scimath/Functionals/Polynomial.h>
    4142#include <scimath/Mathematics/AutoDiff.h>
     
    147148    funcs_.resize(1);
    148149    funcs_[0] = new Polynomial<Float>(ncomp);
     150  } else if (expr == "lorentz") {
     151    if (ncomp < 1) throw (AipsError("Need at least one lorentzian to fit."));
     152    funcs_.resize(ncomp);
     153    for (Int k=0; k<ncomp; ++k) {
     154      funcs_[k] = new Lorentzian1D<Float>();
     155    }
    149156  } else {
    150157    //cerr << " compiled functions not yet implemented" << endl;
     
    230237            (funcs_[0]->parameters())[i] =  tmppar[i];
    231238        }
     239    } else if (dynamic_cast<Lorentzian1D<Float>* >(funcs_[0]) != 0) {
     240        uInt count = 0;
     241        for (uInt j=0; j < funcs_.nelements(); ++j) {
     242            for (uInt i=0; i < funcs_[j]->nparameters(); ++i) {
     243                (funcs_[j]->parameters())[i] = tmppar[count];
     244                parameters_[count] = tmppar[count];
     245                ++count;
     246            }
     247        }
    232248    }
    233249    // reset
     
    263279            funcs_[0]->mask(i) =  !fixed[i];
    264280        }
     281    } else if (dynamic_cast<Lorentzian1D<Float>* >(funcs_[0]) != 0) {
     282      uInt count = 0;
     283        for (uInt j=0; j < funcs_.nelements(); ++j) {
     284            for (uInt i=0; i < funcs_[j]->nparameters(); ++i) {
     285                funcs_[j]->mask(i) = !fixed[count];
     286                fixedpar_[count] = fixed[count];
     287                ++count;
     288            }
     289        }
    265290    }
    266291    return true;
Note: See TracChangeset for help on using the changeset viewer.