IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 19, 2008, 1:53:16 PM (18 years ago)
Author:
eugene
Message:

do not overwrite results in header from earlier stages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroChipAstrom.c

    r19514 r20269  
    44bool psastroChipAstrom (pmConfig *config) {
    55
     6    bool status;
    67    pmChip *chip = NULL;
    78    pmCell *cell = NULL;
     
    910
    1011    // select the current recipe
    11     psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, PSASTRO_RECIPE);
     12    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE);
    1213    if (!recipe) {
    1314        psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe");
     
    1617
    1718    // select the input data sources
    18     pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT");
     19    pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSASTRO.INPUT");
    1920    if (!input) {
    2021        psError(PSASTRO_ERR_CONFIG, true, "Can't find input data");
     
    4344
    4445                // select the raw objects for this readout
    45                 psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS");
     46                psArray *rawstars = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.RAWSTARS");
    4647                if (rawstars == NULL) { continue; }
    4748
    4849                // select the raw objects for this readout
    49                 psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS");
     50                psArray *refstars = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.REFSTARS");
    5051                if (refstars == NULL) { continue; }
    5152
     
    5960
    6061                // save WCS and analysis metadata in update header
    61                 psMetadata *updates = psMetadataAlloc();
     62                // (pull or create local view to entry on readout->analysis)
     63                psMetadata *updates = psMetadataLookupMetadata (&status, readout->analysis, "PSASTRO.HEADER");
     64                if (!updates) {
     65                    updates = psMetadataAlloc ();
     66                    psMetadataAddMetadata (readout->analysis, PS_LIST_TAIL, "PSASTRO.HEADER",  PS_META_REPLACE, "psastro header stats", updates);
     67                    psFree (updates);
     68                }
    6269
    6370                // XXX update the header with info to reflect the failure
     
    6572                    readout->data_exists = false;
    6673                    psLogMsg ("psastro", 3, "failed to find a solution\n");
    67                     psFree (updates);
    6874                    continue;
    6975                }
     
    7278                    readout->data_exists = false;
    7379                    psLogMsg ("psastro", 3, "failed to find a solution\n");
    74                     psFree (updates);
    7580                    continue;
    7681                }
     
    8287
    8388                pmAstromWriteWCS (updates, fpa, chip, NONLIN_TOL);
    84                 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.HEADER",  PS_DATA_METADATA, "psastro header stats", updates);
    85                 psFree (updates);
    8689
    8790                if (psTraceGetLevel("psastro.dump") > 0) {
    8891
    8992                    char *filename = NULL;
    90                     char *chipname = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME");
     93                    char *chipname = psMetadataLookupStr (&status, chip->concepts, "CHIP.NAME");
    9194
    9295                    psStringAppend (&filename, "rawstars.ch.%s.dat", chipname);
Note: See TracChangeset for help on using the changeset viewer.