- Timestamp:
- Jun 22, 2019, 3:34:13 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20190329/src/opihi/mana/deimos_mkobj.c
r40772 r40817 19 19 20 20 // if any of these are not defined, they will have assumed identity values 21 Spline *slit_trace = NULL; 21 Spline *slit_trace_red = NULL; 22 Spline *slit_trace_blu = NULL; 22 23 Spline *psf_trace = NULL; 23 24 Vector *profile = NULL; … … 34 35 float stilt = 0.0; // angle of the slit 35 36 36 if ((N = get_argument (argc, argv, "-slit-trace"))) { 37 remove_argument (N, &argc, argv); 38 if ((slit_trace = FindSpline (argv[N])) == NULL) return (FALSE); 37 // for a red vs blu spline, we need to specify the split point 38 // XXX this is REALLY ad-hoc for Deimos. not sure how to make 39 // this more generic (need to define the ranges somewhere) 40 int redlimit = 4096; 41 if ((N = get_argument (argc, argv, "-redlimit"))) { 42 remove_argument (N, &argc, argv); 43 redlimit = atoi (argv[N]); 44 remove_argument (N, &argc, argv); 45 } 46 47 if ((N = get_argument (argc, argv, "-slit-trace-red"))) { 48 remove_argument (N, &argc, argv); 49 if ((slit_trace_red = FindSpline (argv[N])) == NULL) return (FALSE); 50 remove_argument (N, &argc, argv); 51 } 52 if ((N = get_argument (argc, argv, "-slit-trace-blu"))) { 53 remove_argument (N, &argc, argv); 54 if ((slit_trace_blu = FindSpline (argv[N])) == NULL) return (FALSE); 39 55 remove_argument (N, &argc, argv); 40 56 } … … 138 154 // if we are appying a trace offset spline, we need to generate an output window which 139 155 // is Nx + the full swing of the trace, then window back down 140 if (slit_trace ) {156 if (slit_trace_red && slit_trace_blu) { 141 157 float dXmin = +1000; 142 158 float dXmax = -1000; 143 159 for (int iy = 0; iy < Ny; iy++) { 144 160 // evaluate the trace spline at this y-coord to find the x-coord offset of the profile center 161 Spline *slit_trace = (iy < redlimit) ? slit_trace_red : slit_trace_blu; 145 162 float dx = spline_apply_dbl (slit_trace->xk, slit_trace->yk, slit_trace->y2, slit_trace->Nknots, iy); 146 163 dXmin = MIN (dx, dXmin); … … 369 386 370 387 // shift pixels in x based on the trace 371 if (slit_trace ) {388 if (slit_trace_red && slit_trace_blu) { 372 389 ALLOCATE_PTR (outTraceBuffer, char, NxBase*Ny*sizeof(float)); 373 390 float *outTrace = (float *) outTraceBuffer; … … 377 394 378 395 // evaluate the trace spline at this y-coord to find the x-coord offset of the profile center 396 Spline *slit_trace = (iy < redlimit) ? slit_trace_red : slit_trace_blu; 379 397 float dx = -spline_apply_dbl (slit_trace->xk, slit_trace->yk, slit_trace->y2, slit_trace->Nknots, iy); 380 398
Note:
See TracChangeset
for help on using the changeset viewer.
