IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 28, 2008, 11:13:46 AM (18 years ago)
Author:
eugene
Message:

load FITSTYPES from external recipe file; merge into camera config

File:
1 edited

Legend:

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

    r16611 r17489  
    172172    }
    173173
    174     psMetadata *data = pmConfigFileRule(config, camera, name); // File rule
    175     if (!data) {
     174    psMetadata *filerule = pmConfigFileRule(config, camera, name); // File rule
     175    if (!filerule) {
    176176        psError(PS_ERR_IO, true, "Can't find file rule %s!", name);
    177177        return NULL;
     
    183183    file->name = psStringCopy(name);
    184184
    185     file->filerule = psMemIncrRefCounter(psMetadataLookupStr(&status, data, "FILENAME.RULE"));
    186 
    187     const char *type = psMetadataLookupStr(&status, data, "FILE.TYPE");
     185    // this is the filename rule
     186    file->filerule = psMemIncrRefCounter(psMetadataLookupStr(&status, filerule, "FILENAME.RULE"));
     187
     188    const char *type = psMetadataLookupStr(&status, filerule, "FILE.TYPE");
    188189    file->type = pmFPAfileTypeFromString(type);
    189190    if (file->type == PM_FPA_FILE_NONE) {
     
    214215    if (!formatName || strlen(formatName) == 0) {
    215216        // select the format list from the selected camera
    216         formatName = psMetadataLookupStr(&status, data, "FILE.FORMAT");
     217        formatName = psMetadataLookupStr(&status, filerule, "FILE.FORMAT");
    217218        if (!formatName || strcmp(formatName, "NONE") == 0) {
    218219            // Try to get by with the default
     
    238239
    239240    // Get FITS output scheme
    240     const char *fitsType = psMetadataLookupStr(&status, data, "FITS.TYPE"); // Name of FITS scheme to use
     241    const char *fitsType = psMetadataLookupStr(&status, filerule, "FITS.TYPE"); // Name of FITS scheme to use
    241242    if (fitsType && strcasecmp(fitsType, "NONE") != 0) {
    242         psMetadata *fitsTypes = psMetadataLookupMetadata(&status, camera, "FITS"); // The FITS schemes
    243         if (!fitsTypes) {
    244             psWarning("Unable to find FITS in camera configuration.");
    245             goto FITS_OPTIONS_DONE;
    246         }
    247         psMetadata *scheme = psMetadataLookupMetadata(NULL, fitsTypes, fitsType); // FITS scheme
     243
     244        // load the FITSTYPE scheme for this file
     245        psMetadata *scheme = pmConfigFitsType(config, camera, fitsType); // File rule
    248246        if (!scheme) {
     247            // XXX change to a config error?
    249248            psWarning("Unable to find %s in FITS in camera configuration --- will use defaults.", fitsType);
    250249            goto FITS_OPTIONS_DONE;
     
    337336    }
    338337
    339     file->dataLevel = pmFPALevelFromName(psMetadataLookupStr(&status, data, "DATA.LEVEL"));
     338    file->dataLevel = pmFPALevelFromName(psMetadataLookupStr(&status, filerule, "DATA.LEVEL"));
    340339    if (file->dataLevel == PM_FPA_LEVEL_NONE) {
    341340        psError(PS_ERR_IO, true, "DATA.LEVEL is not set for %s\n", name);
Note: See TracChangeset for help on using the changeset viewer.