Changeset 28990
- Timestamp:
- Aug 20, 2010, 11:08:17 AM (16 years ago)
- Location:
- branches/eam_branches/ipp-20100621/Ohana/src/addstar
- Files:
-
- 7 edited
-
include/addstar.h (modified) (1 diff)
-
src/ConfigInit.c (modified) (1 diff)
-
src/FilterStars.c (modified) (3 diffs)
-
src/LoadData.c (modified) (1 diff)
-
src/ReadStarsSDSS.c (modified) (5 diffs)
-
src/find_matches.c (modified) (3 diffs)
-
src/find_matches_closest.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100621/Ohana/src/addstar/include/addstar.h
r27435 r28990 209 209 Stars *ReadStarsSDSS PROTO((FILE *f, char *name, Header *header, Header *in_theader, Image *images, off_t *nimages, unsigned int *nstars)); 210 210 int ReadImageHeader PROTO((Header *header, Image *image, int photcode)); 211 Stars *FilterStars PROTO((Stars *instars, Image *image, unsigned int imageID ));211 Stars *FilterStars PROTO((Stars *instars, Image *image, unsigned int imageID, const AddstarClientOptions *options)); 212 212 Stars *MergeStars PROTO((Stars *stars, unsigned int *Nstars, Stars *instars, unsigned int Ninstars)); 213 213 double scat_subpix PROTO((double x, double y)); -
branches/eam_branches/ipp-20100621/Ohana/src/addstar/src/ConfigInit.c
r28214 r28990 212 212 } 213 213 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 214 220 free (config); 215 221 free (file); -
branches/eam_branches/ipp-20100621/Ohana/src/addstar/src/FilterStars.c
r28214 r28990 10 10 // the imageID supplied here is the sequence **within this set** 11 11 // this value is updated based on the image table later 12 Stars *FilterStars (Stars *instars, Image *image, unsigned int imageID ) {12 Stars *FilterStars (Stars *instars, Image *image, unsigned int imageID, const AddstarClientOptions *options) { 13 13 14 14 int j, N; … … 28 28 ALLOCATE (stars, Stars, image[0].nstar); 29 29 for (N = j = 0; j < image[0].nstar; j++) { 30 31 if (instars[j].measure.photFlags & options->detectionFilter) continue; 30 32 31 33 /* allow for some dynamic filtering of star list */ … … 100 102 N ++; 101 103 } 104 105 // DEBUG printf("N stars orig = %d after filter = %d\n", image[0].nstar, N); 106 102 107 image[0].nstar = N; 103 108 REALLOCATE (stars, Stars, image[0].nstar); -
branches/eam_branches/ipp-20100621/Ohana/src/addstar/src/LoadData.c
r28723 r28990 84 84 continue; 85 85 } 86 87 inStars = FilterStars (inStars, &images[0][Nvalid], Nvalid); 86 inStars = FilterStars (inStars, &images[0][Nvalid], Nvalid, options); 88 87 *stars = MergeStars (*stars, Nstars, inStars, images[0][Nvalid].nstar); 89 88 Nvalid++; -
branches/eam_branches/ipp-20100621/Ohana/src/addstar/src/ReadStarsSDSS.c
r27435 r28990 11 11 NAME = (TYPE *) gfits_get_bintable_column_data (table.header, &table, #NAME, type, &Nrow, &Ncol); \ 12 12 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); 13 17 14 18 # define GET_COLUMN_1(NAME,TYPE) \ … … 123 127 GET_COLUMN_5 (flags2, int); 124 128 129 #ifdef notyet 125 130 GET_COLUMN_5 (prob_psf, float); 131 #else 132 GET_COLUMN_5_NOASSERT (prob_psf, float); 133 #endif 126 134 127 135 GET_COLUMN_1 (ra, double); … … 160 168 stars[N].measure.FWx = ShortPixels(seeing[j]); // reported in arcsec? 161 169 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 } 163 175 stars[N].measure.detID = N; 164 176 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 ? 166 178 167 179 SetSDSSFlags (&stars[N], flags[N], flags2[N]); … … 182 194 stars[N].measure.az = az; 183 195 stars[N].measure.photcode = photcode[j]; 196 stars[N].measure.imageID = j + *nimages; // set imageID to entry for this filter 184 197 } 185 198 } … … 254 267 images[N].externID = 0; 255 268 images[N].sourceID = 0; 269 images[N].parentID = UINT32_MAX; // UpdateImageIDs sets parentID = 0 256 270 257 271 // save the filename -
branches/eam_branches/ipp-20100621/Ohana/src/addstar/src/find_matches.c
r28241 r28990 247 247 } 248 248 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; 255 254 catalog[0].average[Nave].dR = 0; 256 255 catalog[0].average[Nave].dD = 0; … … 303 302 for (j = 0; j < NSTAR_GROUP; j++) { 304 303 // 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; 307 305 308 306 // the following measure elements cannot be set until here: … … 322 320 /* next[Nmeas] should always be -1 in this context (it is always the only 323 321 measurement for the star) */ 324 stars[ N].found = Nmeas;322 stars[i].found = Nmeas; 325 323 next_meas[Nmeas] = -1; // initial value here update below 326 324 Nmeas ++; -
branches/eam_branches/ipp-20100621/Ohana/src/addstar/src/find_matches_closest.c
r28241 r28990 242 242 } 243 243 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; 250 249 catalog[0].average[Nave].dR = 0; 251 250 catalog[0].average[Nave].dD = 0; … … 297 296 for (j = 0; j < NSTAR_GROUP; j++) { 298 297 // 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; 301 299 302 300 // the following measure elements cannot be set until here: … … 316 314 /* next[Nmeas] should always be -1 in this context (it is always the only 317 315 measurement for the star) */ 318 stars[ N].found = Nmeas;316 stars[i+j].found = Nmeas; 319 317 next_meas[Nmeas] = -1; // inital value here update below 320 318 Nmeas ++;
Note:
See TracChangeset
for help on using the changeset viewer.
