Changeset 23257
- Timestamp:
- Mar 10, 2009, 3:20:25 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/streaksrelease.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksrelease.c
r21156 r23257 8 8 static void excisePixel(streakFiles *sfiles, unsigned int x, unsigned int y, bool streak, double newMaskValue); 9 9 static void writeImages(streakFiles *sf, bool exciseImageCube); 10 static bool replicateOutputs(streakFiles *sfiles);11 10 12 11 int … … 252 251 // image data directly from psFits 253 252 readImage(sf->inImage, sf->extnum, sf->stage, false); 253 254 // astrom struct is only needed for raw stage, and only the chip to cell parameters are used 255 sf->astrom = streakSetAstrometry(sf->astrom, sf->stage, NULL, NULL, false, 256 sf->inImage->header, sf->inImage->numCols, sf->inImage->numRows); 254 257 } 255 258 sf->outImage->header = (psMetadata*) psMemIncrRefCounter(sf->inImage->header); … … 264 267 if (sf->inImage->image) { 265 268 setupImageRefs(sf->outImage, sf->recImage, sf->inImage, sf->extnum, exciseAll); 269 } else if (sf->inImage->imagecube) { 270 // Image cubes should have been excised in the destreaking process 271 streaksExit("unexpected imagecube found", PS_EXIT_CONFIG_ERROR); 266 272 } else { 267 // Image cubes are handeled specially273 return false; 268 274 } 269 275 … … 285 291 if (sf->inMask) { 286 292 readImage(sf->inMask, sf->extnum, sf->stage, true); 287 sf->outMask->header = (psMetadata*) psMemIncrRefCounter(sf->inMask->header); 288 if (sf->recMask) { 289 sf->recMask->header = (psMetadata*) psMemIncrRefCounter(sf->inMask->header); 290 } 291 setupImageRefs(sf->outMask, sf->recMask, sf->inMask, sf->extnum, exciseAll); 292 if (sf->outChMask) { 293 sf->outChMask->header = (psMetadata *) psMemIncrRefCounter(sf->outMask->header); 294 sf->outChMask->image = (psImage *) psMemIncrRefCounter(sf->outMask->image); 295 if (sf->recChMask) { 296 sf->recChMask->header = (psMetadata *) psMemIncrRefCounter(sf->recMask->header); 297 sf->recChMask->image = (psImage *) psMemIncrRefCounter(sf->recMask->image); 298 } 299 } 293 if (sf->outMask) { 294 sf->outMask->header = (psMetadata*) psMemIncrRefCounter(sf->inMask->header); 295 if (sf->recMask) { 296 sf->recMask->header = (psMetadata*) psMemIncrRefCounter(sf->inMask->header); 297 } 298 setupImageRefs(sf->outMask, sf->recMask, sf->inMask, sf->extnum, exciseAll); 299 if (sf->outChMask) { 300 sf->outChMask->header = (psMetadata *) psMemIncrRefCounter(sf->outMask->header); 301 sf->outChMask->image = (psImage *) psMemIncrRefCounter(sf->outMask->image); 302 if (sf->recChMask) { 303 sf->recChMask->header = (psMetadata *) psMemIncrRefCounter(sf->recMask->header); 304 sf->recChMask->image = (psImage *) psMemIncrRefCounter(sf->recMask->image); 305 } 306 } 300 307 301 308 #ifdef STREAKS_COMPRESS_OUTPUT 302 // XXX: see note above303 copyFitsOptions(sf->outMask, sf->recMask, sf->inMask);304 psFitsSetCompression(sf->outMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0);305 if (sf->recMask) {306 psFitsSetCompression(sf->recMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0);307 }308 if (sf->outChMask) {309 copyFitsOptions(sf->outChMask, sf->recChMask, sf->inMask);310 psFitsSetCompression(sf->outChMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0);311 if (sf->recChMask) {312 psFitsSetCompression(sf->recChMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0);313 }314 }309 // XXX: see note above 310 copyFitsOptions(sf->outMask, sf->recMask, sf->inMask); 311 psFitsSetCompression(sf->outMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0); 312 if (sf->recMask) { 313 psFitsSetCompression(sf->recMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0); 314 } 315 if (sf->outChMask) { 316 copyFitsOptions(sf->outChMask, sf->recChMask, sf->inMask); 317 psFitsSetCompression(sf->outChMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0); 318 if (sf->recChMask) { 319 psFitsSetCompression(sf->recChMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0); 320 } 321 } 315 322 #endif 323 } 316 324 } 317 325 … … 396 404 } 397 405 } 398 399 // for any of the outputs that are stored in Nebulous set their extended attributes400 // and replicate the files401 402 static bool403 replicateOutputs(streakFiles *sfiles)404 {405 bool status = false;406 407 // XXX: TODO: need a nebGetXatrr function, but there isn't one408 // another option would be to take the number of copies to be409 // created as an option. That way the system could decide410 // whether to replicate anything other than raw Image files411 void *xattr = NULL;412 413 if (!replicate(sfiles->outImage, xattr)) {414 psError(PM_ERR_SYS, false, "failed to replicate outImage.");415 return false;416 }417 418 #ifdef notyet419 // XXX: don't replicate mask and weight images until we can look up420 // the input's xattr. There may be a perl program that can getXattr421 if (sfiles->outMask) {422 // get xattr from input to see if we need to replicate423 if (!replicate(sfiles->outMask, xattr)) {424 psError(PM_ERR_SYS, false, "failed to replicate outImage.");425 return false;426 }427 }428 if (sfiles->outWeight) {429 // get xattr from input to see if we need to replicate430 if (!replicate(sfiles->outWeight, xattr)) {431 psError(PM_ERR_SYS, false, "failed to replicate outImage.");432 return false;433 }434 }435 #endif436 437 return true;438 }439 440
Note:
See TracChangeset
for help on using the changeset viewer.
