Changeset 22724
- Timestamp:
- Mar 1, 2009, 9:32:54 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro
- Files:
-
- 6 edited
-
Makefile (modified) (1 diff)
-
include/relastro.h (modified) (5 diffs)
-
src/ConfigInit.c (modified) (2 diffs)
-
src/FitChip.c (modified) (7 diffs)
-
src/ImageOps.c (modified) (16 diffs)
-
src/initialize.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/Makefile
r17243 r22724 55 55 $(SRC)/relastro_objects.$(ARCH).o \ 56 56 $(SRC)/save_catalogs.$(ARCH).o \ 57 $(SRC)/write_coords.$(ARCH).o 57 $(SRC)/write_coords.$(ARCH).o \ 58 $(SRC)/relastroVisual.$(ARCH).o 58 59 59 60 $(RELASTRO): $(INC)/relastro.h $(KAPA_INCS) -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/include/relastro.h
r21508 r22724 44 44 double Ro, dRo; 45 45 double Do, dDo; 46 46 47 47 double uR, duR; 48 48 double uD, duD; … … 63 63 char flags; 64 64 Coords coords; 65 } Mosaic; 65 } Mosaic; 66 66 67 67 typedef struct { … … 87 87 88 88 double SIGMA_LIM; 89 int MIN_SRC_FIT; 89 90 double MIN_ERROR; 90 91 … … 145 146 int corner_check PROTO((double *x1, double *y1, double *x2, double *y2)); 146 147 void dumpGrid PROTO((void)); 147 void dump_grid PROTO((void)); 148 void dump_grid PROTO((void)); 148 149 int edge_check PROTO((double *x1, double *y1, double *x2, double *y2)); 149 150 void findImages PROTO((Catalog *catalog, int Ncatalog)); … … 220 221 int setMrelOutput PROTO((Catalog *catalog, int Ncatalog, int mark)); 221 222 void set_ZP PROTO((double ZERO)); 222 int setrefcode PROTO((Image *image, int Nimage)); 223 int setrefcode PROTO((Image *image, int Nimage)); 223 224 void skip_measurements PROTO((Catalog *catalog, int pass)); 224 225 void sortA PROTO((double *X, int N)); -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/ConfigInit.c
r17207 r22724 20 20 21 21 GetConfig (config, "RELASTRO_SIGMA_LIM", "%lf", 0, &SIGMA_LIM); 22 GetConfig (config, "RELASTRO_MIN_SRC_FIT", "%d", 0, &MIN_SRC_FIT); 22 23 23 24 // XXX these are used in relphot to identify poor stars / images -- define … … 55 56 fprintf (stderr, "directory %s does not exist, giving up\n", CATDIR); 56 57 exit (1); 57 } 58 } 58 59 59 60 /* update master photcode table if not defined */ -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/FitChip.c
r17209 r22724 1 1 # include "relastro.h" 2 # include "relastroVisual.h" 2 3 3 4 // XXX make these user parameters … … 22 23 23 24 ALLOCATE (values, double, Nmatch); 24 25 25 for (Niter = 0; Niter < FIT_CHIP_NITER; Niter ++) { 26 26 … … 33 33 dM = raw[i].M - ref[i].M; 34 34 dR = hypot (dL, dM); 35 35 36 36 values[Nscatter] = dR; 37 37 Nscatter++; … … 41 41 dsort (values, Nscatter); 42 42 dRmax = FIT_CHIP_NSIGMA*values[(int)(0.40*Nscatter)]; 43 relastroVisualPlotRawRef(raw, ref, dRmax, Nmatch); 43 44 44 45 // fit the requested order polynomial … … 57 58 dR = hypot (dL, dM); 58 59 if (dR > dRmax) continue; 59 60 60 61 fit_add (fit, raw[i].X, raw[i].Y, ref[i].L, ref[i].M, raw[i].dPos); 61 62 } … … 66 67 case 0: 67 68 case 1: 68 skip = (fit[0].Npts < 8);69 break;69 skip = (fit[0].Npts < 8); 70 break; 70 71 case 2: 71 skip = (fit[0].Npts < 11);72 break;72 skip = (fit[0].Npts < 11); 73 break; 73 74 case 3: 74 skip = (fit[0].Npts < 15);75 break;75 skip = (fit[0].Npts < 15); 76 break; 76 77 default: 77 fprintf (stderr, "invalid chip order %d\n", coords[0].Npolyterms);78 abort ();78 fprintf (stderr, "invalid chip order %d\n", coords[0].Npolyterms); 79 abort (); 79 80 } 80 81 if (skip) { … … 95 96 XY_to_LM (&raw[i].L, &raw[i].M, raw[i].X, raw[i].Y, coords); 96 97 } 98 99 relastroVisualPlotRawRef(fit, coords, dRmax, Nmatch); 100 97 101 } 98 102 -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/ImageOps.c
r17243 r22724 91 91 for (i = 0; VERBOSE && (i < Nimage); i++) { 92 92 name = GetPhotcodeNamebyCode (image[i].photcode); 93 fprintf (stderr, "image %d has %d measures (%s, %s)\n", i, Nlist[i], 94 ohana_sec_to_date(image[i].tzero), name);95 } 93 fprintf (stderr, "image %d has %d measures (%s, %s)\n", i, Nlist[i], 94 ohana_sec_to_date(image[i].tzero), name); 95 } 96 96 } 97 97 … … 101 101 int i; 102 102 Measure *measure; 103 103 104 104 measure = &catalog[cat].measure[meas]; 105 105 … … 110 110 if (measure[0].t < start[i]) continue; 111 111 if (measure[0].t > stop[i]) continue; 112 112 113 113 // index for (catalog, measure) -> image 114 114 bin[cat][meas] = i; … … 125 125 REALLOCATE (clist[i], int, NLIST[i]); 126 126 REALLOCATE (mlist[i], int, NLIST[i]); 127 } 127 } 128 128 return; 129 129 } … … 157 157 158 158 plot_defaults (&graphdata); 159 graphdata.ymin = PlotdMmin; 159 graphdata.ymin = PlotdMmin; 160 160 graphdata.ymax = PlotdMmax; 161 161 plot_list (&graphdata, xlist, Mlist, Nimage, "airmass vs Mcal", "airmass.png"); … … 191 191 int i, m, c, n; 192 192 double X, Y, L, M, P, Q, R, D, dR, dD; 193 193 194 194 Mosaic *mosaic; 195 195 Coords *moscoords, *imcoords; 196 196 197 197 moscoords = NULL; 198 198 mosaic = getMosaicForImage (im); … … 224 224 dR = 3600.0*(catalog[c].average[n].R - R); 225 225 dD = 3600.0*(catalog[c].average[n].D - D); 226 226 227 227 if (fabs(catalog[c].measure[m].dR - dR) > 10.0) { 228 228 // XXXXX running into this still for last megacam exposure: wrong mosaic? … … 249 249 catalog[c].measure[m].dR = 3600.0*(catalog[c].average[n].R - R); 250 250 } 251 } 251 } 252 252 return; 253 253 } … … 259 259 260 260 int i, m, c, n; 261 261 262 262 Mosaic *mosaic; 263 263 Coords *moscoords; 264 264 StarData *raw; 265 265 266 266 ALLOCATE (raw, StarData, Nlist[im]); 267 267 … … 271 271 mosaic = getMosaicForImage (im); 272 272 if (mosaic == NULL) { 273 fprintf (stderr, "mosaic not found for image %s\n", image[im].name);274 exit (1);273 fprintf (stderr, "mosaic not found for image %s\n", image[im].name); 274 exit (1); 275 275 } 276 276 moscoords = &mosaic[0].coords; … … 284 284 raw[i].X = catalog[c].measure[m].Xccd; 285 285 raw[i].Y = catalog[c].measure[m].Yccd; 286 286 287 287 raw[i].Mag = catalog[c].measure[m].M; 288 288 raw[i].dMag = catalog[c].measure[m].dM; … … 293 293 // an object with only one detection provides no information about the image calibration 294 294 raw[i].mask = FALSE; 295 if (catalog[c].average[n].Nmeasure < 2) {295 if (catalog[c].average[n].Nmeasure < MIN_SRC_FIT) { 296 296 raw[i].mask = TRUE; 297 297 } … … 299 299 switch (mode) { 300 300 case MODE_SIMPLE: 301 /* note that for a Simple image, L,M = P,Q */302 XY_to_LM (&raw[i].L, &raw[i].M, raw[i].X, raw[i].Y, &image[im].coords);303 raw[i].P = raw[i].L;304 raw[i].Q = raw[i].M;305 LM_to_RD (&raw[i].R, &raw[i].D, raw[i].P, raw[i].Q, &image[im].coords);306 break;301 /* note that for a Simple image, L,M = P,Q */ 302 XY_to_LM (&raw[i].L, &raw[i].M, raw[i].X, raw[i].Y, &image[im].coords); 303 raw[i].P = raw[i].L; 304 raw[i].Q = raw[i].M; 305 LM_to_RD (&raw[i].R, &raw[i].D, raw[i].P, raw[i].Q, &image[im].coords); 306 break; 307 307 case MODE_MOSAIC: 308 XY_to_LM (&raw[i].L, &raw[i].M, raw[i].X, raw[i].Y, &image[im].coords);309 XY_to_LM (&raw[i].P, &raw[i].Q, raw[i].L, raw[i].M, moscoords);310 LM_to_RD (&raw[i].R, &raw[i].D, raw[i].P, raw[i].Q, moscoords);311 break;308 XY_to_LM (&raw[i].L, &raw[i].M, raw[i].X, raw[i].Y, &image[im].coords); 309 XY_to_LM (&raw[i].P, &raw[i].Q, raw[i].L, raw[i].M, moscoords); 310 LM_to_RD (&raw[i].R, &raw[i].D, raw[i].P, raw[i].Q, moscoords); 311 break; 312 312 default: 313 313 fprintf (stderr, "error: invalid mode in getImageRaw"); 314 314 abort (); 315 315 } 316 } 316 } 317 317 318 318 *Nstars = Nlist[im]; … … 330 330 Coords *moscoords; 331 331 StarData *ref; 332 332 333 333 ALLOCATE (ref, StarData, Nlist[im]); 334 334 … … 352 352 ref[i].R = catalog[c].average[n].R; 353 353 ref[i].D = catalog[c].average[n].D; 354 354 355 355 ref[i].Mag = catalog[c].measure[m].M; 356 356 ref[i].dMag = catalog[c].measure[m].dM; … … 373 373 break; 374 374 default: 375 fprintf (stderr, "invalid case");376 abort();377 } 378 } 379 375 fprintf (stderr, "invalid case"); 376 abort(); 377 } 378 } 379 380 380 *Nstars = Nlist[im]; 381 381 return (ref); -
branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/initialize.c
r17213 r22724 25 25 fprintf (stderr, "codename: %s\n", codename); 26 26 if ((photcodesKeep[NphotcodesKeep] = GetPhotcodebyName (codename)) == NULL) { 27 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", codename);28 exit (1);27 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", codename); 28 exit (1); 29 29 } 30 30 NphotcodesKeep ++; … … 46 46 fprintf (stderr, "codename: %s\n", codename); 47 47 if ((photcodesSkip[NphotcodesSkip] = GetPhotcodebyName (codename)) == NULL) { 48 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", codename);49 exit (1);48 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", codename); 49 exit (1); 50 50 } 51 51 NphotcodesSkip ++;
Note:
See TracChangeset
for help on using the changeset viewer.
