Changeset 12564 for trunk/psModules/src/camera/pmFPARead.c
- Timestamp:
- Mar 22, 2007, 5:09:53 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPARead.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPARead.c
r11793 r12564 39 39 const psRegion *trimsec, // Trim section 40 40 const psList *biassecs, // Bias sections 41 fpaReadType type41 fpaReadType type 42 42 ) 43 43 { … … 65 65 switch (type) { 66 66 case FPA_READ_TYPE_IMAGE: 67 if (readout->image) {68 psFree (readout->image);69 }70 readout->image = psMemIncrRefCounter(psImageSubset(image, region)); 71 break;67 if (readout->image) { 68 psFree (readout->image); 69 } 70 readout->image = psMemIncrRefCounter(psImageSubset(image, region)); 71 break; 72 72 case FPA_READ_TYPE_MASK: 73 if (readout->mask) {74 psFree (readout->mask);75 }76 readout->mask = psMemIncrRefCounter(psImageSubset(image, region)); 77 break;73 if (readout->mask) { 74 psFree (readout->mask); 75 } 76 readout->mask = psMemIncrRefCounter(psImageSubset(image, region)); 77 break; 78 78 case FPA_READ_TYPE_WEIGHT: 79 if (readout->weight) {80 psFree (readout->weight);81 }82 readout->weight = psMemIncrRefCounter(psImageSubset(image, region)); 83 break;79 if (readout->weight) { 80 psFree (readout->weight); 81 } 82 readout->weight = psMemIncrRefCounter(psImageSubset(image, region)); 83 break; 84 84 default: 85 psAbort("Unknown read type: %x\n", type);86 } 87 85 psAbort("Unknown read type: %x\n", type); 86 } 87 88 88 // Get the list of overscans 89 89 // XXX should this step only be performed for IMAGE, not MASK and WEIGHT types? … … 210 210 // check if we have read the desired data, read it if needed 211 211 bool (*hduReadFunc)(pmHDU*, psFits*) = NULL; // Function to use to read the HDU 212 void *dataPointer = NULL; // pointer to location of desired data212 void *dataPointer = NULL; // pointer to location of desired data 213 213 switch (type) { 214 214 case FPA_READ_TYPE_IMAGE: … … 234 234 // do we have the data we want (image, header, or etc). 235 235 if (!dataPointer) { 236 // attempt to read in the desired data237 if (!hduReadFunc(hdu, fits)) {238 psError(PS_ERR_UNKNOWN, false, "Unable to read HDU for cell.\n");239 return false;240 }236 // attempt to read in the desired data 237 if (!hduReadFunc(hdu, fits)) { 238 psError(PS_ERR_UNKNOWN, false, "Unable to read HDU for cell.\n"); 239 return false; 240 } 241 241 } 242 242 … … 250 250 // skip the image arrays completely for the header-only files 251 251 if (type == FPA_READ_TYPE_HEADER) { 252 pmCellSetDataStatus(cell, true);253 return true;252 pmCellSetDataStatus(cell, true); 253 return true; 254 254 } 255 255 256 256 // set up pointers for the different possible image arrays 257 psArray *imageArray = NULL; // Array of images in the HDU257 psArray *imageArray = NULL; // Array of images in the HDU 258 258 psElemType imageType = PS_TYPE_F32; // Expected type for image 259 259 switch (type) { … … 263 263 break; 264 264 case FPA_READ_TYPE_MASK: 265 imageArray = hdu->masks;265 imageArray = hdu->masks; 266 266 imageType = PS_TYPE_MASK; 267 267 break;
Note:
See TracChangeset
for help on using the changeset viewer.
