IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 2, 2005, 3:30:32 PM (21 years ago)
Author:
Paul Price
Message:

Working with release 8. Overscan, bias, flat-fielding all working.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/scripts/src/phase2/psAdditionals.c

    r5104 r5462  
    1515            psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n");
    1616        }
    17     } else if (item->type != PS_META_META) {
     17    } else if (item->type != PS_DATA_METADATA) {
    1818        // The value at the key isn't metadata
    1919        if (status) {
    2020            *status = false;
    2121        } else {
    22             psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_META_META, as expected.\n");
     22            psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_DATA_METADATA, as expected.\n");
    2323        }
    2424        value = NULL;
     
    4545            psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n");
    4646        }
    47     } else if (item->type != PS_META_STR) {
     47    } else if (item->type != PS_DATA_STRING) {
    4848        // The value at the key isn't of the desired type
    4949        if (status) {
    5050            *status = false;
    5151        } else {
    52             psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_META_STR, as expected.\n");
     52            psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_DATA_STRING, as expected.\n");
    5353        }
    5454        value = NULL;
     
    7979        printf(": ");
    8080        switch (item->type) {
    81           case PS_META_STR:
     81          case PS_DATA_STRING:
    8282            printf("%s", item->data.V);
    8383            break;
    84           case PS_META_BOOL:
     84          case PS_DATA_BOOL:
    8585            if (item->data.B) {
    8686                printf("True");
     
    8989            }
    9090            break;
    91           case PS_META_S32:
     91          case PS_DATA_S32:
    9292            printf("%d", item->data.S32);
    9393            break;
    94           case PS_META_F32:
     94          case PS_DATA_F32:
    9595            printf("%f", item->data.F32);
    9696            break;
    97           case PS_META_F64:
     97          case PS_DATA_F64:
    9898            printf("%f", item->data.F64);
    9999            break;
    100           case PS_META_META:
     100          case PS_DATA_METADATA:
    101101            printf("\n");
    102102            psMetadataPrint(item->data.V, level + 1);
     
    200200    switch(item->type) {
    201201        // Only doing a representative set of types
    202       case PS_META_S32:
     202      case PS_DATA_S32:
    203203        newItem = psMetadataItemAlloc(item->name, item->type, item->comment, atoi(argv[argnum]));
    204204        psArgumentRemove(argnum, argc, argv);
    205205        break;
    206       case PS_META_F32:
     206      case PS_DATA_F32:
    207207        newItem = psMetadataItemAlloc(item->name, item->type, item->comment, atof(argv[argnum]));
    208208        psArgumentRemove(argnum, argc, argv);
    209209        break;
    210       case PS_META_BOOL:
     210      case PS_DATA_BOOL:
    211211        // Turn option on; no optional argument to remove
    212212        newItem = psMetadataItemAlloc(item->name, item->type, item->comment, true);
    213213        break;
    214214        // XXX: Include the other numerical types
    215       case PS_META_STR:
     215      case PS_DATA_STRING:
    216216        {
    217217            //psString string = psStringCopy(argv[argnum]);     // Get the argument into PS memory management
     
    250250        if (argItem) {
    251251            psArgumentRemove(i, argc, argv); // Remove the switch
    252             if (argItem->type != PS_META_MULTI) {
    253                 if (argItem->type != PS_META_BOOL && *argc < i + 1) {
     252            if (argItem->type != PS_DATA_METADATA_MULTI) {
     253                if (argItem->type != PS_DATA_BOOL && *argc < i + 1) {
    254254                    psError(PS_ERR_IO, true, "Required argument for %s is missing.\n", argItem->name);
    255255                    // XXX: Cleanup before returning
     
    318318        switch (oldItem->type) {
    319319            // Only doing a representative set of types
    320           case PS_META_S32:
     320          case PS_DATA_S32:
    321321            oldItem->data.S32 = newItem->data.S32;
    322322            break;
    323           case PS_META_F32:
     323          case PS_DATA_F32:
    324324            oldItem->data.F32 = newItem->data.F32;
    325325            break;
    326           case PS_META_BOOL:
     326          case PS_DATA_BOOL:
    327327            oldItem->data.B = newItem->data.B;
    328328            break;
    329329            // XXX: Include the other numerical types
    330           case PS_META_STR:
     330          case PS_DATA_STRING:
    331331            psFree(oldItem->data.V);
    332332            oldItem->data.V = psMemIncrRefCounter(newItem->data.V);
    333333            break;
    334           case PS_META_MULTI:
     334          case PS_DATA_METADATA_MULTI:
    335335            {
    336336                psList *newMulti = psMemIncrRefCounter(newItem->data.V);        // The new list of MULTI
     
    347347                    switch (oldMultiItem->type) {
    348348                        // Only doing a representative set of types
    349                       case PS_META_S32:
     349                      case PS_DATA_S32:
    350350                        oldItem->data.S32 = newItem->data.S32;
    351351                        break;
    352                       case PS_META_F32:
     352                      case PS_DATA_F32:
    353353                        oldItem->data.F32 = newItem->data.F32;
    354354                        break;
    355355                        // XXX: Include the other numerical types
    356                       case PS_META_STR:
     356                      case PS_DATA_STRING:
    357357                        psFree(oldItem->data.V);
    358358                        oldItem->data.V = psMemIncrRefCounter(newItem->data.V);
     
    385385    switch (arg->type) {
    386386        // Only doing a representative set of types
    387       case PS_META_S32:
     387      case PS_DATA_S32:
    388388        return arg->data.S32 >= 0 ? (int)log10f((float)arg->data.S32) + 1 :
    389389            (int)log10f(-(float)arg->data.S32) + 2;
    390390        // XXX: Other numerical types
    391       case PS_META_F32:
     391      case PS_DATA_F32:
    392392        return arg->data.F32 >= 0 ? 12 : 13; // -d.dddddde?dd
    393       case PS_META_F64:
     393      case PS_DATA_F64:
    394394        return arg->data.F64 >= 0 ? 12 : 13; // -d.dddddde?dd
    395       case PS_META_BOOL:
     395      case PS_DATA_BOOL:
    396396        return arg->data.B ? 4 : 5;
    397       case PS_META_STR:
     397      case PS_DATA_STRING:
    398398        return strlen(arg->data.V);
    399399      default:
     
    450450        switch (argItem->type) {
    451451            // Only doing a representative set of types
    452           case PS_META_S32:
     452          case PS_DATA_S32:
    453453            printf("%d", argItem->data.S32);
    454454            break;
    455455            // XXX: Other numerical types
    456           case PS_META_F32:
     456          case PS_DATA_F32:
    457457            printf("%.6e", argItem->data.F32);
    458458            break;
    459           case PS_META_F64:
     459          case PS_DATA_F64:
    460460            printf("%.6e", argItem->data.F64);
    461461            break;
    462           case PS_META_BOOL:
     462          case PS_DATA_BOOL:
    463463            if (argItem->data.B) {
    464464                printf("TRUE");
     
    467467            }
    468468            break;
    469           case PS_META_STR:
     469          case PS_DATA_STRING:
    470470            printf("%s", argItem->data.V);
    471471            break;
Note: See TracChangeset for help on using the changeset viewer.