IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 6, 2007, 2:10:36 PM (19 years ago)
Author:
Paul Price
Message:

Adding ability to determine whether a concept is required or not, and using this ability to downgrade errors into warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/concepts/pmConcepts.c

    r11865 r12285  
    88#include <assert.h>
    99#include <pslib.h>
     10#include <string.h>
    1011
    1112#include "pmConcepts.h"
     
    2021static psMetadata *conceptsCell = NULL; // Known concepts for cell
    2122
     23// Return the appropriate concepts metadata, given the level
     24static psMetadata *conceptsFromLevel(pmFPALevel level)
     25{
     26    switch (level) {
     27    case PM_FPA_LEVEL_FPA:
     28        return conceptsFPA;
     29    case PM_FPA_LEVEL_CHIP:
     30        return conceptsChip;
     31    case PM_FPA_LEVEL_CELL:
     32        return conceptsCell;
     33    default:
     34        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Invalid concept level provided: %d\n", level);
     35        return NULL;
     36    }
     37}
     38
    2239// Free a concept
    2340static void conceptSpecFree(pmConceptSpec *spec)
     
    2744
    2845pmConceptSpec *pmConceptSpecAlloc(psMetadataItem *blank, pmConceptParseFunc parse,
    29                                   pmConceptFormatFunc format)
     46                                  pmConceptFormatFunc format, bool required)
    3047{
    3148    pmConceptSpec *spec = psAlloc(sizeof(pmConceptSpec));
     
    3552    spec->parse = parse;
    3653    spec->format = format;
     54    spec->required = required;
    3755
    3856    return spec;
     
    4664
    4765    // Get the appropriate concepts
    48     psMetadata *concepts = NULL;        // Metadata of concepts specs
    49     switch (level) {
    50     case PM_FPA_LEVEL_FPA:
    51         concepts = conceptsFPA;
    52         break;
    53     case PM_FPA_LEVEL_CHIP:
    54         concepts = conceptsChip;
    55         break;
    56     case PM_FPA_LEVEL_CELL:
    57         concepts = conceptsCell;
    58         break;
    59     default:
    60         psError(PS_ERR_IO, true, "Invalid concept level provided: %d\n", level);
     66    psMetadata *concepts = conceptsFromLevel(level); // Metadata of concepts specs
     67    if (!concepts) {
     68        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Invalid concept level provided: %d\n", level);
    6169        return NULL;
    6270    }
     
    7381}
    7482
    75 
    76 psList *psMetadataKeys(psMetadata *md)
    77 {
    78     psList *list = psListAlloc(NULL);   // List with the keys
    79     psMetadataIterator *iter = psMetadataIteratorAlloc(md, PS_LIST_HEAD, false);
    80     psMetadataItem *item;               // Item from iteration
    81     while ((item = psMetadataGetAndIncrement(iter))) {
    82         psListAdd(list, PS_LIST_TAIL, item->name);
    83     }
    84     return list;
    85 }
    86 
    87 
    88 
    89 bool pmConceptRegister(psMetadataItem *blank, pmConceptParseFunc parse,
    90                        pmConceptFormatFunc format, pmFPALevel level)
    91 {
    92     PS_ASSERT_PTR_NON_NULL(blank, false);
    93 
     83bool pmConceptGetRequired(const char *name, pmFPALevel level)
     84{
     85    PS_ASSERT_STRING_NON_EMPTY(name, false);
    9486    if (!conceptsInitialised) {
    9587        pmConceptsInit();
    9688    }
    9789
    98     pmConceptSpec *spec = pmConceptSpecAlloc(blank, parse, format); // The concept specification
    99     psMetadata **target = NULL;         // The metadata of known concepts to write to
    100     switch (level) {
    101     case PM_FPA_LEVEL_FPA:
    102         target = &conceptsFPA;
    103         break;
    104     case PM_FPA_LEVEL_CHIP:
    105         target = &conceptsChip;
    106         break;
    107     case PM_FPA_LEVEL_CELL:
    108         target = &conceptsCell;
    109         break;
    110     default:
    111         psError(PS_ERR_IO, true, "Invalid concept level provided: %d\n", level);
    112         psFree(spec);
     90    psMetadata *concepts = conceptsFromLevel(level); // The metadata of known concepts
     91
     92    bool mdok;                          // Status of MD lookup
     93    pmConceptSpec *spec = psMetadataLookupPtr(&mdok, concepts, name); // The specification
     94    if (!spec) {
     95        // Won't throw an error, because we can't distinguish an error from the desired result.
     96        // However, that doesn't really matter, because if we can't find it, then it can't be required!
    11397        return false;
    11498    }
    11599
    116     psMetadataAdd(*target, PS_LIST_TAIL, blank->name, PS_DATA_UNKNOWN | PS_META_REPLACE,
     100    return spec->required;
     101}
     102
     103bool pmConceptSetRequired(const char *name, pmFPALevel level, bool required)
     104{
     105    PS_ASSERT_STRING_NON_EMPTY(name, false);
     106
     107    if (!conceptsInitialised) {
     108        pmConceptsInit();
     109    }
     110
     111    psMetadata *concepts = conceptsFromLevel(level); // The metadata of known concepts
     112
     113    bool mdok;                          // Status of MD lookup
     114    pmConceptSpec *spec = psMetadataLookupPtr(&mdok, concepts, name); // The specification
     115    if (!spec) {
     116        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unable to find defined concept %s in level %d.",
     117                name, level);
     118        return false;
     119    }
     120    spec->required = required;
     121
     122    return true;
     123}
     124
     125bool pmConceptRegister(psMetadataItem *blank, pmConceptParseFunc parse,
     126                        pmConceptFormatFunc format, bool required, pmFPALevel level)
     127{
     128    PS_ASSERT_PTR_NON_NULL(blank, false);
     129
     130    if (!conceptsInitialised) {
     131        pmConceptsInit();
     132    }
     133
     134    psMetadata *target = conceptsFromLevel(level); // The metadata of known concepts to write to
     135    if (!target) {
     136        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     137                "Unable to register concept at invalid concept level.");
     138        return false;
     139    }
     140
     141    pmConceptSpec *spec = pmConceptSpecAlloc(blank, parse, format, required); // The concept specification
     142    psMetadataAdd(target, PS_LIST_TAIL, blank->name, PS_DATA_UNKNOWN | PS_META_REPLACE,
    117143                  "Concepts specification", spec);
    118144    psFree(spec);                       // Drop reference
     
    434460        // Install the standard concepts
    435461
    436         #if 0
    437         // FPA.NAME
    438         {
    439             psMetadataItem *fpaName = psMetadataItemAllocStr("FPA.NAME", "Name of FPA", "");
    440             pmConceptRegister(fpaName, NULL, NULL, PM_FPA_LEVEL_FPA);
    441             psFree(fpaName);
    442         }
    443         #endif
    444 
    445462        // FPA.TELESCOPE
    446463        {
    447464            psMetadataItem *fpaTelescope = psMetadataItemAllocStr("FPA.TELESCOPE", "Camera used", "");
    448             pmConceptRegister(fpaTelescope, NULL, NULL, PM_FPA_LEVEL_FPA);
     465            pmConceptRegister(fpaTelescope, NULL, NULL, false, PM_FPA_LEVEL_FPA);
    449466            psFree(fpaTelescope);
    450467        }
     
    453470        {
    454471            psMetadataItem *fpaInstrument = psMetadataItemAllocStr("FPA.INSTRUMENT", "Camera used", "");
    455             pmConceptRegister(fpaInstrument, NULL, NULL, PM_FPA_LEVEL_FPA);
     472            pmConceptRegister(fpaInstrument, NULL, NULL, false, PM_FPA_LEVEL_FPA);
    456473            psFree(fpaInstrument);
    457474        }
     
    460477        {
    461478            psMetadataItem *fpaDetector = psMetadataItemAllocStr("FPA.DETECTOR", "Detector used", "");
    462             pmConceptRegister(fpaDetector, NULL, NULL, PM_FPA_LEVEL_FPA);
     479            pmConceptRegister(fpaDetector, NULL, NULL, false, PM_FPA_LEVEL_FPA);
    463480            psFree(fpaDetector);
    464481        }
     
    468485        {
    469486            psMetadataItem *fpaCamera = psMetadataItemAllocStr("FPA.CAMERA", "Camera used", "");
    470             pmConceptRegister(fpaCamera, NULL, NULL, PM_FPA_LEVEL_FPA);
     487            pmConceptRegister(fpaCamera, NULL, NULL, false, PM_FPA_LEVEL_FPA);
    471488            psFree(fpaCamera);
    472489        }
     
    475492        {
    476493            psMetadataItem *fpaFocus = psMetadataItemAllocF32("FPA.FOCUS", "Telescope focus", NAN);
    477             pmConceptRegister(fpaFocus, NULL, NULL, PM_FPA_LEVEL_FPA);
     494            pmConceptRegister(fpaFocus, NULL, NULL, false, PM_FPA_LEVEL_FPA);
    478495            psFree(fpaFocus);
    479496        }
     
    482499        {
    483500            psMetadataItem *fpaAirmass = psMetadataItemAllocF32("FPA.AIRMASS", "Airmass at boresight", NAN);
    484             pmConceptRegister(fpaAirmass, NULL, NULL, PM_FPA_LEVEL_FPA);
     501            pmConceptRegister(fpaAirmass, NULL, NULL, false, PM_FPA_LEVEL_FPA);
    485502            psFree(fpaAirmass);
    486503        }
     
    491508                                                                 "Filter used (parsed, abstract name) ", "");
    492509            pmConceptRegister(fpaFilterid, (pmConceptParseFunc)p_pmConceptParse_FPA_FILTER,
    493                               (pmConceptFormatFunc)p_pmConceptFormat_FPA_FILTER, PM_FPA_LEVEL_FPA);
     510                              (pmConceptFormatFunc)p_pmConceptFormat_FPA_FILTER, false, PM_FPA_LEVEL_FPA);
    494511            psFree(fpaFilterid);
    495512        }
     
    498515        {
    499516            psMetadataItem *fpaFilter = psMetadataItemAllocStr("FPA.FILTER", "Filter used", "");
    500             pmConceptRegister(fpaFilter, NULL, NULL, PM_FPA_LEVEL_FPA);
     517            pmConceptRegister(fpaFilter, NULL, NULL, false, PM_FPA_LEVEL_FPA);
    501518            psFree(fpaFilter);
    502519        }
     
    506523            psMetadataItem *fpaPosangle = psMetadataItemAllocF32("FPA.POSANGLE",
    507524                                          "Position angle of instrument", NAN);
    508             pmConceptRegister(fpaPosangle, NULL, NULL, PM_FPA_LEVEL_FPA);
     525            pmConceptRegister(fpaPosangle, NULL, NULL, false, PM_FPA_LEVEL_FPA);
    509526            psFree(fpaPosangle);
    510527        }
     
    514531            psMetadataItem *fpaRadecsys = psMetadataItemAllocStr("FPA.RADECSYS",
    515532                                          "Celestial coordinate system", "");
    516             pmConceptRegister(fpaRadecsys, NULL, NULL, PM_FPA_LEVEL_FPA);
     533            pmConceptRegister(fpaRadecsys, NULL, NULL, false, PM_FPA_LEVEL_FPA);
    517534            psFree(fpaRadecsys);
    518535        }
     
    522539            psMetadataItem *fpaRa = psMetadataItemAllocF64("FPA.RA", "Right Ascension of boresight", NAN);
    523540            pmConceptRegister(fpaRa, (pmConceptParseFunc)p_pmConceptParse_FPA_Coords,
    524                               (pmConceptFormatFunc)p_pmConceptFormat_FPA_Coords, PM_FPA_LEVEL_FPA);
     541                              (pmConceptFormatFunc)p_pmConceptFormat_FPA_Coords, false, PM_FPA_LEVEL_FPA);
    525542            psFree(fpaRa);
    526543        }
     
    530547            psMetadataItem *fpaDec = psMetadataItemAllocF64("FPA.DEC", "Declination of boresight", NAN);
    531548            pmConceptRegister(fpaDec, (pmConceptParseFunc)p_pmConceptParse_FPA_Coords,
    532                               (pmConceptFormatFunc)p_pmConceptFormat_FPA_Coords, PM_FPA_LEVEL_FPA);
     549                              (pmConceptFormatFunc)p_pmConceptFormat_FPA_Coords, false, PM_FPA_LEVEL_FPA);
    533550            psFree(fpaDec);
    534551        }
     
    537554        {
    538555            psMetadataItem *fpaObstype = psMetadataItemAllocStr("FPA.OBSTYPE", "Type of observation", "");
    539             pmConceptRegister(fpaObstype, NULL, NULL, PM_FPA_LEVEL_FPA);
     556            pmConceptRegister(fpaObstype, NULL, NULL, false, PM_FPA_LEVEL_FPA);
    540557            psFree(fpaObstype);
    541558        }
     
    544561        {
    545562            psMetadataItem *fpaObject = psMetadataItemAllocStr("FPA.OBJECT", "Object of observation", "");
    546             pmConceptRegister(fpaObject, NULL, NULL, PM_FPA_LEVEL_FPA);
     563            pmConceptRegister(fpaObject, NULL, NULL, false, PM_FPA_LEVEL_FPA);
    547564            psFree(fpaObject);
    548565        }
     
    551568        {
    552569            psMetadataItem *fpaAlt = psMetadataItemAllocF64("FPA.ALT", "Altitude of telescope", NAN);
    553             pmConceptRegister(fpaAlt, NULL, NULL, PM_FPA_LEVEL_FPA);
     570            pmConceptRegister(fpaAlt, NULL, NULL, false, PM_FPA_LEVEL_FPA);
    554571            psFree(fpaAlt);
    555572        }
     
    558575        {
    559576            psMetadataItem *fpaAz = psMetadataItemAllocF64("FPA.AZ", "Azimuth of telescope", NAN);
    560             pmConceptRegister(fpaAz, NULL, NULL, PM_FPA_LEVEL_FPA);
     577            pmConceptRegister(fpaAz, NULL, NULL, false, PM_FPA_LEVEL_FPA);
    561578            psFree(fpaAz);
    562579        }
     
    566583            psMetadataItem *fpaTimesys = psMetadataItemAllocS32("FPA.TIMESYS", "Time system", -1);
    567584            pmConceptRegister(fpaTimesys, (pmConceptParseFunc)p_pmConceptParse_TIMESYS,
    568                               (pmConceptFormatFunc)p_pmConceptFormat_TIMESYS, PM_FPA_LEVEL_FPA);
     585                              (pmConceptFormatFunc)p_pmConceptFormat_TIMESYS, false, PM_FPA_LEVEL_FPA);
    569586            psFree(fpaTimesys);
    570587        }
     
    580597            psFree(time);
    581598            pmConceptRegister(fpaTime, (pmConceptParseFunc)p_pmConceptParse_TIME,
    582                               (pmConceptFormatFunc)p_pmConceptFormat_TIME, PM_FPA_LEVEL_FPA);
     599                              (pmConceptFormatFunc)p_pmConceptFormat_TIME, false, PM_FPA_LEVEL_FPA);
    583600            psFree(fpaTime);
    584601        }
     
    587604        {
    588605            psMetadataItem *fpaTemp = psMetadataItemAllocF32("FPA.TEMP", "Temperature of focal plane", NAN);
    589             pmConceptRegister(fpaTemp, NULL, NULL, PM_FPA_LEVEL_FPA);
     606            pmConceptRegister(fpaTemp, NULL, NULL, false, PM_FPA_LEVEL_FPA);
    590607            psFree(fpaTemp);
    591608        }
     
    595612            psMetadataItem *fpaExposure = psMetadataItemAllocF32("FPA.EXPOSURE",
    596613                                          "Exposure time (sec)", NAN);
    597             pmConceptRegister(fpaExposure, NULL, NULL, PM_FPA_LEVEL_FPA);
     614            pmConceptRegister(fpaExposure, NULL, NULL, false, PM_FPA_LEVEL_FPA);
    598615            psFree(fpaExposure);
    599616        }
     
    611628            psMetadataItem *chipXparity = psMetadataItemAllocS32("CHIP.XPARITY",
    612629                                          "Orientation in x compared to the rest of the FPA", 0);
    613             pmConceptRegister(chipXparity, NULL, NULL, PM_FPA_LEVEL_CHIP);
     630            pmConceptRegister(chipXparity, NULL, NULL, true, PM_FPA_LEVEL_CHIP);
    614631            psFree(chipXparity);
    615632        }
     
    619636            psMetadataItem *chipYparity = psMetadataItemAllocS32("CHIP.YPARITY",
    620637                                          "Orientation in y compared to the rest of the FPA", 0);
    621             pmConceptRegister(chipYparity, NULL, NULL, PM_FPA_LEVEL_CHIP);
     638            pmConceptRegister(chipYparity, NULL, NULL, true, PM_FPA_LEVEL_CHIP);
    622639            psFree(chipYparity);
    623640        }
     
    627644            psMetadataItem *chipX0 = psMetadataItemAllocS32("CHIP.X0", "Position of (0,0) on the FPA", 0);
    628645            pmConceptRegister(chipX0, (pmConceptParseFunc)p_pmConceptParse_Positions,
    629                               (pmConceptFormatFunc)p_pmConceptFormat_Positions, PM_FPA_LEVEL_CHIP);
     646                              (pmConceptFormatFunc)p_pmConceptFormat_Positions, true, PM_FPA_LEVEL_CHIP);
    630647            psFree(chipX0);
    631648        }
     
    635652            psMetadataItem *chipY0 = psMetadataItemAllocS32("CHIP.Y0", "Position of (0,0) on the FPA", 0);
    636653            pmConceptRegister(chipY0, (pmConceptParseFunc)p_pmConceptParse_Positions,
    637                               (pmConceptFormatFunc)p_pmConceptFormat_Positions, PM_FPA_LEVEL_CHIP);
     654                              (pmConceptFormatFunc)p_pmConceptFormat_Positions, true, PM_FPA_LEVEL_CHIP);
    638655            psFree(chipY0);
    639656        }
     
    642659        {
    643660            psMetadataItem *chipXsize = psMetadataItemAllocS32("CHIP.XSIZE", "Size of chip (pixels)", 0);
    644             pmConceptRegister(chipXsize, NULL, NULL, PM_FPA_LEVEL_CHIP);
     661            pmConceptRegister(chipXsize, NULL, NULL, true, PM_FPA_LEVEL_CHIP);
    645662            psFree(chipXsize);
    646663        }
     
    649666        {
    650667            psMetadataItem *chipYsize = psMetadataItemAllocS32("CHIP.YSIZE", "Size of chip (pixels)", 0);
    651             pmConceptRegister(chipYsize, NULL, NULL, PM_FPA_LEVEL_CHIP);
     668            pmConceptRegister(chipYsize, NULL, NULL, true, PM_FPA_LEVEL_CHIP);
    652669            psFree(chipYsize);
    653670        }
     
    656673        {
    657674            psMetadataItem *chipTemp = psMetadataItemAllocF32("CHIP.TEMP", "Temperature of chip", NAN);
    658             pmConceptRegister(chipTemp, NULL, NULL, PM_FPA_LEVEL_CHIP);
     675            pmConceptRegister(chipTemp, NULL, NULL, false, PM_FPA_LEVEL_CHIP);
    659676            psFree(chipTemp);
    660677        }
     
    671688        {
    672689            psMetadataItem *cellGain = psMetadataItemAllocF32("CELL.GAIN", "CCD gain (e/count)", NAN);
    673             pmConceptRegister(cellGain, NULL, NULL, PM_FPA_LEVEL_CELL);
     690            pmConceptRegister(cellGain, NULL, NULL, true, PM_FPA_LEVEL_CELL);
    674691            psFree(cellGain);
    675692        }
     
    679696            psMetadataItem *cellReadnoise = psMetadataItemAllocF32("CELL.READNOISE",
    680697                                            "CCD read noise (e)", NAN);
    681             pmConceptRegister(cellReadnoise, NULL, NULL, PM_FPA_LEVEL_CELL);
     698            pmConceptRegister(cellReadnoise, NULL, NULL, true, PM_FPA_LEVEL_CELL);
    682699            psFree(cellReadnoise);
    683700        }
     
    687704            psMetadataItem *cellSaturation = psMetadataItemAllocF32("CELL.SATURATION",
    688705                                             "Saturation level (counts)", NAN);
    689             pmConceptRegister(cellSaturation, NULL, NULL, PM_FPA_LEVEL_CELL);
     706            pmConceptRegister(cellSaturation, NULL, NULL, true, PM_FPA_LEVEL_CELL);
    690707            psFree(cellSaturation);
    691708        }
     
    694711        {
    695712            psMetadataItem *cellBad = psMetadataItemAllocF32("CELL.BAD", "Bad level (counts)", NAN);
    696             pmConceptRegister(cellBad, NULL, NULL, PM_FPA_LEVEL_CELL);
     713            pmConceptRegister(cellBad, NULL, NULL, true, PM_FPA_LEVEL_CELL);
    697714            psFree(cellBad);
    698715        }
     
    702719            psMetadataItem *cellXparity = psMetadataItemAllocS32("CELL.XPARITY",
    703720                                          "Orientation in x compared to the rest of the chip", 0);
    704             pmConceptRegister(cellXparity, NULL, NULL, PM_FPA_LEVEL_CELL);
     721            pmConceptRegister(cellXparity, NULL, NULL, true, PM_FPA_LEVEL_CELL);
    705722            psFree(cellXparity);
    706723        }
     
    710727            psMetadataItem *cellYparity = psMetadataItemAllocS32("CELL.YPARITY",
    711728                                          "Orientation in y compared to the rest of the chip", 0);
    712             pmConceptRegister(cellYparity, NULL, NULL, PM_FPA_LEVEL_CELL);
     729            pmConceptRegister(cellYparity, NULL, NULL, true, PM_FPA_LEVEL_CELL);
    713730            psFree(cellYparity);
    714731        }
     
    718735            psMetadataItem *cellReaddir = psMetadataItemAllocS32("CELL.READDIR",
    719736                                          "Read direction, rows=1, cols=2", 0);
    720             pmConceptRegister(cellReaddir, NULL, NULL, PM_FPA_LEVEL_CELL);
     737            pmConceptRegister(cellReaddir, NULL, NULL, true, PM_FPA_LEVEL_CELL);
    721738            psFree(cellReaddir);
    722739        }
     
    733750            psMetadataItem *cellExposure = psMetadataItemAllocF32("CELL.EXPOSURE",
    734751                                           "Exposure time (sec)", NAN);
    735             pmConceptRegister(cellExposure, NULL, NULL, PM_FPA_LEVEL_CELL);
     752            pmConceptRegister(cellExposure, NULL, NULL, false, PM_FPA_LEVEL_CELL);
    736753            psFree(cellExposure);
    737754        }
     
    741758            psMetadataItem *cellDarktime = psMetadataItemAllocF32("CELL.DARKTIME",
    742759                                           "Time since flush (sec)", NAN);
    743             pmConceptRegister(cellDarktime, NULL, NULL, PM_FPA_LEVEL_CELL);
     760            pmConceptRegister(cellDarktime, NULL, NULL, false, PM_FPA_LEVEL_CELL);
    744761            psFree(cellDarktime);
    745762        }
     
    753770            psFree(trimsec);
    754771            pmConceptRegister(cellTrimsec, (pmConceptParseFunc)p_pmConceptParse_CELL_TRIMSEC,
    755                               (pmConceptFormatFunc)p_pmConceptFormat_CELL_TRIMSEC, PM_FPA_LEVEL_CELL);
     772                              (pmConceptFormatFunc)p_pmConceptFormat_CELL_TRIMSEC, true, PM_FPA_LEVEL_CELL);
    756773            psFree(cellTrimsec);
    757774        }
     
    764781            psFree(biassecs);
    765782            pmConceptRegister(cellBiassec, (pmConceptParseFunc)p_pmConceptParse_CELL_BIASSEC,
    766                               (pmConceptFormatFunc)p_pmConceptFormat_CELL_BIASSEC, PM_FPA_LEVEL_CELL);
     783                              (pmConceptFormatFunc)p_pmConceptFormat_CELL_BIASSEC, true, PM_FPA_LEVEL_CELL);
    767784            psFree(cellBiassec);
    768785        }
     
    772789            psMetadataItem *cellXbin = psMetadataItemAllocS32("CELL.XBIN", "Binning in x", 0);
    773790            pmConceptRegister(cellXbin, (pmConceptParseFunc)p_pmConceptParse_CELL_Binning,
    774                               (pmConceptFormatFunc)p_pmConceptFormat_CELL_XBIN, PM_FPA_LEVEL_CELL);
     791                              (pmConceptFormatFunc)p_pmConceptFormat_CELL_XBIN, true, PM_FPA_LEVEL_CELL);
    775792            psFree(cellXbin);
    776793        }
     
    780797            psMetadataItem *cellYbin = psMetadataItemAllocS32("CELL.YBIN", "Binning in y", 0);
    781798            pmConceptRegister(cellYbin, (pmConceptParseFunc)p_pmConceptParse_CELL_Binning,
    782                               (pmConceptFormatFunc)p_pmConceptFormat_CELL_YBIN, PM_FPA_LEVEL_CELL);
     799                              (pmConceptFormatFunc)p_pmConceptFormat_CELL_YBIN, true, PM_FPA_LEVEL_CELL);
    783800            psFree(cellYbin);
    784801        }
     
    788805            psMetadataItem *cellTimesys = psMetadataItemAllocS32("CELL.TIMESYS", "Time system", -1);
    789806            pmConceptRegister(cellTimesys, (pmConceptParseFunc)p_pmConceptParse_TIMESYS,
    790                               (pmConceptFormatFunc)p_pmConceptFormat_TIMESYS, PM_FPA_LEVEL_CELL);
     807                              (pmConceptFormatFunc)p_pmConceptFormat_TIMESYS, false, PM_FPA_LEVEL_CELL);
    791808            psFree(cellTimesys);
    792809        }
     
    802819            psFree(time);
    803820            pmConceptRegister(cellTime, (pmConceptParseFunc)p_pmConceptParse_TIME,
    804                               (pmConceptFormatFunc)p_pmConceptFormat_TIME, PM_FPA_LEVEL_CELL);
     821                              (pmConceptFormatFunc)p_pmConceptFormat_TIME, false, PM_FPA_LEVEL_CELL);
    805822            psFree(cellTime);
    806823        }
     
    810827            psMetadataItem *cellX0 = psMetadataItemAllocS32("CELL.X0", "Position of (0,0) on the chip", 0);
    811828            pmConceptRegister(cellX0, (pmConceptParseFunc)p_pmConceptParse_Positions,
    812                               (pmConceptFormatFunc)p_pmConceptFormat_Positions, PM_FPA_LEVEL_CELL);
     829                              (pmConceptFormatFunc)p_pmConceptFormat_Positions, true, PM_FPA_LEVEL_CELL);
    813830            psFree(cellX0);
    814831        }
     
    818835            psMetadataItem *cellY0 = psMetadataItemAllocS32("CELL.Y0", "Position of (0,0) on the chip", 0);
    819836            pmConceptRegister(cellY0, (pmConceptParseFunc)p_pmConceptParse_Positions,
    820                               (pmConceptFormatFunc)p_pmConceptFormat_Positions, PM_FPA_LEVEL_CELL);
     837                              (pmConceptFormatFunc)p_pmConceptFormat_Positions, true, PM_FPA_LEVEL_CELL);
    821838            psFree(cellY0);
    822839        }
     
    825842        {
    826843            psMetadataItem *cellXsize = psMetadataItemAllocS32("CELL.XSIZE", "Size of cell (pixels)", 0);
    827             pmConceptRegister(cellXsize, NULL, NULL, PM_FPA_LEVEL_CELL);
     844            pmConceptRegister(cellXsize, NULL, NULL, true, PM_FPA_LEVEL_CELL);
    828845            psFree(cellXsize);
    829846        }
     
    832849        {
    833850            psMetadataItem *cellYsize = psMetadataItemAllocS32("CELL.YSIZE", "Size of cell (pixels)", 0);
    834             pmConceptRegister(cellYsize, NULL, NULL, PM_FPA_LEVEL_CELL);
     851            pmConceptRegister(cellYsize, NULL, NULL, true, PM_FPA_LEVEL_CELL);
    835852            psFree(cellYsize);
    836853        }
Note: See TracChangeset for help on using the changeset viewer.