Changeset 3476 for trunk/psLib/src/dataIO/psFits.c
- Timestamp:
- Mar 22, 2005, 11:52:49 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/dataIO/psFits.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataIO/psFits.c
r3407 r3476 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-03- 11 20:38:56$9 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-03-22 21:52:49 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 78 78 case TDBLCOMPLEX: 79 79 return PS_TYPE_C64; 80 case TLOGICAL: 81 return PS_TYPE_BOOL; 80 82 default: 83 psError(PS_ERR_IO, true, 84 "Unknown FITS datatype, %d.", 85 datatype); 81 86 return PS_TYPE_PTR; 82 87 } 83 88 } 84 85 89 86 90 static bool convertPsTypeToFits(psElemType type, int* bitPix, double* bZero, int* dataType) … … 1295 1299 fits_get_num_rows(fits->p_fd, &numRows, &status); 1296 1300 1301 // get the column length. 1302 int width; 1303 if ( fits_get_col_display_width(fits->p_fd, colnum, &width, &status) != 0) { 1304 char fitsErr[MAX_STRING_LENGTH]; 1305 (void)fits_get_errstatus(status, fitsErr); 1306 psError(PS_ERR_IO, true, 1307 PS_ERRORTEXT_psFits_GET_COLTYPE, 1308 fitsErr); 1309 return NULL; 1310 } 1311 1312 // allocate the buffers 1297 1313 psArray* result = psArrayAlloc(numRows); 1314 for (int row = 0; row < numRows; row++) { 1315 result->data[row] = psAlloc((width+1)*sizeof(char)); 1316 } 1317 result->n = numRows; 1298 1318 1299 1319 fits_read_col_str(fits->p_fd, … … 1322 1342 const char* colname) 1323 1343 { 1344 int status = 0; 1324 1345 int colnum = 0; 1325 int status = 0;1326 1346 1327 1347 if (fits == NULL) { … … 1359 1379 // get the number of rows 1360 1380 long numRows = 0; 1361 fits_get_num_rows(fits->p_fd, &numRows, &status); 1381 fits_get_num_rows(fits->p_fd, 1382 &numRows, 1383 &status); 1362 1384 1363 1385 // get the column datatype. … … 1376 1398 psVector* result = psVectorAlloc(numRows, convertFitsToPsType(typecode)); 1377 1399 1378 fits_read_col(fits->p_fd, typecode, colnum, 1 /* firstrow */, 1379 1 /* firstelem */, numRows, NULL, result->data.V, 1380 NULL, &status); 1400 fits_read_col(fits->p_fd, 1401 typecode, 1402 colnum, 1403 1 /* firstrow */, 1404 1 /* firstelem */, 1405 numRows, 1406 NULL, 1407 (psPtr)(result->data.U8), 1408 NULL, 1409 &status); 1381 1410 1382 1411 if ( status != 0) {
Note:
See TracChangeset
for help on using the changeset viewer.
