Changeset 20269 for trunk/psastro/src/psastroChipAstrom.c
- Timestamp:
- Oct 19, 2008, 1:53:16 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroChipAstrom.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroChipAstrom.c
r19514 r20269 4 4 bool psastroChipAstrom (pmConfig *config) { 5 5 6 bool status; 6 7 pmChip *chip = NULL; 7 8 pmCell *cell = NULL; … … 9 10 10 11 // select the current recipe 11 psMetadata *recipe = psMetadataLookupPtr ( NULL, config->recipes, PSASTRO_RECIPE);12 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE); 12 13 if (!recipe) { 13 14 psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe"); … … 16 17 17 18 // select the input data sources 18 pmFPAfile *input = psMetadataLookupPtr ( NULL, config->files, "PSASTRO.INPUT");19 pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSASTRO.INPUT"); 19 20 if (!input) { 20 21 psError(PSASTRO_ERR_CONFIG, true, "Can't find input data"); … … 43 44 44 45 // 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"); 46 47 if (rawstars == NULL) { continue; } 47 48 48 49 // 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"); 50 51 if (refstars == NULL) { continue; } 51 52 … … 59 60 60 61 // 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 } 62 69 63 70 // XXX update the header with info to reflect the failure … … 65 72 readout->data_exists = false; 66 73 psLogMsg ("psastro", 3, "failed to find a solution\n"); 67 psFree (updates);68 74 continue; 69 75 } … … 72 78 readout->data_exists = false; 73 79 psLogMsg ("psastro", 3, "failed to find a solution\n"); 74 psFree (updates);75 80 continue; 76 81 } … … 82 87 83 88 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);86 89 87 90 if (psTraceGetLevel("psastro.dump") > 0) { 88 91 89 92 char *filename = NULL; 90 char *chipname = psMetadataLookupStr ( NULL, chip->concepts, "CHIP.NAME");93 char *chipname = psMetadataLookupStr (&status, chip->concepts, "CHIP.NAME"); 91 94 92 95 psStringAppend (&filename, "rawstars.ch.%s.dat", chipname);
Note:
See TracChangeset
for help on using the changeset viewer.
