IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12981


Ignore:
Timestamp:
Apr 23, 2007, 5:29:28 PM (19 years ago)
Author:
eugene
Message:

drop old, unused code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_02_branch/psphot/src/psphotOutput.c

    r12978 r12981  
    151151    return header;
    152152}
    153 
    154 # if (0)
    155 // output functions: we have several fixed modes (sx, obj, cmp)
    156 void psphotOutput (pmReadout *readout, psMetadata *arguments) {
    157 
    158     bool status;
    159     char *outputFile = NULL;
    160 
    161     psMetadata *header = pmReadoutGetHeader (readout);
    162 
    163     pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
    164     // sample PSF images??
    165     if (psfSample != NULL) psphotSamplePSFs (psf, readout->image, psfSample);
    166     if (psfSample != NULL) psphotSamplePSFs (psf, readout->image, psfSample);
    167 
    168     if (psfFile != NULL) {
    169         psMetadata *psfData = pmPSFtoMD (NULL, psf);
    170         psMetadataConfigWrite (psfData, psfFile);
    171         psFree (psfData);
    172     }
    173 }
    174 
    175 psImage *pmModelPSFatXY (psImage *image, pmModel *modelEXT, pmPSF *psf, int x, int y, int dx, int dy) {
    176 
    177     psRegion region = {x - dx, x + dx, y - dy, y + dy};
    178     psImage *view = psImageSubset (image, region);
    179     psImage *sample = psImageCopy (NULL, view, PS_TYPE_F32);
    180     psImageInit (sample, 0);
    181     modelEXT->params->data.F32[2] = x;
    182     modelEXT->params->data.F32[3] = y;
    183     pmModel *modelPSF = pmModelFromPSF (modelEXT, psf);
    184     pmModelAdd (sample, NULL, modelPSF, PM_MODEL_OP_FULL);
    185     psFree (modelPSF);
    186     return (sample);
    187 }
    188 
    189 bool psphotSamplePSFs (pmPSF *psf, psImage *image, char *output) {
    190 
    191     // make sample PSFs for 4 corners and the center
    192     psImage *sample;
    193 
    194     // optional dump of all rough source data
    195     if (output[0] == 0) return false;
    196 
    197     pmModel *modelEXT = pmModelAlloc (psf->type);
    198     modelEXT->params->data.F32[0] = 0;
    199     modelEXT->params->data.F32[1] = 1;
    200 
    201     psFits *fits = psFitsOpen (output, "w");
    202 
    203     // the centers are in parent coordinates; they do not need to correspond to valid pixels...
    204     sample = pmModelPSFatXY (image, modelEXT, psf, 25, 25, 25, 25);
    205     psFitsWriteImage (fits, NULL, sample, 0);
    206     sample = pmModelPSFatXY (image, modelEXT, psf, image->numCols - 25, image->numRows - 25, 25, 25);
    207     psFitsWriteImage (fits, NULL, sample, 0);
    208     sample = pmModelPSFatXY (image, modelEXT, psf, image->numCols - 25, 25, 25, 25);
    209     psFitsWriteImage (fits, NULL, sample, 0);
    210     sample = pmModelPSFatXY (image, modelEXT, psf, 25, image->numRows - 25, 25, 25);
    211     psFitsWriteImage (fits, NULL, sample, 0);
    212     sample = pmModelPSFatXY (image, modelEXT, psf, image->numCols / 2, image->numRows / 2, 25, 25);
    213     psFitsWriteImage (fits, NULL, sample, 0);
    214 
    215     psFitsClose (fits);
    216     return (TRUE);
    217 }
    218 # endif
Note: See TracChangeset for help on using the changeset viewer.