Changeset 35561
- Timestamp:
- May 9, 2013, 12:24:53 PM (13 years ago)
- Location:
- trunk/psModules
- Files:
-
- 10 edited
-
. (modified) (1 prop)
-
src/astrom/pmAstrometryUtils.c (modified) (4 diffs)
-
src/camera/pmFPAConstruct.c (modified) (4 diffs)
-
src/camera/pmFPACopy.c (modified) (2 diffs)
-
src/camera/pmFPAFlags.c (modified) (2 diffs)
-
src/camera/pmFPAFlags.h (modified) (1 diff)
-
src/camera/pmFPAMaskWeight.c (modified) (1 diff)
-
src/camera/pmFPAfileDefine.c (modified) (16 diffs)
-
src/camera/pmFPAfileDefine.h (modified) (1 diff)
-
src/camera/pmFPAfileIO.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules
- Property svn:mergeinfo changed
-
trunk/psModules/src/astrom/pmAstrometryUtils.c
r24096 r35561 23 23 #include "pmAstrometryUtils.h" 24 24 25 // this is used by the test output block 26 static int Nout = 0; 27 25 28 // given a 2D transformation -- L(x,y),M(x,y) -- find the coordinates x,y 26 29 // for which L,M = 0,0. tol is the allowed error on x,y. … … 33 36 double Xo = (trans->y->coeff[0][0]*trans->x->coeff[0][1] - trans->x->coeff[0][0]*trans->y->coeff[0][1])/R; 34 37 double Yo = (trans->x->coeff[0][0]*trans->y->coeff[1][0] - trans->y->coeff[0][0]*trans->x->coeff[1][0])/R; 38 39 if (0) { 40 // this is a test output block, not used in normal operations 41 char filename[64]; 42 snprintf (filename, 64, "trans.%03d.md", Nout); 43 FILE *f = fopen (filename, "w"); 44 45 psMetadata *md = psMetadataAlloc(); 46 47 psPolynomial2DtoMetadata (md, trans->x, "X"); 48 psPolynomial2DtoMetadata (md, trans->y, "Y"); 49 psMetadataConfigPrint (f, md); 50 psFree (md); 51 fclose (f); 52 Nout ++; 53 } 35 54 36 55 // iterate to actual solution: requires small non-linear terms … … 52 71 for (int i = 0; (dPos > tol) && (i < 20); i++) { 53 72 // NOTE: order for Alpha is: [y][x] 73 // original Alpha->data.F32[1][0] = psPolynomial2DEval (XdY, Xo, Yo); 74 // original Alpha->data.F32[0][1] = psPolynomial2DEval (YdX, Xo, Yo); 54 75 Alpha->data.F32[0][0] = psPolynomial2DEval (XdX, Xo, Yo); 55 Alpha->data.F32[ 1][0] = psPolynomial2DEval (XdY, Xo, Yo);56 Alpha->data.F32[ 0][1] = psPolynomial2DEval (YdX, Xo, Yo);76 Alpha->data.F32[0][1] = psPolynomial2DEval (XdY, Xo, Yo); 77 Alpha->data.F32[1][0] = psPolynomial2DEval (YdX, Xo, Yo); 57 78 Alpha->data.F32[1][1] = psPolynomial2DEval (YdY, Xo, Yo); 58 79 59 Beta->data.F32[0] = psPolynomial2DEval (trans->x, Xo, Yo);60 Beta->data.F32[1] = psPolynomial2DEval (trans->y, Xo, Yo);80 Beta->data.F32[0] = -1.0 * psPolynomial2DEval (trans->x, Xo, Yo); 81 Beta->data.F32[1] = -1.0 * psPolynomial2DEval (trans->y, Xo, Yo); 61 82 62 83 if (!psMatrixGJSolve (Alpha, Beta)) { … … 71 92 } 72 93 73 Xo -= Beta->data.F32[0];74 Yo -= Beta->data.F32[1];94 Xo += Beta->data.F32[0]; 95 Yo += Beta->data.F32[1]; 75 96 dPos = hypot(Beta->data.F32[0], Beta->data.F32[1]); 76 97 psTrace ("psastro", 5, "i: %d, Xo,Yo : %f %f dX, dY: %f %f dPos: %f\n", i, Xo, Yo, Beta->data.F32[0], Beta->data.F32[1], dPos); 77 98 } 78 99 psFree (Alpha); -
trunk/psModules/src/camera/pmFPAConstruct.c
r27989 r35561 110 110 assert(hdu); 111 111 112 // XXXX here is the issue : we need to avoid raising an error here 112 113 if (fpa->hdu) { 113 114 // Something's already here 114 115 if (fpa->hdu != hdu) { 115 psError(PS_ERR_IO, true, "Unable to add HDU since FPA already has one.\n"); 116 } 117 return false; 116 # define TEST1 1 117 # if (TEST1) 118 psError(PS_ERR_IO, true, "Unable to add HDU since FPA already has one.\n"); 119 # else 120 psWarning ("Unable to add HDU since FPA already has one.\n"); 121 # endif 122 } 123 # if (TEST1) 124 return false; 125 # else 126 return true; 127 # endif 118 128 } 119 129 fpa->hdu = psMemIncrRefCounter(hdu); … … 1154 1164 phdu->blankPHU = true; 1155 1165 if (install) { 1156 if (!addHDUtoFPA(fpa, phdu) || !addSource_FPA_CHIP(fpa, format) || 1157 !pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_PHU, 1158 true, NULL)) { 1166 if (!addHDUtoFPA(fpa, phdu)) { 1167 psError(PS_ERR_UNKNOWN, false, "Unable to add HDU to FPA."); 1168 psFree(phdu); 1169 psFree(view); 1170 return NULL; 1171 } 1172 if (!addSource_FPA_CHIP(fpa, format)) { 1159 1173 psError(PS_ERR_UNKNOWN, false, "Unable to add source."); 1160 1174 psFree(phdu); … … 1162 1176 return NULL; 1163 1177 } 1164 } 1178 if (!pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_PHU, true, NULL)) { 1179 psError(PS_ERR_UNKNOWN, false, "Unable to read concepts."); 1180 psFree(phdu); 1181 psFree(view); 1182 return NULL; 1183 } 1184 } 1165 1185 psFree(phdu); 1166 1186 return view; 1167 1187 case PM_FPA_LEVEL_CELL: 1188 phdu->blankPHU = true; 1168 1189 if (install) { 1169 phdu->blankPHU = true; 1170 if (!addHDUtoFPA(fpa, phdu) || !addSource_FPA_CELL(fpa, format) || 1171 !pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_PHU, 1172 true, NULL)) { 1190 if (!addHDUtoFPA(fpa, phdu)) { 1191 psError(PS_ERR_UNKNOWN, false, "Unable to add HDU to FPA."); 1192 psFree(phdu); 1193 psFree(view); 1194 return NULL; 1195 } 1196 if (!addSource_FPA_CELL(fpa, format)) { 1173 1197 psError(PS_ERR_UNKNOWN, false, "Unable to add source."); 1198 psFree(phdu); 1199 psFree(view); 1200 return NULL; 1201 } 1202 if (!pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_PHU, true, NULL)) { 1203 psError(PS_ERR_UNKNOWN, false, "Unable to read concepts."); 1174 1204 psFree(phdu); 1175 1205 psFree(view); … … 1180 1210 return view; 1181 1211 case PM_FPA_LEVEL_NONE: 1212 phdu->blankPHU = false; 1182 1213 if (install) { 1183 phdu->blankPHU = false; 1184 if (!addHDUtoFPA(fpa, phdu) || !addSource_FPA_NONE(fpa, format) || 1185 !pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_PHU, 1186 true, NULL)) { 1214 if (!addHDUtoFPA(fpa, phdu)) { 1215 psError(PS_ERR_UNKNOWN, false, "Unable to add HDU to FPA."); 1216 psFree(phdu); 1217 psFree(view); 1218 return NULL; 1219 } 1220 if (!addSource_FPA_NONE(fpa, format)) { 1187 1221 psError(PS_ERR_UNKNOWN, false, "Unable to add source."); 1222 psFree(phdu); 1223 psFree(view); 1224 return NULL; 1225 } 1226 if (!pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_PHU, true, NULL)) { 1227 psError(PS_ERR_UNKNOWN, false, "Unable to read concepts."); 1188 1228 psFree(phdu); 1189 1229 psFree(view); -
trunk/psModules/src/camera/pmFPACopy.c
r24480 r35561 480 480 pmCell *sourceCell = sourceCells->data[cellNum]; // The source cell 481 481 status &= cellCopy(targetCell, sourceCell, pixels, xBin, yBin); 482 // update the attributes 483 targetCell->file_exists = sourceCell->file_exists; 484 targetCell->data_exists = sourceCell->data_exists; 485 targetCell->process = sourceCell->process; 482 486 } 483 487 } … … 489 493 psMetadataItem *chipName = psMemIncrRefCounter(psMetadataLookup(target->concepts, "CHIP.NAME")); 490 494 pmConceptsCopyChip(target, source, false); 495 496 // update the attributes 497 target->file_exists = source->file_exists; 498 target->data_exists = source->data_exists; 499 target->process = source->process; 500 491 501 psMetadataAddItem(target->concepts, chipName, PS_LIST_TAIL, PS_META_REPLACE); 492 502 psFree(chipName); -
trunk/psModules/src/camera/pmFPAFlags.c
r29935 r35561 379 379 } 380 380 } 381 } 382 return true; 383 } 384 385 386 // XXX this function should probably be re-defined to merge with 'setCellsProcess' 387 bool pmChipSelectCells(pmChip *chip) 388 { 389 PS_ASSERT_PTR_NON_NULL(chip, false); 390 391 psArray *cells = chip->cells; // Component cells 392 if (!cells) { 393 return false; 394 } 395 396 for (int i = 0; i < cells->n; i++) { 397 pmCell *cell = cells->data[i]; 398 if (!cell) { 399 continue; 400 } 401 cell->process = true; 381 402 } 382 403 return true; … … 415 436 416 437 438 // turn off all chips 439 bool pmFPAExcludeChips(pmFPA *fpa) 440 { 441 PS_ASSERT_PTR_NON_NULL(fpa, false); 442 443 psArray *chips = fpa->chips; // Component chips 444 if (chips == NULL) { 445 psWarning("WARNING: fpa->chips == NULL\n"); 446 return false; 447 } 448 449 for (int i = 0 ; i < chips->n ; i++) { 450 pmChip *tmpChip = (pmChip *) chips->data[i]; // Chip of interest 451 if (tmpChip != NULL) { 452 tmpChip->process = false; 453 setCellsProcess(tmpChip, false); // Wipe out the cell as well 454 } 455 } 456 457 return true; 458 } 459 417 460 int pmChipExcludeCell(pmChip *chip, int cellNum) 418 461 { -
trunk/psModules/src/camera/pmFPAFlags.h
r29935 r35561 122 122 ); 123 123 124 /// Exclude all chips within an FPA from processing 125 bool pmFPAExcludeChips(pmFPA *fpa ///< FPA containing the chip of interest 126 ); 127 128 bool pmChipSelectCells(pmChip *chip); 129 124 130 /// Exclude a cell within a chip from processing 125 131 int pmChipExcludeCell(pmChip *chip, ///< Chip containing the chip of interest -
trunk/psModules/src/camera/pmFPAMaskWeight.c
r35038 r35561 301 301 psRegion *trimsec = psMetadataLookupPtr(&mdok, cell->concepts, "CELL.TRIMSEC"); // Trim section 302 302 if (!mdok || psRegionIsNaN(*trimsec)) { 303 psError(PS_ERR_IO, true, "CELL.TRIMSEC is not set --- unable to set variance.\n"); 304 return false; 303 // if trimsec is not defined, use the full image 304 trimsec = psRegionAlloc(0,0,0,0); 305 // psError(PS_ERR_IO, true, "CELL.TRIMSEC is not set --- unable to set variance.\n"); 306 // return false; 305 307 } 306 308 -
trunk/psModules/src/camera/pmFPAfileDefine.c
r34085 r35561 446 446 } 447 447 448 // given a filename, convert to UNIX namespace and read the PHU 449 psMetadata *readPHUfromFilename (char *filename, pmConfig *config) { 450 451 // Need to generate an FPA 452 psString realName = pmConfigConvertFilename(filename, config, false, false); 453 if (!realName) { 454 psError(psErrorCodeLast(), false, "Failed to convert file name %s", filename); 455 return NULL; 456 } 457 458 // load the header of the first image 459 // EXTWORD (fits->extword) is not relevant to the PHU 460 psFits *fits = psFitsOpen(realName, "r"); // FITS file 461 if (!fits) { 462 psError(psErrorCodeLast(), false, "Failed to open file %s", realName); 463 psFree(realName); 464 return NULL; 465 } 466 467 psMetadata *phu = psFitsReadHeader (NULL, fits); // Primary header 468 if (!phu) { 469 psError(psErrorCodeLast(), false, "Failed to read file header %s", realName); 470 psFree(realName); 471 return NULL; 472 } 473 474 if (!psFitsClose(fits)) { 475 psError(psErrorCodeLast(), false, "Failed to close file %s", realName); 476 psFree(realName); 477 psFree(phu); 478 return NULL; 479 } 480 481 psFree(realName); 482 return phu; 483 } 484 485 // this this function wants to return: 486 // pmFPA, PHU, fileLevel, outConfig 487 // camera, cameraName, formatName 488 typedef struct { 489 pmFPA *fpa; 490 psMetadata *phu; 491 psMetadata *format; 492 pmFPALevel fileLevel; 493 psString cameraName; 494 psString formatName; 495 } pmFPAfromFilenameOutput; 496 497 // for the given filename, read PHU and determine camera format; build an FPA for the file 498 bool pmFPAfromFilename (pmFPAfromFilenameOutput *output, pmConfig **outConfig, pmConfig *sysConfig, char *filename){ 499 500 // Need to generate an FPA 501 psMetadata *phu = readPHUfromFilename (filename, sysConfig); 502 if (!phu) { 503 psError(psErrorCodeLast(), false, "Failed to read PHU for %s", filename); 504 return false; 505 } 506 507 // if we expect the loaded FPA to differ in configuration from the current system configuration 508 // generate an output config for this FPA 509 pmConfig *config = NULL; 510 if (outConfig) { 511 config = pmConfigAlloc(); 512 config->user = psMemIncrRefCounter(sysConfig->user); 513 config->system = psMemIncrRefCounter(sysConfig->system); 514 515 psFree (config->files); 516 config->files = psMemIncrRefCounter(sysConfig->files); 517 psFree (config->arguments); 518 config->arguments = psMemIncrRefCounter(sysConfig->arguments); 519 520 *outConfig = config; 521 } else { 522 config = sysConfig; 523 } 524 525 // values which are returned to calling function 526 psString formatName = NULL; // Name of camera format 527 psString cameraName = NULL; // Name of camera 528 psMetadata *camera = NULL; // Camera configuration 529 530 // Determine the current format from the header; determine camera if not specified already. 531 psMetadata *format = pmConfigCameraFormatFromHeader(&camera, &cameraName, &formatName, config, phu, true); 532 if (!format) { 533 psError(psErrorCodeLast(), false, "Failed to determine camera format for %s", filename); 534 psFree(camera); 535 psFree(formatName); 536 psFree(phu); 537 return false; 538 } 539 540 pmFPALevel fileLevel = pmFPAPHULevel(format); 541 if (fileLevel == PM_FPA_LEVEL_NONE) { 542 psError(PM_ERR_CONFIG, true, "Unable to determine file level for %s", filename); 543 psFree(camera); 544 psFree(formatName); 545 psFree(phu); 546 return false; 547 } 548 549 // build the template fpa, set up the basic view 550 // we supply the metaCamera name (if NULL, baseCamera name is used) 551 pmFPA *fpa = pmFPAConstruct(camera, cameraName); 552 psFree(camera); 553 554 if (!fpa) { 555 psError(psErrorCodeLast(), false, "Failed to construct FPA from %s", filename); 556 psFree(formatName); 557 psFree(format); 558 psFree(phu); 559 return NULL; 560 } 561 562 output->fpa = fpa; 563 output->phu = phu; 564 output->format = format; 565 output->fileLevel = fileLevel; 566 output->cameraName = cameraName; 567 output->formatName = formatName; 568 569 return true; 570 571 } 448 572 449 573 /// Define a file from an array of filenames 450 static pmFPAfile *fpaFileDefineFromArray(pmConfig *config, // Configuration 574 static pmFPAfile *fpaFileDefineFromArray(pmConfig **outConfig, // output configuration 575 pmConfig *sysConfig, // global configuration 451 576 pmFPAfile *bind, // File to bind to, or NULL 452 577 const char *name, // Name of file … … 454 579 ) 455 580 { 456 PS_ASSERT_PTR_NON_NULL( config, NULL);581 PS_ASSERT_PTR_NON_NULL(sysConfig, NULL); 457 582 PS_ASSERT_STRING_NON_EMPTY(name, NULL); 458 583 … … 463 588 pmFPALevel fileLevel = PM_FPA_LEVEL_NONE; // Level for files 464 589 psMetadata *phu = NULL; // Primary header 590 465 591 if (bind) { 466 592 // Use the FPA we're binding to … … 468 594 fileLevel = bind->fileLevel; 469 595 } else { 470 // Need to generate an FPA 471 psString realName = pmConfigConvertFilename(filenames->data[0], config, false, false); 472 if (!realName) { 473 psError(psErrorCodeLast(), false, "Failed to convert file name %s", (char *)filenames->data[0]); 474 return NULL; 475 } 476 477 // load the header of the first image 478 // EXTWORD (fits->extword) is not relevant to the PHU 479 psFits *fits = psFitsOpen(realName, "r"); // FITS file 480 if (!fits) { 481 psError(psErrorCodeLast(), false, "Failed to open file %s", realName); 482 psFree(realName); 483 return NULL; 484 } 485 phu = psFitsReadHeader (NULL, fits); // Primary header 486 if (!phu) { 487 psError(psErrorCodeLast(), false, "Failed to read file header %s", realName); 488 psFree(realName); 489 return NULL; 490 } 491 if (!psFitsClose(fits)) { 492 psError(psErrorCodeLast(), false, "Failed to close file %s", realName); 493 psFree(realName); 494 return NULL; 495 } 496 497 // Determine the current format from the header; determine camera if not specified already. 498 psMetadata *camera = NULL; // Camera configuration 499 format = pmConfigCameraFormatFromHeader(&camera, &cameraName, &formatName, config, phu, true); 500 if (!format) { 501 psError(psErrorCodeLast(), false, "Failed to determine camera format for %s", realName); 502 psFree(camera); 503 psFree(formatName); 504 psFree(realName); 505 psFree(phu); 506 return NULL; 507 } 508 509 fileLevel = pmFPAPHULevel(format); 510 if (fileLevel == PM_FPA_LEVEL_NONE) { 511 psError(PM_ERR_CONFIG, true, "Unable to determine file level for %s", realName); 512 psFree(camera); 513 psFree(formatName); 514 psFree(realName); 515 psFree(phu); 516 return NULL; 517 } 518 519 // build the template fpa, set up the basic view 520 // XXX do we want this to be the baseCamera name or the metaCamera name? 521 fpa = pmFPAConstruct(camera, cameraName); 522 psFree(camera); 523 if (!fpa) { 524 psError(psErrorCodeLast(), false, "Failed to construct FPA from %s", realName); 525 psFree(formatName); 526 psFree(realName); 527 psFree(format); 528 psFree(phu); 529 return NULL; 530 } 531 psFree(realName); 532 } 596 pmFPAfromFilenameOutput output; 597 if (!pmFPAfromFilename (&output, outConfig, sysConfig, filenames->data[0])) { 598 return NULL; 599 } 600 fpa = output.fpa; 601 phu = output.phu; 602 format = output.format; 603 fileLevel = output.fileLevel; 604 cameraName = output.cameraName; 605 formatName = output.formatName; 606 } 607 608 pmConfig *config = outConfig ? *outConfig : sysConfig; 533 609 534 610 // load the given filerule (from config->camera) and bind it to the fpa … … 561 637 // Check that the file corresponds to the same camera and format 562 638 if (!phu) { 563 psString realName = pmConfigConvertFilename(filenames->data[i], config, false, false);564 if (! realName) {565 psError(psErrorCodeLast(), false, "Failed to convert file name %s", (char*)filenames->data[i]);639 phu = readPHUfromFilename (filenames->data[i], config); 640 if (!phu) { 641 psError(psErrorCodeLast(), false, "Failed to read PHU for %s", (char *)filenames->data[i]); 566 642 return NULL; 567 643 } 568 psFits *fits = psFitsOpen(realName, "r"); // FITS file569 if (!fits) {570 psError(psErrorCodeLast(), false, "Failed to open file %s", realName);571 psFree(realName);572 return NULL;573 }574 phu = psFitsReadHeader(NULL, fits);575 if (!psFitsClose(fits)) {576 psError(psErrorCodeLast(), false, "Failed to close file %s", realName);577 psFree(realName);578 return NULL;579 }580 if (!phu) {581 psError(psErrorCodeLast(), false, "Failed to read file header %s", realName);582 psFree(realName);583 return NULL;584 }585 psFree(realName);586 644 } 587 645 … … 651 709 } 652 710 653 654 pmFPAfile *pmFPAfileDefineFromArgs(bool *success, pmConfig *config, 655 const char *filename, const char *argname) 711 // find the file associated with the argname & generate a pmFPAfile for it based on the filerule 712 pmFPAfile *pmFPAfileDefineFromArgs(bool *success, pmConfig *config, const char *filename, const char *argname) 656 713 { 657 714 PS_ASSERT_PTR_NON_NULL(config, NULL); … … 676 733 } 677 734 678 pmFPAfile *file = fpaFileDefineFromArray( config, NULL, filename, filenames); // File of interest735 pmFPAfile *file = fpaFileDefineFromArray(NULL, config, NULL, filename, filenames); // File of interest 679 736 680 737 if (success) { … … 685 742 } 686 743 687 pmFPAfile *pmFPAfileBindFromArgs(bool *success, pmFPAfile *input, pmConfig *config, 688 const char *filename, const char *argname)744 // find the file associated with the argname & bind it to the given pmFPAfile for it based on the filerule 745 pmFPAfile *pmFPAfileBindFromArgs(bool *success, pmFPAfile *input, pmConfig *config, const char *filename, const char *argname) 689 746 { 690 747 PS_ASSERT_PTR_NON_NULL(input, NULL); … … 710 767 } 711 768 712 pmFPAfile *file = fpaFileDefineFromArray( config, input, filename, filenames); // File of interest769 pmFPAfile *file = fpaFileDefineFromArray(NULL, config, input, filename, filenames); // File of interest 713 770 714 771 if (success) { … … 719 776 } 720 777 721 pmFPAfile *pmFPAfileDefineSingleFromArgs(bool *success, pmConfig *config, const char *filename, 722 const char *argname, int entry)778 // find the specific file associated with the argname & generate a pmFPAfile for it based on the filerule 779 pmFPAfile *pmFPAfileDefineSingleFromArgs(bool *success, pmConfig *config, const char *filename, const char *argname, int entry) 723 780 { 724 781 PS_ASSERT_PTR_NON_NULL(config, NULL); … … 746 803 psArray *single = psArrayAlloc(1); // Array of single filename of interest 747 804 single->data[0] = psMemIncrRefCounter(filenames->data[entry]); 748 pmFPAfile *file = fpaFileDefineFromArray( config, NULL, filename, single); // File of interest805 pmFPAfile *file = fpaFileDefineFromArray(NULL, config, NULL, filename, single); // File of interest 749 806 psFree(single); 750 807 … … 756 813 } 757 814 815 // find the file in the config list & generate a pmFPAfile for it based on the filerule 758 816 pmFPAfile *pmFPAfileDefineFromRun(bool *success, pmFPAfile *bind, pmConfig *config, const char *filename) 759 817 { … … 769 827 } 770 828 771 pmFPAfile *file = fpaFileDefineFromArray( config, bind, filename, filenames); // File of interest829 pmFPAfile *file = fpaFileDefineFromArray(NULL, config, bind, filename, filenames); // File of interest 772 830 psFree(filenames); 773 831 … … 779 837 } 780 838 839 // find the files in the config list & generate an array of pmFPAfiles for them based on the filerule 781 840 psArray *pmFPAfileDefineMultipleFromRun(bool *success, psArray *bind, pmConfig *config, const char *filename) 782 841 { … … 808 867 dummy->data[0] = files->data[i]; 809 868 pmFPAfile *bindFile = bind ? bind->data[i] : NULL; // File to which to bind 810 files->data[i] = psMemIncrRefCounter(fpaFileDefineFromArray( config, bindFile, filename, dummy));869 files->data[i] = psMemIncrRefCounter(fpaFileDefineFromArray(NULL, config, bindFile, filename, dummy)); 811 870 if (!files->data[i]) { 812 871 psError(psErrorCodeLast(), false, "Unable to define file %s %d", filename, i); … … 823 882 824 883 return files; 884 } 885 886 // find the file associated with the argname & generate a pmFPAfile for it based on the filerule 887 pmFPAfile *pmFPAfileDefineNewConfig(bool *success, pmConfig **outConfig, pmConfig *sysConfig, const char *filename, const char *argname) 888 { 889 PS_ASSERT_PTR_NON_NULL(outConfig, NULL); 890 PS_ASSERT_PTR_NON_NULL(sysConfig, NULL); 891 PS_ASSERT_STRING_NON_EMPTY(filename, NULL); 892 PS_ASSERT_STRING_NON_EMPTY(argname, NULL); 893 894 // Search the argument data for the named fileset (argname) 895 bool status; // Status of MD lookup 896 psArray *filenames = psMetadataLookupPtr(&status, sysConfig->arguments, argname); // Filenames for file 897 if (!status) { 898 if (success) { 899 *success = true; 900 } 901 return NULL; 902 } 903 if (filenames->n == 0) { 904 psError(PM_ERR_CONFIG, true, "No files in array in %s in arguments", argname); 905 if (success) { 906 *success = false; 907 } 908 return NULL; 909 } 910 911 pmFPAfile *file = fpaFileDefineFromArray(outConfig, sysConfig, NULL, filename, filenames); // File of interest 912 913 if (success) { 914 *success = file ? true : false; 915 } 916 917 return file; 825 918 } 826 919 -
trunk/psModules/src/camera/pmFPAfileDefine.h
r27657 r35561 81 81 const char *filename ///< Name of file 82 82 ); 83 84 // find the file associated with the argname & generate a pmFPAfile for it based on the filerule 85 pmFPAfile *pmFPAfileDefineNewConfig( 86 bool *success, ///< Found files? 87 pmConfig **outConfig, ///< output configuration for this file 88 pmConfig *sysConfig, ///< existing system config info 89 const char *filename, ///< name of filerule 90 const char *argname ///< argument entry 91 ); 92 83 93 84 94 // look for the given argname on the argument list. find the give filename from the file rules -
trunk/psModules/src/camera/pmFPAfileIO.c
r34800 r35561 382 382 // (existing) fpa 383 383 if (file->type == PM_FPA_FILE_CMF) { 384 if (!pmFPAviewCheckDataStatusForSources (view, file)) {385 psTrace("psModules.camera", 6, "skip write for %s, no data for this entry", file->name);386 return true;387 }384 if (!pmFPAviewCheckDataStatusForSources (view, file)) { 385 psTrace("psModules.camera", 6, "skip write for %s, no data for this entry", file->name); 386 return true; 387 } 388 388 } 389 389 if (file->type == PM_FPA_FILE_PSF) {
Note:
See TracChangeset
for help on using the changeset viewer.
