Changeset 23942
- Timestamp:
- Apr 21, 2009, 2:02:28 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sj_branches/sj_SDSSaddstar_branch_r23928_20090420/Ohana/src/addstar/src/ReadStarsSDSS.c
r23941 r23942 4 4 5 5 # define NFILTER 5 6 # define AR_OBJECT_STATUS_OK_RUN 0x10 6 7 # define dCOS(A) ((double) cos ((double)RAD_DEG*A)) 7 8 # define dSIN(A) ((double) sin ((double)RAD_DEG*A)) … … 33 34 Stars *ReadStarsSDSS (FILE *f, char *name, Header *header, Header *in_theader, Image *images, int *nimages, unsigned int *nstars) { 34 35 35 int i, j, N, Nskip, Nstars, camcol;36 int i, j, N, Nskip, Nstars, Nstars_used, camcol; 36 37 char type[80]; 37 38 Header theader; … … 146 147 // compensate for the difference. 147 148 149 Nstars_used = Nstars; 148 150 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 } 149 156 for (j = 0; j < NFILTER; j++) { 150 157 N = NFILTER*i + j; … … 199 206 } 200 207 208 // Throw away unneeded trailing (I hope) part of Stars 209 REALLOCATE (stars, Stars, NFILTER*Nstars_used); 210 201 211 for (i = 0; i < NFILTER; i++) { 202 212 … … 292 302 images[N].flags = 0; 293 303 294 images[N].nstar = Nstars ;304 images[N].nstar = Nstars_used; 295 305 296 306 images[N].imageID = N; … … 303 313 304 314 *nimages += NFILTER; 305 *nstars = Nstars *NFILTER;315 *nstars = Nstars_used*NFILTER; 306 316 return (stars); 307 317 }
Note:
See TracChangeset
for help on using the changeset viewer.
