Changeset 24286
- Timestamp:
- Jun 1, 2009, 11:43:02 AM (17 years ago)
- Location:
- trunk/magic/remove/src
- Files:
-
- 6 edited
-
Makefile.simple (modified) (1 diff)
-
streaksio.c (modified) (3 diffs)
-
streaksio.h (modified) (1 diff)
-
streaksrelease.c (modified) (4 diffs)
-
streaksremove.c (modified) (3 diffs)
-
streaksreplace.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/Makefile.simple
r23910 r24286 28 28 streaksrelease.o 29 29 30 #STREAKSFLAGS=-DSTREAKS_COMPRESS_OUTPUT=130 STREAKSFLAGS=-DSTREAKS_COMPRESS_OUTPUT=1 31 31 OPTFLAGS= -g -O2 32 32 OPTFLAGS= -g -
trunk/magic/remove/src/streaksio.c
r24283 r24286 602 602 603 603 static void 604 setFitsOptions(sFile *sfile, int bitpix, float bscale, float bzero) 604 setFitsOptions(sFile *sfile, int bitpix, float bscale, float bzero, psFitsCompressionType compType, 605 psVector *tiles) 605 606 { 606 607 if (!sfile) { … … 615 616 sfile->fits->options->bscale = bscale; 616 617 sfile->fits->options->bzero = bzero; 617 } 618 619 void 620 copyFitsOptions(sFile *out, sFile *rec, sFile *in) 621 { 618 619 psFitsSetCompression(sfile->fits, compType, tiles, 8, 0, 0); 620 } 621 622 void 623 copyFitsOptions(sFile *out, sFile *rec, sFile *in, psVector *tiles) 624 { 625 bool mdok; 626 psString compTypeStr = psMetadataLookupStr(&mdok, in->header, "ZCMPTYPE"); 627 psFitsCompressionType compType = psFitsCompressionTypeFromString(compTypeStr); 628 if (compType == PS_FITS_COMPRESS_NONE) { 629 return; 630 } 622 631 // Get current BITPIX, BSCALE, BZERO, EXTNAME 623 632 // Probably not necessary to look the numerical values up in this … … 646 655 647 656 #ifdef STREAKS_COMPRESS_OUTPUT 648 // Paul says that I should be able to leave this blank 649 bitpix = 0; 650 setFitsOptions(out, bitpix, bscale, bzero); 651 setFitsOptions(rec, bitpix, bscale, bzero); 657 // printf("%d %f %f\n", bitpix, bscale, bzero); 658 setFitsOptions(out, bitpix, bscale, bzero, compType, tiles); 659 setFitsOptions(rec, bitpix, bscale, bzero, compType, tiles); 652 660 #endif 653 661 } -
trunk/magic/remove/src/streaksio.h
r24283 r24286 14 14 void copyPHU(streakFiles *sfiles, bool remove); 15 15 void copyTable(sFile *out, sFile *in, int extnum); 16 void copyFitsOptions(sFile *out, sFile *rec, sFile *in );16 void copyFitsOptions(sFile *out, sFile *rec, sFile *in, psVector *tiles); 17 17 void setupImageRefs(sFile *out, sFile *recoveryOut, sFile *in, int extnum, bool exciseAll); 18 18 void strkGetMaskValues(streakFiles *sfiles, psU32 *maskStreak, psU32 *maskMask); -
trunk/magic/remove/src/streaksrelease.c
r23965 r24286 275 275 276 276 // set up the compression parameters 277 #ifdef STREAKS_COMPRESS_OUTPUT 278 // compression of the image pixels is disabled for now. Some consortium members 279 // have problems reading them 280 copyFitsOptions(sf->outImage, sf->recImage, sf->inImage); 281 282 // XXX: TODO: can we derive these values from the input header? 283 // psFitsCompressionGet(sf->inImage->image) gives compression none 284 // perhaps we should just use the definition of COMP_IMG in the configuration 285 psFitsSetCompression(sf->outImage->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 286 if (sf->recImage) { 287 psFitsSetCompression(sf->recImage->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 288 } 289 #endif 277 copyFitsOptions(sf->outImage, sf->recImage, sf->inImage, sf->tiles); 290 278 291 279 if (sf->inMask) { … … 306 294 } 307 295 308 #ifdef STREAKS_COMPRESS_OUTPUT 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 } 296 copyFitsOptions(sf->outMask, sf->recMask, sf->inMask, sf->tiles); 315 297 if (sf->outChMask) { 316 copyFitsOptions(sf->outChMask, sf->recChMask, sf->inMask );298 copyFitsOptions(sf->outChMask, sf->recChMask, sf->inMask, sf->tiles); 317 299 psFitsSetCompression(sf->outChMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0); 318 300 if (sf->recChMask) { … … 320 302 } 321 303 } 322 #endif323 304 } 324 305 } … … 332 313 setupImageRefs(sf->outWeight, sf->recWeight, sf->inWeight, sf->extnum, exciseAll); 333 314 334 #ifdef STREAKS_COMPRESS_OUTPUT 335 copyFitsOptions(sf->outWeight, sf->recWeight, sf->inWeight); 336 // XXX: see note above 337 psFitsSetCompression(sf->outWeight->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 338 if (sf->recWeight) { 339 psFitsSetCompression(sf->recWeight->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 340 } 341 #endif 315 copyFitsOptions(sf->outWeight, sf->recWeight, sf->inWeight, sf->tiles); 342 316 } 343 317 // and for raw images, create sub images that represent the actual image -
trunk/magic/remove/src/streaksremove.c
r24283 r24286 569 569 570 570 // set up the compression parameters 571 #ifdef STREAKS_COMPRESS_OUTPUT 572 // compression of the image pixels is disabled for now. Some consortium members 573 // have problems reading them 574 copyFitsOptions(sf->outImage, sf->recImage, sf->inImage); 575 576 // XXX: TODO: can we derive these values from the input header? 577 // psFitsCompressionGet(sf->inImage->image) gives compression none 578 // perhaps we should just use the definition of COMP_IMG in the configuration 579 psFitsSetCompression(sf->outImage->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 580 if (sf->recImage) { 581 psFitsSetCompression(sf->recImage->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 582 } 583 #endif 571 copyFitsOptions(sf->outImage, sf->recImage, sf->inImage, sf->tiles); 584 572 585 573 if (sf->inMask) { … … 605 593 } 606 594 607 #ifdef STREAKS_COMPRESS_OUTPUT 608 // XXX: see note above 609 copyFitsOptions(sf->outMask, sf->recMask, sf->inMask); 610 psFitsSetCompression(sf->outMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0); 611 if (sf->recMask) { 612 psFitsSetCompression(sf->recMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0); 613 } 595 copyFitsOptions(sf->outMask, sf->recMask, sf->inMask, sf->tiles); 614 596 if (sf->outChMask) { 615 copyFitsOptions(sf->outChMask, sf->recChMask, sf->inMask); 616 psFitsSetCompression(sf->outChMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0); 617 if (sf->recChMask) { 618 psFitsSetCompression(sf->recChMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0); 619 } 620 } 621 #endif 597 copyFitsOptions(sf->outChMask, sf->recChMask, sf->inMask, sf->tiles); 598 } 622 599 } 623 600 } … … 636 613 setupImageRefs(sf->outWeight, sf->recWeight, sf->inWeight, sf->extnum, exciseAll); 637 614 638 #ifdef STREAKS_COMPRESS_OUTPUT 639 copyFitsOptions(sf->outWeight, sf->recWeight, sf->inWeight); 640 // XXX: see note above 641 psFitsSetCompression(sf->outWeight->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 642 if (sf->recWeight) { 643 psFitsSetCompression(sf->recWeight->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 644 } 645 #endif 646 } 647 // and for raw images, create sub images that represent the actual image 648 // area (no overscan) 615 copyFitsOptions(sf->outWeight, sf->recWeight, sf->inWeight, sf->tiles); 616 } 649 617 650 618 return true; -
trunk/magic/remove/src/streaksreplace.c
r23965 r24286 344 344 345 345 // set up the compression parameters 346 #ifdef STREAKS_COMPRESS_OUTPUT 347 // compression of the image pixels is disabled for now. Some consortium members 348 // have problems reading compressed images. 349 copyFitsOptions(sf->outImage, sf->recImage, sf->inImage); 350 351 // XXX: TODO: can we derive these values from the input header? 352 // psFitsCompressionGet(sf->inImage->image) gives compression none 353 // perhaps we should just use the definition of COMP_IMG in the configuration 354 psFitsSetCompression(sf->outImage->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 355 #endif 346 copyFitsOptions(sf->outImage, sf->recImage, sf->inImage, sf->tiles); 347 356 348 if (sf->inMask) { 357 349 readImage(sf->inMask, sf->extnum, sf->stage, true); … … 362 354 setupImageRefs(sf->outMask, NULL, sf->inMask, sf->extnum, false); 363 355 364 // XXX: see note above 365 copyFitsOptions(sf->outMask, NULL, sf->inMask); 366 psFitsSetCompression(sf->outMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0); 356 copyFitsOptions(sf->outMask, NULL, sf->inMask, sf->tiles); 367 357 } 368 358 … … 374 364 setupImageRefs(sf->outMask, NULL, sf->inMask, sf->extnum, false); 375 365 376 copyFitsOptions(sf->outWeight, NULL, sf->inWeight); 377 // XXX: see note above 378 psFitsSetCompression(sf->outWeight->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 366 copyFitsOptions(sf->outWeight, NULL, sf->inWeight, sf->tiles); 379 367 } 380 368
Note:
See TracChangeset
for help on using the changeset viewer.
