Changeset 10421 for trunk/psModules/src/camera/pmFPAfileDefine.c
- Timestamp:
- Dec 3, 2006, 8:48:10 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPAfileDefine.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAfileDefine.c
r9950 r10421 277 277 } 278 278 279 psString realName = pmConfigConvertFilename (infiles->data[0], config); 280 if (!realName) { 281 psError(PS_ERR_IO, false, "Failed to convert file name %s\n", (char *) infiles->data[0]); 282 return NULL; 283 } 284 279 285 // load the header of the first image 280 fits = psFitsOpen (infiles->data[0], "r"); 286 fits = psFitsOpen (realName, "r"); 287 if (!fits) { 288 psError(PS_ERR_IO, false, "Failed to open file %s\n", realName); 289 psFree (realName); 290 return NULL; 291 } 281 292 phu = psFitsReadHeader (NULL, fits); 293 if (!phu) { 294 psError(PS_ERR_IO, false, "Failed to read file header %s\n", realName); 295 psFree (realName); 296 return NULL; 297 } 282 298 psFitsClose (fits); 283 299 … … 286 302 format = pmConfigCameraFormatFromHeader (config, phu); 287 303 if (!format) { 288 psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", (char *)infiles->data[0]);304 psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", realName); 289 305 psFree(phu); 306 psFree (realName); 290 307 return NULL; 291 308 } … … 294 311 fpa = pmFPAConstruct (config->camera); 295 312 if (!fpa) { 296 psError(PS_ERR_IO, false, "Failed to construct FPA from %s", (char *)infiles->data[0]); 297 return NULL; 298 } 313 psError(PS_ERR_IO, false, "Failed to construct FPA from %s", realName); 314 psFree (realName); 315 return NULL; 316 } 317 psFree (realName); 299 318 300 319 // load the given filerule (from config->camera) and bind it to the fpa … … 337 356 for (int i = 0; i < infiles->n; i++) { 338 357 if (i > 0) { 339 fits = psFitsOpen (infiles->data[i], "r"); 358 psString realName = pmConfigConvertFilename (infiles->data[i], config); 359 if (!realName) { 360 psError(PS_ERR_IO, false, "Failed to convert file name %s", (char *) infiles->data[i]); 361 return NULL; 362 } 363 fits = psFitsOpen (realName, "r"); 364 if (!fits) { 365 psError(PS_ERR_IO, false, "Failed to open file %s\n", realName); 366 psFree (realName); 367 return NULL; 368 } 340 369 phu = psFitsReadHeader (NULL, fits); 341 pmConfigValidateCameraFormat (format, phu); 370 if (!phu) { 371 psError(PS_ERR_IO, false, "Failed to read file header %s", realName); 372 psFree (realName); 373 psFitsClose (fits); 374 return NULL; 375 } 376 if (!pmConfigValidateCameraFormat (format, phu)) { 377 psError(PS_ERR_IO, false, "file %s is not from the required camera", realName); 378 psFree (realName); 379 psFitsClose (fits); 380 return NULL; 381 } 342 382 psFitsClose (fits); 343 383 } … … 545 585 546 586 // Prepend the global path to the file rule 547 if (config->workdir) {548 psStringPrepend(&file->filerule, "%s/", config->workdir);549 }587 psString tmpName = pmConfigConvertFilename (file->filerule, config); 588 psFree (file->filerule); 589 file->filerule = tmpName; 550 590 551 591 if (found) {
Note:
See TracChangeset
for help on using the changeset viewer.
