IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 6, 2007, 2:19:54 PM (19 years ago)
Author:
Paul Price
Message:

Copying concepts (e.g., exposure time) from the old to the new. We don't copy certain concepts (actually, we copy and then remove them) so as not to confuse between skycells and real cameras.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpLoop.c

    r13661 r13686  
    6868            psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel mosaic astrometry for input FPA.");
    6969            psFree(view);
     70            psFree(stats);
    7071            return false;
    7172        }
     
    8788                psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel chip astrometry for input FPA.");
    8889                psFree(view);
     90                psFree(stats);
    8991                return false;
    9092            }
     
    9496                psError(PS_ERR_UNKNOWN, false, "Unable to read WCS astrometry for input FPA.");
    9597                psFree(view);
     98                psFree(stats);
    9699                return false;
    97100            }
     
    106109            // process each of the readouts
    107110            pmReadout *readout;
    108             while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
    109                 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
    110                 if (! readout->data_exists) { continue; }
     111            while ((readout = pmFPAviewNextReadout(view, input->fpa, 1)) != NULL) {
     112                pmFPAfileIOChecks(config, view, PM_FPA_BEFORE);
     113                if (!readout->data_exists) {
     114                    continue;
     115                }
    111116
    112                 // XXX _Opt version uses locally-linear map
    113                 // pswarpTransformReadout (output, readout, config);
    114                 pswarpTransformReadout_Opt (output, readout, config);
     117                pswarpTransformReadout_Opt(output, readout, config);
    115118
    116                 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
     119                pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
    117120            }
     121            pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
     122        }
     123        pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
     124    }
    118125
    119             pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
    120         }
    121         pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
     126    pmCell *outCell = output->parent;   // Output cell
     127    pmChip *outChip = outCell->parent;  // Output chip
     128    pmFPA *outFPA = outChip->parent;    // Output FPA
     129
     130    if (!pmFPACopyConcepts(output->parent->parent->parent, input->fpa)) {
     131        psError(PS_ERR_UNKNOWN, false, "Unable to copy concepts from input to output.");
     132        psFree(stats);
     133        psFree(view);
     134        return false;
    122135    }
     136
     137
     138    // XXX Hack so that INSTRUME header keyword and the like are not updated properly
     139    // If INSTRUME (etc) is updated, then the FITS file with the warped image will be often
     140    // recognised as coming from the old camera, not the new, warped camera.
     141    // The proper solution to this, I believe, would be to define a skycell derivative of the
     142    // old camera, so that the skycell can be recognised as coming from the old camera (and would
     143    // also therefore inherit all its recipes, which would be good), rather than having a completely
     144    // different camera.  That will take some work; the below solution should be good enough for now.
     145    {
     146        psMetadataItem *item;           // Concepts item to update
     147
     148        item = psMetadataLookup(outFPA->concepts, "FPA.INSTRUMENT");
     149        psFree(item->data.V);
     150        item->data.V = NULL;
     151
     152        item = psMetadataLookup(outFPA->concepts, "FPA.DETECTOR");
     153        psFree(item->data.V);
     154        item->data.V = NULL;
     155    }
     156
     157
    123158
    124159    // Perform statistics on the output image
Note: See TracChangeset for help on using the changeset viewer.