IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40817


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

Location:
branches/eam_branches/ohana.20190329/src/opihi/mana
Files:
4 edited

Legend:

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

    r40753 r40817  
    44int deimos_fitslit (int argc, char **argv);
    55int 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
    77int deimos_getobj (int argc, char **argv);
    88int deimos_getalt (int argc, char **argv);
     
    1818  {1, "getalt", deimos_getalt, "determine crude object parameters"},
    1919  {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)"},
    2121  {1, "mkslit", deimos_mkslit, "make a slit image"},
    2222  {1, "fitslit", deimos_fitslit, "fit slit image to observed slit flux"},
  • branches/eam_branches/ohana.20190329/src/opihi/mana/deimos_arclines.c

    r40655 r40817  
    5656  for (int iy = 0; iy < Ny; iy++) {
    5757    float Fsum = 0;
     58    float Ksum = 0;
    5859    // cross-correlation of buffer values and kernel values
    5960    for (int ix = 0; ix < Nx; ix++) {
     
    6263        if ((iy + ky) < 0) continue;
    6364        if ((iy + ky) >= Ny) continue;
     65        if (!isfinite(Fin[ix + (iy + ky)*Nx])) continue;
     66        if (!isfinite(kernel[ix + ko*Nx])) continue;
    6467        Fsum += Fin[ix + (iy + ky)*Nx] * kernel[ix + ko*Nx];
     68        Ksum += kernel[ix + ko*Nx];
    6569      }
    6670    }
  • branches/eam_branches/ohana.20190329/src/opihi/mana/deimos_getalt.c

    r40663 r40817  
    2424  // output : object sky background
    2525  // 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
    2630
    2731  // input parameters:
     
    4044  int N;
    4145
    42   Spline *slit_trace = NULL;
     46  Spline *slit_trace_red = NULL;
     47  Spline *slit_trace_blu = NULL;
    4348  Spline *psf_trace  = NULL;
    4449  Vector *profile = NULL;
     
    5459  float stilt = 0.0; // angle of the slit
    5560
     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
    5671  // 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  }
    6282  if ((N = get_argument (argc, argv, "-psf-trace"))) {
    6383    remove_argument (N, &argc, argv);
     
    156176
    157177    // 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;
    158179    float dXtraceSLIT = spline_apply_dbl (slit_trace->xk, slit_trace->yk, slit_trace->y2, slit_trace->Nknots, iy);
    159180    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  
    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.