IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11132


Ignore:
Timestamp:
Jan 17, 2007, 5:14:09 PM (19 years ago)
Author:
Paul Price
Message:

Adding FPA.EXPOSURE

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippconfig/megacam/format_raw.config

    r11131 r11132  
    133133        FPA.AZ                  STR     TELAZ
    134134        FPA.TEMP                STR     DETTEM
     135        FPA.EXPOSURE            STR     EXPTIME
    135136        CHIP.TEMP               STR     DETTEM
    136137        CELL.EXPOSURE           STR     EXPTIME
  • trunk/ippconfig/megacam/format_spliced.config

    r11131 r11132  
    9999        FPA.AZ          STR     TELAZ
    100100        FPA.TEMP        STR     DETTEM
     101        FPA.EXPOSURE    STR     EXPTIME
    101102        CHIP.TEMP       STR     DETTEM
    102103        CELL.EXPOSURE   STR     EXPTIME
  • trunk/ippconfig/megacam/format_split.config

    r11131 r11132  
    9898        FPA.AZ          STR     TELAZ
    9999        FPA.TEMP        STR     DETTEM
     100        FPA.EXPOSURE    STR     EXPTIME
    100101        CHIP.TEMP       STR     DETTEM
    101102        CELL.EXPOSURE   STR     EXPTIME
  • trunk/psModules/src/concepts/pmConceptsStandard.c

    r11091 r11132  
    4242    psAbort(__func__, "Should never ever get here.\n");
    4343    return NAN;
     44}
     45
     46// FPA.FILTER
     47psMetadataItem *p_pmConceptParse_FPA_FILTER(const psMetadataItem *concept,
     48        const psMetadataItem *pattern,
     49        const psMetadata *cameraFormat,
     50        const pmFPA *fpa,
     51        const pmChip *chip,
     52        const pmCell *cell)
     53{
     54    assert(concept);
     55    assert(pattern);
     56    assert(fpa);
     57    assert(fpa->camera);
     58
     59    if (concept->type != PS_DATA_STRING) {
     60        psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Type for %s (%x) is not STR\n",
     61                pattern->name, concept->type);
     62        return NULL;
     63    }
     64
     65    bool mdok;                          // Status of MD lookup
     66    psMetadata *filters = psMetadataLookupMetadata(&mdok, fpa->camera, "FILTER.ID");
     67    if (!mdok || !filters) {
     68        psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find FILTER.ID in camera configuration.\n");
     69        return NULL;
     70    }
     71
     72    const char *key = concept->data.str;        // The name to look up
     73    psString value = psMetadataLookupStr(&mdok, filters, key); // Value to use
     74    if (!mdok || !value || strlen(value) == 0) {
     75        psError(PS_ERR_UNEXPECTED_NULL, true,
     76                "Unable to find %s in FILTER.ID in camera configuration.\n", key);
     77        return NULL;
     78    }
     79
     80    return psMetadataItemAllocStr(pattern->name, pattern->comment, value);
     81}
     82
     83psMetadataItem *p_pmConceptFormat_FPA_FILTER(const psMetadataItem *concept,
     84        const psMetadata *cameraFormat,
     85        const pmFPA *fpa,
     86        const pmChip *chip,
     87        const pmCell *cell)
     88{
     89    assert(concept);
     90    assert(fpa);
     91    assert(fpa->camera);
     92
     93    if (concept->type != PS_DATA_STRING) {
     94        psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Type for %s (%x) is not STR\n",
     95                concept->name, concept->type);
     96        return NULL;
     97    }
     98
     99    bool mdok;                          // Status of MD lookup
     100    psMetadata *filters = psMetadataLookupMetadata(&mdok, fpa->camera, "FILTER.ID");
     101    if (!mdok || !filters) {
     102        psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find FILTER.ID in camera configuration.\n");
     103        return NULL;
     104    }
     105
     106    psMetadataIterator *iter = psMetadataIteratorAlloc(filters, PS_LIST_HEAD, NULL); // Iterator for filters
     107    psMetadataItem *item;               // Item from iteration
     108    char *name = NULL;                  // The winning name
     109    while ((item = psMetadataGetAndIncrement(iter))) {
     110        if (item->type != PS_DATA_STRING) {
     111            psWarning("Type for %s (%x) in FILTER.ID in camera configuration is not STR\n",
     112                      item->name, item->type);
     113            continue;
     114        }
     115        if (strcmp(item->data.str, concept->data.str)) {
     116            name = item->name;
     117            break;
     118        }
     119    }
     120    if (!name) {
     121        psError(PS_ERR_UNEXPECTED_NULL, false,
     122                "Unable to find any filter matching %s in FILTER.ID in camera configuration.\n",
     123                concept->data.str);
     124        return NULL;
     125    }
     126
     127    return psMetadataItemAllocStr(concept->name, concept->comment, name);
    44128}
    45129
  • trunk/psModules/src/concepts/pmConceptsStandard.h

    r9581 r11132  
    77/// @author Paul Price, IfA
    88///
    9 /// @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    10 /// @date $Date: 2006-10-16 22:03:56 $
     9/// @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     10/// @date $Date: 2007-01-18 03:14:09 $
    1111///
    1212/// Copyright 2005-2006 Institute for Astronomy, University of Hawaii
     
    2121// Functions to parse and format the standard concepts
    2222
     23
     24/// Parse the FPA.FILTER concept to apply a lookup table
     25psMetadataItem *p_pmConceptParse_FPA_FILTER(const psMetadataItem *concept, ///< Concept to parse
     26        const psMetadataItem *pattern, ///< Pattern to use in parsing
     27        const psMetadata *cameraFormat, ///< Camera format definition
     28        const pmFPA *fpa, ///< FPA for concept, or NULL
     29        const pmChip *chip, ///< Chip for concept, or NULL
     30        const pmCell *cell ///< Cell for concept, or NULL
     31                                           );
     32
     33/// Format the FPA.FILTER concept to (reverse-)apply a lookup table
     34psMetadataItem *p_pmConceptFormat_FPA_FILTER(const psMetadataItem *concept, ///< Concept to format
     35        const psMetadata *cameraFormat, ///< Camera format definition
     36        const pmFPA *fpa, ///< FPA for concept, or NULL
     37        const pmChip *chip, ///< Chip for concept, or NULL
     38        const pmCell *cell ///< Cell for concept, or NULL
     39                                            );
    2340
    2441/// Parse the coordinates concepts: FPA.RA and FPA.DEC
Note: See TracChangeset for help on using the changeset viewer.