Changeset 34454
- Timestamp:
- Sep 20, 2012, 2:46:30 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20120906/ppSkycell/src/ppSkycellLoop.c
r34450 r34454 200 200 psImageInit(image1,NAN); 201 201 psImageInit(image2,NAN); 202 for (int y = 0; y < numRows1; y++) {203 for (int x = 0; x < numCols1; x++) {204 image1->data.F32[y][x] = NAN;205 }206 }207 202 208 203 psImage *mask1 = NULL, *mask2 = NULL; // Binned masks … … 220 215 continue; 221 216 } 222 fprintf(stderr,"ISITNAN? %g\n",image1->data.F32[0][0]);223 217 pmFPAfileActivateSingle(data->config->files, true, "PPSKYCELL.IMAGE", j); 224 218 if (data->masksName) { … … 240 234 psFree(view); 241 235 242 // Flip images; no idea why this has to be done, but apparently it does243 /* { */244 /* psImage *rot = psImageRotate(NULL, inRO->image, M_PI, NAN, PS_INTERPOLATE_BILINEAR); */245 /* psFree(inRO->image); */246 /* inRO->image = rot; */247 /* } */248 /* if (inRO->mask) { */249 /* psImage *rot = psImageRotate(NULL, inRO->mask, M_PI, 0, PS_INTERPOLATE_FLAT); */250 /* psFree(inRO->mask); */251 /* inRO->mask = rot; */252 /* } */253 254 236 pmReadout *bin1RO = pmReadoutAlloc(NULL), *bin2RO = pmReadoutAlloc(NULL); // Binned readouts 255 237 if (!pmReadoutRebin(bin1RO, inRO, data->maskVal, data->bin1, data->bin1)) { … … 272 254 // XXX Completely neglecting rotations 273 255 // The skycells are divided up neatly with them all having the same orientation 274 psImageOverlaySection(image1, bin1RO->image, xOffset1, yOffset1, " =");275 psImageOverlaySection(image2, bin2RO->image, xOffset2, yOffset2, " =");256 psImageOverlaySection(image1, bin1RO->image, xOffset1, yOffset1, "E"); 257 psImageOverlaySection(image2, bin2RO->image, xOffset2, yOffset2, "E"); 276 258 if (data->masksName) { 277 259 psImageOverlaySection(mask1, bin1RO->mask, xOffset1, yOffset1, "="); … … 331 313 332 314 // Change wcs here 315 #define WCS_DEBUG 0 333 316 if (modify_wcs1) { 334 317 pmAstromWCS *WCS = pmAstromWCSfromHeader(fits1->fpa->hdu->header); 335 318 double cd1f = 1.0 * data->bin1; 336 319 double cd2f = 1.0 * data->bin1; 320 #if WCS_DEBUG 337 321 fprintf(stderr,">>> %d %d (%g %g) (%g %g) (%g %g)\n",data->bin1,data->bin2, 338 322 cd1f,cd2f,WCS->cdelt1,WCS->cdelt2, 339 323 WCS->crpix1,WCS->crpix2 340 324 ); 341 325 #endif 342 326 WCS->cdelt1 *= cd1f; 343 327 WCS->cdelt2 *= cd2f; 344 328 WCS->crpix1 = WCS->crpix1 / cd1f; 345 329 WCS->crpix2 = WCS->crpix2 / cd2f; 330 #if WCS_DEBUG 346 331 fprintf(stderr,">>> %d %d (%g %g) (%g %g) (%g %g) %d %d %d %d\n",data->bin1,data->bin2, 347 332 cd1f,cd2f,WCS->cdelt1,WCS->cdelt2, … … 350 335 WCS->trans->y->nX, WCS->trans->y->nY 351 336 ); 352 337 #endif 353 338 for (int q = 0; q <= WCS->trans->x->nX; q++) { 354 339 for (int r = 0; r <= WCS->trans->x->nY; r++) { 355 340 WCS->trans->x->coeff[q][r] *= pow(cd1f,q) * pow(cd2f,r); 341 #if WCS_DEBUG 356 342 fprintf(stderr,"PC: %d %d %g %g\n", 357 343 q,r,pow(cd1f,q) * pow(cd2f,r), 358 344 WCS->trans->x->coeff[q][r]); 345 #endif 359 346 } 360 347 } … … 362 349 for (int r = 0; r <= WCS->trans->y->nY; r++) { 363 350 WCS->trans->y->coeff[q][r] *= pow(cd1f,q) * pow(cd2f,r); 351 #if WCS_DEBUG 364 352 fprintf(stderr,"PC: %d %d %g %g\n", 365 353 q,r,pow(cd1f,q) * pow(cd2f,r), 366 354 WCS->trans->y->coeff[q][r]); 367 355 #endif 368 356 } 369 357 } 370 358 pmAstromWCStoHeader (fits1->fpa->hdu->header,WCS); 371 359 WCS = pmAstromWCSfromHeader(fits1->fpa->hdu->header); 360 #if WCS_DEBUG 372 361 fprintf(stderr,">>> %d %d (%g %g) (%g %g) (%g %g)\n",data->bin1,data->bin2, 373 362 cd1f,cd2f,WCS->cdelt1,WCS->cdelt2, 374 363 WCS->crpix1,WCS->crpix2 375 364 ); 376 365 #endif 377 366 modify_wcs1 = 0; 378 367 } … … 426 415 modify_wcs2 = 0; 427 416 } 428 429 430 417 431 418 pmChip *Fchip2 = pmFPAfileThisChip(data->config->files, view, "PPSKYCELL.BIN2");
Note:
See TracChangeset
for help on using the changeset viewer.
