Changeset 20269
- Timestamp:
- Oct 19, 2008, 1:53:16 PM (18 years ago)
- Location:
- trunk/psastro/src
- Files:
-
- 3 edited
-
psastroChipAstrom.c (modified) (8 diffs)
-
psastroMosaicAstrom.c (modified) (2 diffs)
-
psastroMosaicChipAstrom.c (modified) (4 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); -
trunk/psastro/src/psastroMosaicAstrom.c
r19518 r20269 63 63 64 64 // save WCS and analysis metadata in update header. 65 psMetadata *updates = psMetadataAlloc(); 65 // (pull or create local view to entry on readout->analysis) 66 psMetadata *updates = psMetadataLookupMetadata (&status, fpa->analysis, "PSASTRO.HEADER"); 67 if (!updates) { 68 updates = psMetadataAlloc (); 69 psMetadataAddMetadata (fpa->analysis, PS_LIST_TAIL, "PSASTRO.HEADER", PS_META_REPLACE, "psastro header stats", updates); 70 psFree (updates); 71 } 66 72 if (!pmAstromWriteBilevelMosaic (updates, fpa, NONLIN_TOL)) { 67 73 psAbort ("failed to save header terms"); … … 70 76 // write the elapsed time here; this will be updated in psastroMosaicAstrometry, if called 71 77 psMetadataAddF32 (updates, PS_LIST_TAIL, "DT_ASTR", PS_META_REPLACE, "elapsed psastro time", psTimerMark ("psastroAnalysis")); 72 73 psMetadataAddMetadata (fpa->analysis, PS_LIST_TAIL, "PSASTRO.HEADER", PS_META_REPLACE, "psastro header stats", updates);74 psFree (updates);75 78 76 79 // update the headers based on the results -
trunk/psastro/src/psastroMosaicChipAstrom.c
r17786 r20269 4 4 bool psastroMosaicChipAstrom (pmFPA *fpa, psMetadata *recipe, int iteration) { 5 5 6 bool status; 6 7 pmChip *chip = NULL; 7 8 pmCell *cell = NULL; … … 25 26 26 27 // save WCS and analysis metadata in update header 27 psMetadata *updates = psMetadataAlloc(); 28 // (pull or create local view to entry on readout->analysis) 29 psMetadata *updates = psMetadataLookupMetadata (&status, readout->analysis, "PSASTRO.HEADER"); 30 if (!updates) { 31 updates = psMetadataAlloc (); 32 psMetadataAddMetadata (readout->analysis, PS_LIST_TAIL, "PSASTRO.HEADER", PS_META_REPLACE, "psastro header stats", updates); 33 psFree (updates); 34 } 28 35 29 36 if (!psastroMosaicOneChip (chip, readout, recipe, updates, iteration)) { … … 31 38 psError(PS_ERR_UNKNOWN, false, "failed to find a solution for %d,%d,%d\n", 32 39 view->chip, view->cell, view->readout); 33 psFree(updates);34 40 psFree(view); 35 41 return false; … … 38 44 // create the header keywords to descripe the results 39 45 pmAstromWriteBilevelChip (updates, chip, NONLIN_TOL); 40 psMetadataAddMetadata (readout->analysis, PS_LIST_TAIL, "PSASTRO.HEADER", PS_META_REPLACE, "psastro header stats", updates);41 psFree (updates);42 46 } 43 47 }
Note:
See TracChangeset
for help on using the changeset viewer.
