Changeset 23199 for branches/cnb_branches/cnb_branch_20090215/psphot
- Timestamp:
- Mar 5, 2009, 11:24:29 AM (18 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090215
- Files:
-
- 6 edited
-
. (modified) (1 prop)
-
psphot/src/Makefile.am (modified) (1 diff)
-
psphot/src/psphot.c (modified) (2 diffs)
-
psphot/src/psphot.h (modified) (1 diff)
-
psphot/src/psphotImageLoop.c (modified) (2 diffs)
-
psphot/src/psphotVersion.c (modified) (1 diff)
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/psphot/src/Makefile.am
r21392 r23199 1 1 lib_LTLIBRARIES = libpsphot.la 2 libpsphot_la_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) 2 3 PSPHOT_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 PSPHOT_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 PSPHOT_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 7 # Force recompilation of psphotVersion.c, since it gets the version information 8 psphotVersion.c: FORCE 9 touch psphotVersion.c 10 FORCE: ; 11 12 libpsphot_la_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPSPHOT_VERSION=\"$(PSPHOT_VERSION)\" -DPSPHOT_BRANCH=\"$(PSPHOT_BRANCH)\" -DPSPHOT_SOURCE=\"$(PSPHOT_SOURCE)\" 3 13 libpsphot_la_LDFLAGS = $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 4 14 -
branches/cnb_branches/cnb_branch_20090215/psphot/src/psphot.c
r20411 r23199 9 9 10 10 psTimerStart ("complete"); 11 pmErrorRegister(); // register psModule's error codes/messages11 pmErrorRegister(); // register psModule's error codes/messages 12 12 psphotInit(); 13 13 … … 15 15 pmConfig *config = psphotArguments (argc, argv); 16 16 if (!config) { 17 psErrorStackPrint(stderr, "Error reading arguments\n");18 usage ();17 psErrorStackPrint(stderr, "Error reading arguments\n"); 18 usage (); 19 19 } 20 21 psphotVersionPrint(); 20 22 21 23 // load input data (config and images (signal, noise, mask) -
branches/cnb_branches/cnb_branch_20090215/psphot/src/psphot.h
r21536 r23199 16 16 const char *psphotCVSName(void); 17 17 psString psphotVersion(void); 18 psString psphotSource(void); 18 19 psString psphotVersionLong(void); 20 bool psphotVersionHeader(psMetadata *header); 21 bool psphotVersionHeaderFull(psMetadata *header); 22 void psphotVersionPrint(void); 19 23 20 24 bool psphotModelTest (pmConfig *config, const pmFPAview *view, psMetadata *recipe); -
branches/cnb_branches/cnb_branch_20090215/psphot/src/psphotImageLoop.c
r21458 r23199 26 26 27 27 pmFPAview *view = pmFPAviewAlloc (0); 28 pmHDU *lastHDU = NULL; // Last HDU updated 28 29 29 30 // files associated with the science image … … 64 65 psLogMsg ("psphot", 6, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 65 66 if (! readout->data_exists) { continue; } 67 68 // Update the header 69 { 70 pmHDU *hdu = pmHDUGetHighest(input->fpa, chip, cell); 71 if (hdu && hdu != lastHDU) { 72 psphotVersionHeaderFull(hdu->header); 73 lastHDU = hdu; 74 } 75 } 66 76 67 77 // run the actual photometry analysis on this chip/cell/readout -
branches/cnb_branches/cnb_branch_20090215/psphot/src/psphotVersion.c
r12805 r23199 1 # include "psphotInternal.h"1 #include "psphotInternal.h" 2 2 3 # if (HAVE_KAPA) 4 # include <kapa.h> 5 # endif 6 7 static const char *cvsTag = "$Name: not supported by cvs2svn $";// CVS tag name 3 #ifdef HAVE_KAPA 4 #include <kapa.h> 5 #endif 8 6 9 7 psString psphotVersion(void) 10 8 { 11 psString version = NULL; // Version, to return 12 psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION); 13 return version; 9 #ifndef PSPHOT_VERSION 10 #error "PSPHOT_VERSION is not set" 11 #endif 12 #ifndef PSPHOT_BRANCH 13 #error "PSPHOT_BRANCH is not set" 14 #endif 15 return psStringCopy(PSPHOT_BRANCH "@" PSPHOT_VERSION); 16 } 17 18 psString psphotSource(void) 19 { 20 #ifndef PSPHOT_SOURCE 21 #error "PSPHOT_SOURCE is not set" 22 #endif 23 return psStringCopy(PSPHOT_SOURCE); 14 24 } 15 25 16 26 psString psphotVersionLong(void) 17 27 { 18 psString version = psphotVersion(); // Version, to return 19 psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag 20 psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__); 28 psString version = psLibVersion(); // Version, to return 29 psString source = psLibSource(); // Source 21 30 22 # if (HAVE_KAPA) 23 psString ohanaVersion = psStringStripCVS (ohana_version(), "Name");24 ps String libdvoVersion = psStringStripCVS (libdvo_version(), "Name");31 psStringPrepend(&version, "psphot "); 32 psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__); 33 psFree(source); 25 34 26 psStringAppend (&version, " with libkapa (ohana %s, libdvo: %s)", ohanaVersion, libdvoVersion); 27 psFree (ohanaVersion); 28 psFree (libdvoVersion); 29 # else 30 psStringAppend (&version, " WITHOUT libkapa"); 31 # endif 35 #ifdef __OPTIMIZE__ 36 psStringAppend(&version, " optimised"); 37 #else 38 psStringAppend(&version, " unoptimised"); 39 #endif 32 40 33 psFree(tag); 41 #ifdef HAVE_KAPA 42 #if 0 43 // XXX Need to get ohana and libdvo versions 44 psString ohanaVersion = psStringStripCVS(ohana_version(), "Name"); 45 psString libdvoVersion = psStringStripCVS(libdvo_version(), "Name"); 46 psStringAppend(&version, " with libkapa (ohana %s, libdvo: %s)", ohanaVersion, libdvoVersion); 47 psFree(ohanaVersion); 48 psFree(libdvoVersion); 49 #else 50 psStringAppend(&version, " with libkapa"); 51 #endif 52 53 #else 54 psStringAppend (&version, " without libkapa"); 55 #endif 56 34 57 return version; 35 58 } 36 59 37 // Defined by RHL; leaving for backwards compatibility. 38 const char *psphotCVSName(void) { 39 return cvsTag; 60 bool psphotVersionHeader(psMetadata *header) 61 { 62 PS_ASSERT_METADATA_NON_NULL(header, false); 63 64 psString version = psphotVersion(); // Software version 65 psString source = psphotSource(); // Software source 66 67 psMetadataAddStr(header, PS_LIST_TAIL, "IPP.PSPHOT.VERSION", PS_META_REPLACE, 68 "Software version", version); 69 psMetadataAddStr(header, PS_LIST_TAIL, "IPP.PSPHOT.SOURCE", PS_META_REPLACE, 70 "S/W source", source); 71 72 psFree(version); 73 psFree(source); 74 75 return true; 40 76 } 77 78 79 bool psphotVersionHeaderFull(psMetadata *header) 80 { 81 PS_ASSERT_METADATA_NON_NULL(header, false); 82 83 psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now 84 psString timeString = psTimeToISO(time); // The time in an ISO string 85 psFree(time); 86 psString history = NULL; // History string 87 psStringAppend(&history, "psphot at %s", timeString); 88 psFree(timeString); 89 psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, history); 90 psFree(history); 91 92 psLibVersionHeader(header); 93 psModulesVersionHeader(header); 94 psphotVersionHeader(header); 95 96 return true; 97 } 98 99 100 void psphotVersionPrint(void) 101 { 102 psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now 103 psString timeString = psTimeToISO(time); // The time in an ISO string 104 psFree(time); 105 psLogMsg("psphot", PS_LOG_INFO, "psphot at %s", timeString); 106 psFree(timeString); 107 108 psString pslib = psLibVersionLong();// psLib version 109 psString psmodules = psModulesVersionLong(); // psModules version 110 psString psphot = psphotVersionLong(); // psphot version 111 112 psLogMsg("psphot", PS_LOG_INFO, "%s", pslib); 113 psLogMsg("psphot", PS_LOG_INFO, "%s", psmodules); 114 psLogMsg("psphot", PS_LOG_INFO, "%s", psphot); 115 116 psFree(pslib); 117 psFree(psmodules); 118 psFree(psphot); 119 120 return; 121 }
Note:
See TracChangeset
for help on using the changeset viewer.
