IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 7, 2007, 3:22:17 PM (19 years ago)
Author:
Paul Price
Message:

Images in the detrend database may be in different formats.
Therefore, in order to get a detrend matching the appropriate level,
we need to place a restriction on the class_id (class identifier,
which can be 'fpa', 'ccd00', or even 'ccd00:cell01'). To do this, we
have "detselect -search" return the file level (fpa/chip/cell) for the
detrend, so that we can provide the correct constraint on the class_id
(using "detselect -select"). Introduced a new metadata in the camera
configuration ("CLASSID") that provides rules for the class_id (e.g.,
"{CHIP.NAME}:{CELL.NAME}") according to the file level string.

File:
1 edited

Legend:

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

    r11801 r12300  
    225225    // get name from detrend database
    226226    // extrule expands to yield the class_id
    227     // filextra contains the desired -det_id detID -iteration iter string
     227    // file->detrend->detID contains the desired -det_id detID -iteration iter string
    228228    if (!strcasecmp (file->filename, "@DETDB")) {
    229         char *extra = pmFPAfileNameFromRule (file->extrule, file, view);
    230         if (extra == NULL) {
    231             psError(PS_ERR_IO, false, "error converting extrule to name %s\n", file->extrule);
    232             return false;
    233         }
    234         psTrace ("pmFPAfile", 6, "looking for detrend (%s, %s)\n", file->filextra, extra);
    235 
     229        if (!file->detrend) {
     230            psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find information about selected detrend.");
     231            return false;
     232        }
     233
     234        psString classId = NULL;        // The class identifier, to pass to pmDetrendFile
     235        psMetadata *menu = psMetadataLookupMetadata(&status, file->camera, "CLASSID"); // Menu of class IDs
     236        if (!status || !menu) {
     237            psWarning("Unable to find CLASSID metadata in camera configuration --- "
     238                      "assuming no class identifier required.");
     239        } else {
     240            const char *rule = psMetadataLookupStr(&status, menu, file->detrend->level); // Rule for class_id
     241            if (!status || !rule || strlen(rule) == 0) {
     242                psWarning("Unable to find %s in CLASSID within camera configuration --- "
     243                          "attempting to proceed without it.", file->detrend->level);
     244            } else {
     245                classId = pmFPAfileNameFromRule(rule, file, view);
     246                if (!classId) {
     247                    psError(PS_ERR_IO, false, "error converting extrule to name: %s\n", rule);
     248                    return false;
     249                }
     250            }
     251        }
     252        psTrace ("pmFPAfile", 6, "looking for detrend (%s, %s)\n", file->detrend->detID, classId);
    236253        psFree (file->filename);
    237         file->filename = pmDetrendFile(file->filextra, extra, config);
     254
     255        file->filename = pmDetrendFile(file->detrend->detID, classId, config);
    238256        if (file->filename == NULL) {
    239             psError(PS_ERR_IO, false, "failed to find a valid detrend image for detID %s : classID %s\n", file->filextra, extra);
    240             psFree (extra);
     257            psError(PS_ERR_IO, false, "failed to find a valid detrend image for detID %s : classID %s\n", file->detrend->detID, classId);
     258            psFree (classId);
    241259            return false;
    242260        }
    243261
    244262        psTrace ("pmFPAfile", 6, "got detrend file %s\n", file->filename);
    245         psFree (extra);
     263        psFree (classId);
    246264    }
    247265
Note: See TracChangeset for help on using the changeset viewer.