Changeset 16397
- Timestamp:
- Feb 11, 2008, 4:15:51 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPARead.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPARead.c
r16395 r16397 43 43 // File-static functions 44 44 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 45 46 // Return pointer to appropriate value for tracking scans 47 static int *readoutScansByType(pmReadout *readout, // Readout of interest 48 fpaReadType type // Type of image 49 ) 50 { 51 switch (type) { 52 case FPA_READ_TYPE_IMAGE: 53 return &readout->imageScan; 54 case FPA_READ_TYPE_MASK: 55 return &readout->maskScan; 56 case FPA_READ_TYPE_WEIGHT: 57 return &readout->weightScan; 58 default: 59 psAbort("Unknown read type: %x\n", type); 60 } 61 } 62 63 // Return pointer to appropriate image 64 static psImage **readoutImageByType(pmReadout *readout, // Readout of interest 65 fpaReadType type // Type of image 66 ) 67 { 68 switch (type) { 69 case FPA_READ_TYPE_IMAGE: 70 return &readout->image; 71 case FPA_READ_TYPE_MASK: 72 return &readout->mask; 73 case FPA_READ_TYPE_WEIGHT: 74 return &readout->weight; 75 default: 76 psAbort("Unknown read type: %x\n", type); 77 } 78 } 45 79 46 80 // Determine number of readouts in the FITS file … … 116 150 assert(readout); 117 151 118 psImage *image; // Appropriate image from readout 119 switch (type) { 120 case FPA_READ_TYPE_IMAGE: 121 image = readout->image; 122 break; 123 case FPA_READ_TYPE_MASK: 124 image = readout->mask; 125 break; 126 case FPA_READ_TYPE_WEIGHT: 127 image = readout->weight; 128 break; 129 default: 130 psAbort("Unknown read type: %x\n", type); 131 } 152 psImage *image = *readoutImageByType(readout, type); // Appropriate image from readout 132 153 133 154 // Header and concepts have been read by a call to cellNumReadouts(), so we can just assume they're there. … … 167 188 } 168 189 169 170 190 // Calculate the segment offset and upper limit 171 if (readdir == 1) { 172 // Reading rows 173 if (numScans == 0) { 174 *next = trimsec->x0; 175 } else { 176 *next = image ? readout->row0 + numScans - overlap : 0; 177 } 178 *last = trimsec->y1; 191 if (numScans == 0) { 192 *next = (readdir == 1) ? trimsec->x0 : trimsec->y0; 179 193 } else { 180 // Reading cols 181 if (numScans == 0) { 182 *next = trimsec->y0; 183 } else { 184 *next = image ? readout->col0 + numScans - overlap : 0; 185 } 186 *last = trimsec->x1; 187 } 194 *next = image ? *readoutScansByType(readout, type) + numScans - overlap : 0; 195 } 196 *last = (readdir == 1) ? trimsec->y1 : trimsec->x1; 188 197 189 198 return true; 190 199 } 191 192 static psImage **readoutImageByType(pmReadout *readout, // Readout of interest193 fpaReadType type // Type of image194 )195 {196 switch (type) {197 case FPA_READ_TYPE_IMAGE:198 return &readout->image;199 case FPA_READ_TYPE_MASK:200 return &readout->mask;201 case FPA_READ_TYPE_WEIGHT:202 return &readout->weight;203 default:204 psAbort("Unknown read type: %x\n", type);205 }206 }207 208 200 209 201 static bool readoutMore(pmReadout *readout, // Readout of interest … … 469 461 } 470 462 463 // Update number of scans read 464 int *scansTracker = readoutScansByType(readout, type); // Tracker for how many scans have been read 465 *scansTracker = next; 466 471 467 // Calculate limits, adjust readout->row0,col0 468 // XXX Should row0,col0 be adjusted, since they are used for astrometry??? 469 // Just moved to using the "scansTracker" for tracking position in chunk reads, so row0,col0 not required 472 470 if (readdir == 1) { 473 471 // Reading rows
Note:
See TracChangeset
for help on using the changeset viewer.
