Changeset 5649 for branches/neb/archive/scripts/src/phase2/pmFPAWrite.c
- Timestamp:
- Nov 30, 2005, 4:05:11 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/neb/archive/scripts/src/phase2/pmFPAWrite.c
r5648 r5649 7 7 #include "pmFPARead.h" 8 8 9 static bool writeHDU(psFits *fits, // FITS file to which to write 9 static psString p_pmFPAGetExtName(psString name, pmCell *cell, psString filename); 10 11 static bool writeHDU(psFits *fits, // FITS file to which to write 10 12 p_pmHDU *hdu // Pixel data to write 11 13 ) … … 22 24 23 25 24 bool pmFPAWrite(psFits *fits, // FITS file to which to write25 pmFPA *fpa, // FPA to write26 bool pmFPAWrite(psFits *fits, // FITS file to which to write 27 pmFPA *fpa, // FPA to write 26 28 psDB *db // Database to update 27 29 ) … … 78 80 79 81 80 bool pmFPAWriteMask(pmFPA *fpa, // FPA containing mask to write82 bool pmFPAWriteMask(pmFPA *fpa, // FPA containing mask to write 81 83 psFits *fits // FITS file for image 82 84 ) … … 136 138 { 137 139 // Source is a file (with optional extension, e.g., "myMaskFile.fits:thisExt" 138 psString filenameExt = p_pmFPATranslateName(name, cell);139 char *colon = strchr(filenameExt, ':'); // Pointer to a colon in the filename-extn140 140 psString filename = NULL; // The filename 141 141 psString extname = NULL; // The extenstion name 142 if (colon) 143 { 144 filename = psStringNCopy(filenameExt, strlen(filenameExt) - strlen(colon)); 145 if (strlen(colon) > 1) 146 { 147 extname = psStringCopy(colon + 1); 148 } 149 } 150 else 151 { 152 filename = psMemIncrRefCounter(filenameExt); 153 } 142 extname = p_pmFPAGetExtName(name, cell, filename); 154 143 155 144 psFree(maskDest); … … 161 150 psFree(filename); 162 151 psFree(extname); 163 psFree(filenameExt);164 152 } 165 153 else if (strncasecmp(sourceType, "EXT", 3) == 0) … … 203 191 204 192 205 bool pmFPAWriteWeight(pmFPA *fpa, // FPA containing mask to write193 bool pmFPAWriteWeight(pmFPA *fpa, // FPA containing mask to write 206 194 psFits *fits // FITS file for image 207 195 ) … … 261 249 { 262 250 // Source is a file (with optional extension, e.g., "myWeightFile.fits:thisExt" 263 psString filenameExt = p_pmFPATranslateName(name, cell);264 char *colon = strchr(filenameExt, ':'); // Pointer to a colon in the filename-extn265 251 psString filename = NULL; // The filename 266 252 psString extname = NULL; // The extenstion name 267 if (colon) 268 { 269 filename = psStringNCopy(filenameExt, strlen(filenameExt) - strlen(colon)); 270 if (strlen(colon) > 1) 271 { 272 extname = psStringCopy(colon + 1); 273 } 274 } 275 else 276 { 277 filename = psMemIncrRefCounter(filenameExt); 278 } 253 extname = p_pmFPAGetExtName(name, cell, filename); 279 254 280 255 psFree(weightDest); … … 286 261 psFree(filename); 287 262 psFree(extname); 288 psFree(filenameExt);289 263 } 290 264 else if (strncasecmp(sourceType, "EXT", 3) == 0) … … 325 299 return true; 326 300 } 301 302 static psString p_pmFPAGetExtName(psString name, pmCell *cell, psString filename) 303 { 304 psString filenameExt = p_pmFPATranslateName(name, cell); 305 char *colon = strchr(filenameExt, ':'); // Pointer to a colon in the filename-extn 306 psString extname = NULL; // The extenstion name 307 filename = NULL; // The filename 308 if (colon) 309 { 310 filename = psStringNCopy(filenameExt, strlen(filenameExt) - strlen(colon)); 311 if (strlen(colon) > 1) 312 { 313 extname = psStringCopy(colon + 1); 314 } 315 } 316 else 317 { 318 filename = psMemIncrRefCounter(filenameExt); 319 } 320 321 psFree(filenameExt); 322 323 return extname; 324 }
Note:
See TracChangeset
for help on using the changeset viewer.
