IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26900


Ignore:
Timestamp:
Feb 10, 2010, 7:42:33 PM (16 years ago)
Author:
eugene
Message:

updates from eam_branches/20091201

Location:
trunk/ppSim/src
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/ppSim/src/Makefile.am

    r23808 r26900  
    3030        ppSimLoadStars.c          \
    3131        ppSimMakeStars.c          \
     32        ppSimMakeStarGrid.c       \
    3233        ppSimMakeGalaxies.c       \
    3334        ppSimMakeBiassec.c        \
     
    4748        ppSimLoadSpots.c          \
    4849        ppSimPhotom.c             \
    49         ppSimPhotomReadoutFake.c  \
    50         ppSimPhotomReadoutForce.c \
    5150        ppSimPhotomFiles.c        \
    5251        ppSimLoadForceSources.c   \
     
    5958        ppSimBadCTE.c             \
    6059        ppSimVersion.c
     60
     61# these functions have been broken by the API change in psphot (Jan 2010)
     62#       ppSimPhotomReadoutFake.c 
     63#       ppSimPhotomReadoutForce.c
    6164
    6265ppSimSequence_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSASTRO_CFLAGS) $(ppSim_CFLAGS)
  • trunk/ppSim/src/ppSim.h

    r23836 r26900  
    103103bool ppSimLoadStars (psArray *stars, pmFPA *fpa, pmConfig *config);
    104104bool ppSimMakeStars(psArray *stars, pmFPA *fpa, pmConfig *config, const psRandom *rng);
     105bool ppSimMakeStarGrid(psArray *stars, pmFPA *fpa, pmConfig *config, const psRandom *rng);
    105106bool ppSimInsertStars (pmReadout *readout, psImage *expCorr, psArray *stars, pmConfig *config);
    106107
  • trunk/ppSim/src/ppSimAddNoise.c

    r18011 r26900  
    1616    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSIM_RECIPE); // Recipe
    1717
    18     float gain = psMetadataLookupF32(NULL, cell->concepts, "CELL.GAIN"); // CCD gain, e/ADU
     18    // the recipe should set GAIN to NAN, and only modify to override the concept value
     19    float gain = psMetadataLookupF32(&mdok, recipe, "GAIN"); // CCD gain, e/ADU
    1920    if (isnan(gain)) {
    20         psWarning("CELL.GAIN is not set; reverting to recipe value GAIN.");
    21         gain = psMetadataLookupF32(&mdok, recipe, "GAIN");
     21        gain = psMetadataLookupF32(&mdok, cell->concepts, "CELL.GAIN");
    2222        if (!mdok) {
    23             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to find GAIN in recipe.");
    24             return false;
     23            psWarning("CELL.GAIN is not set; assuming gain of 1.0.");
     24            gain = 1.0;
    2525        }
    2626    }
  • trunk/ppSim/src/ppSimInsertStars.c

    r21365 r26900  
    2626    float expTime   = psMetadataLookupF32(NULL, recipe, "EXPTIME"); // Exposure time
    2727    float darkRate  = psMetadataLookupF32(NULL, recipe, "DARK.RATE"); // Dark rate
     28    float nSigmaLim = psMetadataLookupF32(NULL, recipe, "STARS.SIGMA.LIM"); // significance of faintest stars
    2829
    2930    float readnoise = psMetadataLookupF32(NULL, cell->concepts, "CELL.READNOISE");// CCD read noise, e
     
    106107        pmModelSetFlux (model, flux);
    107108
    108         // XXX let the flux limit be a user-defined number of sky sigmas (not just 1.0)
    109         float radius = model->modelRadius (model->params, roughNoise);
     109        float radius = model->modelRadius (model->params, nSigmaLim * roughNoise);
    110110        radius = PS_MAX (radius, 1.0);
    111111
  • trunk/ppSim/src/ppSimLoop.c

    r25760 r26900  
    4747        // Add random stars
    4848        if (!ppSimMakeStars (stars, fpa, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "failed to make random stars");
     49
     50        // Add random stars
     51        if (!ppSimMakeStarGrid (stars, fpa, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "failed to make random stars");
    4952
    5053        // Add random galaxies
  • trunk/ppSim/src/ppSimPhotom.c

    r21183 r26900  
    4646            if (! readout->data_exists) { continue; }
    4747
     48// these are broken by the Jan 2010 API changes to psphot
     49#if 0
    4850            // run the actual photometry analysis
    4951            if (!ppSimPhotomReadoutFake (config, view)) {
     
    5658            }
    5759            // ppSimDetectionLimits (config, view);
     60#endif
    5861        }
    5962    }
  • trunk/ppSim/src/ppSimPhotomReadout.c

    r21183 r26900  
    3939# if 0   
    4040    // set the photcode for this image
    41     if (!psphotAddPhotcode (recipe, config, view, "PPSIM.CHIP")) {
     41    if (!psphotAddPhotcodeReadout (recipe, config, view, "PPSIM.CHIP", 0)) {
    4242        psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
    4343        return false;
     
    7474
    7575    // Generate the mask and weight images, including the user-defined analysis region of interest
    76     psphotSetMaskAndWeight (config, readout, recipe);
     76    psphotSetMaskAndWeight (config, view, recipe);
    7777
    7878    // load the psf model, if suppled.  FWHM_X,FWHM_Y,etc are saved in the recipe
     
    8585
    8686    // generate a background model (median, smoothed image)
    87     if (!psphotModelBackground (config, view, "PPSIM.CHIP")) {
     87    if (!psphotModelBackgroundReadoutFileIndex (config, view, "PPSIM.CHIP", 0)) {
    8888        return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL);
    8989    }
    90     if (!psphotSubtractBackground (config, view, "PPSIM.CHIP")) {
     90    if (!psphotSubtractBackgroundReadout (config, view, "PPSIM.CHIP", 0)) {
    9191        return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL);
    9292    }
  • trunk/ppSim/src/ppSimPhotomReadoutFake.c

    r21365 r26900  
    11# include "ppSim.h"
    22
     3// XXX this function is currently disabled -- need to update code below to distinguish the fake
     4// and force positions, etc
    35bool ppSimPhotomReadoutFake(pmConfig *config, const pmFPAview *view) {
    46
     
    1113        return false;
    1214    }
    13 
    14 # if 0
    15     // set the photcode for this image
    16     if (!psphotAddPhotcode (recipe, config, view, "PPSIM.FAKE.CHIP")) {
    17         psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
    18         return false;
    19     }
    20 # endif
    2115
    2216    // *** in this section, perform the photometry for real + fake sources on PPSIM.FAKE.CHIP ***
     
    3630
    3731    // Generate the mask and variance images, including the user-defined analysis region of interest
    38     psphotSetMaskAndVariance (config, readout, recipe);
     32    psphotSetMaskAndVariance (config, view);
    3933
    4034    // XXX need to define the source pixels
     
    5852    // load the psf model, if suppled.  FWHM_X,FWHM_Y,etc are saved in the recipe
    5953    // this function uses PSPHOT.PSF.LOAD as the pmFPAfile
    60     pmPSF *psf = psphotLoadPSF (config, view, recipe);
    61     assert (psf);
     54    psphotLoadPSF (config, view);
    6255
    6356    // remove all sources
     
    6558
    6659    // generate a background model (median, smoothed image)
    67     if (!psphotModelBackground (config, view, "PPSIM.FAKE.CHIP")) {
     60    if (!psphotModelBackgroundReadoutFileIndex (config, view, "PPSIM.FAKE.CHIP", 0)) {
    6861        return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL);
    6962    }
    70     if (!psphotSubtractBackground (config, view, "PPSIM.FAKE.CHIP")) {
     63    if (!psphotSubtractBackgroundReadout (config, view, "PPSIM.FAKE.CHIP", 0, recipe)) {
    7164        return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL);
    7265    }
  • trunk/ppSim/src/ppSimPhotomReadoutForce.c

    r21365 r26900  
    1414# if 0
    1515    // set the photcode for this image
    16     if (!psphotAddPhotcode (recipe, config, view, "PPSIM.FAKE.CHIP")) {
     16    if (!psphotAddPhotcodeReadout (recipe, config, view, "PPSIM.FAKE.CHIP", 0)) {
    1717        psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
    1818        return false;
     
    3636
    3737    // Generate the mask and variance images, including the user-defined analysis region of interest
    38     psphotSetMaskAndVariance (config, readout, recipe);
     38    psphotSetMaskAndVariance (config, view, recipe);
    3939
    4040    // XXX need to define the source pixels
     
    5858
    5959    // generate a background model (median, smoothed image)
    60     if (!psphotModelBackground (config, view, "PPSIM.FORCE.CHIP")) {
     60    if (!psphotModelBackgroundReadoutFileIndex (config, view, "PPSIM.FORCE.CHIP", 0)) {
    6161        return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL);
    6262    }
    63     if (!psphotSubtractBackground (config, view, "PPSIM.FORCE.CHIP")) {
     63    if (!psphotSubtractBackgroundReadout (config, view, "PPSIM.FORCE.CHIP", 0)) {
    6464        return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL);
    6565    }
  • trunk/ppSim/src/ppSimSetPSF.c

    r18011 r26900  
    2020    // ppSimArguments)
    2121    float seeing   = psMetadataLookupF32(&status, recipe, "SEEING"); // Seeing SIGMA (pixels)
     22    float aRatio   = psMetadataLookupF32(&status, recipe, "PSF.ARATIO"); // Seeing SIGMA (pixels)
     23    float theta    = psMetadataLookupF32(&status, recipe, "PSF.THETA"); // Seeing SIGMA (pixels)
    2224
    2325    char *psfModelName = psMetadataLookupStr(&status, recipe, "PSF.MODEL"); // Name of PSF model
     
    5557    // supply the semi-major axis (these are SIGMA values in PIXELS)
    5658    axes.major = seeing;
    57     axes.minor = seeing;
    58     axes.theta = 0.0;
     59    axes.minor = aRatio * seeing;
     60    axes.theta = theta * PS_RAD_DEG;
    5961
    6062    pol = psEllipseAxesToPol (axes);
Note: See TracChangeset for help on using the changeset viewer.