IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35538


Ignore:
Timestamp:
May 9, 2013, 6:22:55 AM (13 years ago)
Author:
eugene
Message:

trying to get the output format right

Location:
branches/eam_branches/ipp-20130419/pswarp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130419/pswarp/doc/notes.20130406.txt

    r35512 r35538  
     1
     220130406
    13
    24examining pswarp to handle inverse transformations or more general transformations:
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpParseCamera.c

    r35535 r35538  
    6464    }
    6565
     66    // use the skycell camera or the input camera?
     67    bool useInputCamera = !strcmp (skycell->cameraName, "SIMPLE");
     68
    6669    // The output skycell
    67     pmFPAfile *output = pmFPAfileDefineOutputForFormat(config, NULL, "PSWARP.OUTPUT", skycell->cameraName, skycell->formatName);
     70    pmFPAfile *output = useInputCamera ?
     71        pmFPAfileDefineSkycell(config, NULL, "PSWARP.OUTPUT") :
     72        pmFPAfileDefineOutputForFormat(config, NULL, "PSWARP.OUTPUT", skycell->cameraName, skycell->formatName);
    6873    if (!output) {
    6974        psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT");
     
    7277    output->save = true;
    7378
    74     pmFPAfile *outMask = pmFPAfileDefineOutputForFormat(config, output->fpa, "PSWARP.OUTPUT.MASK", skycell->cameraName, skycell->formatName);
     79    pmFPAfile *outMask = useInputCamera ?
     80        pmFPAfileDefineSkycell(config, output->fpa, "PSWARP.OUTPUT.MASK"):
     81        pmFPAfileDefineOutputForFormat(config, output->fpa, "PSWARP.OUTPUT.MASK", skycell->cameraName, skycell->formatName);
    7582    if (!outMask) {
    7683        psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT.MASK");
     
    8188    // only create an output variance in we supply an input variance
    8289    if (foundVariance) {
    83         pmFPAfile *outVariance = pmFPAfileDefineOutputForFormat(config, output->fpa, "PSWARP.OUTPUT.VARIANCE", skycell->cameraName, skycell->formatName);
     90        pmFPAfile *outVariance = useInputCamera ?
     91            pmFPAfileDefineSkycell(config, output->fpa, "PSWARP.OUTPUT.VARIANCE"):
     92            pmFPAfileDefineOutputForFormat(config, output->fpa, "PSWARP.OUTPUT.VARIANCE", skycell->cameraName, skycell->formatName);
    8493        if (!outVariance) {
    8594            psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT.VARIANCE");
     
    91100    // XXX we assume input sources come from the input astrom description, but this need not be true (we could define an input sources file)
    92101    if (foundAstrom && psMetadataLookupBool(&status, recipe, "SOURCES")) {
    93         pmFPAfile *outSources = pmFPAfileDefineOutputForFormat(config, output->fpa, "PSWARP.OUTPUT.SOURCES", skycell->cameraName, skycell->formatName);
     102        pmFPAfile *outSources = useInputCamera ?
     103            pmFPAfileDefineSkycell(config, output->fpa, "PSWARP.OUTPUT.SOURCES"):
     104            pmFPAfileDefineOutputForFormat(config, output->fpa, "PSWARP.OUTPUT.SOURCES", skycell->cameraName, skycell->formatName);
    94105        if (!outSources) {
    95106            psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT.SOURCES");
     
    102113    if (foundBackground && psMetadataLookupBool(&status, recipe, "BACKGROUND.MODEL")) {
    103114        // pmFPAfile *outBackground = pmFPAfileDefineSkycell(config, NULL, "PSWARP.OUTPUT.BKGMODEL");
    104         pmFPAfile *outBackground = pmFPAfileDefineOutputForFormat(config, NULL, "PSWARP.OUTPUT.BKGMODEL", skycell->cameraName, skycell->formatName);
     115        pmFPAfile *outBackground = useInputCamera ?
     116            pmFPAfileDefineSkycell(config, NULL, "PSWARP.OUTPUT.BKGMODEL"):
     117            pmFPAfileDefineOutputForFormat(config, NULL, "PSWARP.OUTPUT.BKGMODEL", skycell->cameraName, skycell->formatName);
    105118        outBackground->xBin = psMetadataLookupS32(&status, recipe, "BKG.XGRID");
    106119        outBackground->yBin = psMetadataLookupS32(&status, recipe, "BKG.YGRID");
     
    115128    if (psMetadataLookupBool(&status, recipe, "PSF")) {
    116129        // This file, PSPHOT.INPUT, is just used as a carrier; output files (eg, PSPHOT.RESID) are defined by psphotDefineFiles
    117         pmFPAfile *psphotInput = pmFPAfileDefineOutputForFormat(config, NULL, "PSPHOT.INPUT", skycell->cameraName, skycell->formatName);
     130        pmFPAfile *psphotInput = useInputCamera ?
     131            pmFPAfileDefineSkycell(config, NULL, "PSPHOT.INPUT"):
     132            pmFPAfileDefineOutputForFormat(config, NULL, "PSPHOT.INPUT", skycell->cameraName, skycell->formatName);
    118133        if (!psphotInput) {
    119134            psError(psErrorCodeLast(), false, _("Unable to generate output file from PSPHOT.INPUT"));
     
    131146
    132147        // pmFPAfile *psphotInSources = pmFPAfileDefineSkycell(config, output->fpa, "PSPHOT.INPUT.CMF");
    133         pmFPAfile *psphotInSources = pmFPAfileDefineOutputForFormat(config, output->fpa, "PSPHOT.INPUT.CMF", skycell->cameraName, skycell->formatName);
     148        pmFPAfile *psphotInSources = useInputCamera ?
     149            pmFPAfileDefineSkycell(config, output->fpa, "PSPHOT.INPUT.CMF"):
     150            pmFPAfileDefineOutputForFormat(config, output->fpa, "PSPHOT.INPUT.CMF", skycell->cameraName, skycell->formatName);
    134151        if (!psphotInSources) {
    135152            psError(psErrorCodeLast(), false, _("Unable to generate output file from PSPHOT.INPUT.CMF"));
Note: See TracChangeset for help on using the changeset viewer.