Changeset 40817
- Timestamp:
- Jun 22, 2019, 3:34:13 PM (7 years ago)
- Location:
- branches/eam_branches/ohana.20190329/src/opihi/mana
- Files:
-
- 4 edited
-
deimos.c (modified) (2 diffs)
-
deimos_arclines.c (modified) (2 diffs)
-
deimos_getalt.c (modified) (4 diffs)
-
deimos_mkobj.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20190329/src/opihi/mana/deimos.c
r40753 r40817 4 4 int deimos_fitslit (int argc, char **argv); 5 5 int deimos_mkobj (int argc, char **argv); 6 int deimos_mkalt (int argc, char **argv); 6 // int deimos_mkalt (int argc, char **argv); -- deprecated: mkobj adds slit vs psf traces as well as red vs blu chips 7 7 int deimos_getobj (int argc, char **argv); 8 8 int deimos_getalt (int argc, char **argv); … … 18 18 {1, "getalt", deimos_getalt, "determine crude object parameters"}, 19 19 {1, "mkobj", deimos_mkobj, "make a full object image"}, 20 {1, "mkalt", deimos_mkalt, "make a full object image (uses deimos_make_object, for a test)"},20 // {1, "mkalt", deimos_mkalt, "make a full object image (uses deimos_make_object, for a test)"}, 21 21 {1, "mkslit", deimos_mkslit, "make a slit image"}, 22 22 {1, "fitslit", deimos_fitslit, "fit slit image to observed slit flux"}, -
branches/eam_branches/ohana.20190329/src/opihi/mana/deimos_arclines.c
r40655 r40817 56 56 for (int iy = 0; iy < Ny; iy++) { 57 57 float Fsum = 0; 58 float Ksum = 0; 58 59 // cross-correlation of buffer values and kernel values 59 60 for (int ix = 0; ix < Nx; ix++) { … … 62 63 if ((iy + ky) < 0) continue; 63 64 if ((iy + ky) >= Ny) continue; 65 if (!isfinite(Fin[ix + (iy + ky)*Nx])) continue; 66 if (!isfinite(kernel[ix + ko*Nx])) continue; 64 67 Fsum += Fin[ix + (iy + ky)*Nx] * kernel[ix + ko*Nx]; 68 Ksum += kernel[ix + ko*Nx]; 65 69 } 66 70 } -
branches/eam_branches/ohana.20190329/src/opihi/mana/deimos_getalt.c
r40663 r40817 24 24 // output : object sky background 25 25 // not used : LSF -- not needed (measurement per disp pixel) 26 27 // This version uses the median of the pixels in the image which are 28 // in regions where the slit profile is < 15% (as opposed to the 29 // getobj version which attempts to fit both background and sky regions 26 30 27 31 // input parameters: … … 40 44 int N; 41 45 42 Spline *slit_trace = NULL; 46 Spline *slit_trace_red = NULL; 47 Spline *slit_trace_blu = NULL; 43 48 Spline *psf_trace = NULL; 44 49 Vector *profile = NULL; … … 54 59 float stilt = 0.0; // angle of the slit 55 60 61 // for a red vs blu spline, we need to specify the split point 62 // XXX this is REALLY ad-hoc for Deimos. not sure how to make 63 // this more generic (need to define the ranges somewhere) 64 int redlimit = 4096; 65 if ((N = get_argument (argc, argv, "-redlimit"))) { 66 remove_argument (N, &argc, argv); 67 redlimit = atoi (argv[N]); 68 remove_argument (N, &argc, argv); 69 } 70 56 71 // Input parameters: 57 if ((N = get_argument (argc, argv, "-slit-trace"))) { 58 remove_argument (N, &argc, argv); 59 if ((slit_trace = FindSpline (argv[N])) == NULL) return (FALSE); 60 remove_argument (N, &argc, argv); 61 } else { goto usage; } 72 if ((N = get_argument (argc, argv, "-slit-trace-red"))) { 73 remove_argument (N, &argc, argv); 74 if ((slit_trace_red = FindSpline (argv[N])) == NULL) return (FALSE); 75 remove_argument (N, &argc, argv); 76 } 77 if ((N = get_argument (argc, argv, "-slit-trace-blu"))) { 78 remove_argument (N, &argc, argv); 79 if ((slit_trace_blu = FindSpline (argv[N])) == NULL) return (FALSE); 80 remove_argument (N, &argc, argv); 81 } 62 82 if ((N = get_argument (argc, argv, "-psf-trace"))) { 63 83 remove_argument (N, &argc, argv); … … 156 176 157 177 // evaluate the trace spline at this y-coord to find the x-coord offset of the profile center 178 Spline *slit_trace = (iy < redlimit) ? slit_trace_red : slit_trace_blu; 158 179 float dXtraceSLIT = spline_apply_dbl (slit_trace->xk, slit_trace->yk, slit_trace->y2, slit_trace->Nknots, iy); 159 180 float dXtracePSF = spline_apply_dbl (psf_trace->xk, psf_trace->yk, psf_trace->y2, psf_trace->Nknots, iy); -
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.
