IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 31, 2019, 3:08:13 PM (7 years ago)
Author:
eugene
Message:

deimos updates to add psf trace

File:
1 edited

Legend:

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

    r40655 r40663  
    2727  // input parameters:
    2828  // * buffer      : 2D image of slit (full frame or cutout?)
    29   // * trace       : spline fit of slit central x pos vs y-coord
     29  // * slit_trace  : spline fit of slit central x pos vs y-coord
     30  // * psf_trace   : spline fit of slit central x pos vs y-coord
    3031  // * profile     : slit window profile (vector)
    3132  // * PSF         : point-spread function vector (flux normalized, x-dir)
     
    3940  int N;
    4041
    41   Spline *trace   = NULL;
     42  Spline *slit_trace = NULL;
     43  Spline *psf_trace  = NULL;
    4244  Vector *profile = NULL;
    4345
     
    106108
    107109  // Input parameters:
    108   if ((N = get_argument (argc, argv, "-trace"))) {
    109     remove_argument (N, &argc, argv);
    110     if ((trace = FindSpline (argv[N])) == NULL) return (FALSE);
     110  if ((N = get_argument (argc, argv, "-slit-trace"))) {
     111    remove_argument (N, &argc, argv);
     112    if ((slit_trace = FindSpline (argv[N])) == NULL) return (FALSE);
     113    remove_argument (N, &argc, argv);
     114  } else { goto usage; }
     115  if ((N = get_argument (argc, argv, "-psf-trace"))) {
     116    remove_argument (N, &argc, argv);
     117    if ((psf_trace = FindSpline (argv[N])) == NULL) return (FALSE);
    111118    remove_argument (N, &argc, argv);
    112119  } else { goto usage; }
     
    244251      // current vector value:
    245252      // for deimos_make_model, row is the starting point of the subimage
    246       float *model_ref = deimos_make_model (objCurr, skyCurr, bckCurr, psf, profile, trace, Nx, Nrow, row_0);
     253      float *model_ref = deimos_make_model (objCurr, skyCurr, bckCurr, psf, profile, slit_trace, psf_trace, Nx, Nrow, row_0);
    247254
    248255      // in the test functions below, dRow is the central pixel of the subset, e.g., obj[row] => objCurr[dRow]
     
    252259      // delta obj (save dObj)
    253260      opihi_flt *objtest = deimos_make_test (objCurr, objNoise[row], dRow, Nrow, &dObj);
    254       float *model_obj = deimos_make_model (objtest, skyCurr, bckCurr, psf, profile, trace, Nx, Nrow, row_0);
     261      float *model_obj = deimos_make_model (objtest, skyCurr, bckCurr, psf, profile, slit_trace, psf_trace, Nx, Nrow, row_0);
    255262
    256263      // delta sky (save dSky)
    257264      opihi_flt *skytest = deimos_make_test (skyCurr, skyNoise[row], dRow, Nrow, &dSky);
    258       float *model_sky = deimos_make_model (objCurr, skytest, bckCurr, psf, profile, trace, Nx, Nrow, row_0);
     265      float *model_sky = deimos_make_model (objCurr, skytest, bckCurr, psf, profile, slit_trace, psf_trace, Nx, Nrow, row_0);
    259266
    260267      // delta bck (save dBck)
    261268      opihi_flt *bcktest = deimos_make_test (bckCurr, bckNoise[row], dRow, Nrow, &dBck);
    262       float *model_bck = deimos_make_model (objCurr, skyCurr, bcktest, psf, profile, trace, Nx, Nrow, row_0);
     269      float *model_bck = deimos_make_model (objCurr, skyCurr, bcktest, psf, profile, slit_trace, psf_trace, Nx, Nrow, row_0);
    263270
    264271      // dObj, dSky, dBck carry the delta used derivatives in and the delta applied to the values out
     
    294301    }
    295302
    296     float *model_full = deimos_make_model (objVal, skyVal, bckVal, psf, profile, trace, Nx, Ny, 0);
     303    float *model_full = deimos_make_model (objVal, skyVal, bckVal, psf, profile, slit_trace, psf_trace, Nx, Ny, 0);
    297304
    298305    int Npts = 0;
     
    305312
    306313 usage:
    307   gprint (GP_ERR, "USAGE: deimos fitobj (buffer) (Xref) -object vector -sky vector -backgnd vector -trace spline -profile vector -psf vector -stilt (angle)\n");
     314  gprint (GP_ERR, "USAGE: deimos fitobj (buffer) (Xref) -object vector -sky vector -backgnd vector -slit-trace spline -psf-trace spline -profile vector -psf vector -stilt (angle)\n");
    308315  return FALSE;
    309316}
Note: See TracChangeset for help on using the changeset viewer.