Changeset 15335 for trunk/psLib/src/fits/psFitsImage.c
- Timestamp:
- Oct 19, 2007, 1:52:39 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/fits/psFitsImage.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFitsImage.c
r15179 r15335 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $10 * @date $Date: 2007-10- 03 21:27:21$9 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2007-10-19 23:52:39 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 185 185 } 186 186 187 188 bool psFitsImageSize(int *numCols, int *numRows, psElemType *type, const psFits *fits, psRegion region) 189 { 190 PS_ASSERT_FITS_NON_NULL(fits, NULL); 191 192 if (psFitsCheckSingleCompressedImagePHU(fits, NULL)) { 193 // This is really what we want, not the empty PHU 194 psTrace("psLib.fits", 1, 195 "This PHU should really be a compressed image --- reading that image instead."); 196 } 197 198 p_psFitsReadInfo *info = p_psFitsReadInfoAlloc(fits, region, 0); // How big the region to read is 199 200 if (numCols) { 201 *numCols = info->lastPixel[0] - info->firstPixel[0] + 1; 202 } 203 if (numRows) { 204 *numRows = info->lastPixel[1] - info->firstPixel[1] + 1; 205 } 206 if (type) { 207 *type = info->psDatatype; 208 } 209 210 psFree(info); 211 212 return true; 213 } 214 215 187 216 // Read into an extant image of just the right size 188 217 static bool fitsReadImage(psImage *output, // Output image … … 287 316 { 288 317 PS_ASSERT_FITS_NON_NULL(fits, false); 318 PS_ASSERT_FITS_WRITABLE(fits, false); 289 319 PS_ASSERT_IMAGE_NON_NULL(input, false); 290 320 // this is equivalent to insert after the last HDU … … 302 332 { 303 333 PS_ASSERT_FITS_NON_NULL(fits, false); 334 PS_ASSERT_FITS_WRITABLE(fits, false); 304 335 PS_ASSERT_IMAGE_NON_NULL(input, false); 305 336 … … 402 433 { 403 434 PS_ASSERT_FITS_NON_NULL(fits, false); 435 PS_ASSERT_FITS_WRITABLE(fits, false); 404 436 PS_ASSERT_IMAGE_NON_NULL(input, false); 405 437 … … 556 588 { 557 589 PS_ASSERT_FITS_NON_NULL(fits, false); 590 PS_ASSERT_FITS_WRITABLE(fits, false); 558 591 PS_ASSERT_ARRAY_NON_NULL(input, false); 559 592 … … 622 655 { 623 656 PS_ASSERT_FITS_NON_NULL(fits, false); 657 PS_ASSERT_FITS_WRITABLE(fits, false); 624 658 PS_ASSERT_ARRAY_NON_NULL(input, false); 625 659
Note:
See TracChangeset
for help on using the changeset viewer.
