IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42856


Ignore:
Timestamp:
May 9, 2025, 2:37:03 PM (14 months ago)
Author:
eugene
Message:

fix broken input config files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSub/src/ppSubCamera.c

    r42624 r42856  
    359359    }
    360360
     361    int did_rewrite = 0;
     362   
    361363    // Use a temporary config for the reference image, keeping the main user, site,
    362364    // system, files, arguments entries.  This allows the reference image to be from a
     
    371373    pmFPAfile *ref = defineInputFile(&success, refconfig, NULL, "PPSUB.REF", "REF", PM_FPA_FILE_IMAGE);
    372374    if (!success) {
    373         psError(psErrorCodeLast(), false, "Failed to build FPA from PPSUB.REF");
    374         return false;
     375        psError(psErrorCodeLast(), false, "Failed to build FPA from PPSUB.REF");
     376
     377        psErrorClear();
     378        fprintf(stderr,"%s\n", config->cameraName);
     379        psStringSubstitute(&( config->cameraName ),"GPC1","GPC2");
     380        fprintf(stderr,"%s\n", config->cameraName);
     381        did_rewrite = 1;
     382       
     383        ref = defineInputFile(&success, config, NULL, "PPSUB.REF", "REF", PM_FPA_FILE_IMAGE);
     384        if (!success) {
     385          return false;
     386        }
    375387    }
    376388    // Reference mask
     
    397409    pmFPAfile *src = defineInputFile(&success, srcconfig, NULL, "PPSUB.REF.SOURCES", "REF.SOURCES", PM_FPA_FILE_CMF);
    398410    if (!success) {
    399         psError(psErrorCodeLast(), false, "Failed to build FPA from PPSUB.REF.SOURCES");
    400         return false;
     411      if (did_rewrite == 1) {
     412        // Sometimes we use the warp sources instead of the stack
     413        psErrorClear();
     414        did_rewrite = 0;
     415       
     416        fprintf(stderr,"%s\n", config->cameraName);
     417        psStringSubstitute(&( config->cameraName ),"GPC2","GPC1");
     418        fprintf(stderr,"%s\n", config->cameraName);
     419        defineInputFile(&success, config, NULL, "PPSUB.REF.SOURCES", "REF.SOURCES", PM_FPA_FILE_CMF);
     420        if (!success) {
     421          psError(psErrorCodeLast(), false, "Failed to build FPA from PPSUB.REF.SOURCES");
     422          return false;
     423        }
     424      }
     425      else {
     426        psError(psErrorCodeLast(), false, "Failed to build FPA from PPSUB.REF.SOURCES");
     427        return false;
     428      }
    401429    }
    402430    // copy src->format(RULE) PSCAMERA from input->format(RULE)
    403431    ppSubCopyPSCamera (src, input);
    404432    psFree (srcconfig);
     433   
     434    if (did_rewrite == 1) {
     435      fprintf(stderr,"%s\n", config->cameraName);
     436      psStringSubstitute(&( config->cameraName ),"GPC2","GPC1");
     437      fprintf(stderr,"%s\n", config->cameraName);
     438    }
    405439   
    406440    // Now that the camera has been determined, we can read the recipe
Note: See TracChangeset for help on using the changeset viewer.