Changeset 31033 for trunk/ippToPsps/src/Fits.c
- Timestamp:
- Mar 24, 2011, 11:03:32 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/src/Fits.c (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/src/Fits.c
r31030 r31033 26 26 if (!strncmp(typename, "TSTRING", 7)) return TSTRING; 27 27 28 // this->logger->print(this->logger, MSG_ERROR, "Fits :Don't understand data type '%s'", typename);28 // this->logger->print(this->logger, MSG_ERROR, "Fits", "Don't understand data type '%s'", typename); 29 29 30 30 return 0; … … 36 36 static void destroy(Fits* this) { 37 37 38 this->logger->print(this->logger, MSG_DEBUG, "Fits :Destructor\n");38 this->logger->print(this->logger, MSG_DEBUG, "Fits", "Destructor\n"); 39 39 40 40 int status = 0; 41 41 if (fits_close_file(this->file, &status)) { 42 42 43 this->logger->print(this->logger, MSG_ERROR, "Fits :Unable to close FITS file '%s'\n", this->path);43 this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to close FITS file '%s'\n", this->path); 44 44 fits_report_error(stderr, status); 45 45 } 46 46 else 47 this->logger->print(this->logger, MSG_INFO, "Fits :Closed FITS file '%s'\n", this->path);47 this->logger->print(this->logger, MSG_INFO, "Fits", "Closed FITS file '%s'\n", this->path); 48 48 49 49 free(this); … … 60 60 if (status) { 61 61 62 this->logger->print(this->logger, MSG_ERROR, "Fits :Could not get value for header key '%s' from file at '%s'\n", name, this->path);62 this->logger->print(this->logger, MSG_ERROR, "Fits", "Could not get value for header key '%s' from file at '%s'\n", name, this->path); 63 63 return false; 64 64 } … … 86 86 if (status) { 87 87 88 this->logger->print(this->logger, MSG_ERROR, "Fits :Failed to read vector column %d row %ld\n", col, row);88 this->logger->print(this->logger, MSG_ERROR, "Fits", "Failed to read vector column %d row %ld\n", col, row); 89 89 return false; 90 90 } … … 102 102 if (status) { 103 103 104 this->logger->print(this->logger, MSG_ERROR, "Fits :Could not get column number for '%s'\n", name);104 this->logger->print(this->logger, MSG_ERROR, "Fits", "Could not get column number for '%s'\n", name); 105 105 return false; 106 106 } … … 123 123 if (status) { 124 124 125 this->logger->print(this->logger, MSG_ERROR, "Fits :Unable to read col '%s'\n", name);125 this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to read col '%s'\n", name); 126 126 return false; 127 127 } … … 131 131 if (status) { 132 132 133 this->logger->print(this->logger, MSG_ERROR, "Fits :Unable to read type info for '%s'\n", name);133 this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to read type info for '%s'\n", name); 134 134 return false; 135 135 } … … 147 147 if (fits_movnam_hdu(this->file, type, name, 0, &status)) { 148 148 149 this->logger->print(this->logger, MSG_ERROR, "Fits :Can't move to table extension named '%s'\n", name);149 this->logger->print(this->logger, MSG_ERROR, "Fits", "Can't move to table extension named '%s'\n", name); 150 150 return false; 151 151 } … … 178 178 if (fits_get_num_rows(this->file, count, &status)) { 179 179 180 this->logger->print(this->logger, MSG_ERROR, "Fits :Count not count rows in this table\n");180 this->logger->print(this->logger, MSG_ERROR, "Fits", "Count not count rows in this table\n"); 181 181 return false; 182 182 } … … 201 201 if (remove(this->path) == -1) { 202 202 203 this->logger->print(this->logger, MSG_ERROR, "Fits :Unable to delete '%s'\n", this->path);204 return false; 205 } 206 207 this->logger->print(this->logger, MSG_INFO, "Fits :Deleted FITS file at '%s'\n", this->path);203 this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to delete '%s'\n", this->path); 204 return false; 205 } 206 207 this->logger->print(this->logger, MSG_INFO, "Fits", "Deleted FITS file at '%s'\n", this->path); 208 208 209 209 return true; … … 235 235 if (status) { 236 236 237 this->logger->print(this->logger, MSG_ERROR, "Fits :Unable to delete rows using rowlist\n");237 this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to delete rows using rowlist\n"); 238 238 return false; 239 239 } … … 290 290 else { 291 291 292 this->logger->print(this->logger, MSG_ERROR, "Fits :Don't understand datatype '%d'\n", datatype);293 return false; 294 } 295 296 if (status) { 297 298 this->logger->print(this->logger, MSG_ERROR, "Fits :Unable to read column data from column %d\n", colnum);292 this->logger->print(this->logger, MSG_ERROR, "Fits", "Don't understand datatype '%d'\n", datatype); 293 return false; 294 } 295 296 if (status) { 297 298 this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to read column data from column %d\n", colnum); 299 299 return false; 300 300 … … 338 338 if (status) { 339 339 340 this->logger->print(this->logger, MSG_ERROR, "Fits :Unable to write column data for column %d\n", colnum);340 this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to write column data for column %d\n", colnum); 341 341 return false; 342 342 … … 362 362 if (status) { 363 363 364 this->logger->print(this->logger, MSG_ERROR, "Fits :Unable to create table: '%s'\n", name);364 this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to create table: '%s'\n", name); 365 365 return false; 366 366 } … … 415 415 416 416 Fits* this = init(path, logger); 417 this->logger->print(this->logger, MSG_DEBUG, "Fits :Constructor for existing file at '%s'\n", path);417 this->logger->print(this->logger, MSG_DEBUG, "Fits", "Constructor for existing file at '%s'\n", path); 418 418 419 419 int status = 0; 420 420 if (fits_open_file(&this->file, path, READONLY, &status)) { 421 421 422 this->logger->print(this->logger, MSG_ERROR, "Fits :Unable to open FITS file here %s\n", path);422 this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to open FITS file here %s\n", path); 423 423 this->file = NULL; 424 424 } … … 436 436 437 437 Fits* this = init(path, logger); 438 this->logger->print(this->logger, MSG_DEBUG, "Fits :Constructor for new file at '%s'\n", path);438 this->logger->print(this->logger, MSG_DEBUG, "Fits", "Constructor for new file at '%s'\n", path); 439 439 440 440 int status = 0; 441 441 if (fits_create_file(&this->file, path, &status)) { 442 442 443 this->logger->print(this->logger, MSG_ERROR, "Fits :Unable to create FITS file here '%s'\n", path);443 this->logger->print(this->logger, MSG_ERROR, "Fits", "Unable to create FITS file here '%s'\n", path); 444 444 this->file = NULL; 445 445 }
Note:
See TracChangeset
for help on using the changeset viewer.
