~ubuntu-branches/debian/sid/eso-midas/sid

« back to all changes in this revision

Viewing changes to stdred/feros/libsrc/fit_back.c

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2015-06-10 14:20:37 UTC
  • mfrom: (1.2.1) (6.1.9 experimental)
  • Revision ID: package-import@ubuntu.com-20150610142037-6iowpbtyjrpou36o
Tags: 15.02pl1.3-1
* New upstream version
* Add CI tests
* Move back to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
/* FEROS specific includes */
23
23
 
24
24
#include <glsp.h>
25
 
#include <proto_nrutil.h>
26
 
#include <proto_mutil.h>
 
25
#include <nrutil.h>
 
26
#include <mutil.h>
27
27
#include <echelle.h>
28
28
 
29
29
int fit_back
30
 
#ifdef __STDC__
31
30
(
32
 
 float xval[], float yval[], float **ya, float **y2a, 
 
31
 float xval[], float yval[], float **ya, double **y2a,
33
32
 int npix[], int imno, int m, int n, 
34
33
 int nact, float **centers, int xysize[], int bgdist, int fibmode
35
34
 )
36
 
#else
37
 
     (
38
 
      xval, yval, ya, y2a, npix, imno, m, n, nact, 
39
 
      centers, xysize, bgdist, fibmode
40
 
      )
41
 
     int npix[], imno, nact, m, n, xysize[], bgdist, fibmode; 
42
 
     float **ya, **y2a, xval[], yval[], **centers;
43
 
#endif
44
35
{
45
36
  int i, ii, j, jj, k, iarr1, iy, actvals, center;
46
37
  int splwidth[2], splwin[2];
47
 
  float *arr1, *xpos, *ypos, *imagex1;
48
 
  double xxd, *xn, *fn, *w, *a, *b, *c, *d, ausg[3];
 
38
  float *xpos, *ypos, *imagex1;
 
39
  double xxd, *xn, *fn, *w, *a, *b, *c, *d, ausg[3], *arr1;
49
40
  double xposs, weight;
50
41
  int status;
51
42
 
66
57
 
67
58
  imagex1 = vector(0, npix[0] * splwidth[1]);
68
59
 
69
 
  arr1 = vector (0, splwidth[0] * splwidth[1] + 1);
 
60
  arr1 = dvector (0, splwidth[0] * splwidth[1] + 1);
70
61
  xpos = vector (1, 2*nact + 1);
71
62
  ypos = vector (1, 2*nact + 1);
72
63
 
163
154
        }
164
155
    }
165
156
 
166
 
  /* to compute second derivatives, see Recipes, pg. 128 - we need
167
 
     an rectangular grid.*/
168
 
 
169
 
  splie2(xval, yval, ya, m, n, y2a); 
 
157
  /* to compute splines */
 
158
  nat_spline2d(yval, ya, m, n, y2a);
170
159
  
171
160
  free_dvector(xn, 0, 2*nact + 2);
172
161
  free_dvector(fn, 0, 2*nact + 2);
177
166
  free_dvector(d, 0, 2*nact + 2);
178
167
 
179
168
  free_vector(imagex1, 0, npix[0] * splwidth[1]);
180
 
  free_vector(arr1, 0, (splwidth[0] * splwidth[1] + 1));
 
169
  free_dvector(arr1, 0, (splwidth[0] * splwidth[1] + 1));
181
170
  free_vector(xpos, 1,2*nact + 1);
182
171
  free_vector(ypos, 1, 2*nact + 1);
183
172