- Timestamp:
- Mar 31, 2019, 3:08:13 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20190329/src/opihi/mana/deimos_fitalt.c
r40655 r40663 27 27 // input parameters: 28 28 // * 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 30 31 // * profile : slit window profile (vector) 31 32 // * PSF : point-spread function vector (flux normalized, x-dir) … … 39 40 int N; 40 41 41 Spline *trace = NULL; 42 Spline *slit_trace = NULL; 43 Spline *psf_trace = NULL; 42 44 Vector *profile = NULL; 43 45 … … 106 108 107 109 // 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); 111 118 remove_argument (N, &argc, argv); 112 119 } else { goto usage; } … … 244 251 // current vector value: 245 252 // 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); 247 254 248 255 // in the test functions below, dRow is the central pixel of the subset, e.g., obj[row] => objCurr[dRow] … … 252 259 // delta obj (save dObj) 253 260 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); 255 262 256 263 // delta sky (save dSky) 257 264 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); 259 266 260 267 // delta bck (save dBck) 261 268 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); 263 270 264 271 // dObj, dSky, dBck carry the delta used derivatives in and the delta applied to the values out … … 294 301 } 295 302 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); 297 304 298 305 int Npts = 0; … … 305 312 306 313 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"); 308 315 return FALSE; 309 316 }
Note:
See TracChangeset
for help on using the changeset viewer.
