- Timestamp:
- Oct 28, 2008, 1:20:29 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branch_20081011/psModules/src/astrom/pmAstrometryVisual.c
r20415 r20443 259 259 260 260 261 /** Plot the refinements that pmAstromGridTweak makes to the offset between raw and ref stars */ 262 bool pmAstromVisualPlotTweak (psVector *xHist, psVector *yHist, psVector *xHistNew, psVector *yHistNew, int xBin, int yBin) 261 /** Plot the refinements made within pmAstromGridTweak. 262 * After pmAstromGridMatch finds the best rotaion/scale/offset between raw and reference stars 263 * within a coarse grid of rotations/scales, pmAstromGridTweak computes a higher precision 264 * estimate of the offset. It computes the 2 point correlation function between raw and ref 265 * stars along horizontal and vertical cuts through the first-guess offset. It finds the peak 266 * of these two profiles and adjusts the offset accordingly. This procedure plots the profiles. 267 */ 268 bool pmAstromVisualPlotTweak (psVector *xHist, psVector *yHist, int xBin, int yBin) 263 269 { 264 270 //make sure we want to plot this … … 274 280 psVector *xIndices = psVectorAlloc (xHist->n, PS_TYPE_F32); 275 281 psVector *yIndices = psVectorAlloc (yHist->n, PS_TYPE_F32); 276 277 282 278 283 //populate the Indices vectors … … 298 303 KapaSendLabel (kapa, "Horizontal Profile", 299 304 KAPA_LABEL_XP); 300 graphdata.style = 2;305 graphdata.style = 1; 301 306 graphdata.ptype = 0; 302 307 graphdata.size = 0.4; … … 307 312 KapaPlotVector (kapa, xHist->n, xHist->data.F32, "y"); 308 313 309 //overplot smoothed line310 graphdata.style = 1;311 graphdata.color = KapaColorByName ("red");312 KapaPrepPlot (kapa, xHist->n, &graphdata);313 KapaPlotVector (kapa, xHist->n, xIndices->data.F32, "x");314 KapaPlotVector (kapa, xHist->n, xHistNew->data.F32, "y");315 316 314 //overplot the peak 317 315 float x[2] = {xBin, xBin}; 318 316 float y[2] = {-500, 500}; 319 graphdata.color = KapaColorByName (" black");317 graphdata.color = KapaColorByName ("red"); 320 318 KapaPrepPlot (kapa, 2, &graphdata); 321 319 KapaPlotVector (kapa, 2, x, "x"); … … 328 326 KapaSetFont(kapa, "helvetica", 14); 329 327 KapaBox(kapa, &graphdata); 330 KapaSendLabel (kapa, " Xoffset Bin", KAPA_LABEL_XM);328 KapaSendLabel (kapa, "Y offset Bin", KAPA_LABEL_XM); 331 329 KapaSendLabel (kapa, "Number of Sources", KAPA_LABEL_YM); 332 330 KapaSendLabel (kapa, "Vertical Profile", 333 331 KAPA_LABEL_XP); 334 graphdata.style = 2;332 graphdata.style = 1; 335 333 graphdata.ptype = 0; 336 334 graphdata.size = 0.4; … … 341 339 KapaPlotVector (kapa, yHist->n, yHist->data.F32, "y"); 342 340 343 //overplot smoothed line344 graphdata.style = 1;345 graphdata.color = KapaColorByName ("red");346 KapaPrepPlot (kapa, yHist->n, &graphdata);347 KapaPlotVector (kapa, yHist->n, yIndices->data.F32, "x");348 KapaPlotVector (kapa, yHist->n, yHistNew->data.F32, "y");349 350 341 //overplot the peak 351 342 x[0] = x[1] = yBin; 352 graphdata.color = KapaColorByName (" black");343 graphdata.color = KapaColorByName ("red"); 353 344 KapaPrepPlot (kapa, 2, &graphdata); 354 345 KapaPlotVector (kapa, 2, x, "x"); … … 356 347 357 348 //plot title 349 graphdata.color = KapaColorByName("black"); 358 350 KapaSection section3 = {"s3", 0, 0, 1, 1}; 359 351 KapaSetSection( kapa, §ion3); … … 366 358 psFree(yIndices); 367 359 return true; 368 } 369 370 371 /** p sastroVisualScaleGraphdata360 } //end of pmAstromPlotTweak 361 362 363 /** pmAstromScaleGraphdata 372 364 * Scale the graphdata structure based on x and y coordinates. Use sigma clipping to 373 365 * prevent outliers from making te plot region too big. … … 441 433 442 434 443 444 435 # else 445 436 … … 449 440 bool pmAstromVisualClose() { return true; } 450 441 bool pmAstromVisualPlotGridMatch (const psArray *raw, const psArray *ref, psImage *gridNP, double offsetX, double offsetY, double maxOffpix, double Scale, double Offset) { return true; } 442 bool pmAstromVisualPlotTweak (psVector *xHist, psVector *yHist, int xBin, int yBin) {return true;} 451 443 452 444 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
