IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 6, 2010, 1:36:51 PM (16 years ago)
Author:
eugene
Message:

working on stackphot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/stackphot.20100406/psphot/src/psphotStackParseCamera.c

    r26894 r27625  
    1515    }
    1616
    17     psMetadata *item == NULL;
     17    psMetadataItem *item = NULL;
    1818    int nInputs = 0;
    19     while ((item = psMetadataGetIndex(inputs, nInputs)) != NULL) {
     19    while ((item = psMetadataGet(inputs, nInputs)) != NULL) {
    2020        if (item->type != PS_DATA_METADATA) {
    2121            psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Component %s of the input metadata is not of type METADATA", item->name);
     
    3434        pmFPAfile *imageFile = defineFile(config, NULL, "PSPHOT.INPUT", image, PM_FPA_FILE_IMAGE); // File for image
    3535        if (!imageFile) {
    36             psError(PS_ERR_UNKNOWN, false, "Unable to define file from image %d (%s)", i, image);
     36            psError(PS_ERR_UNKNOWN, false, "Unable to define file from image %d (%s)", nInputs, image);
    3737            return false;
    3838        }
     
    4141        if (mask && strlen(mask) > 0) {
    4242            if (!defineFile(config, imageFile, "PSPHOT.INPUT.MASK", mask, PM_FPA_FILE_MASK)) {
    43                 psError(PS_ERR_UNKNOWN, false, "Unable to define file from mask %d (%s)", i, mask);
     43                psError(PS_ERR_UNKNOWN, false, "Unable to define file from mask %d (%s)", nInputs, mask);
    4444                return false;
    4545            }
    4646        }
    4747
    48         psString variance = psMetadataLookupStr(&mdok, input, "VARIANCE"); // Name of variance map
     48        psString variance = psMetadataLookupStr(&status, input, "VARIANCE"); // Name of variance map
    4949        if (variance && strlen(variance) > 0) {
    5050            if (!defineFile(config, imageFile, "PSPHOT.INPUT.VARIANCE", variance, PM_FPA_FILE_VARIANCE)) {
    51                 psError(PS_ERR_UNKNOWN, false, "Unable to define file from variance %d (%s)", i, variance);
     51                psError(PS_ERR_UNKNOWN, false, "Unable to define file from variance %d (%s)", nInputs, variance);
    5252                return false;
    5353            }
     
    5858    psMetadataAddS32 (config->arguments, PS_LIST_TAIL, "PSPHOT.INPUT.NUM", PS_META_REPLACE, "number of inputs", nInputs);
    5959
     60    // generate an pmFPAimage for the chisqImage
     61    pmFPAfile *chisqImage = pmFPAfileDefineOutput(config, NULL, "PSPHOT.CHISQ.IMAGE");
     62    if (!chisqImage) {
     63        psError(PSPHOT_ERR_CONFIG, false, "Trouble defining PSPHOT.CHISQ.IMAGE");
     64        return false;
     65    }
     66    pmFPAfile *chisqMask = pmFPAfileDefineOutput(config, chisqImage->fpa, "PPIMAGE.CHISQ.MASK");
     67    if (!chisqMask) {
     68        psError(PS_ERR_IO, false, _("Unable to generate output file from PPIMAGE.CHISQ.MASK"));
     69        return NULL;
     70    }
     71    if (chisqMask->type != PM_FPA_FILE_MASK) {
     72        psError(PS_ERR_IO, true, "PPIMAGE.CHISQ.MASK is not of type MASK");
     73        return NULL;
     74    }
     75    pmFPAfile *chisqVariance = pmFPAfileDefineOutput(config, chisqImage->fpa, "PPIMAGE.CHISQ.VARIANCE");
     76    if (!chisqVariance) {
     77        psError(PS_ERR_IO, false, _("Unable to generate output file from PPIMAGE.CHISQ.VARIANCE"));
     78        return NULL;
     79    }
     80    if (chisqVariance->type != PM_FPA_FILE_VARIANCE) {
     81        psError(PS_ERR_IO, true, "PPIMAGE.CHISQ.VARIANCE is not of type VARIANCE");
     82        return NULL;
     83    }
     84
     85# if (0)   
    6086    // define the additional input/output files associated with psphot
    6187    // XXX figure out which files are needed by psphotStack
     
    6490        return false;
    6591    }
     92# endif
    6693
    6794    psTrace("psphot", 1, "Done with psphotStackParseCamera...\n");
Note: See TracChangeset for help on using the changeset viewer.