99 #include <uves_extract_iterate.h>
101 #include <uves_utils.h>
153 uves_iterate_position *
156 int minorder,
int maxorder,
159 uves_iterate_position *p = cpl_calloc(1,
sizeof(uves_iterate_position));
163 p->order_locations = order_locations;
164 p->minorder = minorder;
165 p->maxorder = maxorder;
205 int ordermin,
int ordermax,
206 const cpl_binary *bpm,
212 p->ordermax = ordermax;
223 p->yhigh = uves_round_double(p->ycenter + p->sg.length/2);
224 p->ylow = uves_round_double(p->ycenter - p->sg.length/2);
249 if (p->loop_y && p->y < p->yhigh)
253 else if (p->x < p->xmax)
262 p->yhigh = uves_round_double(p->ycenter + p->sg.length/2);
263 p->ylow = uves_round_double(p->ycenter - p->sg.length/2);
264 if (p->loop_y) p->y = p->ylow;
266 else if (p->order < p->ordermax)
276 p->yhigh = uves_round_double(p->ycenter + p->sg.length/2);
277 p->ylow = uves_round_double(p->ycenter - p->sg.length/2);
278 if (p->loop_y) p->y = p->ylow;
316 fprintf(stream,
"Position:\n");
317 fprintf(stream,
"order = %d\n", p->order);
318 fprintf(stream,
"x = %d\n", p->x);
319 fprintf(stream,
"y = %d\n", p->y);
320 fprintf(stream,
"ycenter = %f\n", p->ycenter);
321 fprintf(stream,
"ylow, yhigh = %d, %d\n", p->ylow, p->yhigh);
322 fprintf(stream,
"Limits:\n");
323 fprintf(stream,
"xmin, xmax = %d, %d\n", p->xmin, p->xmax);
324 fprintf(stream,
"ordermax = %d\n", p->ordermax);
325 fprintf(stream,
"bpm = %d\n", p->bpm != NULL ? 1 : 0);
326 fprintf(stream,
"loop_y = %s\n", p->loop_y ?
"true" :
"false");
327 fprintf(stream,
"end = %s\n", p->end ?
"true" :
"false");
328 fprintf(stream,
"Geometry:\n");
329 fprintf(stream,
"nx, ny = %d, %d\n", p->nx, p->ny);
330 fprintf(stream,
"minorder, maxorder = %d, %d\n", p->minorder, p->maxorder);
331 fprintf(stream,
"order_locations = %d\n", p->order_locations != NULL ? 1 : 0);
332 fprintf(stream,
"slit length = %f\n", p->sg.length);
333 fprintf(stream,
"slit offset = %f\n", p->sg.offset);
349 return p->ylow < 1 || p->yhigh > p->ny ||
350 (p->loop_y && p->bpm != NULL &&
351 p->bpm[(p->x-1) + (p->y-1)*p->nx] != CPL_BINARY_0);
double uves_polynomial_evaluate_2d(const polynomial *p, double x1, double x2)
Evaluate a 2d polynomial.