IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23942


Ignore:
Timestamp:
Apr 21, 2009, 2:02:28 AM (17 years ago)
Author:
Sebastian Jester
Message:

Initial version that skips objects that are not OK_RUN - untested

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sj_branches/sj_SDSSaddstar_branch_r23928_20090420/Ohana/src/addstar/src/ReadStarsSDSS.c

    r23941 r23942  
    44
    55# define NFILTER 5
     6# define AR_OBJECT_STATUS_OK_RUN 0x10
    67# define dCOS(A)   ((double) cos ((double)RAD_DEG*A))
    78# define dSIN(A)   ((double) sin ((double)RAD_DEG*A))
     
    3334Stars *ReadStarsSDSS (FILE *f, char *name, Header *header, Header *in_theader, Image *images, int *nimages, unsigned int *nstars) {
    3435
    35   int i, j, N, Nskip, Nstars, camcol;
     36  int i, j, N, Nskip, Nstars, Nstars_used, camcol;
    3637  char type[80];
    3738  Header theader;
     
    146147  // compensate for the difference.
    147148
     149  Nstars_used = Nstars;
    148150  for (i = 0; i < Nstars; i++) {
     151    // Skip objects that are not OK_RUN
     152    if ( ((status[i]) & AR_OBJECT_STATUS_OK_RUN) != 0) {
     153      Nstars_used--;
     154      continue;
     155    }
    149156    for (j = 0; j < NFILTER; j++) {
    150157      N = NFILTER*i + j;
     
    199206  }
    200207
     208  // Throw away unneeded trailing (I hope) part of Stars
     209  REALLOCATE (stars, Stars, NFILTER*Nstars_used);
     210
    201211  for (i = 0; i < NFILTER; i++) {
    202212
     
    292302    images[N].flags = 0;
    293303
    294     images[N].nstar = Nstars;
     304    images[N].nstar = Nstars_used;
    295305
    296306    images[N].imageID = N;
     
    303313
    304314  *nimages += NFILTER;
    305   *nstars = Nstars*NFILTER;
     315  *nstars = Nstars_used*NFILTER;
    306316  return (stars);
    307317}
Note: See TracChangeset for help on using the changeset viewer.