IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39927 for trunk


Ignore:
Timestamp:
Jan 7, 2017, 11:30:03 AM (9 years ago)
Author:
eugene
Message:

need to assume a default ROT_PARITY if not set in the model file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/astrom/pmAstrometryModel.c

    r39926 r39927  
    627627    TRANSFER (file->fpa->concepts, row, "BORE_P0");
    628628    TRANSFER (file->fpa->concepts, row, "POS_ZERO");
    629     TRANSFER (file->fpa->concepts, row, "ROT_PARITY");
     629    //   TRANSFER (file->fpa->concepts, row, "ROT_PARITY");
    630630    TRANSFER (file->fpa->concepts, row, "REF_CHIP");
     631
     632    // DEFAULT value of +1 for ROT_PARITY (do not abort on missing value)
     633    psMetadataItem *item = psMetadataLookup(row, "ROT_PARITY");
     634    if (!item) {
     635      psMetadataAddS32(row, PS_LIST_TAIL, "ROT_PARITY", PS_META_REPLACE, "rotator parity", +1);
     636      psLogMsg ("psModules.astrom", 4, "setting default ROT_PARITY of +1\n");
     637    } else {
     638      psMetadataItem *newItem = psMetadataItemCopy(item);
     639      if (!psMetadataAddItem(file->fpa->concepts, newItem, PS_LIST_TAIL, PS_META_REPLACE)) {
     640        psAbort ("cannot copy %s", "ROT_PARITY");
     641      }
     642      psFree (newItem);
     643    }
    631644
    632645    psFree (model);
     
    691704    char *refChip  = psMetadataLookupStr(&status, file->fpa->concepts, "REF_CHIP"); REQUIRE (status, "missing REF_CHIP");
    692705
    693     int rotatorParity = psMetadataLookupS32(&status, file->fpa->concepts, "ROT_PARITY"); REQUIRE (status, "missing ROT_PARITY");
     706    int rotatorParity = psMetadataLookupS32(&status, file->fpa->concepts, "ROT_PARITY");
     707    // REQUIRE (status, "missing ROT_PARITY");
     708    if (!status) {
     709      rotatorParity = +1;
     710      psLogMsg ("psModules.astrom", 4, "setting default ROT_PARITY of +1\n");
     711    }
    694712   
    695713    // XXX we've swapped the sign and parity of POS (add to model)
Note: See TracChangeset for help on using the changeset viewer.