Changeset 41504 for trunk/psLib
- Timestamp:
- Feb 24, 2021, 10:29:51 AM (5 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/fits/psFitsImage.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFitsImage.c
r38538 r41504 308 308 psFitsOptions *options = fits->options; // Options for FITS writing 309 309 310 // psMemCheckCorruption (stderr, true); // 1 311 310 312 // Can't PLIO compress U16,U32,U64 directly, so convert them 311 313 if (psFitsCompressionGetType(fits) == PS_FITS_COMPRESS_PLIO && (!options || options->bitpix == 0)) { … … 329 331 } 330 332 333 // psMemCheckCorruption (stderr, true); // 1x 334 331 335 // Custom floating-point 332 336 if (PS_IS_PSELEMTYPE_REAL(image->type.type) && options->conventions.psBitpix && … … 340 344 return psMemIncrRefCounter((psImage*)image); // Casting away const 341 345 } 346 347 // psMemCheckCorruption (stderr, true); // 2 342 348 343 349 // Quantise floating-point images … … 358 364 return NULL; 359 365 } 366 367 // psMemCheckCorruption (stderr, true); // 2x 368 360 369 status = 0; 361 370 if (fits_read_key_dbl(fits->fd, "BZERO", bzero, NULL, &status) && status != KEY_NO_EXIST) { … … 369 378 return NULL; 370 379 } 380 381 // psMemCheckCorruption (stderr, true); // 3 382 371 383 } 372 384 … … 404 416 break; 405 417 418 419 // psMemCheckCorruption (stderr, true); // 4 420 406 421 *bscale = 1.0; 407 422 *bzero = 0.0; … … 421 436 } 422 437 438 // psMemCheckCorruption (stderr, true); // 3x 439 423 440 if (outType == inType) { 424 441 return psMemIncrRefCounter((psImage*)image); 425 442 } 426 443 444 // psMemCheckCorruption (stderr, true); // 5 445 427 446 if (PSELEMTYPE_SIZEOF(inType) > PSELEMTYPE_SIZEOF(outType)) { 428 447 psWarning("Truncating image pixels to write to disk."); 429 448 } 449 450 // psMemCheckCorruption (stderr, true); // 4x 430 451 431 452 return psImageCopy(NULL, image, outType); … … 647 668 } 648 669 670 // fprintf (stderr, "calling psFitsInsertImageWithMask for %s, %lx, %lx\n", fits->fd->Fptr->filename, (long int) image, (long int) mask); 671 649 672 int numCols = image->numCols; // Number of columns for image 650 673 int numRows = image->numRows; // Number of rows for image … … 659 682 psFitsFloat floatType; // Custom floating-point convention type 660 683 684 // psMemCheckCorruption (stderr, true); 685 661 686 psImage *diskImage = imageToDiskRepresentation(&bscale, &bzero, &boffset, &bsoften, &blank, &floatType, 662 687 fits, image, mask, maskVal, NULL, true); // Image to write out 688 689 // psMemCheckCorruption (stderr, true); 690 691 // fprintf (stderr, "allocated in psFitsInsertImageWithMask %s, %lx\n", fits->fd->Fptr->filename, (long int) diskImage); 663 692 664 693 if (!diskImage) { … … 721 750 naxis = 2; 722 751 } 752 753 // psMemCheckCorruption (stderr, true); 723 754 724 755 bool createPHU = false; // Are we creating a PHU? … … 864 895 } 865 896 897 // psMemCheckCorruption (stderr, true); 898 866 899 if (psFitsError(status, true, "Could not write image to file.")) { 867 900 success = false; … … 877 910 } 878 911 912 913 // psMemCheckCorruption (stderr, true); 879 914 880 915 INSERT_DONE:
Note:
See TracChangeset
for help on using the changeset viewer.
