IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 22, 2019, 3:34:13 PM (7 years ago)
Author:
eugene
Message:

deprecate deimos mkalt; skip nan pixels in deimos arclines; apply blue and red-chip traces to getalt, mkobj

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20190329/src/opihi/mana/deimos_mkobj.c

    r40772 r40817  
    1919
    2020  // 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;
    2223  Spline *psf_trace  = NULL;
    2324  Vector *profile    = NULL;
     
    3435  float stilt = 0.0; // angle of the slit
    3536
    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);
    3955    remove_argument (N, &argc, argv);
    4056  }
     
    138154  // if we are appying a trace offset spline, we need to generate an output window which
    139155  // is Nx + the full swing of the trace, then window back down
    140   if (slit_trace) {
     156  if (slit_trace_red && slit_trace_blu) {
    141157    float dXmin = +1000;
    142158    float dXmax = -1000;
    143159    for (int iy = 0; iy < Ny; iy++) {
    144160      // 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;
    145162      float dx = spline_apply_dbl (slit_trace->xk, slit_trace->yk, slit_trace->y2, slit_trace->Nknots, iy);
    146163      dXmin = MIN (dx, dXmin);
     
    369386
    370387  // shift pixels in x based on the trace
    371   if (slit_trace) {
     388  if (slit_trace_red && slit_trace_blu) {
    372389    ALLOCATE_PTR (outTraceBuffer, char, NxBase*Ny*sizeof(float));
    373390    float *outTrace = (float *) outTraceBuffer;
     
    377394
    378395      // 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;
    379397      float dx = -spline_apply_dbl (slit_trace->xk, slit_trace->yk, slit_trace->y2, slit_trace->Nknots, iy);
    380398     
Note: See TracChangeset for help on using the changeset viewer.