IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1387


Ignore:
Timestamp:
Aug 4, 2004, 4:22:42 PM (22 years ago)
Author:
harman
Message:

Minor corrections from testing

Location:
trunk/psLib/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astronomy/psMetadata.c

    r1385 r1387  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-04 23:37:39 $
     13*  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-05 02:22:42 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    266266            return false;
    267267        }
    268     } else
    269         if ( value != NULL ) {
    270 
    271             // The key was found and the new metadata item is a folder node. Don't add new metadata item, since
    272             // it will wipe out existing node.
    273             psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s",
     268    } else if ( value != NULL ) {
     269
     270        // The key was found and the new metadata item is a folder node. Don't add new metadata item, since
     271        // it will wipe out existing node.
     272        psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s",
     273                 metadataItem->name );
     274        return false;
     275    } else {
     276
     277        // Duplicate key not found. Add new metadata item to metadata collection's hash
     278        if ( !psHashAdd( mdTable, key, metadataItem ) ) {
     279            psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s",
    274280                     metadataItem->name );
    275281            return false;
    276         } else {
    277 
    278             // Duplicate key not found. Add new metadata item to metadata collection's hash
    279             if ( !psHashAdd( mdTable, key, metadataItem ) ) {
    280                 psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s",
    281                          metadataItem->name );
    282                 return false;
    283             }
    284         }
     282        }
     283    }
    285284
    286285    // Add all items to metadata collection's list, even if they have the same metadata item names
     
    600599        psError( __func__, "Null extname AND extnum = 0 not allowed" );
    601600        return NULL;
    602     } else
    603         if ( extname && extnum ) {
    604             psError( __func__, "Both extname AND extnum arguments should not have values." );
    605             return NULL;
    606         }
     601    } else if ( extname && extnum ) {
     602        psError( __func__, "Both extname AND extnum arguments should not have values." );
     603        return NULL;
     604    }
    607605
    608606    // Allocate metadata if user didn't
     
    619617            return output;
    620618        }
    621     } else
    622         if ( extnum > 0 ) {
    623             tempExtname = ( char* ) extname;
    624             if ( fits_movnam_hdu( fd, ANY_HDU, tempExtname, 0, &status ) != 0 ) {
    625                 fits_get_errstatus( status, fitsErr );
    626                 psError( __func__, "FITS error while locating header: %s", fitsErr );
    627                 status = 0;
    628                 return output;
    629             }
    630         }
     619    } else if ( extnum > 0 ) {
     620        tempExtname = ( char* ) extname;
     621        if ( fits_movnam_hdu( fd, ANY_HDU, tempExtname, 0, &status ) != 0 ) {
     622            fits_get_errstatus( status, fitsErr );
     623            psError( __func__, "FITS error while locating header: %s", fitsErr );
     624            status = 0;
     625            return output;
     626        }
     627    }
    631628
    632629    // Get number of key names
  • trunk/psLib/src/collections/psMetadata.c

    r1385 r1387  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-04 23:37:39 $
     13*  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-05 02:22:42 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    266266            return false;
    267267        }
    268     } else
    269         if ( value != NULL ) {
    270 
    271             // The key was found and the new metadata item is a folder node. Don't add new metadata item, since
    272             // it will wipe out existing node.
    273             psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s",
     268    } else if ( value != NULL ) {
     269
     270        // The key was found and the new metadata item is a folder node. Don't add new metadata item, since
     271        // it will wipe out existing node.
     272        psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s",
     273                 metadataItem->name );
     274        return false;
     275    } else {
     276
     277        // Duplicate key not found. Add new metadata item to metadata collection's hash
     278        if ( !psHashAdd( mdTable, key, metadataItem ) ) {
     279            psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s",
    274280                     metadataItem->name );
    275281            return false;
    276         } else {
    277 
    278             // Duplicate key not found. Add new metadata item to metadata collection's hash
    279             if ( !psHashAdd( mdTable, key, metadataItem ) ) {
    280                 psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s",
    281                          metadataItem->name );
    282                 return false;
    283             }
    284         }
     282        }
     283    }
    285284
    286285    // Add all items to metadata collection's list, even if they have the same metadata item names
     
    600599        psError( __func__, "Null extname AND extnum = 0 not allowed" );
    601600        return NULL;
    602     } else
    603         if ( extname && extnum ) {
    604             psError( __func__, "Both extname AND extnum arguments should not have values." );
    605             return NULL;
    606         }
     601    } else if ( extname && extnum ) {
     602        psError( __func__, "Both extname AND extnum arguments should not have values." );
     603        return NULL;
     604    }
    607605
    608606    // Allocate metadata if user didn't
     
    619617            return output;
    620618        }
    621     } else
    622         if ( extnum > 0 ) {
    623             tempExtname = ( char* ) extname;
    624             if ( fits_movnam_hdu( fd, ANY_HDU, tempExtname, 0, &status ) != 0 ) {
    625                 fits_get_errstatus( status, fitsErr );
    626                 psError( __func__, "FITS error while locating header: %s", fitsErr );
    627                 status = 0;
    628                 return output;
    629             }
    630         }
     619    } else if ( extnum > 0 ) {
     620        tempExtname = ( char* ) extname;
     621        if ( fits_movnam_hdu( fd, ANY_HDU, tempExtname, 0, &status ) != 0 ) {
     622            fits_get_errstatus( status, fitsErr );
     623            psError( __func__, "FITS error while locating header: %s", fitsErr );
     624            status = 0;
     625            return output;
     626        }
     627    }
    631628
    632629    // Get number of key names
  • trunk/psLib/src/types/psMetadata.c

    r1385 r1387  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-04 23:37:39 $
     13*  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-05 02:22:42 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    266266            return false;
    267267        }
    268     } else
    269         if ( value != NULL ) {
    270 
    271             // The key was found and the new metadata item is a folder node. Don't add new metadata item, since
    272             // it will wipe out existing node.
    273             psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s",
     268    } else if ( value != NULL ) {
     269
     270        // The key was found and the new metadata item is a folder node. Don't add new metadata item, since
     271        // it will wipe out existing node.
     272        psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s",
     273                 metadataItem->name );
     274        return false;
     275    } else {
     276
     277        // Duplicate key not found. Add new metadata item to metadata collection's hash
     278        if ( !psHashAdd( mdTable, key, metadataItem ) ) {
     279            psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s",
    274280                     metadataItem->name );
    275281            return false;
    276         } else {
    277 
    278             // Duplicate key not found. Add new metadata item to metadata collection's hash
    279             if ( !psHashAdd( mdTable, key, metadataItem ) ) {
    280                 psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s",
    281                          metadataItem->name );
    282                 return false;
    283             }
    284         }
     282        }
     283    }
    285284
    286285    // Add all items to metadata collection's list, even if they have the same metadata item names
     
    600599        psError( __func__, "Null extname AND extnum = 0 not allowed" );
    601600        return NULL;
    602     } else
    603         if ( extname && extnum ) {
    604             psError( __func__, "Both extname AND extnum arguments should not have values." );
    605             return NULL;
    606         }
     601    } else if ( extname && extnum ) {
     602        psError( __func__, "Both extname AND extnum arguments should not have values." );
     603        return NULL;
     604    }
    607605
    608606    // Allocate metadata if user didn't
     
    619617            return output;
    620618        }
    621     } else
    622         if ( extnum > 0 ) {
    623             tempExtname = ( char* ) extname;
    624             if ( fits_movnam_hdu( fd, ANY_HDU, tempExtname, 0, &status ) != 0 ) {
    625                 fits_get_errstatus( status, fitsErr );
    626                 psError( __func__, "FITS error while locating header: %s", fitsErr );
    627                 status = 0;
    628                 return output;
    629             }
    630         }
     619    } else if ( extnum > 0 ) {
     620        tempExtname = ( char* ) extname;
     621        if ( fits_movnam_hdu( fd, ANY_HDU, tempExtname, 0, &status ) != 0 ) {
     622            fits_get_errstatus( status, fitsErr );
     623            psError( __func__, "FITS error while locating header: %s", fitsErr );
     624            status = 0;
     625            return output;
     626        }
     627    }
    631628
    632629    // Get number of key names
Note: See TracChangeset for help on using the changeset viewer.