Changeset 28513
- Timestamp:
- Jun 25, 2010, 3:01:05 PM (16 years ago)
- Location:
- tags/ipp-20100623
- Files:
-
- 5 edited
-
magic/remove/src (modified) (1 prop)
-
magic/remove/src/streaksremove.c (modified) (3 diffs)
-
psLib/src/fits (modified) (1 prop)
-
psLib/src/fits/psFitsImage.c (modified) (1 diff)
-
psLib/src/fits/psFitsTable.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20100623/magic/remove/src
- Property svn:mergeinfo set to
-
tags/ipp-20100623/magic/remove/src/streaksremove.c
r28275 r28513 577 577 } 578 578 579 static void 579 static void 580 580 setStreakBits(psImage *maskImage, psU32 maskStreak) 581 581 { … … 644 644 if (exciseAll) { 645 645 strkGetMaskValues(sf); 646 646 647 647 // add the STREAK bit to the mask image pixels 648 648 setStreakBits(sf->inMask->image, sf->maskStreak); … … 941 941 psArray *inTable = psFitsReadTable(in->fits); 942 942 if (!inTable) { 943 psErrorStackPrint(stderr, "failed to read tablle in %s", in->resolved_name); 944 streaksExit("", PS_EXIT_DATA_ERROR); 945 } 946 if (!inTable->n) { 947 psErrorStackPrint(stderr, "table in %s is empty", in->resolved_name); 943 psErrorStackPrint(stderr, "failed to read table in %s", in->resolved_name); 948 944 streaksExit("", PS_EXIT_DATA_ERROR); 949 945 } -
tags/ipp-20100623/psLib/src/fits
- Property svn:mergeinfo set to
-
tags/ipp-20100623/psLib/src/fits/psFitsImage.c
r27313 r28513 415 415 if (fits_read_subset(fits->fd, info->fitsDatatype, info->firstPixel, info->lastPixel, 416 416 info->increment, nullValue, output->data.V[0], &anynull, &status) != 0) { 417 psFitsError(status, true, "Reading FITS file failed.");417 psFitsError(status, true, "Reading FITS file %s failed.", fits->fd->Fptr->filename); 418 418 return false; 419 419 } -
tags/ipp-20100623/psLib/src/fits/psFitsTable.c
r28508 r28513 39 39 40 40 int status = 0; // CFITSIO status 41 42 // Check for empty table, which looks like an image 43 int hdutype; // Type of HDU 44 fits_get_hdu_type(fits->fd, &hdutype, &status); 45 if (psFitsError(status, true, "Could not determine the HDU type.")) { 46 return -1; 47 } 48 if (hdutype == IMAGE_HDU) { 49 // It could be an empty table 50 int naxis = 0; // Dimensions of image 51 if (fits_get_img_dim(fits->fd, &naxis, &status) != 0) { 52 psFitsError(status, true, "Unable to determine dimension for table."); 53 return -1; 54 } 55 if (naxis != 0) { 56 psFitsError(PS_ERR_BAD_FITS, true, "Current FITS HDU is not a table."); 57 return -1; 58 } 59 return 0; 60 } 61 41 62 long numRows; // Number of rows 42 63 if (fits_get_num_rows(fits->fd, &numRows, &status)) { … … 48 69 } 49 70 71 50 72 // Check the FITS file in preparation for reading a table 51 73 static bool readTableCheck(const psFits *fits // FITS file 52 74 ) 53 75 { 54 PS_ASSERT_FITS_NON_NULL(fits, NULL);76 PS_ASSERT_FITS_NON_NULL(fits, false); 55 77 56 78 if (psFitsGetExtNum(fits) == 0 && !psFitsMoveExtNum(fits, 1, false)) { … … 58 80 return false; 59 81 } 60 61 82 62 83 // check that we are positioned on a table HDU … … 69 90 if (hdutype == IMAGE_HDU) { 70 91 // It could be an empty table 71 long size = 0; // Size of 'table'72 if (fits_get_ num_rows(fits->fd, &size, &status)) {73 psFitsError(status, true, "Unable to determine size oftable.");92 int naxis = 0; // Dimensions of image 93 if (fits_get_img_dim(fits->fd, &naxis, &status) != 0) { 94 psFitsError(status, true, "Unable to determine dimension for table."); 74 95 return false; 75 96 } 76 if ( size!= 0) {97 if (naxis != 0) { 77 98 psFitsError(PS_ERR_BAD_FITS, true, "Current FITS HDU is not a table."); 78 99 return false; 79 100 } 80 } 81 if (hdutype != ASCII_TBL && hdutype != BINARY_TBL) { 101 } else if (hdutype != ASCII_TBL && hdutype != BINARY_TBL) { 82 102 psError(PS_ERR_BAD_FITS, true, _("Current FITS HDU is not a table.")); 83 103 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
