Changeset 17052
- Timestamp:
- Mar 18, 2008, 4:08:40 PM (18 years ago)
- Location:
- trunk/pstamp/src
- Files:
-
- 2 edited
-
ppstampMakeStamp.c (modified) (11 diffs)
-
pstampparse.c (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/src/ppstampMakeStamp.c
r17047 r17052 2 2 #include <config.h> 3 3 #endif 4 #include <strings.h> 4 5 5 6 #include "ppstamp.h" … … 122 123 lastY = image->row0 + image->numRows; 123 124 } 124 125 125 126 int leftBlank = 0; 126 127 int dstX = 0; … … 173 174 // Build the postage stamp output file 174 175 175 static bool makeStamp(pmConfig *config, ppstampOptions *options, pmFPAfile *input, 176 static bool makeStamp(pmConfig *config, ppstampOptions *options, pmFPAfile *input, 176 177 pmChip *inChip, pmFPAview *view) 177 178 { … … 194 195 195 196 // psMetadataPrint(stderr, inChip->concepts, 0); 196 197 197 198 // These default to zero. would that be ok? 198 199 psMetadataAddS32(target->concepts, PS_LIST_TAIL, "CELL.XBIN", PS_META_REPLACE, "Binning in x", 1); … … 236 237 if (ppstampMegacamWorkaround) { 237 238 // 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 239 240 // skycells. 240 241 extractRegion.x0 -= 32; … … 345 346 options->roi.y0 = INFINITY; 346 347 options->roi.y1 = -INFINITY; 347 348 348 349 pt->sky->rErr = 0; 349 350 pt->sky->dErr = 0; … … 422 423 423 424 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", 425 426 center->chip->x, center->chip->y, chipName); 426 427 onChip = true; 427 428 } 428 429 } else { 429 // center specified in pixels. 430 // center specified in pixels. 430 431 // If the user specified a name of a chip name wait until we get to that one. 431 432 // If no chip name was specified, select this one (the first one that had data) … … 499 500 pmChip *chip; 500 501 while ((chip = pmFPAviewNextChip(view, input->fpa, 1)) != NULL) { 501 bool allDone = false;502 bool allDone = false; 502 503 503 504 if (!chip->process || !chip->file_exists) { … … 518 519 break; 519 520 case PPSTAMP_ON: 520 case PPSTAMP_PARTIALLY_ON:521 case PPSTAMP_PARTIALLY_ON: 521 522 returnval = makeStamp(config, options, input, chip, view); 522 523 allDone = true; … … 532 533 } 533 534 534 pmFPAfileIOChecks(config, view, PM_FPA_AFTER);535 pmFPAfileIOChecks(config, view, PM_FPA_AFTER); 535 536 536 537 if (allDone) { … … 538 539 break; 539 540 } 540 } 541 } 541 542 pmFPAfileIOChecks(config, view, PM_FPA_AFTER); 542 543 -
trunk/pstamp/src/pstampparse.c
r16978 r17052 5 5 #include <psmodules.h> 6 6 #include <string.h> 7 #include <strings.h> 7 8 #include "pstamp.h" 8 9 #include "pstampROI.h" … … 135 136 psError(PS_ERR_IO, false, "psFitsReadTable failed for %s", options->fileName); 136 137 return false; 137 } 138 } 138 139 139 140 options->md = array->data[0]; … … 213 214 // target key1 214 215 // 215 // 216 // 216 217 // we return an array containing strins for the values 217 218 … … 283 284 } 284 285 psU64 len = psArrayLength(array); 285 286 286 287 psString id = NULL; 287 288 if (len > 0) { … … 322 323 return NULL; 323 324 324 psArray *chip_files = runQuery(options, 325 psArray *chip_files = runQuery(options, 325 326 "SELECT %s from chipProcessedImfile WHERE chip_id = %s AND class_id = '%s'", 326 327 "uri", chip_id, class_id, true, NULL); … … 343 344 psString warp_id = warpIDForCam(options, cam_id); 344 345 345 psArray *warp_files = runQuery(options, 346 psArray *warp_files = runQuery(options, 346 347 "SELECT %s from warpSkyfile WHERE warp_id = %s" 347 348 " AND uri IS NOT NULL and (fault = 0 or fault is NULL)", … … 384 385 385 386 psU64 len = psArrayLength(stackIDs); 386 387 387 388 // loop over the stack's for this exposure and add the images 388 389 for (int i = 0; i < len ; i++ ) { … … 424 425 425 426 psU64 len = psArrayLength(diffIDs); 426 427 427 428 for (int i = 0; i < len ; i++ ) { 428 429 psString diff_id = (psString) diffIDs->data[i]; … … 474 475 psString uri = (psString) uris->data[i]; 475 476 printf("uri: %s\n", uri ? (psString) uri : "NULL uri"); 476 } 477 } 477 478 #endif 478 479 … … 484 485 { 485 486 psArray *results; 486 487 487 488 results = runQuery(options, "SELECT %s from rawExp WHERE exp_name = '%s'", 488 489 "exp_id", exposure, NULL, false, NULL); … … 603 604 psString cmd = NULL; 604 605 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 ", 606 607 options->req_id, job_type, uri); 607 608 608 609 if (outputBase != NULL) { 609 610 psStringAppend(&cmd, "-outputBase "); 610 611 611 612 if (options->outputDirectory) { 612 613 psStringAppend(&cmd, "%s/", options->outputDirectory); … … 646 647 for (int i = 0; i< numURIs; i++) { 647 648 psString outputBase = NULL; 648 649 649 650 // append an integer to the user_tag to get a uniqueu outputBase 650 651 psStringAppend(&outputBase, "%s_%d", user_tag, i); … … 677 678 psString img_type = psMetadataLookupStr(NULL, options->md, "IMG_TYPE"); 678 679 679 if (! turnOffResultsFile(options)) { 680 if (! turnOffResultsFile(options)) { 680 681 fprintf(stderr, "failed to update resultsFile for request %" PRId64 "\n", options->req_id); 681 682 return false; … … 700 701 701 702 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", 703 704 options->req_id, fileName, options->outputDirectory); 704 705 705 706 int rstatus = system(cmd); 706 707 if (rstatus) { … … 792 793 // TODO: the ppstamp argument needs to change to class_id 793 794 // perhaps allow chip as a synonym 794 psStringAppend(&commandArgs, " -chip %s", class_id); 795 psStringAppend(&commandArgs, " -chip %s", class_id); 795 796 } 796 797 psString user_tag = psMetadataLookupStr(&status, options->md, "USER_TAG"); … … 839 840 840 841 // 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. 842 843 // For example: 843 844 // If we can't connect to the DB it's a configuration problem.
Note:
See TracChangeset
for help on using the changeset viewer.
