Changeset 18590 for trunk/psLib/src/fits/psFitsImage.c
- Timestamp:
- Jul 16, 2008, 5:34:22 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/fits/psFitsImage.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFitsImage.c
r18580 r18590 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.3 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2008-07-1 6 23:05:06$9 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2008-07-17 03:34:22 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 703 703 psFitsCompression *compress = NULL; // FITS compression parameters; to save state 704 704 705 bool success = true; // Successful update? 705 706 double bscale = NAN, bzero = NAN; // Scale and zero point to put in header 706 707 long blank = 0; // Blank (undefined) value for image … … 710 711 if (!diskImage) { 711 712 psError(PS_ERR_UNKNOWN, false, "Unable to convert image to desired disk format."); 712 goto UPDATE_FAIL; 713 success = false; 714 goto UPDATE_DONE; 713 715 } 714 716 … … 720 722 if (!psFitsSetCompression(fits, PS_FITS_COMPRESS_NONE, NULL, 0, 0, 0)) { 721 723 psError(PS_ERR_IO, false, "Unable to unset compression."); 722 goto UPDATE_FAIL; 724 success = false; 725 goto UPDATE_DONE; 723 726 } 724 727 } … … 729 732 int dataType; // cfitsio data type 730 733 if (!p_psFitsTypeToCfitsio(diskImage->type.type, &bitPix, &cfitsioBzero, &dataType)) { 731 goto UPDATE_FAIL; 734 success = false; 735 goto UPDATE_DONE; 732 736 } 733 737 if (cfitsioBzero != 0.0) { … … 751 755 psError(PS_ERR_BAD_PARAMETER_SIZE, true, 752 756 _("Current FITS HDU has %ld z-planes, but z-plane %d was specified."), nAxes[2], z); 753 goto UPDATE_FAIL; 757 success = false; 758 goto UPDATE_DONE; 754 759 } 755 760 … … 773 778 "Input image [size of %ix%i] at position (%i,%i) does not all lay in the %lix%li FITS image.", 774 779 numCols, numRows, x0, y0, nAxes[0], nAxes[1]); 775 goto UPDATE_FAIL; 780 success = false; 781 goto UPDATE_DONE; 776 782 } 777 783 … … 782 788 fits_write_subset(fits->fd, dataType, firstPixel, lastPixel, diskImage->data.V[0], &status); 783 789 if (psFitsError(status, true, "Could not write data to file.")) { 784 goto UPDATE_FAIL; 790 success = false; 791 goto UPDATE_DONE; 785 792 } 786 793 … … 790 797 ffrdef(fits->fd, &status); 791 798 if (psFitsError(status, true, "Could not re-scan HDU.")) { 792 goto UPDATE_FAIL; 793 } 794 795 psFree(diskImage); 796 return true; 797 798 UPDATE_FAIL: 799 success = false; 800 goto UPDATE_DONE; 801 } 802 803 UPDATE_DONE: 799 804 psFree(diskImage); 800 805 if (compress) { … … 803 808 psFree(compress); 804 809 } 805 return false; 810 811 return success; 806 812 } 807 813
Note:
See TracChangeset
for help on using the changeset viewer.
