Changeset 15179 for trunk/psLib/src/fits/psFitsTable.c
- Timestamp:
- Oct 3, 2007, 11:27:21 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/fits/psFitsTable.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFitsTable.c
r12549 r15179 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2007- 03-22 21:40:47$9 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2007-10-03 21:27:21 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 38 38 int row) 39 39 { 40 PS_ASSERT_FITS_NON_NULL(fits, NULL); 41 PS_ASSERT_INT_NONNEGATIVE(row, NULL); 42 40 43 long numRows; 41 44 int numCols; 42 45 int status = 0; 43 44 if (fits == NULL) {45 psError(PS_ERR_BAD_PARAMETER_NULL, true,46 _("The input psFits object can not NULL."));47 return NULL;48 }49 46 50 47 // check to see if we even are positioned on a table HDU … … 185 182 const char* colname) 186 183 { 184 PS_ASSERT_FITS_NON_NULL(fits, NULL); 185 PS_ASSERT_STRING_NON_EMPTY(colname, NULL); 186 187 187 int colnum = 0; 188 188 int status = 0; 189 190 if (fits == NULL) {191 psError(PS_ERR_BAD_PARAMETER_NULL, true,192 _("The input psFits object can not NULL."));193 return NULL;194 }195 189 196 190 // check to see if we even are positioned on a table HDU … … 266 260 const char* colname) 267 261 { 262 PS_ASSERT_FITS_NON_NULL(fits, NULL); 263 PS_ASSERT_STRING_NON_EMPTY(colname, NULL); 264 268 265 int status = 0; 269 266 int colnum = 0; 270 271 if (fits == NULL) {272 psError(PS_ERR_BAD_PARAMETER_NULL, true,273 _("The input psFits object can not NULL."));274 return NULL;275 }276 267 277 268 // check to see if we even are positioned on a table HDU … … 348 339 psArray* psFitsReadTable(const psFits* fits) 349 340 { 341 PS_ASSERT_FITS_NON_NULL(fits, NULL); 342 350 343 int status = 0; 351 352 if (fits == NULL) {353 psError(PS_ERR_BAD_PARAMETER_NULL, true,354 _("The input psFits object can not NULL."));355 return NULL;356 }357 344 358 345 // check to see if we even are positioned on a table HDU … … 400 387 const char *extname) 401 388 { 402 psFitsMoveLast(fits); 389 PS_ASSERT_FITS_NON_NULL(fits, false); 390 if (!psFitsMoveLast(fits)) { 391 psError(PS_ERR_UNKNOWN, false, "Unable to move to last extension to write table"); 392 return false; 393 } 403 394 return psFitsInsertTable(fits, header, table, extname, true); 404 395 } … … 460 451 // Column specification 461 452 // Included here, because there's no need for the user to have access to it 462 typedef struct 463 { 453 typedef struct { 464 454 psDataType type; // psLib type (e.g., PS_DATA_STRING or PS_TYPE_F32) 465 455 size_t size; // Size (number of repeats) 466 456 psElemType vectorType; // psLib type of vectors 467 } 468 colSpec; 457 } colSpec; 469 458 470 459 … … 475 464 bool after) 476 465 { 466 PS_ASSERT_FITS_NON_NULL(fits, false); 467 PS_ASSERT_ARRAY_NON_NULL(table, false); 468 477 469 int status = 0; 478 479 PS_ASSERT_PTR_NON_NULL(fits, false);480 PS_ASSERT_ARRAY_NON_NULL(table, false);481 470 482 471 long numRows = table->n; … … 614 603 char fitsErr[MAX_STRING_LENGTH]; 615 604 fits_get_errstatus(status, fitsErr); 616 psError(PS_ERR_LOCATION_INVALID, true, "Unable to create FITS table with %ld columns and %ld rows: %s", 605 psError(PS_ERR_LOCATION_INVALID, true, 606 "Unable to create FITS table with %ld columns and %ld rows: %s", 617 607 numColumns, table->n, fitsErr); 618 608 psFree(colSpecsIter); … … 632 622 if (extname && strlen(extname) > 0) { 633 623 if (!psFitsSetExtName(fits, extname)) { 634 psError(PS_ERR_IO, false, "Unable to write FITS header extension name.\n");635 psFree(colSpecsIter);636 psFree(colSpecs);637 return false;638 }624 psError(PS_ERR_IO, false, "Unable to write FITS header extension name.\n"); 625 psFree(colSpecsIter); 626 psFree(colSpecs); 627 return false; 628 } 639 629 } 640 630 … … 728 718 int row) 729 719 { 720 PS_ASSERT_FITS_NON_NULL(fits, false); 721 PS_ASSERT_METADATA_NON_NULL(data, false); 722 PS_ASSERT_INT_NONNEGATIVE(row, false); 723 730 724 int status = 0; 731 732 if (fits == NULL) {733 psError(PS_ERR_BAD_PARAMETER_NULL, true,734 _("The input psFits object can not NULL."));735 return false;736 }737 738 if (data == NULL) {739 psError(PS_ERR_BAD_PARAMETER_NULL, true,740 _("The input psImage was NULL. Need a non-NULL psImage for operation to be performed."));741 return false;742 }743 725 744 726 // check to see if we even are positioned on a table HDU
Note:
See TracChangeset
for help on using the changeset viewer.
