IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 17, 2007, 4:19:23 PM (19 years ago)
Author:
Paul Price
Message:

We need a new PSF model for the warped frame. It would be good to generate this analytically, but that's going to be tricky. We have a list of sources, so we could use those to redetermine the PSF model. Until Gene makes the necessary adaptations to psphot, we will simply redetermine the PSF model from scratch.

File:
1 edited

Legend:

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

    r14768 r14874  
    198198    }
    199199
     200    // We need a new PSF model for the warped frame
     201    // It would be good to generate this analytically, but that's going to be tricky.
     202    // We have a list of sources, so we could use those to redetermine the PSF model.
     203    // Until Gene makes the necessary adaptations to psphot, we will simply redetermine the PSF model from
     204    // scratch.
     205    if (psMetadataLookupBool(&mdok, config->arguments, "PSF")) {
     206        psMetadata *psphotRecipe = psMetadataLookupPtr(NULL, config->recipes,
     207                                                       PSPHOT_RECIPE); // Recipe for psphot
     208        if (!psphotRecipe) {
     209            psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find %s recipe.", PSPHOT_RECIPE);
     210            return false;
     211        }
     212
     213        psMetadataAddStr(psphotRecipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_REPLACE,
     214                         "Break point for psphot operations", "PSFMODEL");
     215
     216        pmFPAfile *photFile = psMetadataLookupPtr(NULL, config->files, "PSPHOT.INPUT");
     217        pmFPACopy(photFile->fpa, outFPA);
     218
     219        pmFPAview *view = pmFPAviewAlloc(0); // View into skycell
     220        if (!psphotReadout(config, view)) {
     221            psError(psErrorCodeLast(), false, "Unable to determine PSF for warped image.\n");
     222            psFree(view);
     223            return false;
     224        }
     225        psFree(view);
     226
     227        pmFPAfileActivate(config->files, false, "PSPHOT.INPUT");
     228    }
     229
    200230    output->data_exists = true;
    201231    outCell->data_exists = true;
    202232    outChip->data_exists = true;
    203233
    204 #if 0
    205     float gain = 0.0, readnoise = 0.0, saturation = INFINITY, exposure = 0.0, darktime = 0.0;
    206     double mjd = 0.0;
    207 #endif
    208 
    209 #if 0
    210     // XXX Hack so that INSTRUME header keyword and the like are not updated properly
    211     // If INSTRUME (etc) is updated, then the FITS file with the warped image will be often
    212     // recognised as coming from the old camera, not the new, warped camera.
    213     // The proper solution to this, I believe, would be to define a skycell derivative of the
    214     // old camera, so that the skycell can be recognised as coming from the old camera (and would
    215     // also therefore inherit all its recipes, which would be good), rather than having a completely
    216     // different camera.  That will take some work; the below solution should be good enough for now.
    217     {
    218         psMetadataItem *item;           // Concepts item to update
    219 
    220         item = psMetadataLookup(outFPA->concepts, "FPA.INSTRUMENT");
    221         psFree(item->data.V);
    222         item->data.V = NULL;
    223 
    224         item = psMetadataLookup(outFPA->concepts, "FPA.DETECTOR");
    225         psFree(item->data.V);
    226         item->data.V = NULL;
    227     }
    228 #endif
    229234
    230235    // Perform statistics on the output image
Note: See TracChangeset for help on using the changeset viewer.