From 3db384424bd7398ffbb7a355cab8f15f3add009f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 2 Oct 2016 19:24:58 +0200 Subject: New upstream version 1.9.1+repack --- spectro/rspec.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'spectro/rspec.c') diff --git a/spectro/rspec.c b/spectro/rspec.c index e0e0194..6a7f8c7 100644 --- a/spectro/rspec.c +++ b/spectro/rspec.c @@ -28,6 +28,7 @@ #include #include #include +#include #if defined(UNIX) # include #else @@ -43,7 +44,9 @@ #include "sa_config.h" #include "numsup.h" #endif /* !SALONEINSTLIB */ -#include "plot.h" +#ifndef SALONEINSTLIB +# include "plot.h" +#endif #include "xspect.h" #include "insttypes.h" #include "conv.h" @@ -51,6 +54,9 @@ #include "inst.h" #include "rspec.h" +#define BOX_INTEGRATE /* [und] Integrate raw samples as if they were +/-0.5 boxes */ + /* (This improves coeficient consistency a bit ?) */ + /* -------------------------------------------------- */ #if defined(__APPLE__) && defined(__POWERPC__) @@ -250,6 +256,7 @@ void del_rspec(rspec *p) { /* Plot the first rspec */ void plot_rspec1(rspec *p) { +#ifndef SALONEINSTLIB int i, no; double xx[RSPEC_MAXSAMP]; double yy[RSPEC_MAXSAMP]; @@ -264,10 +271,12 @@ void plot_rspec1(rspec *p) { yy[i] = p->samp[0][i]; } do_plot(xx, yy, NULL, NULL, no); +#endif } /* Plot the first rspec of 2 */ void plot_rspec2(rspec *p1, rspec *p2) { +#ifndef SALONEINSTLIB int i, no; double xx[RSPEC_MAXSAMP]; double y1[RSPEC_MAXSAMP]; @@ -286,9 +295,11 @@ void plot_rspec2(rspec *p1, rspec *p2) { y2[i] = p2->samp[0][i]; } do_plot(xx, y1, y2, NULL, no); +#endif } void plot_ecal(rspec_inf *inf) { +#ifndef SALONEINSTLIB int i, no; double xx[RSPEC_MAXSAMP]; double yy[RSPEC_MAXSAMP]; @@ -303,6 +314,7 @@ void plot_ecal(rspec_inf *inf) { yy[i] = inf->ecal[i]; } do_plot(xx, yy, NULL, NULL, no); +#endif } @@ -710,7 +722,7 @@ void rspec_make_resample_filters(rspec_inf *inf) { a1logd(inf->log, 4,"rspec_make_resample_filters: maxcoeffs = %d\n",maxcoeffs); - /* Figure out integration step size */ + /* Figure out box integration step size */ #ifdef FAST_HIGH_RES_SETUP finc = twidth/50.0; if (rawspace/finc < 10.0) @@ -754,6 +766,7 @@ void rspec_make_resample_filters(rspec_inf *inf) { if (fabs(w1 - cwl) > fshmax && fabs(w2 - cwl) > fshmax) continue; /* Doesn't fall into this filter */ +#ifdef BOX_INTEGRATE /* Integrate in finc nm increments from filter shape */ /* using triangular integration. */ { @@ -778,6 +791,9 @@ void rspec_make_resample_filters(rspec_inf *inf) { lw = cw; } } +#else + we = fabs(w2 - w1) * kernel(twidth, rwl); +#endif if (inf->fnocoef[j] >= maxcoeffs) error("rspec_make_resample_filters: run out of high res filter space\n"); @@ -846,6 +862,7 @@ void rspec_make_resample_filters(rspec_inf *inf) { /* Plot the wave resampling filters */ void plot_resample_filters(rspec_inf *inf) { +#ifndef SALONEINSTLIB double *xx, *ss; double **yy; int i, j, k, sx; @@ -877,6 +894,7 @@ void plot_resample_filters(rspec_inf *inf) { do_plot6(xx, yy[0], yy[1], yy[2], yy[3], yy[4], yy[5], inf->nraw); free_dvector(xx, 0, inf->nraw-1); free_dmatrix(yy, 0, 2, 0, inf->nraw-1); +#endif } /* ================================================== */ -- cgit v1.2.3