IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17052


Ignore:
Timestamp:
Mar 18, 2008, 4:08:40 PM (18 years ago)
Author:
Paul Price
Message:

Need strings.h for strcasecmp

Location:
trunk/pstamp/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/src/ppstampMakeStamp.c

    r17047 r17052  
    22#include <config.h>
    33#endif
     4#include <strings.h>
    45
    56#include "ppstamp.h"
     
    122123        lastY = image->row0 + image->numRows;
    123124    }
    124        
     125
    125126    int leftBlank = 0;
    126127    int dstX  = 0;
     
    173174// Build the postage stamp output file
    174175
    175 static bool makeStamp(pmConfig *config, ppstampOptions *options, pmFPAfile *input, 
     176static bool makeStamp(pmConfig *config, ppstampOptions *options, pmFPAfile *input,
    176177                pmChip *inChip, pmFPAview *view)
    177178{
     
    194195
    195196    //   psMetadataPrint(stderr, inChip->concepts, 0);
    196    
     197
    197198    // These default to zero. would that be ok?
    198199    psMetadataAddS32(target->concepts, PS_LIST_TAIL, "CELL.XBIN", PS_META_REPLACE, "Binning in x", 1);
     
    236237        if (ppstampMegacamWorkaround) {
    237238            // the coordinates of the mosaic are shifted 32 pixels from the chip
    238             // TODO does this always apply? For example I doubt that applies to 
     239            // TODO does this always apply? For example I doubt that applies to
    239240            // skycells.
    240241            extractRegion.x0 -= 32;
     
    345346    options->roi.y0 = INFINITY;
    346347    options->roi.y1 = -INFINITY;
    347    
     348
    348349    pt->sky->rErr = 0;
    349350    pt->sky->dErr = 0;
     
    422423
    423424        if (regionContainsPoint(chipBounds, center->chip)) {
    424             psLogMsg("ppstampMakeStamp", 2, "Found center (%f %f) on chip: %s\n", 
     425            psLogMsg("ppstampMakeStamp", 2, "Found center (%f %f) on chip: %s\n",
    425426                center->chip->x, center->chip->y, chipName);
    426427            onChip = true;
    427428        }
    428429    } else {
    429         // center specified in pixels. 
     430        // center specified in pixels.
    430431        // If the user specified a name of a chip name wait until we get to that one.
    431432        // If no chip name was specified, select this one (the first one that had data)
     
    499500    pmChip *chip;
    500501    while ((chip = pmFPAviewNextChip(view, input->fpa, 1)) != NULL) {
    501         bool allDone = false;
     502        bool allDone = false;
    502503
    503504        if (!chip->process || !chip->file_exists) {
     
    518519            break;
    519520        case PPSTAMP_ON:
    520         case PPSTAMP_PARTIALLY_ON:
     521        case PPSTAMP_PARTIALLY_ON:
    521522            returnval = makeStamp(config, options, input, chip, view);
    522523            allDone = true;
     
    532533        }
    533534
    534         pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
     535        pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
    535536
    536537        if (allDone) {
     
    538539            break;
    539540        }
    540     } 
     541    }
    541542    pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
    542543
  • trunk/pstamp/src/pstampparse.c

    r16978 r17052  
    55#include <psmodules.h>
    66#include <string.h>
     7#include <strings.h>
    78#include "pstamp.h"
    89#include "pstampROI.h"
     
    135136        psError(PS_ERR_IO, false, "psFitsReadTable failed for %s", options->fileName);
    136137        return false;
    137     } 
     138    }
    138139
    139140    options->md = array->data[0];
     
    213214    //         target                               key1
    214215    //
    215     // 
     216    //
    216217    // we return an array containing strins for the values
    217218
     
    283284    }
    284285    psU64 len = psArrayLength(array);
    285    
     286
    286287    psString id = NULL;
    287288    if (len > 0) {
     
    322323        return NULL;
    323324
    324     psArray *chip_files = runQuery(options, 
     325    psArray *chip_files = runQuery(options,
    325326                        "SELECT %s from chipProcessedImfile WHERE chip_id = %s AND class_id = '%s'",
    326327                        "uri", chip_id, class_id, true, NULL);
     
    343344    psString warp_id = warpIDForCam(options, cam_id);
    344345
    345     psArray *warp_files = runQuery(options, 
     346    psArray *warp_files = runQuery(options,
    346347                        "SELECT %s from warpSkyfile WHERE warp_id = %s"
    347348                        " AND uri IS NOT NULL and (fault = 0 or fault is NULL)",
     
    384385
    385386    psU64 len = psArrayLength(stackIDs);
    386    
     387
    387388    // loop over the stack's for this exposure and add the images
    388389    for (int i = 0; i < len ; i++ ) {
     
    424425
    425426    psU64 len = psArrayLength(diffIDs);
    426    
     427
    427428    for (int i = 0; i < len ; i++ ) {
    428429        psString diff_id = (psString) diffIDs->data[i];
     
    474475            psString uri = (psString) uris->data[i];
    475476            printf("uri: %s\n", uri ? (psString) uri : "NULL uri");
    476         } 
     477        }
    477478#endif
    478479
     
    484485{
    485486    psArray *results;
    486    
     487
    487488    results = runQuery(options, "SELECT %s from rawExp WHERE exp_name = '%s'",
    488489                        "exp_id", exposure, NULL, false, NULL);
     
    603604    psString cmd = NULL;
    604605
    605     psStringAppend(&cmd, "pstamptool -addjob -req_id %ld -job_type %s -uri %s ", 
     606    psStringAppend(&cmd, "pstamptool -addjob -req_id %ld -job_type %s -uri %s ",
    606607        options->req_id, job_type, uri);
    607    
     608
    608609    if (outputBase != NULL) {
    609610        psStringAppend(&cmd, "-outputBase ");
    610    
     611
    611612        if (options->outputDirectory) {
    612613            psStringAppend(&cmd, "%s/", options->outputDirectory);
     
    646647        for (int i = 0; i< numURIs; i++) {
    647648            psString outputBase = NULL;
    648            
     649
    649650            // append an integer to the user_tag to get a uniqueu outputBase
    650651            psStringAppend(&outputBase, "%s_%d", user_tag, i);
     
    677678    psString    img_type = psMetadataLookupStr(NULL, options->md, "IMG_TYPE");
    678679
    679     if (! turnOffResultsFile(options)) { 
     680    if (! turnOffResultsFile(options)) {
    680681        fprintf(stderr, "failed to update resultsFile for request %" PRId64 "\n", options->req_id);
    681682        return false;
     
    700701
    701702    psString cmd = NULL;
    702     psStringAppend(&cmd, "pstamptool -addjob -req_id %ld -job_type get_image -uri %s -outputBase %s", 
     703    psStringAppend(&cmd, "pstamptool -addjob -req_id %ld -job_type get_image -uri %s -outputBase %s",
    703704        options->req_id, fileName, options->outputDirectory);
    704    
     705
    705706    int rstatus = system(cmd);
    706707    if (rstatus) {
     
    792793            // TODO: the ppstamp argument needs to change to class_id
    793794            // perhaps allow chip as a synonym
    794             psStringAppend(&commandArgs, " -chip %s", class_id); 
     795            psStringAppend(&commandArgs, " -chip %s", class_id);
    795796        }
    796797        psString user_tag = psMetadataLookupStr(&status, options->md, "USER_TAG");
     
    839840
    840841    // XXX: create a set of status codes to return so the
    841     // scripts can distinguish between different errors. 
     842    // scripts can distinguish between different errors.
    842843    // For example:
    843844    //      If we can't connect to the DB it's a configuration problem.
Note: See TracChangeset for help on using the changeset viewer.