Changeset 23352 for branches/cnb_branches/cnb_branch_20090301/psastro/src
- Timestamp:
- Mar 17, 2009, 12:08:50 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 1 deleted
- 10 edited
-
. (modified) (1 prop)
-
psastro (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/psastroArguments.c (modified) (2 diffs)
-
psastro/src/psastroCleanup.c (modified) (2 diffs)
-
psastro/src/psastroConvert.c (modified) (1 diff)
-
psastro/src/psastroDataSave.c (modified) (5 diffs)
-
psastro/src/psastroVersion.c (modified) (2 diffs)
-
psastro/src/psastroVisual.c (deleted)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk merged eligible /branches/eam_branches/eam_branch_20090303 23158-23228
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/psastro
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/cnb_branches/cnb_branch_20090215/psastro merged eligible /trunk/psastro merged eligible /branches/cnb_branch_20090215/psastro 21495-22685 /branches/eam_branches/eam_branch_20090303/psastro 23158-23228
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/psastro/src/Makefile.am
r21422 r23352 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 libpsastro_la_CFLAGS = $(PSASTRO_CFLAGS) $(PPSTATS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPSASTRO_VERSION=$(SVN_VERSION) -DPSASTRO_BRANCH=$(SVN_BRANCH) -DPSASTRO_SOURCE=$(SVN_SOURCE) 4 libpsastro_la_LDFLAGS = $(PSASTRO_LIBS) $(PPSTATS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 5 6 # Force recompilation of psastroVersion.c, since it gets the version information 7 # can we do this with dependency info? 8 # psastroVersion.c: FORCE 9 # touch psastroVersion.c 10 # FORCE: ; 5 11 6 12 bin_PROGRAMS = psastro psastroModel psastroModelFit gpcModel -
branches/cnb_branches/cnb_branch_20090301/psastro/src/psastro.c
r21409 r23352 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_20090301/psastro/src/psastro.h
r21422 r23352 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_20090301/psastro/src/psastroArguments.c
r21422 r23352 6 6 * 7 7 * @author IfA 8 * @version $Revision: 1.34 $ $Name: not supported by cvs2svn $9 * @date $Date: 2009-02- 09 21:25:34$8 * @version $Revision: 1.34.2.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-02-19 17:59:50 $ 10 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 11 */ … … 100 100 if ((N = psArgumentGet (argc, argv, "-visual"))) { 101 101 psArgumentRemove (N, &argc, argv); 102 pm AstromSetVisual (true);102 pmVisualSetVisual (true); 103 103 } 104 104 -
branches/cnb_branches/cnb_branch_20090301/psastro/src/psastroCleanup.c
r21422 r23352 6 6 * 7 7 * @author IfA 8 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $9 * @date $Date: 2009-02- 09 21:25:34$8 * @version $Revision: 1.8.2.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-02-19 17:59:50 $ 10 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 11 */ … … 16 16 17 17 psFree (config); 18 pm AstromVisualClose ();18 pmVisualClose (); 19 19 20 20 psTimerStop (); -
branches/cnb_branches/cnb_branch_20090301/psastro/src/psastroConvert.c
r21409 r23352 99 99 int n = index->data.S32[i]; 100 100 pmSource *source = sources->data[n]; 101 // XXX this needs to be flexible 101 102 psTrace ("psastro", 6, "mag: %f +/- %f, mode: %x, skip: %x\n", source->psfMag, source->errMag, source->mode, skip); 103 102 104 if (source->mode & skip) { 103 105 nModeSkip ++; 104 106 continue; 105 107 } 108 106 109 if ((iMagMax != 0.0) && (source->psfMag > iMagMax)) { 107 110 nFaintSkip ++; -
branches/cnb_branches/cnb_branch_20090301/psastro/src/psastroDataSave.c
r21409 r23352 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_20090301/psastro/src/psastroVersion.c
r21409 r23352 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 name 12 #ifndef PSASTRO_VERSION 13 #error "PSASTRO_VERSION is not set" 14 #endif 15 #ifndef PSASTRO_BRANCH 16 #error "PSASTRO_BRANCH is not set" 17 #endif 18 #ifndef PSASTRO_SOURCE 19 #error "PSASTRO_SOURCE is not set" 20 #endif 21 22 #define xstr(s) str(s) 23 #define str(s) #s 16 24 17 25 psString psastroVersion(void) 18 26 { 19 psString version = NULL; // Version, to return 20 psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION); 21 return version; 27 char *value = NULL; 28 psStringAppend(&value, "%s@%s", xstr(PSASTRO_BRANCH), xstr(PSASTRO_VERSION)); 29 return value; 30 } 31 32 psString psastroSource(void) 33 { 34 return psStringCopy(xstr(PSASTRO_SOURCE)); 22 35 } 23 36 24 37 psString psastroVersionLong(void) 25 38 { 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); 39 psString version = psastroVersion(); // Version, to return 40 psString source = psastroSource(); // Source 41 42 psStringPrepend(&version, "psastro "); 43 psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__); 44 psFree(source); 45 46 #ifdef __OPTIMIZE__ 47 psStringAppend(&version, " optimised"); 48 #else 49 psStringAppend(&version, " unoptimised"); 50 #endif 51 30 52 return version; 53 }; 54 55 bool psastroVersionHeader(psMetadata *header) 56 { 57 PS_ASSERT_METADATA_NON_NULL(header, false); 58 59 psString version = psastroVersion(); // Software version 60 psString source = psastroSource(); // Software source 61 62 psStringPrepend(&version, "psastro version: "); 63 psStringPrepend(&source, "psastro source: "); 64 65 psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, version); 66 psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, source); 67 68 psFree(version); 69 psFree(source); 70 71 return true; 31 72 } 32 73 74 bool psastroVersionHeaderFull(psMetadata *header) 75 { 76 PS_ASSERT_METADATA_NON_NULL(header, false); 77 78 psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now 79 psString timeString = psTimeToISO(time); // The time in an ISO string 80 psFree(time); 81 psString history = NULL; // History string 82 psStringAppend(&history, "psastro at %s", timeString); 83 psFree(timeString); 84 psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, history); 85 psFree(history); 86 87 psLibVersionHeader(header); 88 psModulesVersionHeader(header); 89 ppStatsVersionHeader(header); 90 psastroVersionHeader(header); 91 92 return true; 93 } 94 95 void psastroVersionPrint(void) 96 { 97 psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now 98 psString timeString = psTimeToISO(time); // The time in an ISO string 99 psFree(time); 100 psLogMsg("psastro", PS_LOG_INFO, "psastro at %s", timeString); 101 psFree(timeString); 102 103 psString pslib = psLibVersionLong();// psLib version 104 psString psmodules = psModulesVersionLong(); // psModules version 105 psString ppStats = ppStatsVersionLong(); // ppStats version 106 psString psastro = psastroVersionLong(); // psastro version 107 108 psLogMsg("psastro", PS_LOG_INFO, "%s", pslib); 109 psLogMsg("psastro", PS_LOG_INFO, "%s", psmodules); 110 psLogMsg("psastro", PS_LOG_INFO, "%s", ppStats); 111 psLogMsg("psastro", PS_LOG_INFO, "%s", psastro); 112 113 psFree(pslib); 114 psFree(psmodules); 115 psFree(ppStats); 116 psFree(psastro); 117 118 return; 119 }
Note:
See TracChangeset
for help on using the changeset viewer.
