IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 13, 2005, 6:30:21 PM (20 years ago)
Author:
Paul Price
Message:

Made changes from Josh, with some modification

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/scripts/src/phase2/pmFPAWrite.c

    r5786 r5789  
    124124                    if (strcasecmp(sourceType, "FILE") == 0) {
    125125                        // Source is a file (with optional extension, e.g., "myMaskFile.fits:thisExt"
    126                         psString filenameExt = p_pmFPATranslateName(name, cell);
    127                         char *colon = strchr(filenameExt, ':'); // Pointer to a colon in the filename-extn
    128                         psString filename = NULL; // The filename
    129                         psString extname = NULL;// The extenstion name
    130                         if (colon) {
    131                             filename = psStringNCopy(filenameExt, strlen(filenameExt) - strlen(colon));
    132                             if (strlen(colon) > 1) {
    133                                 extname = psStringCopy(colon + 1);
    134                             }
    135                         } else {
    136                             filename = psMemIncrRefCounter(filenameExt);
    137                         }
    138 
     126                        psString extname = NULL; // Extension name
     127                        psString filename = p_pmFPATranslateFileExt(&extname, name, cell); // The filename
    139128                        psFree(maskDest);
    140129                        maskDest = psFitsOpen(filename, "rw");
     
    144133                        psFree(filename);
    145134                        psFree(extname);
    146                         psFree(filenameExt);
    147135                    } else if (strncasecmp(sourceType, "EXT", 3) == 0) {
    148136                        // Source is an extension in the original file
     
    227215                    if (strcasecmp(sourceType, "FILE") == 0) {
    228216                        // Source is a file (with optional extension, e.g., "myWeightFile.fits:thisExt"
    229                         psString filenameExt = p_pmFPATranslateName(name, cell);
    230                         char *colon = strchr(filenameExt, ':'); // Pointer to a colon in the filename-extn
    231                         psString filename = NULL; // The filename
    232                         psString extname = NULL;// The extenstion name
    233                         if (colon) {
    234                             filename = psStringNCopy(filenameExt, strlen(filenameExt) - strlen(colon));
    235                             if (strlen(colon) > 1) {
    236                                 extname = psStringCopy(colon + 1);
    237                             }
    238                         } else {
    239                             filename = psMemIncrRefCounter(filenameExt);
    240                         }
     217                        psString extname = NULL; // Extension name
     218                        psString filename = p_pmFPATranslateFileExt(&extname, name, cell); // The filename
    241219
    242220                        psFree(weightDest);
     
    247225                        psFree(filename);
    248226                        psFree(extname);
    249                         psFree(filenameExt);
    250227                    } else if (strncasecmp(sourceType, "EXT", 3) == 0) {
    251228                        // Source is an extension in the original file
Note: See TracChangeset for help on using the changeset viewer.