/* * lag.cpp * * Created on: Jun 1, 2013 * Author: azoghbi */ #include "inc/lag_rms.hpp" lag_rms::lag_rms( lcurve lc1 , lcurve lc2 , vec fqL , vec pars ) { // ----------- initial parameters ------------ // n1 = lc1.len; n = n1 + lc2.len; dt = lc1.dt; // ------------------------------------------ // // ----------- light curve setup ------------ // setlc(); mean1 = lc1.demean(); mean2 = lc2.demean(); mean1sq = mean1*mean1; mean2sq = mean2*mean2; mean12 = mean1*mean2; int i; for( i=0 ; i3000 ){dpar[i] = 3000;} if( dpar[i]<-3000 ){dpar[i] = -3000;} pars[i] += dpar[i]/((n<10)?10:1); } } void lag_rms::print_pars( vec& pars , vec& errs ){ for( int i=0 ; i M_PI ){ pars[i+nfq] -= 2*M_PI; } while( pars[i+nfq] <-M_PI ){ pars[i+nfq] += 2*M_PI; } } mod::print_pars( pars , errs ); } // ****************************************** // lag10_rms::lag10_rms( lcurve lc1 , lcurve lc2 , vec fqL , vec pars ) { // ----------- initial parameters ------------ // n1 = lc1.len; n = n1 + lc2.len; dt = lc1.dt; // ------------------------------------------ // // ----------- light curve setup ------------ // setlc(); mean1 = lc1.demean(); mean2 = lc2.demean(); mean1sq = mean1*mean1; mean2sq = mean2*mean2; mean12 = mean1*mean2; int i; for( i=0 ; i3 ){dpar[i] = 3;} if( dpar[i]<-3 ){dpar[i] = -3;} //pars[i] += dpar[i]; pars[i] += dpar[i]/((n<5)?10:1); } } void lag10_rms::print_pars( vec& pars , vec& errs ){ for( int i=0 ; i M_PI ){ pars[i+nfq] -= 2*M_PI; } while( pars[i+nfq] <-M_PI ){ pars[i+nfq] += 2*M_PI; } } mod::print_pars( pars , errs ); } void lag10_rms::what_pars( int& ip1 , int& ip2 ){ ip1 = nfq; ip2 = npar; }