Changeset 23199 for branches/cnb_branches/cnb_branch_20090215/psastro
- Timestamp:
- Mar 5, 2009, 11:24:29 AM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090215
- Files:
-
- 6 edited
-
. (modified) (1 prop)
-
psastro/src/Makefile.am (modified) (1 diff)
-
psastro/src/psastro.c (modified) (2 diffs)
-
psastro/src/psastro.h (modified) (1 diff)
-
psastro/src/psastroDataSave.c (modified) (5 diffs)
-
psastro/src/psastroVersion.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090215
- Property svn:mergeinfo changed
/trunk merged: 22727-22752,23115-23126,23128,23137-23157,23159-23174,23182-23195,23198
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090215/psastro/src/Makefile.am
r21422 r23199 1 lib_LTLIBRARIES = libpsastro.la 1 2 2 lib_LTLIBRARIES = libpsastro.la 3 libpsastro_la_CFLAGS = $(PSASTRO_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) 4 libpsastro_la_LDFLAGS = $(PSASTRO_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 3 PSASTRO_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 PSASTRO_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 PSASTRO_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 7 # Force recompilation of psastroVersion.c, since it gets the version information 8 psastroVersion.c: FORCE 9 touch psastroVersion.c 10 FORCE: ; 11 12 libpsastro_la_CFLAGS = $(PSASTRO_CFLAGS) $(PPSTATS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPSASTRO_VERSION=\"$(PSASTRO_VERSION)\" -DPSASTRO_BRANCH=\"$(PSASTRO_BRANCH)\" -DPSASTRO_SOURCE=\"$(PSASTRO_SOURCE)\" 13 libpsastro_la_LDFLAGS = $(PSASTRO_LIBS) $(PPSTATS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 5 14 6 15 bin_PROGRAMS = psastro psastroModel psastroModelFit gpcModel -
branches/cnb_branches/cnb_branch_20090215/psastro/src/psastro.c
r21409 r23199 34 34 if (!config) usage (); 35 35 36 psastroVersionPrint(); 37 36 38 // load identify the data sources 37 39 if (!psastroParseCamera (config)) { 38 psErrorStackPrint(stderr, "error setting up the camera\n");39 exit (1);40 psErrorStackPrint(stderr, "error setting up the camera\n"); 41 exit (1); 40 42 } 41 43 … … 43 45 // select subset of stars for astrometry 44 46 if (!psastroDataLoad (config)) { 45 psErrorStackPrint(stderr, "error loading input data\n");46 exit (1);47 psErrorStackPrint(stderr, "error loading input data\n"); 48 exit (1); 47 49 } 48 50 49 51 // run the full astrometry analysis (chip and/or mosaic) 50 52 if (!psastroAnalysis (config)) { 51 psErrorStackPrint(stderr, "failure in psastro analysis\n");52 exit (1);53 psErrorStackPrint(stderr, "failure in psastro analysis\n"); 54 exit (1); 53 55 } 54 56 55 57 // write out the results 56 58 if (!psastroDataSave (config)) { 57 psErrorStackPrint(stderr, "failed to write out data\n");58 exit (1);59 psErrorStackPrint(stderr, "failed to write out data\n"); 60 exit (1); 59 61 } 60 62 -
branches/cnb_branches/cnb_branch_20090215/psastro/src/psastro.h
r21422 r23199 95 95 // Return version strings. 96 96 psString psastroVersion(void); 97 psString psastroSource(void); 97 98 psString psastroVersionLong(void); 99 bool psastroVersionHeader(psMetadata *header); 100 bool psastroVersionHeaderFull(psMetadata *header); 101 void psastroVersionPrint(void); 98 102 99 103 // demo plots -
branches/cnb_branches/cnb_branch_20090215/psastro/src/psastroDataSave.c
r21409 r23199 18 18 return false; \ 19 19 } 20 20 21 21 /** 22 22 * this loop saves the photometry/astrometry data files … … 31 31 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSASTRO_RECIPE); 32 32 if (!recipe) { 33 psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!\n");34 return false;33 psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!\n"); 34 return false; 35 35 } 36 36 … … 38 38 pmFPAfile *output = psMetadataLookupPtr (NULL, config->files, "PSASTRO.OUTPUT"); 39 39 if (!output) { 40 psError(PSASTRO_ERR_CONFIG, true, "Can't find or interpret output file rule PSASTRO.OUTPUT!\n");41 return false;40 psError(PSASTRO_ERR_CONFIG, true, "Can't find or interpret output file rule PSASTRO.OUTPUT!\n"); 41 return false; 42 42 } 43 43 … … 48 48 49 49 pmFPAview *view = pmFPAviewAlloc (0); 50 pmHDU *lastHDU = NULL; // Last HDU updated 50 51 51 52 // open/load files as needed … … 55 56 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 56 57 if (!chip->process || !chip->file_exists) { continue; } 57 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;58 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 58 59 59 while ((cell = pmFPAviewNextCell (view, output->fpa, 1)) != NULL) {60 while ((cell = pmFPAviewNextCell (view, output->fpa, 1)) != NULL) { 60 61 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 61 62 if (!cell->process || !cell->file_exists) { continue; } 62 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;63 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 63 64 64 // process each of the readouts65 while ((readout = pmFPAviewNextReadout (view, output->fpa, 1)) != NULL) {66 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;67 if (!readout->data_exists) { continue; }65 // process each of the readouts 66 while ((readout = pmFPAviewNextReadout (view, output->fpa, 1)) != NULL) { 67 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 68 if (!readout->data_exists) { continue; } 68 69 69 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; 70 } 71 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; 72 } 73 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; 70 // Put version information into the header 71 pmHDU *hdu = pmHDUGetHighest(output->fpa, chip, cell); 72 if (hdu && hdu != lastHDU) { 73 psastroVersionHeaderFull(hdu->header); 74 lastHDU = hdu; 75 } 76 77 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; 78 } 79 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; 80 } 81 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; 74 82 } 75 83 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; -
branches/cnb_branches/cnb_branch_20090215/psastro/src/psastroVersion.c
r21409 r23199 5 5 * @ingroup libpsastro 6 6 * 7 * @author IfA8 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $9 * @date $Date: 2009-02-07 02:03:34 $10 7 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 8 */ … … 13 10 #include "psastroInternal.h" 14 11 15 static const char *cvsTag = "$Name: not supported by cvs2svn $";///< CVS tag name16 17 12 psString psastroVersion(void) 18 13 { 19 psString version = NULL; // Version, to return 20 psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION); 21 return version; 14 #ifndef PSASTRO_VERSION 15 #error "PSASTRO_VERSION is not set" 16 #endif 17 #ifndef PSASTRO_BRANCH 18 #error "PSASTRO_BRANCH is not set" 19 #endif 20 return psStringCopy(PSASTRO_BRANCH "@" PSASTRO_VERSION); 21 } 22 23 psString psastroSource(void) 24 { 25 #ifndef PSASTRO_SOURCE 26 #error "PSASTRO_SOURCE is not set" 27 #endif 28 return psStringCopy(PSASTRO_SOURCE); 22 29 } 23 30 24 31 psString psastroVersionLong(void) 25 32 { 26 psString version = psastroVersion(); // Version, to return 27 psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag 28 psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__); 29 psFree(tag); 33 psString version = psastroVersion(); // Version, to return 34 psString source = psastroSource(); // Source 35 36 psStringPrepend(&version, "psastro "); 37 psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__); 38 psFree(source); 39 40 #ifdef __OPTIMIZE__ 41 psStringAppend(&version, " optimised"); 42 #else 43 psStringAppend(&version, " unoptimised"); 44 #endif 45 30 46 return version; 47 }; 48 49 bool psastroVersionHeader(psMetadata *header) 50 { 51 PS_ASSERT_METADATA_NON_NULL(header, false); 52 53 psString version = psastroVersion(); // Software version 54 psString source = psastroSource(); // Software source 55 56 psMetadataAddStr(header, PS_LIST_TAIL, "IPP.PSASTRO.VERSION", PS_META_REPLACE, 57 "Software version", version); 58 psMetadataAddStr(header, PS_LIST_TAIL, "IPP.PSASTRO.SOURCE", PS_META_REPLACE, 59 "S/W source", source); 60 61 psFree(version); 62 psFree(source); 63 64 return true; 31 65 } 32 66 67 bool psastroVersionHeaderFull(psMetadata *header) 68 { 69 PS_ASSERT_METADATA_NON_NULL(header, false); 70 71 psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now 72 psString timeString = psTimeToISO(time); // The time in an ISO string 73 psFree(time); 74 psString history = NULL; // History string 75 psStringAppend(&history, "psastro at %s", timeString); 76 psFree(timeString); 77 psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, history); 78 psFree(history); 79 80 psLibVersionHeader(header); 81 psModulesVersionHeader(header); 82 ppStatsVersionHeader(header); 83 psastroVersionHeader(header); 84 85 return true; 86 } 87 88 void psastroVersionPrint(void) 89 { 90 psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now 91 psString timeString = psTimeToISO(time); // The time in an ISO string 92 psFree(time); 93 psLogMsg("psastro", PS_LOG_INFO, "psastro at %s", timeString); 94 psFree(timeString); 95 96 psString pslib = psLibVersionLong();// psLib version 97 psString psmodules = psModulesVersionLong(); // psModules version 98 psString ppStats = ppStatsVersionLong(); // ppStats version 99 psString psastro = psastroVersionLong(); // psastro version 100 101 psLogMsg("psastro", PS_LOG_INFO, "%s", pslib); 102 psLogMsg("psastro", PS_LOG_INFO, "%s", psmodules); 103 psLogMsg("psastro", PS_LOG_INFO, "%s", ppStats); 104 psLogMsg("psastro", PS_LOG_INFO, "%s", psastro); 105 106 psFree(pslib); 107 psFree(psmodules); 108 psFree(ppStats); 109 psFree(psastro); 110 111 return; 112 }
Note:
See TracChangeset
for help on using the changeset viewer.
