Changeset 9574
- Timestamp:
- Oct 13, 2006, 5:10:34 PM (20 years ago)
- Location:
- trunk/psastro/src
- Files:
-
- 22 edited
-
Makefile.am (modified) (2 diffs)
-
psastro.c (modified) (3 diffs)
-
psastro.h (modified) (2 diffs)
-
psastroArguments.c (modified) (3 diffs)
-
psastroAstromGuess.c (modified) (5 diffs)
-
psastroChipAstrom.c (modified) (3 diffs)
-
psastroConvert.c (modified) (1 diff)
-
psastroDataLoad.c (modified) (4 diffs)
-
psastroDataSave.c (modified) (3 diffs)
-
psastroLoadReferences.c (modified) (2 diffs)
-
psastroMosaicAstrom.c (modified) (2 diffs)
-
psastroMosaicChipAstrom.c (modified) (1 diff)
-
psastroMosaicGetGrads.c (modified) (1 diff)
-
psastroMosaicGetRefstars.c (modified) (4 diffs)
-
psastroMosaicHeaders.c (modified) (2 diffs)
-
psastroMosaicRescaleChips.c (modified) (1 diff)
-
psastroMosaicSetAstrom.c (modified) (1 diff)
-
psastroMosaicSetMatch.c (modified) (2 diffs)
-
psastroOneChip.c (modified) (1 diff)
-
psastroParseCamera.c (modified) (4 diffs)
-
psastroTestFuncs.c (modified) (2 diffs)
-
psastroWCS.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/Makefile.am
r7573 r9574 31 31 psastroMosaicHeaders.c \ 32 32 psastroMosaicRescaleChips.c \ 33 psastroWCS.c 33 psastroWCS.c \ 34 psastroErrorCodes.c 34 35 35 36 include_HEADERS = \ … … 44 45 45 46 ### Error codes. 46 #BUILT_SOURCES = psastroErrorCodes.h psastroErrorCodes.c47 #CLEANFILES = psastroErrorCodes.h psastroErrorCodes.c47 BUILT_SOURCES = psastroErrorCodes.h psastroErrorCodes.c 48 CLEANFILES = psastroErrorCodes.h psastroErrorCodes.c 48 49 49 #psastroErrorCodes.h : psastroErrorCodes.dat psastroErrorCodes.h.in50 #$(ERRORCODES) --data=psastroErrorCodes.dat --outdir=. psastroErrorCodes.h50 psastroErrorCodes.h : psastroErrorCodes.dat psastroErrorCodes.h.in 51 $(ERRORCODES) --data=psastroErrorCodes.dat --outdir=. psastroErrorCodes.h 51 52 52 #psastroErrorCodes.c : psastroErrorCodes.dat psastroErrorCodes.c.in psastroErrorCodes.h53 # $(ERRORCODES) --data=psastroEerrorCodes.dat --outdir=. psastroErrorCodes.c53 psastroErrorCodes.c : psastroErrorCodes.dat psastroErrorCodes.c.in psastroErrorCodes.h 54 $(ERRORCODES) --data=psastroErrorCodes.dat --outdir=. psastroErrorCodes.c -
trunk/psastro/src/psastro.c
r9374 r9574 1 1 # include "psastro.h" 2 3 static void usage (void) { 4 psErrorStackPrint(stderr, "USAGE: psastro [-file image(s)] [-list imagelist] (output)"); 5 exit (2); 6 } 2 7 3 8 int main (int argc, char **argv) { … … 11 16 // load configuration information 12 17 pmConfig *config = psastroArguments (argc, argv); 18 if (!config) usage (); 13 19 14 20 // load identify the data sources 15 psastroParseCamera (config); 21 if (!psastroParseCamera (config)) { 22 psErrorStackPrint(stderr, "error setting up the camera"); 23 exit (1); 24 } 16 25 17 26 // load the raw pixel data (from PSPHOT.SOURCES) 18 27 // select subset of stars for astrometry 19 psastroDataLoad (config); 28 if (!psastroDataLoad (config)) { 29 psErrorStackPrint(stderr, "error loading input data"); 30 exit (1); 31 } 20 32 21 33 // interpret the available initial astrometric information 22 34 // apply the initial guess 23 psastroAstromGuess (config); 35 if (!psastroAstromGuess (config)) { 36 psErrorStackPrint(stderr, "failed to determine initial astrometry guess"); 37 exit (1); 38 } 24 39 25 40 // load the reference stars overlapping the data stars 26 41 psArray *refs = psastroLoadReferences (config); 42 if (!refs) { 43 psErrorStackPrint(stderr, "failed to load reference data"); 44 exit (1); 45 } 27 46 47 // XXX ?? what does this do ?? 28 48 psastroMosaicGetRefstars (config, refs); 29 49 30 50 char *mosastro = psMetadataLookupStr (NULL, config->arguments, "MOSASTRO"); 31 51 if (mosastro == NULL) { 32 psastroChipAstrom (config, refs); 52 if (!psastroChipAstrom (config, refs)) { 53 psErrorStackPrint(stderr, "failed to perform single chip astrometry"); 54 exit (1); 55 } 33 56 } else { 34 psastroMosaicAstrom (config, refs); 57 if (!psastroMosaicAstrom (config, refs)) { 58 psErrorStackPrint(stderr, "failed to perform mosaic camera astrometry"); 59 exit (1); 60 } 35 61 } 36 62 … … 39 65 40 66 // write out the results 41 psastroDataSave (config); 67 if (!psastroDataSave (config)) { 68 psErrorStackPrint(stderr, "failed to write out data"); 69 exit (1); 70 } 42 71 43 72 psLogMsg ("psastro", 3, "complete psastro run: %f sec\n", psTimerMark ("complete")); -
trunk/psastro/src/psastro.h
r9373 r9574 9 9 # include <pslib.h> 10 10 # include <psmodules.h> 11 12 # include "psastroErrorCodes.h" 11 13 12 14 # define psMemCopy(A)(psMemIncrRefCounter((A))) … … 37 39 bool psastroOneChip (pmFPA *fpa, pmChip *chip, psArray *refset, psArray *rawset, psMetadata *recipe, psMetadata *updates); 38 40 39 // bool psVectorSmooth (psVector *vector, double sigma, double Nsigma);40 41 41 // utility functions: 42 42 bool psastroUpdateChipToFPA (pmFPA *fpa, pmChip *chip, psArray *rawstars, psArray *refstars); -
trunk/psastro/src/psastroArguments.c
r9373 r9574 1 1 # include "psastro.h" 2 2 # include <glob.h> 3 // XXX leak free 2006.04.274 5 static void usage (void) {6 fprintf (stderr, "USAGE: psastro [-file image(s)] [-list imagelist] (output)\n");7 exit (2);8 }9 3 10 4 pmConfig *psastroArguments (int argc, char **argv) { … … 13 7 int N; 14 8 15 if (argc == 1) usage (); 9 if (argc == 1) { 10 psError(PSASTRO_ERR_ARGUMENTS, true, "No arguments supplied"); 11 return NULL; 12 } 16 13 17 14 // basic pslib options … … 50 47 51 48 status = pmConfigFileSetsMD (config->arguments, config, "INPUT", "-file", "-list"); 52 if (!status) { usage ();} 53 54 if (argc != 2) usage (); 55 49 if (!status) { 50 psError(PSASTRO_ERR_ARGUMENTS, true, "Missing -file (input) or -list (input)"); 51 return NULL; 52 } 53 54 if (argc != 2) { 55 psError(PSASTRO_ERR_ARGUMENTS, true, "Incorrect arguments supplied"); 56 return NULL; 57 } 58 56 59 // output positions is fixed 57 60 psMetadataAddStr (config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "", argv[1]); 58 61 59 psTrace( __func__, 1, "Done with psastroArguments...\n");62 psTrace("psastro", 1, "Done with psastroArguments...\n"); 60 63 return (config); 61 64 } -
trunk/psastro/src/psastroAstromGuess.c
r9374 r9574 26 26 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO"); 27 27 if (!recipe) { 28 psErrorStackPrint(stderr, "Can't find PSASTRO recipe!\n");29 exit(EXIT_FAILURE);28 psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!"); 29 return false; 30 30 } 31 31 … … 33 33 pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT"); 34 34 if (!input) { 35 psErrorStackPrint(stderr, "Can't find input data!\n");36 exit(EXIT_FAILURE);35 psError(PSASTRO_ERR_CONFIG, true, "Can't find input data"); 36 return false; 37 37 } 38 38 … … 45 45 46 46 while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) { 47 psTrace ( __func__, 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);47 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 48 48 if (!chip->process || !chip->file_exists) { continue; } 49 49 … … 63 63 // XXX should this go into a different function? this would separate WCS interpretation from application 64 64 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) { 65 psTrace ( __func__, 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);65 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 66 66 if (!cell->process || !cell->file_exists) { continue; } 67 67 … … 80 80 p_psDeproject (raw->sky, raw->TP, fpa->projection); 81 81 82 if (i < 0) {82 if ((i < 10) && (psTraceGetLevel("psastro.guess") > 5)) { 83 83 fprintf (stderr, "up: %f,%f -> %f,%f -> %f,%f -> %f,%f\n", 84 84 raw->chip->x, raw->chip->y, -
trunk/psastro/src/psastroChipAstrom.c
r9374 r9574 11 11 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO"); 12 12 if (!recipe) { 13 psError StackPrint(stderr, "Can't find PSASTRO recipe!\n");14 exit(EXIT_FAILURE);13 psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe"); 14 return false; 15 15 } 16 16 … … 18 18 pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT"); 19 19 if (!input) { 20 psError StackPrint(stderr, "Can't find input data!\n");21 exit(EXIT_FAILURE);20 psError(PSASTRO_ERR_CONFIG, true, "Can't find input data"); 21 return false; 22 22 } 23 23 … … 29 29 30 30 while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) { 31 psTrace ( __func__, 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);31 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 32 32 if (!chip->process || !chip->file_exists) { continue; } 33 33 34 34 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) { 35 psTrace ( __func__, 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);35 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 36 36 if (!cell->process || !cell->file_exists) { continue; } 37 37 -
trunk/psastro/src/psastroConvert.c
r9374 r9574 10 10 11 11 while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) { 12 psTrace ( __func__, 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);12 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 13 13 if (!chip->process || !chip->file_exists) { continue; } 14 14 15 15 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) { 16 psTrace ( __func__, 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);16 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 17 17 if (!cell->process || !cell->file_exists) { continue; } 18 18 -
trunk/psastro/src/psastroDataLoad.c
r9374 r9574 1 1 # include "psastro.h" 2 // XXX leak free 2006.04.273 4 2 // this loop loads the data from the input files and selects the 5 3 // brighter stars for astrometry 6 4 // at the end of this function, the complete stellar data is loaded 7 5 // into the correct fpa structure locations (readout.analysis:PSPHOT.SOURCES) 8 // 6 9 7 // all of the different astrometry analysis modes use the same data load loop 10 8 bool psastroDataLoad (pmConfig *config) { … … 17 15 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO"); 18 16 if (!recipe) { 19 psError StackPrint(stderr, "Can't find PSASTRO recipe!\n");20 exit(EXIT_FAILURE);17 psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!\n"); 18 return false; 21 19 } 22 20 … … 24 22 pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT"); 25 23 if (!input) { 26 psError StackPrint(stderr, "Can't find input data!\n");27 exit(EXIT_FAILURE);24 psError(PSASTRO_ERR_CONFIG, true, "Can't find input data!\n"); 25 return false; 28 26 } 27 29 28 // de-activate all files except PSASTRO.INPUT 30 29 pmFPAfileActivate (config->files, false, NULL); … … 37 36 38 37 while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) { 39 psTrace ( __func__, 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);38 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 40 39 if (!chip->process || !chip->file_exists) { continue; } 41 40 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 42 41 43 42 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 44 psTrace ( __func__, 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);43 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 45 44 if (!cell->process || !cell->file_exists) { continue; } 46 45 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); -
trunk/psastro/src/psastroDataSave.c
r9374 r9574 12 12 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO"); 13 13 if (!recipe) { 14 psError StackPrint(stderr, "Can't find PSASTRO recipe!\n");15 exit(EXIT_FAILURE);14 psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!\n"); 15 return false; 16 16 } 17 17 … … 19 19 pmFPAfile *output = psMetadataLookupPtr (NULL, config->files, "PSASTRO.OUTPUT"); 20 20 if (!output) { 21 psError StackPrint(stderr, "Can't find output data!\n");22 exit(EXIT_FAILURE);21 psError(PSASTRO_ERR_CONFIG, true, "Can't find output data!\n"); 22 return false; 23 23 } 24 24 … … 33 33 34 34 while ((chip = pmFPAviewNextChip (view, output->fpa, 1)) != NULL) { 35 psTrace ( __func__, 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);35 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 36 36 if (!chip->process || !chip->file_exists) { continue; } 37 37 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 38 38 39 39 while ((cell = pmFPAviewNextCell (view, output->fpa, 1)) != NULL) { 40 psTrace ( __func__, 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);40 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 41 41 if (!cell->process || !cell->file_exists) { continue; } 42 42 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); -
trunk/psastro/src/psastroLoadReferences.c
r9368 r9574 42 42 # if ELIXIR_MODE 43 43 if (CATDIR) { 44 sprintf (tempLine, "getstar -D CATDIR %s -D CATFORMAT elixir -D CATMODE mef -region %f %f %f %f >%s", CATDIR, RAmin, DECmin, RAmax, DECmax, tempFile);44 sprintf (tempLine, "getstar -D CATDIR %s -D CATFORMAT elixir -D CATMODE mef -region %f %f %f %f -o %s", CATDIR, RAmin, DECmin, RAmax, DECmax, tempFile); 45 45 } else { 46 sprintf (tempLine, "getstar -D CATFORMAT elixir -D CATMODE mef -region %f %f %f %f >%s", RAmin, DECmin, RAmax, DECmax, tempFile);46 sprintf (tempLine, "getstar -D CATFORMAT elixir -D CATMODE mef -region %f %f %f %f -o %s", RAmin, DECmin, RAmax, DECmax, tempFile); 47 47 } 48 48 # else 49 49 if (CATDIR) { 50 sprintf (tempLine, "getstar -D CATDIR %s -D CATFORMAT panstarrs -D CATMODE mef -region %f %f %f %f >%s", CATDIR, RAmin, DECmin, RAmax, DECmax, tempFile);50 sprintf (tempLine, "getstar -D CATDIR %s -D CATFORMAT panstarrs -D CATMODE mef -region %f %f %f %f -o %s", CATDIR, RAmin, DECmin, RAmax, DECmax, tempFile); 51 51 } else { 52 sprintf (tempLine, "getstar -D CATFORMAT panstarrs -D CATMODE mef -region %f %f %f %f >%s", RAmin, DECmin, RAmax, DECmax, tempFile);52 sprintf (tempLine, "getstar -D CATFORMAT panstarrs -D CATMODE mef -region %f %f %f %f -o %s", RAmin, DECmin, RAmax, DECmax, tempFile); 53 53 } 54 54 # endif 55 55 56 psTrace ( __func__, 3, "%s\n", tempLine);56 psTrace ("psastro", 3, "%s\n", tempLine); 57 57 status = system (tempLine); 58 58 if (status) { … … 99 99 psFree (table); 100 100 101 psTrace ( __func__, 3, "loaded %ld reference stars from (%10.6f,%10.6f) - (%10.6f,%10.6f)\n",101 psTrace ("psastro", 3, "loaded %ld reference stars from (%10.6f,%10.6f) - (%10.6f,%10.6f)\n", 102 102 refs->n, RAmin, DECmin, RAmax, DECmax); 103 103 return refs; -
trunk/psastro/src/psastroMosaicAstrom.c
r9374 r9574 9 9 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO"); 10 10 if (!recipe) { 11 psError StackPrint(stderr, "Can't find PSASTRO recipe!\n");12 exit(EXIT_FAILURE);11 psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!\n"); 12 return false; 13 13 } 14 14 … … 16 16 pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT"); 17 17 if (!input) { 18 psError StackPrint(stderr, "Can't find input data!\n");19 exit(EXIT_FAILURE);18 psError(PSASTRO_ERR_CONFIG, true, "Can't find input data!\n"); 19 return false; 20 20 } 21 21 -
trunk/psastro/src/psastroMosaicChipAstrom.c
r9374 r9574 10 10 // this loop selects the matched stars for all chips 11 11 while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) { 12 psTrace ( __func__, 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);12 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 13 13 if (!chip->process || !chip->file_exists) { continue; } 14 14 15 15 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) { 16 psTrace ( __func__, 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);16 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 17 17 if (!cell->process || !cell->file_exists) { continue; } 18 18 -
trunk/psastro/src/psastroMosaicGetGrads.c
r9374 r9574 12 12 // this loop selects the matched stars for all chips 13 13 while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) { 14 psTrace ( __func__, 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);14 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 15 15 if (!chip->process || !chip->file_exists) { continue; } 16 16 17 17 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) { 18 psTrace ( __func__, 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);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 -
trunk/psastro/src/psastroMosaicGetRefstars.c
r9374 r9574 11 11 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO"); 12 12 if (!recipe) { 13 psError StackPrint(stderr, "Can't find PSASTRO recipe!\n");14 exit(EXIT_FAILURE);13 psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!\n"); 14 return false; 15 15 } 16 16 … … 18 18 pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT"); 19 19 if (!input) { 20 psError StackPrint(stderr, "Can't find input data!\n");21 exit(EXIT_FAILURE);20 psError(PSASTRO_ERR_CONFIG, true, "Can't find input data!\n"); 21 return false; 22 22 } 23 23 … … 30 30 // this loop selects the matched stars for all chips 31 31 while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) { 32 psTrace ( __func__, 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);32 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 33 33 if (!chip->process || !chip->file_exists) { continue; } 34 34 35 35 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) { 36 psTrace ( __func__, 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);36 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 37 37 if (!cell->process || !cell->file_exists) { continue; } 38 38 … … 75 75 psFree (ref); 76 76 } 77 psTrace ( __func__, 4, "Added %ld refstars\n", refstars->n);77 psTrace ("psastro", 4, "Added %ld refstars\n", refstars->n); 78 78 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.REFSTARS", PS_DATA_ARRAY, "astrometry matches", refstars); 79 79 -
trunk/psastro/src/psastroMosaicHeaders.c
r9374 r9574 9 9 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO"); 10 10 if (!recipe) { 11 psErrorStackPrint(stderr, "Can't find PSASTRO recipe!\n");12 exit(EXIT_FAILURE);11 psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!\n"); 12 return false; 13 13 } 14 14 15 15 16 // select the input data sources 16 17 pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT"); 17 18 if (!input) { 18 psErrorStackPrint(stderr, "Can't find input data!\n");19 exit(EXIT_FAILURE);19 psError(PSASTRO_ERR_CONFIG, true, "Can't find input data!\n"); 20 return false; 20 21 } 21 22 … … 29 30 30 31 while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) { 31 psTrace ( __func__, 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);32 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 32 33 if (!chip->process || !chip->file_exists) { continue; } 33 34 -
trunk/psastro/src/psastroMosaicRescaleChips.c
r9374 r9574 8 8 // this loop selects the matched stars for all chips 9 9 while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) { 10 psTrace ( __func__, 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);10 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 11 11 if (!chip->process || !chip->file_exists) { continue; } 12 12 -
trunk/psastro/src/psastroMosaicSetAstrom.c
r9374 r9574 10 10 // this loop selects the matched stars for all chips 11 11 while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) { 12 psTrace ( __func__, 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);12 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 13 13 if (!chip->process || !chip->file_exists) { continue; } 14 14 15 15 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) { 16 psTrace ( __func__, 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);16 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 17 17 if (!cell->process || !cell->file_exists) { continue; } 18 18 -
trunk/psastro/src/psastroMosaicSetMatch.c
r9374 r9574 16 16 // this loop selects the matched stars for all chips 17 17 while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) { 18 psTrace ( __func__, 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);18 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 19 19 if (!chip->process || !chip->file_exists) { continue; } 20 20 21 21 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) { 22 psTrace ( __func__, 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);22 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 23 23 if (!cell->process || !cell->file_exists) { continue; } 24 24 … … 35 35 psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS"); 36 36 if (refstars == NULL) { continue; } 37 psTrace ( __func__, 4, "Trying %ld refstars\n", refstars->n);37 psTrace ("psastro", 4, "Trying %ld refstars\n", refstars->n); 38 38 39 39 // use small radius to match stars (assume starting astrometry is good) 40 40 // XXX should this take a (double radius)? 41 41 psArray *matches = pmAstromRadiusMatchChip (rawstars, refstars, recipe); 42 psTrace ( __func__, 4, "Matched %ld refstars\n", matches->n);42 psTrace ("psastro", 4, "Matched %ld refstars\n", matches->n); 43 43 44 44 sprintf (name, "raw.%02d.dat", view->chip); -
trunk/psastro/src/psastroOneChip.c
r9374 r9574 13 13 pmAstromStats stats = pmAstromGridMatch (rawstars, refstars, recipe); 14 14 stats = pmAstromGridTweak (rawstars, refstars, recipe, stats); 15 psLogMsg ( __func__, 3, "grid search result: %f,%f @ %f deg\n", stats.offset.x, stats.offset.y, DEG_RAD*stats.angle);15 psLogMsg ("psastro", 3, "grid search result: %f,%f @ %f deg\n", stats.offset.x, stats.offset.y, DEG_RAD*stats.angle); 16 16 17 17 // adjust the chip.toFPA terms only -
trunk/psastro/src/psastroParseCamera.c
r9374 r9574 1 1 # include "psastro.h" 2 // XXX leak free 2006.04.273 2 4 3 bool psastroParseCamera (pmConfig *config) { … … 8 7 // the input image(s) are required arguments; they define the camera 9 8 pmFPAfile *input = pmFPAfileDefineFromArgs (&status, config, "PSASTRO.INPUT", "INPUT"); 10 if (!status) { psAbort (__func__, "missing INPUT entry"); } 9 if (!status) { 10 psError(PSASTRO_ERR_CONFIG, false, "Failed to build FPA from PSASTRO.INPUT"); 11 return false; 12 } 11 13 12 14 // select recipe options supplied on command line … … 30 32 int chipNum = atoi(chips->data[i]); 31 33 if (! pmFPASelectChip(input->fpa, chipNum, false)) { 32 psError StackPrint(stderr, "Chip number %d doesn't exist in camera.\n", chipNum);33 exit(EXIT_FAILURE);34 psError(PSASTRO_ERR_CONFIG, true, "Chip number %d doesn't exist in camera.\n", chipNum); 35 return false; 34 36 } 35 37 } … … 37 39 psFree (chips); 38 40 39 psTrace( __func__, 1, "Done with psastroParseCamera...\n");41 psTrace("psastro", 1, "Done with psastroParseCamera...\n"); 40 42 return true; 41 43 } -
trunk/psastro/src/psastroTestFuncs.c
r9374 r9574 32 32 for (int j = 0; j < map->x->nY + 1; j++) { 33 33 if (map->x->mask[i][j]) continue; 34 psLogMsg ( __func__, 4, "x term %d,%d: %f +/- %f\n", i, j, map->x->coeff[i][j], map->x->coeffErr[i][j]);34 psLogMsg ("psastro", 4, "x term %d,%d: %f +/- %f\n", i, j, map->x->coeff[i][j], map->x->coeffErr[i][j]); 35 35 } 36 36 } … … 39 39 for (int j = 0; j < map->y->nY + 1; j++) { 40 40 if (map->y->mask[i][j]) continue; 41 psLogMsg ( __func__, 4, "y term %d,%d: %f +/- %f\n", i, j, map->y->coeff[i][j], map->y->coeffErr[i][j]);41 psLogMsg ("psastro", 4, "y term %d,%d: %f +/- %f\n", i, j, map->y->coeff[i][j], map->y->coeffErr[i][j]); 42 42 } 43 43 } -
trunk/psastro/src/psastroWCS.c
r9373 r9574 6 6 7 7 psProjectionType type; 8 bool status ;8 bool status, pcKeys, cdKeys; 9 9 float crval1, crval2, crpix1, crpix2, cdelt1, cdelt2; 10 10 float pc1_1, pc1_2, pc2_1, pc2_2; … … 29 29 } 30 30 31 // what type of WCS keywords are available? 32 psMetadataLookupF32 (&pcKeys, header, "PC001001"); 33 psMetadataLookupF32 (&cdKeys, header, "CD1_1"); 34 35 if (cdKeys && pcKeys) { 36 psLogMsg ("psastro", 2, "warning: both CDi_j and PC00i00j defined in headers, using CDi_j terms\n"); 37 } 38 if (!cdKeys && !pcKeys) { 39 psError(PS_ERR_UNKNOWN, true, "missing both CDi_j and PC00i00j WCS terms"); 40 // XXX we could default here to RA, DEC, ROTANGLE 41 return false; 42 } 43 31 44 crval1 = psMetadataLookupF32 (&status, header, "CRVAL1"); 32 45 crval2 = psMetadataLookupF32 (&status, header, "CRVAL2"); … … 35 48 36 49 // test the CDELTi varient 37 cdelt1 = psMetadataLookupF32 (&status, header, "CDELT1");38 if (status) { 50 if (pcKeys) { 51 cdelt1 = psMetadataLookupF32 (&status, header, "CDELT1"); 39 52 cdelt2 = psMetadataLookupF32 (&status, header, "CDELT2"); 40 53 … … 65 78 66 79 // test the CDi_j varient 67 pc1_1 = psMetadataLookupF32 (&status, header, "CD1_1");68 if (status) { 80 if (cdKeys) { 81 pc1_1 = psMetadataLookupF32 (&status, header, "CD1_1"); 69 82 pc1_2 = psMetadataLookupF32 (&status, header, "CD1_2"); 70 83 pc2_1 = psMetadataLookupF32 (&status, header, "CD2_1");
Note:
See TracChangeset
for help on using the changeset viewer.
