diff --git a/src/wavelib.c b/src/wavelib.c index 565a74e..d33671c 100644 --- a/src/wavelib.c +++ b/src/wavelib.c @@ -1418,9 +1418,12 @@ void icwt(cwt_object wt, double *cwtop) { cdel = cdelta(wt->mother, wt->m, psi); //printf("\n PSI %g CDEL %g param %g mother %d \n", psi, cdel,wt->m,wt->mother); - - icwavelet(wt->params, N, wt->params+nj2, wt->J, wt->dt, wt->dj, cdel, psi, cwtop); - + if (!strcmp(wt->type, "pow") || !strcmp(wt->type, "power")) { + icwavelet(wt->params, N, wt->params+nj2, wt->J, wt->dt, wt->dj, cdel, psi, cwtop); + } else { + printf("Inverse CWT is only available for power of 2.0 scales \n"); + exit(-1); + } for(i = 0; i < N;++i) { cwtop[i] += wt->smean; }