IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 9, 2006, 3:03:47 PM (20 years ago)
Author:
magnier
Message:

adding substitution for CAMERA (poor) and additional error tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAfile.c

    r8848 r9436  
    176176    if (strstr (newName, "{EXTNAME}") != NULL) {
    177177        pmHDU *hdu = pmFPAviewThisHDU (view, file->fpa);
    178         if (hdu->extname != NULL) {
     178        if (hdu->extname && *hdu->extname) {
    179179            newName = psStringSubstitute (newName, hdu->extname, "{EXTNAME}");
    180180        }
     
    183183        if (file->fpa != NULL) {
    184184            char *name = psMetadataLookupStr (NULL, file->fpa->concepts, "FPA.FILTER");
    185             if (name != NULL) {
     185            if (name && *name) {
    186186                newName = psStringSubstitute (newName, name, "{FILTER}");
    187187            }
     
    190190    if (strstr (newName, "{CAMERA}") != NULL) {
    191191        if (file->fpa != NULL) {
    192             char *name = psMetadataLookupStr (NULL, file->fpa->concepts, "FPA.CAMERA");
    193             if (name != NULL) {
     192            // XXX this concept does not exist...
     193            // char *name = psMetadataLookupStr (NULL, file->fpa->concepts, "FPA.CAMERA");
     194            char *name = psStringCopy ("isp");
     195            if (name && *name) {
    194196                newName = psStringSubstitute (newName, name, "{CAMERA}");
    195197            }
     198            psFree (name);
    196199        }
    197200    }
     
    200203            char *filterName = psMetadataLookupStr (NULL, file->fpa->concepts, "FPA.FILTER");
    201204            psMetadata *filterTable = psMetadataLookupPtr (NULL, file->camera, "FILTER.ID");
    202             if (filterName && filterTable) {
     205            if (filterName && *filterName && filterTable) {
    203206                char *ID = psMetadataLookupStr (NULL, filterTable, filterName);
    204                 newName = psStringSubstitute (newName, ID, "{FILTER.ID}");
     207                if (ID && *ID) {
     208                    newName = psStringSubstitute (newName, ID, "{FILTER.ID}");
     209                }
    205210            }
    206211        }
Note: See TracChangeset for help on using the changeset viewer.