Changeset 10421 for trunk/psModules/src/objects/pmPSF_IO.c
- Timestamp:
- Dec 3, 2006, 8:48:10 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmPSF_IO.c (modified) (25 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmPSF_IO.c
r9770 r10421 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-1 0-28 20:23:51$8 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-12-03 18:48:10 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 117 117 } 118 118 119 bool pmFPAviewWritePSFmodel (const pmFPAview *view, pmFPAfile *file )119 bool pmFPAviewWritePSFmodel (const pmFPAview *view, pmFPAfile *file, pmConfig *config) 120 120 { 121 121 … … 123 123 124 124 if (view->chip == -1) { 125 pmFPAWritePSFmodel (fpa, view, file );125 pmFPAWritePSFmodel (fpa, view, file, config); 126 126 return true; 127 127 } … … 133 133 134 134 if (view->cell == -1) { 135 pmChipWritePSFmodel (chip, view, file );135 pmChipWritePSFmodel (chip, view, file, config); 136 136 return true; 137 137 } … … 143 143 144 144 if (view->readout == -1) { 145 pmCellWritePSFmodel (cell, view, file );145 pmCellWritePSFmodel (cell, view, file, config); 146 146 return true; 147 147 } … … 152 152 pmReadout *readout = cell->readouts->data[view->readout]; 153 153 154 pmReadoutWritePSFmodel (readout, view, file );154 pmReadoutWritePSFmodel (readout, view, file, config); 155 155 return true; 156 156 } 157 157 158 158 // read in all chip-level PSFmodel files for this FPA 159 bool pmFPAWritePSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file )159 bool pmFPAWritePSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config) 160 160 { 161 161 … … 163 163 164 164 pmChip *chip = fpa->chips->data[i]; 165 pmChipWritePSFmodel (chip, view, file );165 pmChipWritePSFmodel (chip, view, file, config); 166 166 } 167 167 return true; … … 169 169 170 170 // read in all cell-level PSFmodel files for this chip 171 bool pmChipWritePSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file )171 bool pmChipWritePSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config) 172 172 { 173 173 … … 175 175 176 176 pmCell *cell = chip->cells->data[i]; 177 pmCellWritePSFmodel (cell, view, file );177 pmCellWritePSFmodel (cell, view, file, config); 178 178 } 179 179 return true; … … 181 181 182 182 // read in all readout-level PSFmodel files for this cell 183 bool pmCellWritePSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file )183 bool pmCellWritePSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config) 184 184 { 185 185 … … 187 187 188 188 pmReadout *readout = cell->readouts->data[i]; 189 pmReadoutWritePSFmodel (readout, view, file );189 pmReadoutWritePSFmodel (readout, view, file, config); 190 190 } 191 191 return true; … … 193 193 194 194 // read in all readout-level Objects files for this cell 195 bool pmReadoutWritePSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file )195 bool pmReadoutWritePSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config) 196 196 { 197 197 bool status; 198 198 char *filename; 199 char *realname; 199 200 200 201 pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF"); … … 203 204 case PM_FPA_FILE_PSF: 204 205 filename = pmFPAfileNameFromRule (file->filerule, file, view); 206 realname = pmConfigConvertFilename (filename, config); 207 205 208 psMetadata *psfData = pmPSFtoMetadata (NULL, psf); 206 psMetadataConfigWrite (psfData, filename);209 psMetadataConfigWrite (psfData, realname); 207 210 psFree (psfData); 211 psFree (realname); 208 212 psFree (filename); 209 213 return true; … … 218 222 219 223 220 bool pmFPAviewReadPSFmodel (const pmFPAview *view, pmFPAfile *file )224 bool pmFPAviewReadPSFmodel (const pmFPAview *view, pmFPAfile *file, pmConfig *config) 221 225 { 222 226 … … 224 228 225 229 if (view->chip == -1) { 226 pmFPAReadPSFmodel (fpa, view, file );230 pmFPAReadPSFmodel (fpa, view, file, config); 227 231 return true; 228 232 } … … 234 238 235 239 if (view->cell == -1) { 236 pmChipReadPSFmodel (chip, view, file );240 pmChipReadPSFmodel (chip, view, file, config); 237 241 return true; 238 242 } … … 244 248 245 249 if (view->readout == -1) { 246 pmCellReadPSFmodel (cell, view, file );250 pmCellReadPSFmodel (cell, view, file, config); 247 251 return true; 248 252 } … … 253 257 pmReadout *readout = cell->readouts->data[view->readout]; 254 258 255 pmReadoutReadPSFmodel (readout, view, file );259 pmReadoutReadPSFmodel (readout, view, file, config); 256 260 return true; 257 261 } 258 262 259 263 // read in all chip-level PSFmodel files for this FPA 260 bool pmFPAReadPSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file )264 bool pmFPAReadPSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config) 261 265 { 262 266 … … 264 268 265 269 pmChip *chip = fpa->chips->data[i]; 266 pmChipReadPSFmodel (chip, view, file );270 pmChipReadPSFmodel (chip, view, file, config); 267 271 } 268 272 return true; … … 270 274 271 275 // read in all cell-level PSFmodel files for this chip 272 bool pmChipReadPSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file )276 bool pmChipReadPSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config) 273 277 { 274 278 … … 276 280 277 281 pmCell *cell = chip->cells->data[i]; 278 pmCellReadPSFmodel (cell, view, file );282 pmCellReadPSFmodel (cell, view, file, config); 279 283 } 280 284 return true; … … 282 286 283 287 // read in all readout-level PSFmodel files for this cell 284 bool pmCellReadPSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file )288 bool pmCellReadPSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config) 285 289 { 286 290 … … 288 292 289 293 pmReadout *readout = cell->readouts->data[i]; 290 pmReadoutReadPSFmodel (readout, view, file );294 pmReadoutReadPSFmodel (readout, view, file, config); 291 295 } 292 296 return true; … … 294 298 295 299 // read in all readout-level Objects files for this cell 296 bool pmReadoutReadPSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file )300 bool pmReadoutReadPSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config) 297 301 { 298 302 299 303 unsigned int Nfail; 300 304 char *filename; 305 char *realname; 301 306 302 307 switch (file->type) { 303 308 case PM_FPA_FILE_PSF: 304 309 filename = pmFPAfileNameFromRule (file->filerule, file, view); 305 306 psMetadata *psfData = psMetadataConfigRead(NULL, &Nfail, filename, FALSE); 310 realname = pmConfigConvertFilename (filename, config); 311 312 psMetadata *psfData = psMetadataConfigRead(NULL, &Nfail, realname, FALSE); 307 313 pmPSF *psf = pmPSFfromMetadata (psfData); 308 314 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN, "psphot psf", psf); … … 310 316 psFree (psf); 311 317 psFree (psfData); 318 psFree (realname); 312 319 psFree (filename); 313 320
Note:
See TracChangeset
for help on using the changeset viewer.
