Changeset 13034 for trunk/psModules/src/camera
- Timestamp:
- Apr 25, 2007, 3:20:29 PM (19 years ago)
- Location:
- trunk/psModules/src/camera
- Files:
-
- 3 edited
-
pmFPACopy.c (modified) (2 diffs)
-
pmFPAfile.c (modified) (4 diffs)
-
pmFPAfileIO.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPACopy.c
r12838 r13034 211 211 if (mdok && trimsec && !psRegionIsNaN(*trimsec)) { 212 212 *trimsec = psImageBinningSetRuffRegion(binning, *trimsec); 213 // force integer pixels : truncate x0, roundup x1: 214 trimsec->x0 = (int)trimsec->x0; 215 if (trimsec->x1 > (int)trimsec->x1) { 216 trimsec->x1 = (int)trimsec->x1 + 1; 217 } else { 218 trimsec->x1 = (int)trimsec->x1; 219 } 220 trimsec->y0 = (int)trimsec->y0; 221 if (trimsec->y1 > (int)trimsec->y1) { 222 trimsec->y1 = (int)trimsec->y1 + 1; 223 } else { 224 trimsec->y1 = (int)trimsec->y1; 225 } 213 226 } 214 227 psList *biassecs = psMetadataLookupPtr(&mdok, target->concepts, "CELL.BIASSEC"); // The bias sections … … 219 232 if (!psRegionIsNaN(*biassec)) { 220 233 *biassec = psImageBinningSetRuffRegion(binning, *biassec); 234 // force integer pixels : truncate x0, roundup x1: 235 biassec->x0 = (int)biassec->x0; 236 if (biassec->x1 > (int)biassec->x1) { 237 biassec->x1 = (int)biassec->x1 + 1; 238 } else { 239 biassec->x1 = (int)biassec->x1; 240 } 241 biassec->y0 = (int)biassec->y0; 242 if (biassec->y1 > (int)biassec->y1) { 243 biassec->y1 = (int)biassec->y1 + 1; 244 } else { 245 biassec->y1 = (int)biassec->y1; 246 } 221 247 } 222 248 } -
trunk/psModules/src/camera/pmFPAfile.c
r12890 r13034 17 17 #include "pmFPAfile.h" 18 18 #include "pmFPACopy.h" 19 #include "pmConcepts.h" 19 20 20 21 static void pmFPAfileFree(pmFPAfile *file) … … 326 327 PS_ASSERT_PTR_NON_NULL(view, false); 327 328 329 // XXX this should be smarter (ie, only copy concepts from the current chips) 330 // but such a call is needed, so re-copy stuff rather than no copy 331 pmFPACopyConcepts (out, in); 332 328 333 // pmFPAWrite takes care of all PHUs as needed 329 if ( (view->chip == -1) || in->hdu) {334 if (view->chip == -1) { 330 335 status = pmFPACopyStructure (out, in, xBin, yBin); 331 336 return status; … … 338 343 pmChip *outChip = out->chips->data[view->chip]; 339 344 340 if ( (view->cell == -1) || inChip->hdu) {345 if (view->cell == -1) { 341 346 status = pmChipCopyStructure (outChip, inChip, xBin, yBin); 342 347 return status; 343 } 348 } 344 349 if (view->cell >= inChip->cells->n) { 345 350 psError(PS_ERR_IO, true, "Requested cell == %d>= inChip->cells->n == %ld", … … 350 355 pmCell *outCell = outChip->cells->data[view->cell]; 351 356 352 if ((view->readout == -1) || inCell->hdu) { 353 status = pmCellCopyStructure (outCell, inCell, xBin, yBin); 354 return status; 355 } 356 psError(PS_ERR_UNKNOWN, true, "Returning false"); 357 return false; 357 status = pmCellCopyStructure (outCell, inCell, xBin, yBin); 358 return status; 358 359 } 359 360 -
trunk/psModules/src/camera/pmFPAfileIO.c
r12949 r13034 434 434 case PM_FPA_FILE_FRINGE: 435 435 case PM_FPA_FILE_CMF: 436 case PM_FPA_FILE_PSF: 436 437 psTrace ("psModules.camera", 5, "closing %s (%s) (%d:%d:%d)\n", file->filename, file->name, view->chip, view->cell, view->readout); 437 438 status = psFitsClose (file->fits); … … 447 448 case PM_FPA_FILE_OBJ: 448 449 case PM_FPA_FILE_CMP: 449 case PM_FPA_FILE_PSF:450 450 case PM_FPA_FILE_JPEG: 451 451 case PM_FPA_FILE_KAPA: … … 500 500 case PM_FPA_FILE_CMP: 501 501 case PM_FPA_FILE_CMF: 502 case PM_FPA_FILE_PSF: 502 503 psTrace ("psModules.camera", 5, "NOT freeing %s (%s) : save for further analysis\n", file->filename, file->name); 503 504 return true; 504 case PM_FPA_FILE_PSF:505 505 case PM_FPA_FILE_JPEG: 506 506 case PM_FPA_FILE_KAPA: … … 638 638 case PM_FPA_FILE_FRINGE: 639 639 case PM_FPA_FILE_CMF: 640 case PM_FPA_FILE_PSF: 640 641 psTrace ("psModules.camera", 5, "opening %s (%s) (%d:%d:%d)\n", file->filename, file->name, view->chip, view->cell, view->readout); 641 642 file->fits = psFitsOpen (file->filename, mode); … … 672 673 case PM_FPA_FILE_CMP: 673 674 case PM_FPA_FILE_RAW: 674 case PM_FPA_FILE_PSF:675 675 case PM_FPA_FILE_JPEG: 676 676 case PM_FPA_FILE_KAPA: … … 751 751 752 752 // XXX this function is only called from pmFPAfileWrite 753 // XXX for each data type, there should be a function which writes the PHU, if needed 753 754 bool pmFPAfileWritePHU(pmFPAfile *file, const pmFPAview *view, const pmConfig *config) 754 755 {
Note:
See TracChangeset
for help on using the changeset viewer.
