IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 13, 2019, 1:00:44 PM (7 years ago)
Author:
eugene
Message:

add option to insert a gaussian-profile globular cluster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20191011/ppSim/src/ppSimMakeGalaxies.c

    r36079 r40939  
    4545    float zp              = psMetadataLookupF32(&mdok, recipe, "ZEROPOINT"); // Photometric zero point
    4646    float seeing          = psMetadataLookupF32(&mdok, recipe, "SEEING"); // Seeing sigma (pix)
    47     float scale           = psMetadataLookupF32(&mdok, recipe, "PIXEL.SCALE") * M_PI / 3600.0 / 180.0; // Plate scale (radians/pixel)
     47    float scale           = psMetadataLookupF32(&mdok, recipe, "PIXEL.SCALE"); // Plate scale (arcsec/pixel)
    4848    float skyRate         = psMetadataLookupF32(&mdok, recipe, "SKY.RATE"); // Sky rate
    4949    if (isnan(skyRate)) {
    5050        float skyMags = psMetadataLookupF32(&mdok, recipe, "SKY.MAGS");  assert (mdok);
    5151        skyRate = scale * scale * ppSimMagToFlux (skyMags, zp);
     52        // skyMags is in mags / square arcsec so scale must be arcsec / pixel
    5253    }
    5354
     
    9495
    9596    // Normalisation, set by the specified stellar density at the specified bright magnitude
    96     float refSum = galaxyDensity * xSize * ySize * PS_SQR(scale * 180.0 / M_PI);
     97    float refSum = galaxyDensity * xSize * ySize * PS_SQR(scale / 3600.0);
    9798    float normLum =  refSum / (galaxyAlpha * logf(10.0) * powf(10.0, (galaxyAlpha * brightMag)));
    9899    float normScale = normLum * galaxyAlpha * logf(10.0);
     
    143144                rndValue = galaxyGridRandom ? drand48() : i / (float) nTotal;
    144145                float scale = (galaxyRmajorMin + rndValue * galaxyRmajorSlope);
    145 
    146146                galaxy->Rmaj  = scale;
    147147
Note: See TracChangeset for help on using the changeset viewer.