Changeset 17786
- Timestamp:
- May 23, 2008, 3:04:23 PM (18 years ago)
- Location:
- trunk/psastro/src
- Files:
-
- 2 edited
-
psastroAnalysis.c (modified) (4 diffs)
-
psastroMosaicChipAstrom.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroAnalysis.c
r17675 r17786 12 12 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE); 13 13 if (!recipe) { 14 psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe");15 return false;14 psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe"); 15 return false; 16 16 } 17 17 18 18 if (!psastroUseModel (config, recipe)) { 19 psError (PSASTRO_ERR_UNKNOWN, false, "failed to set model astrometry\n");20 return false;19 psError (PSASTRO_ERR_UNKNOWN, false, "failed to set model astrometry\n"); 20 return false; 21 21 } 22 22 … … 24 24 // apply the initial guess 25 25 if (!psastroAstromGuess (&nStars, config)) { 26 psError (PSASTRO_ERR_UNKNOWN, false, "failed to determine initial astrometry guess\n");27 return false;26 psError (PSASTRO_ERR_UNKNOWN, false, "failed to determine initial astrometry guess\n"); 27 return false; 28 28 } 29 29 if (nStars == 0) { 30 psLogMsg ("psastro", 2, "skipping astrometry analysis : no stars\n");31 return true;30 psLogMsg ("psastro", 2, "skipping astrometry analysis : no stars\n"); 31 return false; 32 32 } 33 33 … … 35 35 psArray *refs = psastroLoadRefstars(config); 36 36 if (!refs) { 37 psError (PSASTRO_ERR_UNKNOWN, false, "failed to load reference data\n");38 return false;37 psError (PSASTRO_ERR_UNKNOWN, false, "failed to load reference data\n"); 38 return false; 39 39 } 40 40 if (refs->n == 0) { 41 41 psError(PSASTRO_ERR_REFSTARS, true, "no reference stars found"); 42 42 psFree(refs); 43 return NULL;43 return false; 44 44 } 45 45 46 46 if (!psastroChooseRefstars (config, refs)) { 47 psError (PSASTRO_ERR_UNKNOWN, false, "failed to select reference data for chips\n");47 psError (PSASTRO_ERR_UNKNOWN, false, "failed to select reference data for chips\n"); 48 48 psFree(refs); 49 return false;49 return false; 50 50 } 51 51 … … 53 53 bool chipastro = psMetadataLookupBool (&status, config->arguments, "PSASTRO.CHIP.MODE"); 54 54 if (!status) { 55 chipastro = psMetadataLookupBool (&status, recipe, "PSASTRO.CHIP.MODE");55 chipastro = psMetadataLookupBool (&status, recipe, "PSASTRO.CHIP.MODE"); 56 56 } 57 57 bool mosastro = psMetadataLookupBool (&status, config->arguments, "PSASTRO.MOSAIC.MODE"); 58 58 if (!status) { 59 mosastro = psMetadataLookupBool (&status, recipe, "PSASTRO.MOSAIC.MODE");59 mosastro = psMetadataLookupBool (&status, recipe, "PSASTRO.MOSAIC.MODE"); 60 60 } 61 61 if (!chipastro && !mosastro) { 62 psLogMsg ("psastro", 3, "no astrometry mode selected, assuming chip astrometry\n");63 chipastro = true;62 psLogMsg ("psastro", 3, "no astrometry mode selected, assuming chip astrometry\n"); 63 chipastro = true; 64 64 } 65 65 66 66 if (chipastro) { 67 if (!psastroChipAstrom (config)) {68 psError (PSASTRO_ERR_UNKNOWN, false, "failed to perform single chip astrometry\n");69 psFree(refs);70 return false;71 }72 } 67 if (!psastroChipAstrom (config)) { 68 psError (PSASTRO_ERR_UNKNOWN, false, "failed to perform single chip astrometry\n"); 69 psFree(refs); 70 return false; 71 } 72 } 73 73 if (mosastro) { 74 if (!psastroMosaicAstrom (config)) {75 psError (PSASTRO_ERR_UNKNOWN, false, "failed to perform mosaic camera astrometry\n");76 psFree(refs);77 return false;78 }74 if (!psastroMosaicAstrom (config)) { 75 psError (PSASTRO_ERR_UNKNOWN, false, "failed to perform mosaic camera astrometry\n"); 76 psFree(refs); 77 return false; 78 } 79 79 } 80 80 -
trunk/psastro/src/psastroMosaicChipAstrom.c
r17108 r17786 13 13 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 14 14 if (!chip->process || !chip->file_exists) { continue; } 15 if (!chip->toFPA) { continue; }16 17 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) {15 if (!chip->toFPA) { continue; } 16 17 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) { 18 18 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 19 19 if (!cell->process || !cell->file_exists) { continue; } 20 20 21 // process each of the readouts22 // XXX there can only be one readout per chip, right?23 while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) {24 if (! readout->data_exists) { continue; }21 // process each of the readouts 22 // XXX there can only be one readout per chip, right? 23 while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) { 24 if (! readout->data_exists) { continue; } 25 25 26 // save WCS and analysis metadata in update header27 psMetadata *updates = psMetadataAlloc();26 // save WCS and analysis metadata in update header 27 psMetadata *updates = psMetadataAlloc(); 28 28 29 if (!psastroMosaicOneChip (chip, readout, recipe, updates, iteration)) { 30 readout->data_exists = false; 31 psLogMsg ("psastro", 3, "failed to find a solution for %d,%d,%d\n", view->chip, view->cell, view->readout); 32 psFree (updates); 33 continue; 34 } 29 if (!psastroMosaicOneChip (chip, readout, recipe, updates, iteration)) { 30 readout->data_exists = false; 31 psError(PS_ERR_UNKNOWN, false, "failed to find a solution for %d,%d,%d\n", 32 view->chip, view->cell, view->readout); 33 psFree(updates); 34 psFree(view); 35 return false; 36 } 35 37 36 // create the header keywords to descripe the results37 pmAstromWriteBilevelChip (updates, chip, NONLIN_TOL);38 psMetadataAddMetadata (readout->analysis, PS_LIST_TAIL, "PSASTRO.HEADER", PS_META_REPLACE, "psastro header stats", updates);39 psFree (updates);40 }41 }38 // create the header keywords to descripe the results 39 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 } 43 } 42 44 } 43 45 psFree (view);
Note:
See TracChangeset
for help on using the changeset viewer.
