IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 31, 2012, 4:03:41 PM (14 years ago)
Author:
eugene
Message:

add trails to test images from ppSim

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSim/src/ppSimInsertGalaxies.c

    r34083 r34261  
    7676    if (type == -1) {
    7777        psError (PS_ERR_UNKNOWN, false, "invalid model name");
    78         return false;
     78        return false;
    7979    }
    8080
     
    136136        PAR[PM_PAR_YPOS] = yChip;
    137137
    138         psEllipseAxes axes;
    139         axes.major       = galaxy->Rmaj;
    140         axes.minor       = galaxy->Rmin;
    141         axes.theta       = galaxy->theta;
    142         pmPSF_AxesToModel (PAR, axes, type);
    143         psF64 Area = 2.0 * M_PI * axes.major * axes.minor;
     138        if (type == pmModelClassGetType ("PS_MODEL_TRAIL")) {
     139            PAR[PM_PAR_LENGTH] = galaxy->Rmaj;
     140            PAR[PM_PAR_SIGMA]  = galaxy->Rmin;
     141            PAR[PM_PAR_THETA]  = galaxy->theta;
     142        } else {
     143            psEllipseAxes axes;
     144            axes.major       = galaxy->Rmaj;
     145            axes.minor       = galaxy->Rmin;
     146            axes.theta       = galaxy->theta;
     147            pmPSF_AxesToModel (PAR, axes, type);
     148        }
     149        psF64 Area = 2.0 * M_PI * galaxy->Rmaj * galaxy->Rmin;
    144150
    145151        if (nParam == 8) {
     
    147153        }
    148154
    149         // set the normalization to get the desired flux
    150         // XXX for now, use peak: pmModelSetFlux (model, galaxy->flux);
    151 
    152155        // XXX let the flux limit be a user-defined number of sky sigmas (not just 1.0)
    153156        float radius = model->modelRadius (model->params, 0.1*roughNoise);
    154157        radius = PS_MAX (radius, 1.0);
     158
    155159        // XXX the exp(-r^0.25) models can go way out if allowed...
    156160        radius = PS_MIN (radius, 300.0);
     
    176180
    177181        float par8 = (model->params->n == 8) ? model->params->data.F32[7] : 0.0;
    178         fprintf (outfile, "%8.3f %8.3f %10.2f  %2d  %7.3f %5.3f  %5.3f %5.3f %5.3f %5.3f\n", galaxy->x, galaxy->y, flux, 1, source->psfMag, source->psfMagErr, axes.major, axes.minor, axes.theta, par8);
     182        fprintf (outfile, "%8.3f %8.3f %10.2f  %2d  %7.3f %5.3f  %5.3f %5.3f %5.3f %5.3f\n", galaxy->x, galaxy->y, flux, 1, source->psfMag, source->psfMagErr, galaxy->Rmaj, galaxy->Rmin, galaxy->theta, par8);
    179183
    180184        psArrayAdd (sources, 100,source);
Note: See TracChangeset for help on using the changeset viewer.