IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 25, 2007, 11:57:36 AM (19 years ago)
Author:
eugene
Message:

added galaxies, some tweaks

File:
1 edited

Legend:

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

    r14531 r14667  
    11#include "ppSim.h"
    22
    3 psArray *ppSimLoadStars (pmFPA *fpa, pmConfig *config) {
     3bool ppSimLoadStars (psArray *stars, pmFPA *fpa, pmConfig *config) {
     4
     5    bool mdok;
     6    assert (stars);
     7
     8    psMetadata *recipe = psMetadataLookupMetadata(&mdok, config->recipes, PPSIM_RECIPE); // Recipe
     9
     10    bool starsReal = psMetadataLookupBool(&mdok, recipe, "STARS.REAL"); // Density of fakes
     11    if (!starsReal) return true;
    412
    513    // Read catalogue stars using psastro
     
    3846    psLogMsg("ppSim", PS_LOG_INFO, "Adding %ld reference stars", refStars->n);
    3947
    40     psArray *stars = psArrayAlloc (refStars->n);
     48    long oldSize = stars->n;
     49    stars = psArrayRealloc (stars, refStars->n);
    4150
    4251    // Conversion loop
     
    6170        star->flux = powf(10.0, -0.4 * (star->mag - zp)) * expTime;
    6271        star->peak = star->flux / sqrt(2.0*M_PI) / seeing;
    63         stars->data[i] = star;
     72        stars->data[oldSize + i] = star;
    6473    }
    6574    psFree(refStars);
Note: See TracChangeset for help on using the changeset viewer.