Index: trunk/psLib/src/fits/psFits.c
===================================================================
--- trunk/psLib/src/fits/psFits.c	(revision 4898)
+++ trunk/psLib/src/fits/psFits.c	(revision 5057)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-08-30 01:14:13 $
+ *  @version $Revision: 1.44 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-15 21:22:21 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -186,5 +186,5 @@
     int status = 0;
 
-    fits_get_hdrspace(fits->p_fd, &keysexist, &morekeys, &status);
+    fits_get_hdrspace(fits->fd, &keysexist, &morekeys, &status);
 
     // if no keys exist and not primary HDU, this really is an empty HDU
@@ -202,5 +202,5 @@
 
     if (fits != NULL) {
-        (void)fits_close_file(fits->p_fd, &status);
+        (void)fits_close_file(fits->fd, &status);
         psFree(fits->filename);
     }
@@ -247,5 +247,5 @@
     psFits* fits = psAlloc(sizeof(psFits));
     fits->filename = psAlloc(strlen(name)+1);
-    fits->p_fd = fptr;
+    fits->fd = fptr;
     strcpy((char*)fits->filename,name);
     psMemSetDeallocator(fits,(psFreeFunc)fitsFree);
@@ -279,5 +279,5 @@
 
 
-    if (fits_movnam_hdu(fits->p_fd, ANY_HDU, (char*)extname, 0, &status) != 0) {
+    if (fits_movnam_hdu(fits->fd, ANY_HDU, (char*)extname, 0, &status) != 0) {
         char fitsErr[MAX_STRING_LENGTH];
         fits_get_errstatus(status, fitsErr);
@@ -305,5 +305,5 @@
 
     if (relative) {
-        fits_movrel_hdu(fits->p_fd, extnum, &hdutype, &status);
+        fits_movrel_hdu(fits->fd, extnum, &hdutype, &status);
         if (status != 0) {
             char fitsErr[MAX_STRING_LENGTH];
@@ -315,5 +315,5 @@
         }
     } else {
-        fits_movabs_hdu(fits->p_fd, extnum+1, &hdutype, &status);
+        fits_movabs_hdu(fits->fd, extnum+1, &hdutype, &status);
         if (status != 0) {
             char fitsErr[MAX_STRING_LENGTH];
@@ -340,5 +340,5 @@
 
 
-    return fits_get_hdu_num(fits->p_fd,&hdunum) - 1;
+    return fits_get_hdu_num(fits->fd,&hdunum) - 1;
 }
 
@@ -354,7 +354,7 @@
     char name[MAX_STRING_LENGTH];
 
-    if (fits_read_key_str(fits->p_fd, "EXTNAME", name, NULL, &status) != 0) {
+    if (fits_read_key_str(fits->fd, "EXTNAME", name, NULL, &status) != 0) {
         status = 0;
-        if (fits_read_key_str(fits->p_fd, "HDUNAME", name, NULL, &status) != 0) {
+        if (fits_read_key_str(fits->fd, "HDUNAME", name, NULL, &status) != 0) {
             int num = psFitsGetExtNum(fits);
             snprintf(name, MAX_STRING_LENGTH, "EXT-%3d",num);
@@ -380,5 +380,5 @@
     int status = 0;
 
-    if (fits_update_key_str(fits->p_fd, "EXTNAME", (char*)name, NULL, &status) != 0) {
+    if (fits_update_key_str(fits->fd, "EXTNAME", (char*)name, NULL, &status) != 0) {
         char fitsErr[MAX_STRING_LENGTH];
         (void)fits_get_errstatus(status, fitsErr);
@@ -403,5 +403,5 @@
     int status = 0;
 
-    if (fits_get_num_hdus(fits->p_fd, &num, &status) != 0) {
+    if (fits_get_num_hdus(fits->fd, &num, &status) != 0) {
         char fitsErr[MAX_STRING_LENGTH];
         fits_get_errstatus(status, fitsErr);
@@ -426,5 +426,5 @@
     int hdutype = PS_FITS_TYPE_NONE;
 
-    if (fits_get_hdu_type(fits->p_fd, &hdutype, &status) != 0) {
+    if (fits_get_hdu_type(fits->fd, &hdutype, &status) != 0) {
         char fitsErr[MAX_STRING_LENGTH];
         fits_get_errstatus(status, fitsErr);
@@ -466,5 +466,5 @@
     int keyNum = 0;
     int status = 0;
-    fits_get_hdrpos(fits->p_fd, &numKeys, &keyNum, &status);
+    fits_get_hdrpos(fits->fd, &numKeys, &keyNum, &status);
 
     // Get each key name. Keywords start at one.
@@ -478,5 +478,5 @@
     for (int i = 1; i <= numKeys; i++) {
 
-        fits_read_keyn(fits->p_fd, i, keyName, keyValue, keyComment, &status);
+        fits_read_keyn(fits->fd, i, keyName, keyValue, keyComment, &status);
 
         stdKey = false;
@@ -657,5 +657,5 @@
     // check to see if we even are positioned on an image HDU
     int hdutype;
-    if ( fits_get_hdu_type(fits->p_fd,&hdutype, &status) != 0) {
+    if ( fits_get_hdu_type(fits->fd,&hdutype, &status) != 0) {
         char fitsErr[MAX_STRING_LENGTH];
         (void)fits_get_errstatus(status, fitsErr);
@@ -672,5 +672,5 @@
 
     /* Get the data type 'bitPix' from the FITS image */
-    if (fits_get_img_equivtype(fits->p_fd, &bitPix, &status) != 0) {
+    if (fits_get_img_equivtype(fits->fd, &bitPix, &status) != 0) {
         fits_get_errstatus(status, fitsErr);
         psError(PS_ERR_IO, true,
@@ -682,5 +682,5 @@
 
     /* Get the dimensions 'nAxis' from the FITS image */
-    if (fits_get_img_dim(fits->p_fd, &nAxis, &status) != 0) {
+    if (fits_get_img_dim(fits->fd, &nAxis, &status) != 0) {
         (void)fits_get_errstatus(status, fitsErr);
         psError(PS_ERR_IO, true,
@@ -701,5 +701,5 @@
 
     /* Get the Image size from the FITS file */
-    if (fits_get_img_size(fits->p_fd, nAxis, nAxes, &status) != 0) {
+    if (fits_get_img_size(fits->fd, nAxis, nAxes, &status) != 0) {
         (void)fits_get_errstatus(status, fitsErr);
         psError(PS_ERR_IO, true,
@@ -787,5 +787,5 @@
 
     // n.b., this assumes contiguous image buffer
-    if (fits_read_subset(fits->p_fd, fitsDatatype, firstPixel, lastPixel, increment,
+    if (fits_read_subset(fits->fd, fitsDatatype, firstPixel, lastPixel, increment,
                          NULL, output->data.V[0], &anynull, &status) != 0) {
         psFree(output);
@@ -842,10 +842,10 @@
     }
 
-    fits_create_img(fits->p_fd, bitPix, naxis, naxes, &status);
+    fits_create_img(fits->fd, bitPix, naxis, naxes, &status);
 
     if (bZero != 0) {        // set the bscale/bzero
-        fits_write_key_dbl(fits->p_fd, "BZERO", bZero, 12, "Pixel Value Offset", &status);
-        fits_write_key_dbl(fits->p_fd, "BSCALE", 1.0, 12, "Pixel Value Scale", &status);
-        fits_set_bscale(fits->p_fd, 1.0, bZero, &status);
+        fits_write_key_dbl(fits->fd, "BZERO", bZero, 12, "Pixel Value Offset", &status);
+        fits_write_key_dbl(fits->fd, "BSCALE", 1.0, 12, "Pixel Value Scale", &status);
+        fits_set_bscale(fits->fd, 1.0, bZero, &status);
     }
 
@@ -856,5 +856,5 @@
 
     if (input->parent == NULL) { // if no parent, assume that the image data is contiguous
-        fits_write_img(fits->p_fd,
+        fits_write_img(fits->fd,
                        dataType,              // datatype
                        1,                     // writing to the first z-plane
@@ -865,5 +865,5 @@
         int firstPixel = 1;
         for (int row = 0; row < numRows; row++) {
-            fits_write_img(fits->p_fd,
+            fits_write_img(fits->fd,
                            dataType,          // datatype
                            firstPixel,
@@ -909,5 +909,5 @@
     // check to see if we are positioned on an image HDU
     int hdutype;
-    if ( fits_get_hdu_type(fits->p_fd,&hdutype, &status) != 0) {
+    if ( fits_get_hdu_type(fits->fd,&hdutype, &status) != 0) {
         char fitsErr[MAX_STRING_LENGTH];
         (void)fits_get_errstatus(status, fitsErr);
@@ -939,5 +939,5 @@
     long nAxes[3];
     nAxes[2] = 1;
-    fits_get_img_param(fits->p_fd, 3, &fileBitpix, &naxis, nAxes, &status);
+    fits_get_img_param(fits->fd, 3, &fileBitpix, &naxis, nAxes, &status);
 
     //check to see if the HDU has the same datatype
@@ -1012,5 +1012,5 @@
     }
 
-    fits_write_subset(fits->p_fd, dataType, firstPixel, lastPixel, subset->data.V[0], &status);
+    fits_write_subset(fits->fd, dataType, firstPixel, lastPixel, subset->data.V[0], &status);
 
     if ( status != 0) {
@@ -1052,5 +1052,5 @@
         case PS_META_BOOL: {
                 int value = item->data.B;
-                fits_update_key(fits->p_fd,
+                fits_update_key(fits->fd,
                                 TLOGICAL,
                                 item->name,
@@ -1061,5 +1061,5 @@
             }
         case PS_META_S32:
-            fits_update_key(fits->p_fd,
+            fits_update_key(fits->fd,
                             TINT,
                             item->name,
@@ -1069,5 +1069,5 @@
             break;
         case PS_META_F32:
-            fits_update_key(fits->p_fd,
+            fits_update_key(fits->fd,
                             TFLOAT,
                             item->name,
@@ -1077,5 +1077,5 @@
             break;
         case PS_META_F64:
-            fits_update_key(fits->p_fd,
+            fits_update_key(fits->fd,
                             TDOUBLE,
                             item->name,
@@ -1085,5 +1085,5 @@
             break;
         case PS_META_STR:
-            fits_update_key(fits->p_fd,
+            fits_update_key(fits->fd,
                             TSTRING,
                             item->name,
@@ -1124,5 +1124,5 @@
     // check to see if we even are positioned on a table HDU
     int hdutype;
-    fits_get_hdu_type(fits->p_fd,&hdutype, &status);
+    fits_get_hdu_type(fits->fd,&hdutype, &status);
     if ( status != 0) {
         char fitsErr[MAX_STRING_LENGTH];
@@ -1140,6 +1140,6 @@
 
     // get the size of the FITS table
-    fits_get_num_rows(fits->p_fd, &numRows, &status);
-    fits_get_num_cols(fits->p_fd, &numCols, &status);
+    fits_get_num_rows(fits->fd, &numRows, &status);
+    fits_get_num_cols(fits->fd, &numCols, &status);
     if ( status != 0) {
         char fitsErr[MAX_STRING_LENGTH];
@@ -1169,12 +1169,12 @@
         // get the column name
         if (hdutype == BINARY_TBL) {
-            fits_get_bcolparms(fits->p_fd, col, name,
+            fits_get_bcolparms(fits->fd, col, name,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL, &status);
         } else {
-            fits_get_acolparms(fits->p_fd, col, name,
+            fits_get_acolparms(fits->fd, col, name,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL, &status);
         }
         // get the column type
-        fits_get_coltype(fits->p_fd, col, &typecode, &repeat, &width, &status);
+        fits_get_coltype(fits->fd, col, &typecode, &repeat, &width, &status);
 
         if (status == 0) {
@@ -1184,5 +1184,5 @@
                 NATIVETYPE value = 0; \
                 int anynul = 0; \
-                fits_read_col(fits->p_fd, FITSTYPE, col,row+1, \
+                fits_read_col(fits->fd, FITSTYPE, col,row+1, \
                               1, 1, NULL, &value, &anynul, &status); \
                 psTrace(".psFits.psFitsReadTableRow",5,"Column #%i, '%s', is type %i, repeat %i, Value = %g\n", \
@@ -1205,5 +1205,5 @@
                     char* value = psAlloc(repeat+1);
                     int anynul = 0;
-                    fits_read_col(fits->p_fd, TSTRING, col,row+1,
+                    fits_read_col(fits->fd, TSTRING, col,row+1,
                                   1, 1, NULL, &value, &anynul, &status);
                     psTrace(".psFits.psFitsReadTableRow",5,"Column #%i, '%s', is type %i, repeat %i, value = %s\n",
@@ -1253,5 +1253,5 @@
     // check to see if we even are positioned on a table HDU
     int hdutype;
-    if ( fits_get_hdu_type(fits->p_fd,&hdutype, &status) != 0) {
+    if ( fits_get_hdu_type(fits->fd,&hdutype, &status) != 0) {
         char fitsErr[MAX_STRING_LENGTH];
         (void)fits_get_errstatus(status, fitsErr);
@@ -1268,5 +1268,5 @@
 
     // find the column by name
-    if ( fits_get_colnum(fits->p_fd, CASESEN, (char*)colname, &colnum, &status) != 0) {
+    if ( fits_get_colnum(fits->fd, CASESEN, (char*)colname, &colnum, &status) != 0) {
         char fitsErr[MAX_STRING_LENGTH];
         (void)fits_get_errstatus(status, fitsErr);
@@ -1279,9 +1279,9 @@
     // get the number of rows
     long numRows = 0;
-    fits_get_num_rows(fits->p_fd, &numRows, &status);
+    fits_get_num_rows(fits->fd, &numRows, &status);
 
     // get the column length.
     int width;
-    if ( fits_get_col_display_width(fits->p_fd, colnum, &width, &status) != 0) {
+    if ( fits_get_col_display_width(fits->fd, colnum, &width, &status) != 0) {
         char fitsErr[MAX_STRING_LENGTH];
         (void)fits_get_errstatus(status, fitsErr);
@@ -1299,5 +1299,5 @@
     result->n = numRows;
 
-    fits_read_col_str(fits->p_fd,
+    fits_read_col_str(fits->fd,
                       colnum,
                       1, // firstrow
@@ -1335,5 +1335,5 @@
     // check to see if we even are positioned on a table HDU
     int hdutype;
-    if ( fits_get_hdu_type(fits->p_fd,&hdutype, &status) != 0) {
+    if ( fits_get_hdu_type(fits->fd,&hdutype, &status) != 0) {
         char fitsErr[MAX_STRING_LENGTH];
         (void)fits_get_errstatus(status, fitsErr);
@@ -1350,5 +1350,5 @@
 
     // find the column by name
-    if ( fits_get_colnum(fits->p_fd, CASESEN, (char*)colname, &colnum, &status) != 0) {
+    if ( fits_get_colnum(fits->fd, CASESEN, (char*)colname, &colnum, &status) != 0) {
         char fitsErr[MAX_STRING_LENGTH];
         (void)fits_get_errstatus(status, fitsErr);
@@ -1361,5 +1361,5 @@
     // get the number of rows
     long numRows = 0;
-    fits_get_num_rows(fits->p_fd,
+    fits_get_num_rows(fits->fd,
                       &numRows,
                       &status);
@@ -1369,5 +1369,5 @@
     long repeat;
     long width;
-    if ( fits_get_eqcoltype(fits->p_fd, colnum, &typecode, &repeat, &width, &status) != 0) {
+    if ( fits_get_eqcoltype(fits->fd, colnum, &typecode, &repeat, &width, &status) != 0) {
         char fitsErr[MAX_STRING_LENGTH];
         (void)fits_get_errstatus(status, fitsErr);
@@ -1380,5 +1380,5 @@
     psVector* result = psVectorAlloc(numRows, convertFitsToPsType(typecode));
 
-    fits_read_col(fits->p_fd,
+    fits_read_col(fits->fd,
                   typecode,
                   colnum,
@@ -1416,5 +1416,5 @@
     // check to see if we even are positioned on a table HDU
     int hdutype;
-    if ( fits_get_hdu_type(fits->p_fd,&hdutype, &status) != 0) {
+    if ( fits_get_hdu_type(fits->fd,&hdutype, &status) != 0) {
         char fitsErr[MAX_STRING_LENGTH];
         (void)fits_get_errstatus(status, fitsErr);
@@ -1432,5 +1432,5 @@
     // get the size of the FITS table
     long numRows = 0;
-    fits_get_num_rows(fits->p_fd, &numRows, &status);
+    fits_get_num_rows(fits->fd, &numRows, &status);
     if ( status != 0) {
         char fitsErr[MAX_STRING_LENGTH];
@@ -1535,5 +1535,5 @@
     }
 
-    fits_create_tbl(fits->p_fd,
+    fits_create_tbl(fits->fd,
                     BINARY_TBL,
                     table->n, // number of rows in table
@@ -1562,5 +1562,5 @@
                                          item->name);
                 }
-                fits_write_col_int(fits->p_fd,
+                fits_write_col_int(fits->fd,
                                    n+1, // column number
                                    1, // firstrow
@@ -1577,5 +1577,5 @@
                                          item->name);
                 }
-                fits_write_col_flt(fits->p_fd,
+                fits_write_col_flt(fits->fd,
                                    n+1, // column number
                                    1, // firstrow
@@ -1592,5 +1592,5 @@
                                          item->name);
                 }
-                fits_write_col_dbl(fits->p_fd,
+                fits_write_col_dbl(fits->fd,
                                    n+1, // column number
                                    1, // firstrow
@@ -1607,5 +1607,5 @@
                                         item->name);
                 }
-                fits_write_col_log(fits->p_fd,
+                fits_write_col_log(fits->fd,
                                    n+1, // column number
                                    1, // firstrow
@@ -1625,5 +1625,5 @@
                 col->data[row] = item->data.V;
             }
-            fits_write_col_str(fits->p_fd,
+            fits_write_col_str(fits->fd,
                                n, // column number
                                1, // firstrow
@@ -1661,5 +1661,5 @@
     // check to see if we even are positioned on a table HDU
     int hdutype;
-    if ( fits_get_hdu_type(fits->p_fd,&hdutype, &status) != 0) {
+    if ( fits_get_hdu_type(fits->fd,&hdutype, &status) != 0) {
         char fitsErr[MAX_STRING_LENGTH];
         (void)fits_get_errstatus(status, fitsErr);
@@ -1684,10 +1684,10 @@
             int colnum = 0;
 
-            if ( fits_get_colnum(fits->p_fd, CASESEN, item->name, &colnum, &status) == 0) {
+            if ( fits_get_colnum(fits->fd, CASESEN, item->name, &colnum, &status) == 0) {
                 // cooresponding column found in table
                 int dataType = 0;
                 convertPsTypeToFits(item->type, NULL, NULL, &dataType);
 
-                if (fits_write_col(fits->p_fd, dataType, colnum, row+1, 1, 1, &item->data,&status) != 0) {
+                if (fits_write_col(fits->fd, dataType, colnum, row+1, 1, 1, &item->data,&status) != 0) {
                     char fitsErr[MAX_STRING_LENGTH];
                     (void)fits_get_errstatus(status, fitsErr);
