Changeset 23688 for trunk/psastro/src/psastro.c
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/pap (added) merged: 23511,23520-23521,23532,23578-23581,23596-23599,23603-23604,23606-23608,23619-23621,23638-23639,23641,23646-23648,23651-23653,23656,23672-23674,23677-23684
- Property svn:mergeinfo changed
-
trunk/psastro
- Property svn:mergeinfo changed
/branches/pap/psastro (added) merged: 23638,23641
- Property svn:mergeinfo changed
-
trunk/psastro/src/psastro.c
r23195 r23688 13 13 # include "psastroStandAlone.h" 14 14 15 static void usage (void) {16 fprintf (stderr, "USAGE: psastro [-file image(s)] [-list imagelist] (output)\n");17 exit (2);15 static void usage(void) { 16 fprintf(stderr, "USAGE: psastro [-file image(s)] [-list imagelist] (output)\n"); 17 exit(PS_EXIT_CONFIG_ERROR); 18 18 } 19 19 20 int main (int argc, char **argv) { 21 22 pmConfig *config = NULL; 23 20 int main (int argc, char **argv) 21 { 24 22 psTimerStart ("complete"); 25 23 … … 28 26 // model inits are needed in pmSourceIO 29 27 // models defined in psphot/src/models are not available in psastro 30 pmModelClassInit ();28 pmModelClassInit(); 31 29 32 30 // load configuration information 33 config = psastroArguments (argc, argv); 34 if (!config) usage (); 31 pmConfig *config = config = psastroArguments(argc, argv); 32 if (!config) { 33 usage(); 34 } 35 35 36 36 psastroVersionPrint(); … … 39 39 if (!psastroParseCamera (config)) { 40 40 psErrorStackPrint(stderr, "error setting up the camera\n"); 41 exit (1); 41 psFree(config); 42 exit(PS_EXIT_CONFIG_ERROR); 42 43 } 43 44 … … 46 47 if (!psastroDataLoad (config)) { 47 48 psErrorStackPrint(stderr, "error loading input data\n"); 48 exit (1); 49 psFree(config); 50 exit(PS_EXIT_DATA_ERROR); 49 51 } 50 52 53 psMetadata *stats = psMetadataAlloc(); // Statistics, for output 54 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0); 55 51 56 // run the full astrometry analysis (chip and/or mosaic) 52 if (!psastroAnalysis (config)) {57 if (!psastroAnalysis(config, stats)) { 53 58 psErrorStackPrint(stderr, "failure in psastro analysis\n"); 54 exit (1); 59 psFree(config); 60 psFree(stats); 61 exit(PS_EXIT_SYS_ERROR); 55 62 } 56 63 57 64 // write out the results 58 if (!psastroDataSave (config)) {65 if (!psastroDataSave(config, stats)) { 59 66 psErrorStackPrint(stderr, "failed to write out data\n"); 60 exit (1); 67 psFree(config); 68 psFree(stats); 69 exit(PS_EXIT_DATA_ERROR); 61 70 } 62 71 63 psLogMsg ("psastro", 3, "complete psastro run: %f sec\n", psTimerMark ("complete"));72 psLogMsg("psastro", 3, "complete psastro run: %f sec\n", psTimerMark ("complete")); 64 73 65 psastroCleanup (config);66 exit (EXIT_SUCCESS);74 psastroCleanup(config); 75 exit(PS_EXIT_SUCCESS); 67 76 }
Note:
See TracChangeset
for help on using the changeset viewer.
