diff options
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 } /* ================================================== */ |