Changeset 25595
- Timestamp:
- Sep 27, 2009, 10:39:09 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/psModules/src/objects/pmSourceVisual.c
r25591 r25595 142 142 psImageInit (resid, 0.0); 143 143 144 FILE *f = fopen ("stats.dat", "w"); 145 for (int i = 0; i < sources->n; i++) { 144 // FILE *f = fopen ("stats.dat", "w"); 145 // psAssert (f, "failed to open"); 146 147 for (int i = sources->n - 1; i >= 0; i--) { 146 148 pmSource *source = sources->data[i]; 147 149 if (!source) continue; … … 159 161 int Yo = 0.1*srcModel->params->data.F32[PM_PAR_YPOS]; 160 162 161 // insert source pixels in the image at 1/10th offset (XXX ignore centering for now) 162 // XXX calculate the pixel scatter values, chisq 163 // insert source pixels in the image at 1/10th offset 163 164 for (int iy = 0; iy < source->pixels->numRows; iy++) { 164 165 int jy = iy + Yo; … … 174 175 } 175 176 } 176 177 fprintf (f, "%d, %d -> %f %f %f %f\n", Xo, Yo, norm, source->psfMag, source->apMag, -2.5*log10(source->moments->Sum)); 178 } 179 fclose (f); 177 // fprintf (f, "%d, %d -> %f %f %f %f\n", Xo, Yo, norm, source->psfMag, source->apMag, -2.5*log10(source->moments->Sum)); 178 } 179 // fclose (f); 180 180 181 181 // KapaClearSections (kapa2); … … 184 184 pmVisualScaleImage (kapa2, resid, "resid", 2, true); 185 185 186 # ifdef DEBUG 186 187 { 187 188 psFits *fits = psFitsOpen ("image.fits", "w"); … … 195 196 psFitsClose (fits); 196 197 } 198 # endif 197 199 198 200 psFree (image); … … 264 266 if (!pmVisualIsVisual() || !plotPSF) return true; 265 267 266 // XXX skip for now267 // return true;268 269 268 if (kapa1 == -1) { 270 269 kapa1 = KapaOpenNamedSocket ("kapa", "pmSource:plots"); … … 278 277 KapaClearPlots (kapa1); 279 278 KapaInitGraph (&graphdata); 280 281 // float min = +1e32;282 // float max = -1e32;283 // float Min = +1e32;284 // float Max = -1e32;285 279 286 280 float Xmin = +1e32; … … 316 310 xm->n = ym->n = Fm->n = n; 317 311 318 // psVector *xn = psVectorAlloc (x->n, PS_TYPE_F32);319 // psVector *yn = psVectorAlloc (x->n, PS_TYPE_F32);320 // psVector *zn = psVectorAlloc (x->n, PS_TYPE_F32);321 // psVector *Zn = psVectorAlloc (x->n, PS_TYPE_F32);322 // psVector *Fn = psVectorAlloc (x->n, PS_TYPE_F32);323 // for (int i = 0; i < x->n; i++) {324 // xn->data.F32[i] = x->data.F32[i] / 5000.0;325 // yn->data.F32[i] = y->data.F32[i] / 5000.0;326 // zn->data.F32[i] = (resid->data.F32[i] - min) / (max - min);327 // Zn->data.F32[i] = (param->data.F32[i] - Min) / (Max - Min);328 // Fn->data.F32[i] = (model->data.F32[i] - Min) / (Max - Min);329 // }330 331 312 // view 1 on resid 332 313 section.dx = 1.0; … … 430 411 KapaPlotVector (kapa1, y->n, model->data.F32, "y"); 431 412 432 # if (0)433 // view 3 on resid434 section.dx = 0.5;435 section.dy = 0.33;436 section.x = 0.0;437 section.y = 0.33;438 section.name = NULL;439 psStringAppend (§ion.name, "a3");440 KapaSetSection (kapa1, §ion);441 psFree (section.name);442 pmSourcePlotPoints3D (kapa1, &graphdata, xn, yn, Zn, 30.0*PS_RAD_DEG, -15.0*PS_RAD_DEG);443 444 // view 4 on resid445 section.dx = 0.5;446 section.dy = 0.33;447 section.x = 0.5;448 section.y = 0.33;449 section.name = NULL;450 psStringAppend (§ion.name, "a4");451 KapaSetSection (kapa1, §ion);452 psFree (section.name);453 pmSourcePlotPoints3D (kapa1, &graphdata, xn, yn, Zn, -60.0*PS_RAD_DEG, -15.0*PS_RAD_DEG);454 455 // view 5 on resid456 section.dx = 0.5;457 section.dy = 0.33;458 section.x = 0.0;459 section.y = 0.66;460 section.name = NULL;461 psStringAppend (§ion.name, "a5");462 KapaSetSection (kapa1, §ion);463 psFree (section.name);464 pmSourcePlotPoints3D (kapa1, &graphdata, xn, yn, Fn, 30.0*PS_RAD_DEG, -15.0*PS_RAD_DEG);465 466 // view 6 on resid467 section.dx = 0.5;468 section.dy = 0.33;469 section.x = 0.5;470 section.y = 0.66;471 section.name = NULL;472 psStringAppend (§ion.name, "a6");473 KapaSetSection (kapa1, §ion);474 psFree (section.name);475 pmSourcePlotPoints3D (kapa1, &graphdata, xn, yn, Fn, -60.0*PS_RAD_DEG, -15.0*PS_RAD_DEG);476 # endif477 478 413 psFree (resid); 479 414 psFree (model); … … 486 421 } 487 422 488 // send in normalized points423 // Somewhat broken 3D plotting function (was used by pmSourceVisualPSFModelResid, but not anymore) 489 424 bool pmSourcePlotPoints3D (int myKapa, Graphdata *graphdata, psVector *xn, psVector *yn, psVector *zn, float theta, float phi) { 490 425 … … 521 456 KapaSetLimits (myKapa, graphdata); 522 457 523 // KapaSetFont (myKapa, "helvetica", 14);524 // KapaBox (myKapa, graphdata);525 // KapaSendLabel (myKapa, "&ss&h_x| (pixels)", KAPA_LABEL_XM);526 // KapaSendLabel (myKapa, "&ss&h_y| (pixels)", KAPA_LABEL_YM);527 528 458 graphdata->color = KapaColorByName ("black"); 529 459 graphdata->ptype = 100;
Note:
See TracChangeset
for help on using the changeset viewer.
