IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28990


Ignore:
Timestamp:
Aug 20, 2010, 11:08:17 AM (16 years ago)
Author:
eugene
Message:

update from trunk

Location:
branches/eam_branches/ipp-20100621/Ohana/src/addstar
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100621/Ohana/src/addstar/include/addstar.h

    r27435 r28990  
    209209Stars     *ReadStarsSDSS          PROTO((FILE *f, char *name, Header *header, Header *in_theader, Image *images, off_t *nimages, unsigned int *nstars));
    210210int        ReadImageHeader        PROTO((Header *header, Image *image, int photcode));
    211 Stars     *FilterStars            PROTO((Stars *instars, Image *image, unsigned int imageID));
     211Stars     *FilterStars            PROTO((Stars *instars, Image *image, unsigned int imageID, const AddstarClientOptions *options));
    212212Stars     *MergeStars             PROTO((Stars *stars, unsigned int *Nstars, Stars *instars, unsigned int Ninstars));
    213213double     scat_subpix            PROTO((double x, double y));
  • branches/eam_branches/ipp-20100621/Ohana/src/addstar/src/ConfigInit.c

    r28214 r28990  
    212212  }
    213213
     214  /* get detection filtering mask */
     215  if(!ScanConfig (config, "DETECTIONFILTER", "%d", 0, &options.detectionFilter)) {
     216      options.detectionFilter = 0;
     217      fprintf (stderr, "Could not find 'DETECTIONFILTER' in config, using '%x'\n", options.detectionFilter);
     218  }
     219
    214220  free (config);
    215221  free (file);
  • branches/eam_branches/ipp-20100621/Ohana/src/addstar/src/FilterStars.c

    r28214 r28990  
    1010// the imageID supplied here is the sequence **within this set**
    1111// this value is updated based on the image table later
    12 Stars *FilterStars (Stars *instars, Image *image, unsigned int imageID) {
     12Stars *FilterStars (Stars *instars, Image *image, unsigned int imageID, const AddstarClientOptions *options) {
    1313
    1414  int j, N;
     
    2828  ALLOCATE (stars, Stars, image[0].nstar);
    2929  for (N = j = 0; j < image[0].nstar; j++) {
     30
     31    if (instars[j].measure.photFlags & options->detectionFilter) continue;
    3032
    3133    /* allow for some dynamic filtering of star list */
     
    100102    N ++;
    101103  }
     104
     105  // DEBUG printf("N stars orig = %d after filter = %d\n", image[0].nstar, N);
     106 
    102107  image[0].nstar = N;
    103108  REALLOCATE (stars, Stars, image[0].nstar);
  • branches/eam_branches/ipp-20100621/Ohana/src/addstar/src/LoadData.c

    r28723 r28990  
    8484      continue;
    8585    }
    86 
    87     inStars = FilterStars (inStars, &images[0][Nvalid], Nvalid);
     86    inStars = FilterStars (inStars, &images[0][Nvalid], Nvalid, options);
    8887    *stars = MergeStars (*stars, Nstars, inStars, images[0][Nvalid].nstar);
    8988    Nvalid++;
  • branches/eam_branches/ipp-20100621/Ohana/src/addstar/src/ReadStarsSDSS.c

    r27435 r28990  
    1111  NAME = (TYPE *) gfits_get_bintable_column_data (table.header, &table, #NAME, type, &Nrow, &Ncol); \
    1212  assert (NAME); assert (!strcmp (type, #TYPE)); assert (Nrow == Nstars); assert (Ncol == NFILTER);
     13
     14# define GET_COLUMN_5_NOASSERT(NAME,TYPE) \
     15  TYPE *NAME; \
     16  NAME = (TYPE *) gfits_get_bintable_column_data (table.header, &table, #NAME, type, &Nrow, &Ncol);
    1317
    1418# define GET_COLUMN_1(NAME,TYPE) \
     
    123127  GET_COLUMN_5 (flags2, int);
    124128
     129#ifdef notyet
    125130  GET_COLUMN_5 (prob_psf, float);
     131#else
     132  GET_COLUMN_5_NOASSERT (prob_psf, float);
     133#endif
    126134
    127135  GET_COLUMN_1 (ra, double);
     
    160168      stars[N].measure.FWx       = ShortPixels(seeing[j]); // reported in arcsec?
    161169      stars[N].measure.FWy       = ShortPixels(seeing[j]);
    162       stars[N].measure.psfChisq  = prob_psf[N]; // XXX not really the correct value...
     170      if (prob_psf) {
     171          stars[N].measure.psfChisq  = prob_psf[N]; // XXX not really the correct value...
     172      } else {
     173          stars[N].measure.psfChisq  = NAN;
     174      }
    163175      stars[N].measure.detID     = N;
    164176      stars[N].measure.t         = tzero[j] + clockRate*rowc[N]; // time since row 0
    165       stars[N].measure.dt        = 53.907456; // is this 2048*clockRate ?
     177      stars[N].measure.dt        = 4.32912209; // 2.5 * log(53.907456) the sdss exposure time // old comment is 53907456 is this 2048*clockRate ?
    166178
    167179      SetSDSSFlags (&stars[N], flags[N], flags2[N]);
     
    182194      stars[N].measure.az        = az;
    183195      stars[N].measure.photcode  = photcode[j];
     196      stars[N].measure.imageID   = j + *nimages; // set imageID to entry for this filter
    184197    }
    185198  }   
     
    254267    images[N].externID = 0;
    255268    images[N].sourceID = 0;
     269    images[N].parentID = UINT32_MAX; // UpdateImageIDs sets parentID = 0
    256270
    257271    // save the filename
  • branches/eam_branches/ipp-20100621/Ohana/src/addstar/src/find_matches.c

    r28241 r28990  
    247247    }
    248248
    249     N = N1[i];
    250     if (stars[N].found >= 0) continue;
    251     if (!IN_REGION (stars[N].average.R, stars[N].average.D)) continue;
    252 
    253     catalog[0].average[Nave].R             = stars[N].average.R;
    254     catalog[0].average[Nave].D             = stars[N].average.D;
     249    if (stars[i].found >= 0) continue;
     250    if (!IN_REGION (stars[i].average.R, stars[i].average.D)) continue;
     251
     252    catalog[0].average[Nave].R             = stars[i].average.R;
     253    catalog[0].average[Nave].D             = stars[i].average.D;
    255254    catalog[0].average[Nave].dR            = 0;
    256255    catalog[0].average[Nave].dD            = 0;
     
    303302    for (j = 0; j < NSTAR_GROUP; j++) {
    304303      // supply the measurments from this detection
    305       catalog[0].measure[Nmeas]           = stars[N].measure;
    306       N = N1[i + j];
     304      catalog[0].measure[Nmeas]           = stars[i + j].measure;
    307305
    308306      // the following measure elements cannot be set until here:
     
    322320      /* next[Nmeas] should always be -1 in this context (it is always the only
    323321         measurement for the star) */
    324       stars[N].found = Nmeas;
     322      stars[i].found = Nmeas;
    325323      next_meas[Nmeas] = -1;  // initial value here update below
    326324      Nmeas ++;
  • branches/eam_branches/ipp-20100621/Ohana/src/addstar/src/find_matches_closest.c

    r28241 r28990  
    242242    }
    243243
    244     N = N1[i];
    245     if (stars[N].found >= 0) continue;
    246     if (!IN_REGION (stars[N].average.R, stars[N].average.D)) continue;
    247 
    248     catalog[0].average[Nave].R             = stars[N].average.R;
    249     catalog[0].average[Nave].D             = stars[N].average.D;
     244    if (stars[i].found >= 0) continue;
     245    if (!IN_REGION (stars[i].average.R, stars[i].average.D)) continue;
     246
     247    catalog[0].average[Nave].R             = stars[i].average.R;
     248    catalog[0].average[Nave].D             = stars[i].average.D;
    250249    catalog[0].average[Nave].dR            = 0;
    251250    catalog[0].average[Nave].dD            = 0;
     
    297296    for (j = 0; j < NSTAR_GROUP; j++) {
    298297        // supply the measurments from this detection
    299         catalog[0].measure[Nmeas]           = stars[N].measure;
    300         N = N1[i + j];
     298        catalog[0].measure[Nmeas]           = stars[i + j].measure;
    301299
    302300        // the following measure elements cannot be set until here:
     
    316314        /* next[Nmeas] should always be -1 in this context (it is always the only
    317315           measurement for the star) */
    318         stars[N].found = Nmeas;
     316        stars[i+j].found = Nmeas;
    319317        next_meas[Nmeas] = -1;  // inital value here update below
    320318        Nmeas ++;
Note: See TracChangeset for help on using the changeset viewer.