Changeset 13191
- Timestamp:
- May 3, 2007, 10:04:18 AM (19 years ago)
- Location:
- trunk/psModules/src/objects
- Files:
-
- 2 edited
-
pmPSF_IO.c (modified) (6 diffs)
-
pmPSF_IO.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmPSF_IO.c
r13034 r13191 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-0 4-26 01:20:29$8 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-05-03 20:04:18 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 #include "pmModelGroup.h" 44 44 #include "pmSourceIO.h" 45 46 bool pmFPAviewCheckDataStatusForPSFmodel (const pmFPAview *view, const pmFPAfile *file) 47 { 48 pmFPA *fpa = file->fpa; 49 50 if (view->chip == -1) { 51 bool exists = pmFPACheckDataStatusForPSFmodel (fpa); 52 return exists; 53 } 54 if (view->chip >= fpa->chips->n) { 55 psError(PS_ERR_IO, true, "Requested chip == %d >= fpa->chips->n == %ld", view->chip, fpa->chips->n); 56 return false; 57 } 58 pmChip *chip = fpa->chips->data[view->chip]; 59 60 if (view->cell == -1) { 61 bool exists = pmChipCheckDataStatusForPSFmodel (chip); 62 return exists; 63 } 64 if (view->cell >= chip->cells->n) { 65 psError(PS_ERR_IO, true, "Requested cell == %d >= chip->cells->n == %ld", view->cell, chip->cells->n); 66 return false; 67 } 68 pmCell *cell = chip->cells->data[view->cell]; 69 70 if (view->readout == -1) { 71 bool exists = pmCellCheckDataStatusForPSFmodel (cell); 72 return exists; 73 } 74 75 if (view->readout >= cell->readouts->n) { 76 psError(PS_ERR_IO, true, "Requested readout == %d >= cell->readouds->n == %ld", view->readout, cell->readouts->n); 77 return false; 78 } 79 pmReadout *readout = cell->readouts->data[view->readout]; 80 81 bool exists = pmReadoutCheckDataStatusForPSFmodel (readout); 82 return exists; 83 } 84 85 bool pmFPACheckDataStatusForPSFmodel (const pmFPA *fpa) { 86 87 for (int i = 0; i < fpa->chips->n; i++) { 88 pmChip *chip = fpa->chips->data[i]; 89 if (!chip) continue; 90 if (pmChipCheckDataStatusForPSFmodel (chip)) return true; 91 } 92 return false; 93 } 94 95 bool pmChipCheckDataStatusForPSFmodel (const pmChip *chip) { 96 97 for (int i = 0; i < chip->cells->n; i++) { 98 pmCell *cell = chip->cells->data[i]; 99 if (!cell) continue; 100 if (pmCellCheckDataStatusForPSFmodel (cell)) return true; 101 } 102 return false; 103 } 104 105 bool pmCellCheckDataStatusForPSFmodel (const pmCell *cell) { 106 107 for (int i = 0; i < cell->readouts->n; i++) { 108 pmReadout *readout = cell->readouts->data[i]; 109 if (!readout) continue; 110 if (pmReadoutCheckDataStatusForPSFmodel (readout)) return true; 111 } 112 return false; 113 } 114 115 bool pmReadoutCheckDataStatusForPSFmodel (const pmReadout *readout) { 116 117 bool status; 118 119 // select the psf of interest 120 pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF"); 121 if (!psf) return false; 122 return true; 123 } 45 124 46 125 bool pmFPAviewWritePSFmodel (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) … … 618 697 619 698 switch (file->type) { 620 case PM_FPA_FILE_PSF:699 case PM_FPA_FILE_PSF: 621 700 filename = pmFPAfileNameFromRule (file->filerule, file, view); 622 701 bool create = file->mode == PM_FPA_MODE_WRITE ? true : false; … … 630 709 return true; 631 710 632 default:711 default: 633 712 fprintf (stderr, "warning: type mismatch\n"); 634 713 break; … … 646 725 647 726 switch (file->type) { 648 case PM_FPA_FILE_PSF:727 case PM_FPA_FILE_PSF: 649 728 filename = pmFPAfileNameFromRule (file->filerule, file, view); 650 729 bool create = file->mode == PM_FPA_MODE_WRITE ? true : false; … … 662 741 return true; 663 742 664 default:743 default: 665 744 fprintf (stderr, "warning: type mismatch\n"); 666 745 break; -
trunk/psModules/src/objects/pmPSF_IO.h
r12832 r13191 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-0 4-14 03:22:48 $8 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-05-03 20:04:18 $ 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 11 11 */ … … 31 31 bool pmReadoutReadPSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 32 32 33 bool pmFPAviewCheckDataStatusForPSFmodel (const pmFPAview *view, const pmFPAfile *file); 34 bool pmFPACheckDataStatusForPSFmodel (const pmFPA *fpa); 35 bool pmChipCheckDataStatusForPSFmodel (const pmChip *chip); 36 bool pmCellCheckDataStatusForPSFmodel (const pmCell *cell); 37 bool pmReadoutCheckDataStatusForPSFmodel (const pmReadout *readout); 38 33 39 /// @} 34 40 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
