IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 5, 2009, 11:24:29 AM (17 years ago)
Author:
beaumont
Message:

sync with mainline

Location:
branches/cnb_branches/cnb_branch_20090215
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090215

  • branches/cnb_branches/cnb_branch_20090215/ppImage/src/Makefile.am

    r20774 r23199  
    44        ppImage.h
    55
    6 ppImage_CFLAGS = $(PPIMAGE_CFLAGS) $(PPSTATS_CFLAGS) $(PSASTRO_CFLAGS) $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS)
     6PPIMAGE_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi`
     7PPIMAGE_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`
     8PPIMAGE_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi`
     9
     10# Force recompilation of ppImageVersion.c, since it gets the version information
     11ppImageVersion.c: FORCE
     12        touch ppImageVersion.c
     13FORCE: ;
     14
     15ppImage_CFLAGS = $(PPIMAGE_CFLAGS) $(PPSTATS_CFLAGS) $(PSASTRO_CFLAGS) $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPPIMAGE_VERSION=\"$(PPIMAGE_VERSION)\" -DPPIMAGE_BRANCH=\"$(PPIMAGE_BRANCH)\" -DPPIMAGE_SOURCE=\"$(PPIMAGE_SOURCE)\"
    716ppImage_LDFLAGS = $(PPIMAGE_LIBS) $(PSASTRO_LIBS) $(PPSTATS_LIBS) $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS)
    817ppImage_SOURCES = \
  • branches/cnb_branches/cnb_branch_20090215/ppImage/src/ppImage.c

    r19928 r23199  
    2121        exit(PS_EXIT_CONFIG_ERROR);
    2222    }
     23
     24    ppImageVersionPrint();
    2325
    2426    // define recipe options
  • branches/cnb_branches/cnb_branch_20090215/ppImage/src/ppImage.h

    r21364 r23199  
    208208psString ppImageVersion(void);
    209209
     210/// Return software source
     211psString ppImageSource(void);
     212
    210213/// Return long version information
    211214psString ppImageVersionLong(void);
    212215
    213 /// Update the metadata with version information for all dependencies
    214 void ppImageVersionMetadata(psMetadata *metadata ///< Metadata to update with version information
    215     );
     216/// Populate the header with version information for all dependencies
     217bool ppImageVersionHeader(psMetadata *metadata ///< Header to populate
     218    );
     219
     220/// Print version information
     221void ppImageVersionPrint(void);
    216222
    217223
  • branches/cnb_branches/cnb_branch_20090215/ppImage/src/ppImageLoop.c

    r21183 r23199  
    2828    if (dump_file) {
    2929        pmConfigCamerasCull(config, NULL);
    30         pmConfigRecipesCull(config, "PPIMAGE,PPSTATS,PSPHOT,MASKS,PSASTRO");
     30        pmConfigRecipesCull(config, "PPIMAGE,PPSTATS,PSPHOT,MASKS,PSASTRO,JPEG");
    3131
    3232        pmConfigDump(config, input->fpa, dump_file);
     
    6363
    6464            // Put version information into the header
    65             pmHDU *hdu = pmHDUFromCell(cell);
     65            pmHDU *hdu = pmHDUGetHighest(input->fpa, chip, cell);
    6666            if (hdu && hdu != lastHDU) {
    67                 ppImageVersionMetadata(hdu->header);
     67                ppImageVersionHeader(hdu->header);
    6868                lastHDU = hdu;
    6969            }
     
    9696                }
    9797
    98                 // free detrend images potentially in use: MASK, BIAS, DARK, SHUTTER, FLAT
    99                 if (!ppImageDetrendFree (config, view)) {
    100                     ESCAPE("Unable to free detrend images");
    101                 }
     98                // free detrend images potentially in use: MASK, BIAS, DARK, SHUTTER, FLAT
     99                if (!ppImageDetrendFree (config, view)) {
     100                    ESCAPE("Unable to free detrend images");
     101                }
    102102            }
    103103
     
    105105                ppImageDetrendRecord(cell, config, options, view);
    106106            }
    107             // free detrend images potentially in use: MASK, BIAS, DARK, SHUTTER, FLAT
    108             if (!ppImageDetrendFree (config, view)) {
    109                 ESCAPE("Unable to free detrend images");
    110             }
    111         }
    112         // free detrend images potentially in use: MASK, BIAS, DARK, SHUTTER, FLAT
    113         if (!ppImageDetrendFree (config, view)) {
    114             ESCAPE("Unable to free detrend images");
    115         }
     107            // free detrend images potentially in use: MASK, BIAS, DARK, SHUTTER, FLAT
     108            if (!ppImageDetrendFree (config, view)) {
     109                ESCAPE("Unable to free detrend images");
     110            }
     111        }
     112        // free detrend images potentially in use: MASK, BIAS, DARK, SHUTTER, FLAT
     113        if (!ppImageDetrendFree (config, view)) {
     114            ESCAPE("Unable to free detrend images");
     115        }
    116116
    117117        // Apply the fringe correction
     
    121121            }
    122122        }
    123         // free detrend images potentially in use: MASK, BIAS, DARK, SHUTTER, FLAT
    124         if (!ppImageFringeFree (config, view)) {
    125             ESCAPE("Unable to free fringe images");
    126         }
     123        // free detrend images potentially in use: MASK, BIAS, DARK, SHUTTER, FLAT
     124        if (!ppImageFringeFree (config, view)) {
     125            ESCAPE("Unable to free fringe images");
     126        }
    127127
    128128        // measure various pixel-based statistics for this image
     
    152152        }
    153153
    154         // these may be used by ppImageSubtractBackground.
    155         // if these are defined as internal files, drop them here
    156         status = true;
    157         status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");
    158         status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV");
    159         status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND");
    160         if (!status) {
    161             psError(PSPHOT_ERR_PROG, false, "trouble dropping internal files");
    162             psFree (view);
    163             return false;
    164         }
     154        // these may be used by ppImageSubtractBackground.
     155        // if these are defined as internal files, drop them here
     156        status = true;
     157        status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");
     158        status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV");
     159        status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND");
     160        if (!status) {
     161            psError(PSPHOT_ERR_PROG, false, "trouble dropping internal files");
     162            psFree (view);
     163            return false;
     164        }
    165165
    166166        // binning (used for display) must take place after the background is replaced, if desired
  • branches/cnb_branches/cnb_branch_20090215/ppImage/src/ppImageVersion.c

    r14000 r23199  
    55#include "ppImage.h"
    66
    7 static const char *cvsTag = "$Name: not supported by cvs2svn $";// CVS tag name
    8 
    97psString ppImageVersion(void)
    108{
    11     psString version = NULL;            // Version, to return
    12     psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION);
    13     return version;
     9#ifndef PPIMAGE_VERSION
     10#error "PPIMAGE_VERSION is not set"
     11#endif
     12#ifndef PPIMAGE_BRANCH
     13#error "PPIMAGE_BRANCH is not set"
     14#endif
     15    return psStringCopy(PPIMAGE_BRANCH "@" PPIMAGE_VERSION);
     16}
     17
     18psString ppImageSource(void)
     19{
     20#ifndef PPIMAGE_SOURCE
     21#error "PPIMAGE_SOURCE is not set"
     22#endif
     23    return psStringCopy(PPIMAGE_SOURCE);
    1424}
    1525
    1626psString ppImageVersionLong(void)
    1727{
    18     psString version = ppImageVersion(); // Version, to return
    19     psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag
    20     psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__);
    21     psFree(tag);
     28    psString version = ppImageVersion();  // Version, to return
     29    psString source = ppImageSource();    // Source
     30
     31    psStringPrepend(&version, "ppImage ");
     32    psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__);
     33    psFree(source);
     34
     35#ifdef __OPTIMIZE__
     36    psStringAppend(&version, " optimised");
     37#else
     38    psStringAppend(&version, " unoptimised");
     39#endif
     40
    2241    return version;
     42};
     43
     44bool ppImageVersionHeader(psMetadata *header)
     45{
     46    PS_ASSERT_METADATA_NON_NULL(header, false);
     47
     48    psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now
     49    psString timeString = psTimeToISO(time); // The time in an ISO string
     50    psFree(time);
     51    psString history = NULL;               // History string
     52    psStringAppend(&history, "ppImage at %s", timeString);
     53    psFree(timeString);
     54    psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, history);
     55    psFree(history);
     56
     57    psLibVersionHeader(header);
     58    psModulesVersionHeader(header);
     59    psphotVersionHeader(header);
     60    psastroVersionHeader(header);
     61    ppStatsVersionHeader(header);
     62
     63    psString version = ppImageVersion(); // ppImage software version
     64    psString source  = ppImageSource();  // ppImage software source
     65
     66    psMetadataAddStr(header, PS_LIST_TAIL, "IPP.PPIMAGE.VERSION", PS_META_REPLACE,
     67                     "Software version", version);
     68    psMetadataAddStr(header, PS_LIST_TAIL, "IPP.PPIMAGE.SOURCE", PS_META_REPLACE,
     69                     "S/W source", source);
     70
     71    psFree(version);
     72    psFree(source);
     73
     74    return true;
    2375}
    2476
    2577
    26 void ppImageVersionMetadata(psMetadata *metadata)
     78void ppImageVersionPrint(void)
    2779{
    28     PS_ASSERT_METADATA_NON_NULL(metadata,);
     80    psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now
     81    psString timeString = psTimeToISO(time); // The time in an ISO string
     82    psFree(time);
     83    psLogMsg("ppImage", PS_LOG_INFO, "ppImage at %s", timeString);
     84    psFree(timeString);
    2985
    3086    psString pslib = psLibVersionLong();// psLib version
     
    3591    psString ppImage = ppImageVersionLong(); // ppImage version
    3692
    37     psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now
    38     psString timeString = psTimeToISO(time); // The time in an ISO string
    39     psFree(time);
    40     psString head = NULL;               // Head string
    41     psStringAppend(&head, "ppImage processing at %s. Component information:", timeString);
    42     psFree(timeString);
     93    psLogMsg("ppImage", PS_LOG_INFO, "%s", pslib);
     94    psLogMsg("ppImage", PS_LOG_INFO, "%s", psmodules);
     95    psLogMsg("ppImage", PS_LOG_INFO, "%s", psphot);
     96    psLogMsg("ppImage", PS_LOG_INFO, "%s", psastro);
     97    psLogMsg("ppImage", PS_LOG_INFO, "%s", ppStats);
     98    psLogMsg("ppImage", PS_LOG_INFO, "%s", ppImage);
    4399
    44     psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, head, "");
    45     psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, pslib, "");
    46     psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, psmodules, "");
    47     psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, psphot, "");
    48     psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, psastro, "");
    49     psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, ppStats, "");
    50     psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, ppImage, "");
    51 
    52     psFree(head);
    53100    psFree(pslib);
    54101    psFree(psmodules);
Note: See TracChangeset for help on using the changeset viewer.