Changeset 23487 for trunk/magic/remove/src/streaksio.c
- Timestamp:
- Mar 23, 2009, 9:42:42 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/streaksio.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksio.c
r21481 r23487 75 75 } 76 76 } 77 77 78 78 psElemType tileType; // Type corresponding to "long" 79 79 if (sizeof(long) == sizeof(psS64)) { … … 214 214 215 215 // XXX: I should probably be using a different file rule for diffs, but I don't 216 // have an input rule that takes a diff image. 216 // have an input rule that takes a diff image. 217 217 // Since they're skycells, this should be compatible 218 218 sfile->pmfile = pmFPAfileDefineFromArgs(&status, config, "PPSUB.INPUT", "INPUT"); … … 229 229 psFree(view); 230 230 sfile->resolved_name = psStringCopy(sfile->pmfile->filename); 231 231 232 232 // copy header from fpu 233 233 sfile->header = (psMetadata*) psMemIncrRefCounter(sfile->pmfile->fpa->hdu->header); … … 248 248 } 249 249 250 // if outputFilename is not null name it contains the "directory" 250 // if outputFilename is not null name it contains the "directory" 251 251 // and outputFilename is the basename name of the file (or nebulous key) 252 252 // and the file is to be opened for writing … … 293 293 bool status = psFitsMoveExtNum(sfile->fits, extnum, false); 294 294 if (!status) { 295 psError(PS_ERR_IO, false, 295 psError(PS_ERR_IO, false, 296 296 "failed to move to extension %d for %s", extnum, sfile->resolved_name); 297 297 streaksExit("", PS_EXIT_DATA_ERROR); … … 427 427 return true; 428 428 } else if (in->nHDU == 1) { 429 // no extensions in the file, can just return true? For now require 429 // no extensions in the file, can just return true? For now require 430 430 // at least one dimension 431 431 int naxis = psMetadataLookupS32(&status, in->header, "NAXIS"); … … 524 524 in->header = psFitsReadHeader(NULL, in->fits); 525 525 if (!in->header) { 526 psError(PS_ERR_IO, false, "failed to read header from %s extnum: %d", 526 psError(PS_ERR_IO, false, "failed to read header from %s extnum: %d", 527 527 in->resolved_name, extnum); 528 528 streaksExit("", PS_EXIT_DATA_ERROR); … … 541 541 in->image = psFitsReadImage(in->fits, region, 0); 542 542 if (!in->image) { 543 psError(PS_ERR_IO, false, "failed to read image from %s extnum: %d", 543 psError(PS_ERR_IO, false, "failed to read image from %s extnum: %d", 544 544 in->resolved_name, extnum); 545 545 streaksExit("", PS_EXIT_DATA_ERROR); … … 559 559 in->imagecube = psFitsReadImageCube(in->fits, region); 560 560 if (!in->imagecube) { 561 psError(PS_ERR_IO, false, "failed to read image cube from %s extnum: %d", 561 psError(PS_ERR_IO, false, "failed to read image cube from %s extnum: %d", 562 562 in->resolved_name, extnum); 563 563 streaksExit("", PS_EXIT_DATA_ERROR); … … 631 631 // XXX abort? 632 632 return; 633 } 633 } 634 634 if (!extname) { 635 635 psWarning("extnum %d has no image and extname not defined in %s", … … 689 689 } 690 690 if (!psFitsWriteImage(sfile->fits, sfile->header, sfile->image, 0, extname)) { 691 psError(PS_ERR_IO, false, "failed to write image to %s extnum: %d", 691 psError(PS_ERR_IO, false, "failed to write image to %s extnum: %d", 692 692 sfile->resolved_name, extnum); 693 693 streaksExit("", PS_EXIT_DATA_ERROR); … … 706 706 } 707 707 if (!psFitsWriteImageCube(sfile->fits, sfile->header, imagecube, extname)) { 708 psError(PS_ERR_IO, false, "failed to write image to %s extnum: %d", 708 psError(PS_ERR_IO, false, "failed to write image to %s extnum: %d", 709 709 sfile->resolved_name, extnum); 710 710 streaksExit("", PS_EXIT_DATA_ERROR); … … 732 732 } 733 733 if (sfile->fits && !psFitsClose(sfile->fits)) { 734 psError(PS_ERR_IO, false, "failed to close image to %s", 734 psError(PS_ERR_IO, false, "failed to close image to %s", 735 735 sfile->resolved_name); 736 736 streaksExit("", PS_EXIT_DATA_ERROR); … … 1030 1030 1031 1031 void 1032 streaksNebulousCleanup( )1032 streaksNebulousCleanup(void) 1033 1033 { 1034 1034 nebServerFree(ourNebServer);
Note:
See TracChangeset
for help on using the changeset viewer.
