diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-10-02 19:25:17 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-10-02 19:25:17 +0200 |
commit | c2ca7be5a751879159f3cb591a64bb9568b79762 (patch) | |
tree | 04e38d4f4a2aad4d789bda0a65b7abb80a3439a2 /spectro/rspec.c | |
parent | 45c152c326d87478fbf41714b4b8e2f7b57a282b (diff) | |
parent | 3db384424bd7398ffbb7a355cab8f15f3add009f (diff) |
Updated version 1.9.1+repack from 'upstream/1.9.1+repack'
with Debian dir 98a996367aa69ae41accf9c6d369f600bc94de80
Diffstat (limited to 'spectro/rspec.c')
-rw-r--r-- | spectro/rspec.c | 22 |
1 files changed, 20 insertions, 2 deletions
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 <ctype.h> #include <string.h> #include <time.h> +#include <fcntl.h> #if defined(UNIX) # include <utime.h> #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 } /* ================================================== */ |