Changeset 16141 for branches/pap_branch_080117/psLib/src/fits/psFitsImage.c
- Timestamp:
- Jan 18, 2008, 3:04:13 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_080117/psLib/src/fits/psFitsImage.c
r16127 r16141 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.23.2. 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2008-01-1 8 02:41:43 $9 * @version $Revision: 1.23.2.4 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2008-01-19 01:04:13 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 263 263 *floatType = PS_FITS_FLOAT_NONE; 264 264 265 psFitsOptions *options = fits->options; 266 if (!options) { 267 return psMemIncrRefCounter((psImage*)image); // Casting away const 268 } 269 265 270 // Custom floating-point 266 if (PS_IS_PSELEMTYPE_REAL(image->type.type) && fits->conventions.psBitpix &&267 fits->floatType != PS_FITS_FLOAT_NONE) {268 *floatType = fits->floatType;269 return psFitsFloatImageToDisk(image, fits->floatType);271 if (PS_IS_PSELEMTYPE_REAL(image->type.type) && options->conventions.psBitpix && 272 options->floatType != PS_FITS_FLOAT_NONE) { 273 *floatType = options->floatType; 274 return psFitsFloatImageToDisk(image, options->floatType); 270 275 } 271 276 272 277 // Automatically select what we're given 273 if ( fits->bitpix == 0) {278 if (options->bitpix == 0) { 274 279 return psMemIncrRefCounter((psImage*)image); // Casting away const 275 280 } 276 281 277 282 // Quantise floating-point images 278 if (PS_IS_PSELEMTYPE_REAL(image->type.type) && fits->bitpix > 0) {283 if (PS_IS_PSELEMTYPE_REAL(image->type.type) && options->bitpix > 0) { 279 284 if (newScaleZero) { 280 285 // Choose an appropriate BSCALE and BZERO … … 303 308 } 304 309 305 return psFitsScaleForDisk(image, fits ->bitpix, *bscale, *bzero, fits->fuzz, rng);310 return psFitsScaleForDisk(image, fits, *bscale, *bzero, rng); 306 311 } 307 312 … … 320 325 psElemType inType = image->type.type; // Type for input image 321 326 psElemType outType; // Type for output image 322 switch ( fits->bitpix) {327 switch (options->bitpix) { 323 328 CONVERT_TYPE_INT_CASE(outType, inType, 8); 324 329 CONVERT_TYPE_INT_CASE(outType, inType, 16); … … 329 334 default: 330 335 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Target bitpix (%d) is not one of 8,16,32,64", 331 fits->bitpix);336 options->bitpix); 332 337 return NULL; 333 338 } … … 514 519 bzero = cfitsioBzero; 515 520 } 516 assert(bitPix == fits->bitpix || fits->bitpix == 0); 521 psFitsOptions *options = fits->options; // FITS I/O options 522 assert(!options || bitPix == options->bitpix || options->bitpix == 0); 517 523 518 524 int naxis = 3; // Number of axes … … 644 650 bzero = cfitsioBzero; 645 651 } 646 assert(bitPix == fits->bitpix || fits->bitpix == 0); 652 psFitsOptions *options = fits->options; // FITS I/O options 653 assert(!options || bitPix == options->bitpix || options->bitpix == 0); 647 654 648 655 //check to see if the HDU has the same datatype
Note:
See TracChangeset
for help on using the changeset viewer.
