IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2009, 6:15:31 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/ppSim/src/Makefile.am

    r23352 r23594  
    4545        ppSimRandomGaussian.c     \
    4646        ppSimBadPixels.c          \
     47        ppSimBadCTE.c             \
    4748        ppSimVersion.c
    4849
  • branches/cnb_branches/cnb_branch_20090301/ppSim/src/ppSim.h

    r23352 r23594  
    6767} ppSimGalaxy;
    6868
    69 ppSimStar *ppSimStarAlloc ();
    70 ppSimGalaxy *ppSimGalaxyAlloc ();
     69ppSimStar *ppSimStarAlloc(void);
     70ppSimGalaxy *ppSimGalaxyAlloc(void);
    7171
    7272/// Parse command-line arguments
     
    135135
    136136
     137// add a bad CTE region
     138bool ppSimBadCTE(psImage *image,        // Signal image, modified and returned
     139                 const pmConfig *config // configuration
     140  );
     141
    137142/// Add bad pixels to an image
    138143bool ppSimBadPixels(pmReadout *readout, ///< Readout for which to generate bad pixels
     
    184189double ppSimRandomGaussian (const psRandom *rnd, double mean, double sigma);
    185190double ppSimRandomGaussianNorm (const psRandom *rnd);
    186 void ppSimRandomGaussianFree();
     191void ppSimRandomGaussianFree(void);
    187192
    188193bool ppSimPhotomFiles (pmConfig *config, pmFPAfile *fakeFile, pmFPAfile *forceFile);
  • branches/cnb_branches/cnb_branch_20090301/ppSim/src/ppSimLoadSpots.c

    r18047 r23594  
    5757
    5858    // load refstars from the catalog
    59     psArray *spots = psastroLoadRefstars(config);
     59    psArray *spots = psastroLoadRefstars(config, "PSASTRO.INPUT");
    6060    if (!spots || spots->n == 0) {
    6161        psError(PS_ERR_UNKNOWN, false, "Unable to find reference stars.");
  • branches/cnb_branches/cnb_branch_20090301/ppSim/src/ppSimLoadStars.c

    r20040 r23594  
    4141    psMetadataAdd(astroRecipe, PS_LIST_TAIL, "DEC_MIN", PS_DATA_F32 | PS_META_REPLACE, "", dec0 - radius);
    4242    psMetadataAdd(astroRecipe, PS_LIST_TAIL, "DEC_MAX", PS_DATA_F32 | PS_META_REPLACE, "", dec0 + radius);
    43     psArray *refStars = psastroLoadRefstars(config);
     43    psArray *refStars = psastroLoadRefstars(config, "PSASTRO.INPUT");
    4444    if (!refStars) {
    4545        psError(PS_ERR_UNKNOWN, false, "Unable to find reference stars.");
  • branches/cnb_branches/cnb_branch_20090301/ppSim/src/ppSimLoop.c

    r23352 r23594  
    154154            done:
    155155                if (!ppSimAddNoise(readout->image, readout->variance, cell, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "problem adding noise");
     156
     157                if (!ppSimBadCTE(readout->image, config)) ESCAPE (PS_ERR_UNKNOWN, "problem inducing bad cte");
     158
    156159                if (!ppSimSaturate(readout, config)) ESCAPE (PS_ERR_UNKNOWN, "problem setting saturation levels");
    157160
  • branches/cnb_branches/cnb_branch_20090301/ppSim/src/ppSimRandomGaussian.c

    r18011 r23594  
    2929
    3030/* integrate a gaussian from -5 sigma to +5 sigma */
    31 void p_ppSimRandomGaussianInit () {
    32  
     31void p_ppSimRandomGaussianInit (void) {
     32
    3333  int i;
    3434  long A, B;
    3535  double val, x, dx, dx1, dx2, dx3, df;
    3636  double mean, sigma;
    37  
     37
    3838  /* no need to generate this if it already exists */
    3939  if (gaussint) return;
     
    4242  for (B = 0; A == time(NULL); B++);
    4343  srand48(B);
    44  
     44
    4545  Ngaussint = 0x1000;
    4646  ppSimRandomGaussianAlloc (Ngaussint + 1);
     
    5353  mean = 0.0;
    5454  sigma = 1.0;
    55  
     55
    5656  for (i = 0, x = -7.0; (i < Ngaussint) && (x < 7.0); x += dx)  {
    57     df = (3.0*p_ppSimGaussian(x    , mean, sigma) + 
     57    df = (3.0*p_ppSimGaussian(x    , mean, sigma) +
    5858          9.0*p_ppSimGaussian(x+dx1, mean, sigma) +
    59           9.0*p_ppSimGaussian(x+dx2, mean, sigma) + 
     59          9.0*p_ppSimGaussian(x+dx2, mean, sigma) +
    6060          3.0*p_ppSimGaussian(x+dx3, mean, sigma)) * (dx1/8.0);
    6161    val += df;
     
    6767}
    6868
    69 // XXX we are using drand48() rather than the random var supplied by rnd 
     69// XXX we are using drand48() rather than the random var supplied by rnd
    7070double ppSimRandomGaussian (const psRandom *rnd, double mean, double sigma) {
    71  
     71
    7272  int i;
    7373  double y;
    74  
     74
    7575  if (gaussint == NULL) {
    7676      p_ppSimRandomGaussianInit ();
     
    8080  i = Ngaussint*y;
    8181  y = gaussint[i]*sigma + mean;
    82  
     82
    8383  return (y);
    84  
     84
    8585}
    86  
    87 // XXX we are using drand48() rather than the random var supplied by rnd 
     86
     87// XXX we are using drand48() rather than the random var supplied by rnd
    8888double ppSimRandomGaussianNorm (const psRandom *rnd) {
    89  
     89
    9090  int i;
    9191  double y;
    92  
     92
    9393  if (gaussint == NULL) {
    9494      p_ppSimRandomGaussianInit ();
     
    9898  i = Ngaussint*y;
    9999  y = gaussint[i];
    100  
     100
    101101  return (y);
    102102}
  • branches/cnb_branches/cnb_branch_20090301/ppSim/src/ppSimStars.c

    r17557 r23594  
    66}
    77
    8 ppSimStar *ppSimStarAlloc () {
     8ppSimStar *ppSimStarAlloc(void) {
    99
    1010    ppSimStar *star = (ppSimStar *) psAlloc(sizeof(ppSimStar));
     
    1919}
    2020
    21 ppSimGalaxy *ppSimGalaxyAlloc () {
     21ppSimGalaxy *ppSimGalaxyAlloc(void) {
    2222
    2323    ppSimGalaxy *galaxy = (ppSimGalaxy *) psAlloc(sizeof(ppSimGalaxy));
Note: See TracChangeset for help on using the changeset viewer.