Changeset 15111 for branches/pap_branch_070920/psLib/src/fits/psFits.c
- Timestamp:
- Sep 29, 2007, 11:55:41 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_070920/psLib/src/fits/psFits.c
r14984 r15111 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.71.2. 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2007-09-2 2 03:06:16$9 * @version $Revision: 1.71.2.2 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2007-09-29 21:55:41 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 144 144 &status); 145 145 if (fptr == NULL || status != 0) { 146 char fitsErr[MAX_STRING_LENGTH] 147 ; 146 char fitsErr[MAX_STRING_LENGTH]; 148 147 fits_get_errstatus(status, fitsErr); 149 148 psError(PS_ERR_IO, true, … … 163 162 &status); 164 163 if (fptr == NULL || status != 0) { 165 char fitsErr[MAX_STRING_LENGTH] 166 ; 164 char fitsErr[MAX_STRING_LENGTH]; 167 165 fits_get_errstatus(status, fitsErr); 168 166 psError(PS_ERR_IO, true, … … 211 209 } 212 210 213 static void psFits OptionsFree(psFitsOptions *opt)214 { 215 psFree( opt->tilesize);216 } 217 218 psFits Options* psFitsOptionsAlloc(211 static void psFitsCompressionFree(psFitsCompression *comp) 212 { 213 psFree(comp->tilesize); 214 } 215 216 psFitsCompression* psFitsCompressionAlloc( 219 217 psFitsCompressionType type, ///< type of compression 220 218 psVector *tilesize, ///< vector defining compression tile size … … 224 222 ) 225 223 { 226 psFitsOptions *opt = psAlloc(sizeof(psFitsOptions)); 227 228 opt->type = type; 229 opt->tilesize = psVectorCopy(NULL, tilesize, PS_DATA_S64); 230 opt->noisebits = noisebits; 231 opt->scale = scale; 232 opt->smooth = smooth; 233 234 psMemSetDeallocator(opt, (psFreeFunc) psFitsOptionsFree); 235 236 return opt; 224 psFitsCompression *comp = psAlloc(sizeof(psFitsCompression)); 225 psMemSetDeallocator(comp, (psFreeFunc) psFitsCompressionFree); 226 227 comp->type = type; 228 comp->tilesize = psVectorCopy(NULL, tilesize, PS_DATA_S64); 229 comp->noisebits = noisebits; 230 comp->scale = scale; 231 comp->smooth = smooth; 232 233 return comp; 237 234 } 238 235 … … 669 666 psAbort("can't map (long) type to a psLib type"); 670 667 } 668 psFree(dim); 671 669 // status check belongs to fits_set_tile_dim() call 672 670 if (status) { … … 711 709 712 710 713 bool psFits SetOptions(711 bool psFitsCompressionApply( 714 712 psFits* fits, ///< psFits object to close 715 psFits Options *opt///< options object713 psFitsCompression *comp ///< options object 716 714 ) 717 715 { 718 return psFitsSetCompression( 719 fits, 720 opt->type, 721 opt->tilesize, 722 opt->noisebits, 723 opt->scale, 724 opt->smooth); 716 return psFitsSetCompression(fits, comp->type, comp->tilesize, comp->noisebits, comp->scale, comp->smooth); 725 717 } 726 718 … … 855 847 856 848 849 psFitsCompressionType psFitsCompressionTypeFromString(const char *string) 850 { 851 if (!string || strlen(string) == 0) { 852 psWarning("Unable to identify compression type --- none set."); 853 return PS_FITS_COMPRESS_NONE; 854 } 855 856 if (strcmp(string, "GZIP") == 0) return PS_FITS_COMPRESS_GZIP; 857 if (strcmp(string, "RICE") == 0) return PS_FITS_COMPRESS_RICE; 858 if (strcmp(string, "HCOMPRESS") == 0) return PS_FITS_COMPRESS_HCOMPRESS; 859 if (strcmp(string, "PLIO") == 0) return PS_FITS_COMPRESS_PLIO; 860 861 psWarning("Unable to identify compression type (%s) --- none set.", string); 862 return PS_FITS_COMPRESS_NONE; 863 }
Note:
See TracChangeset
for help on using the changeset viewer.
