IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6841


Ignore:
Timestamp:
Apr 11, 2006, 6:44:00 PM (20 years ago)
Author:
Paul Price
Message:

Renaming variables to be consistent with configuration file usage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/rel10_ifa/psModules/src/astrom/pmFPAConstruct.c

    r6839 r6841  
    9090// Get the name of a PHU chip or cell from the header
    9191static psString phuNameFromHeader(const char *name, // The name to lookup: "CELL.NAME" or "CHIP.NAME"
    92                                   const psMetadata *format, // FILE within the camera format description
     92                                  const psMetadata *fileInfo, // FILE within the camera format description
    9393                                  const psMetadata *header // Primary header
    9494                                 )
    9595{
    9696    bool mdok = true;                   // Result of MD lookup
    97     psString keyword = psMetadataLookupStr(&mdok, format, name);
     97    psString keyword = psMetadataLookupStr(&mdok, fileInfo, name);
    9898    if (!mdok || strlen(keyword) == 0) {
    9999        return false;
     
    181181
    182182// Looks up the particular content based on the header
    183 static const char *getContent(psMetadata *format, // The FORMAT from the camera format configuration
     183static const char *getContent(psMetadata *fileInfo, // The FILE from the camera format configuration
    184184                              psMetadata *contents, // The CONTENTS from the camera format configuration
    185185                              psMetadata *header // The (primary) header
     
    187187{
    188188    bool mdok = true;                   // Status of MD lookup
    189     const char *contentHeaders = psMetadataLookupStr(&mdok, format, "CONTENT"); // Headers for content
     189    const char *contentHeaders = psMetadataLookupStr(&mdok, fileInfo, "CONTENT"); // Headers for content
    190190    if (!mdok || !contentHeaders || strlen(contentHeaders) == 0) {
    191         psError(PS_ERR_IO, true, "Unable to find CONTENT in FORMAT.\n");
     191        psError(PS_ERR_IO, true, "Unable to find CONTENT in FILE within camera format configuration.\n");
    192192        return NULL;
    193193    }
     
    496496
    497497    bool mdok = true;                   // Status from metadata lookups
    498     psMetadata *formatSpec = psMetadataLookupMD(&mdok, format, "FILE"); // The format specification
    499     if (!mdok || !formatSpec) {
     498    psMetadata *fileInfo = psMetadataLookupMD(&mdok, format, "FILE"); // The file information
     499    if (!mdok || !fileInfo) {
    500500        psError(PS_ERR_IO, false, "Unable to find FILE in the camera format configuration.\n");
    501501        return NULL;
     
    503503
    504504    // Check the name of the FPA
    505     psString newFPAname = phuNameFromHeader("FPA.NAME", formatSpec, phu); // New name for the FPA
     505    psString newFPAname = phuNameFromHeader("FPA.NAME", fileInfo, phu); // New name for the FPA
    506506    const char *currentFPAname = psMetadataLookupStr(&mdok, fpa->concepts, "FPA.NAME"); // Current name
    507507    if (mdok && currentFPAname && strlen(currentFPAname) > 0 && strcmp(currentFPAname, newFPAname) != 0) {
     
    513513
    514514    // Where does the PHU go?
    515     const char *phuType = psMetadataLookupStr(&mdok, formatSpec, "PHU"); // What is the PHU?
     515    const char *phuType = psMetadataLookupStr(&mdok, fileInfo, "PHU"); // What is the PHU?
    516516    if (!mdok || strlen(phuType) == 0) {
    517517        psError(PS_ERR_IO, false, "Unable to find PHU in the format specification.\n");
     
    528528
    529529    // And what are the individual extensions?
    530     const char *extType = psMetadataLookupStr(&mdok, formatSpec, "EXTENSIONS"); // What's in the extns?
     530    const char *extType = psMetadataLookupStr(&mdok, fileInfo, "EXTENSIONS"); // What's in the extns?
    531531    if (!mdok || strlen(extType) == 0) {
    532532        psError(PS_ERR_IO, false, "Unable to find EXTENSIONS in the format specification.\n");
     
    565565    if (strcasecmp(extType, "NONE") == 0) {
    566566        // We have already dealt with the case PHU=FPA, in a special case, above.
    567         const char *content = getContent(formatSpec, contents, phu); // The content: string of chip:cell pairs
     567        const char *content = getContent(fileInfo, contents, phu); // The content: string of chip:cell pairs
    568568
    569569        // Need to look up what chip we have.
    570         psString chipName = phuNameFromHeader("CHIP.NAME", formatSpec, phu);
     570        psString chipName = phuNameFromHeader("CHIP.NAME", fileInfo, phu);
    571571        psTrace(__func__, 5, "This is chip %s\n", chipName);
    572572        int chipNum = pmFPAFindChip(fpa, chipName); // Chip number
     
    587587            level = PM_FPA_LEVEL_CELL;
    588588            // Need to look up what cell we have.
    589             psString cellName = phuNameFromHeader("CELL.NAME", formatSpec, phu);
     589            psString cellName = phuNameFromHeader("CELL.NAME", fileInfo, phu);
    590590            int cellNum = pmChipFindCell(chip, cellName); // Cell number
    591591            if (cellNum == -1) {
     
    619619    } else {
    620620        // Get the chip
    621         psString chipName = phuNameFromHeader("CHIP.NAME", formatSpec, phu); // Name of the chip
     621        psString chipName = phuNameFromHeader("CHIP.NAME", fileInfo, phu); // Name of the chip
    622622        int chipNum = pmFPAFindChip(fpa, chipName); // Chip number
    623623        if (chipNum == -1) {
     
    632632            addHDUtoChip(chip, phdu);
    633633        } else if (strcasecmp(phuType, "CELL") == 0) {
    634             psString cellName = phuNameFromHeader("CELL.NAME", formatSpec, phu); // Name of the cell
     634            psString cellName = phuNameFromHeader("CELL.NAME", fileInfo, phu); // Name of the cell
    635635            int cellNum = pmChipFindCell(chip, cellName); // Cell number
    636636            if (cellNum == -1) {
Note: See TracChangeset for help on using the changeset viewer.