69 std::vector<LOMB_TYPE> lodata, lodata2;
77 for(
int j = 0; j < Ndat; j++) {
80 lodata.push_back(tlom);
86 datcnt = (int) count_if(p, q,
Lomb_eq(0.));
88 if(datcnt > (q - p - 10)) {
89 memset(mess,
'\0',
sizeof(mess));
90 sprintf(mess,
"Just found %d data points that are == 0!", datcnt);
104 stat = la->
period(&lodata, &lodata2,
ofac,
hifac, &nout, &jmax, &prob, 0);
106 memset(mess,
'\0',
sizeof(mess));
107 sprintf(mess,
"@C3ERROR: Lomb analysis failed!");
119 for(i = 0; i < nout; i++) {
120 if(lodata2[i].y > 2.) {
121 pairx[pairc] = lodata2[i].x;
122 pairy[pairc] = lodata2[i].y;
123 if((pairy[pairc] > pairy[pairc-1]) &&
124 (pairy[pairc] > lodata2[i+1].y)) {
125 probi = la->
signi(&pairy[pairc], &nout, &tofac);
126 if(pairy[pairc] > 4.) {
127 memset(mess,
'\0',
sizeof(mess));
128 sprintf(mess,
"%12.8f %8.2f %8.3f %d", pairx[pairc]*Norm, pairy[pairc], probi, i);
136 memset(mess,
'\0',
sizeof(mess));
137 sprintf(mess,
" ===> Max: %12.8f %8.3f\n", lodata2[jmax].x * Norm, lodata2[jmax].y);
166 std::vector<LOMB_TYPE> lodata, lodata2;
169 sprintf(mess,
"TUNE_class LombAnalysis requested");
177 for(
int j = 0; j < Ndat; j++) {
180 lodata.push_back(tlom);
186 datcnt = count_if(p, q,
Lomb_eq(0.));
188 if(datcnt > (q - p - 10)) {
189 memset(mess,
'\0',
sizeof(mess));
190 sprintf(mess,
"Just found %d data points that are == 0!", datcnt);
204 stat = la->
period(&lodata, &lodata2,
ofac,
hifac, &nout, &jmax, &prob, 0);
206 memset(mess,
'\0',
sizeof(mess));
207 sprintf(mess,
"@C3ERROR: Lomb analysis failed!");
215 memset(mess,
'\0',
sizeof(mess));
216 sprintf(mess,
"=====> jmax = %d", jmax);
222 memset(mess,
'\0',
sizeof(mess));
223 sprintf(mess,
"\n********** Peaks in Data: **************");
234 for(i = 0; i < nout; i++) {
238 if(lodata2[i].y > 2.) {
239 pairx[pairc] = lodata2[i].x;
240 pairy[pairc] = lodata2[i].y;
241 if((pairy[pairc] > pairy[pairc-1]) &&
242 (pairy[pairc] > lodata2[i+1].y)) {
243 probi = la->
signi(&pairy[pairc], &nout, &tofac);
244 if(pairy[pairc] > 4.) {
245 memset(mess,
'\0',
sizeof(mess));
246 sprintf(mess,
"%12.8f %8.2f %8.3f %d", pairx[pairc], pairy[pairc],
255 memset(mess,
'\0',
sizeof(mess));
256 sprintf(mess,
"\n===> Max: %12.8f %8.3f\n", lodata2[jmax].x, lodata2[jmax].y);
std::vector< LOMB_TYPE >::const_iterator CI_lt
Inform & endl(Inform &inf)
int lombAnalysis(double *x, double *y, int Ndat, int nhis)
virtual ~TUNE_class(void)
double signi(double *peak, int *nout, double *ofac)
int period(std::vector< LOMB_TYPE > *indata, std::vector< LOMB_TYPE > *outdata, double ofac, double hifac, int *nout, int *jmax, double *prob, int amp)