Changeset 32055
- Timestamp:
- Aug 9, 2011, 12:25:01 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110710/Ohana/src/relastro
- Files:
-
- 2 added
- 16 edited
-
Makefile (modified) (1 diff)
-
include/relastro.h (modified) (4 diffs)
-
src/CoordOps.c (modified) (1 diff)
-
src/FitPM.c (modified) (1 diff)
-
src/FitPMandPar.c (modified) (2 diffs)
-
src/FixProblemImages.c (modified) (1 diff)
-
src/ImageOps.c (modified) (3 diffs)
-
src/StarMaps.c (modified) (4 diffs)
-
src/UpdateChips.c (modified) (1 diff)
-
src/UpdateMeasures.c (modified) (1 diff)
-
src/UpdateObjects.c (modified) (2 diffs)
-
src/UpdateSimple.c (modified) (1 diff)
-
src/args.c (modified) (4 diffs)
-
src/initialize.c (modified) (1 diff)
-
src/load_images.c (modified) (2 diffs)
-
src/relastro.c (modified) (1 diff)
-
src/relastro_merge_source.c (added)
-
src/resort_catalog.c (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110710/Ohana/src/relastro/Makefile
r31635 r32055 62 62 $(SRC)/high_speed_objects.$(ARCH).o \ 63 63 $(SRC)/high_speed_utils.$(ARCH).o \ 64 $(SRC)/relastro_merge_source.$(ARCH).o \ 65 $(SRC)/resort_catalog.$(ARCH).o \ 64 66 $(SRC)/relastroVisual.$(ARCH).o 65 67 -
branches/eam_branches/ipp-20110710/Ohana/src/relastro/include/relastro.h
r31664 r32055 15 15 typedef enum {FIT_NONE, FIT_AVERAGE, FIT_PM_ONLY, FIT_PAR_ONLY, FIT_PM_AND_PAR} FitMode; 16 16 17 typedef enum {TARGET_NONE, TARGET_OBJECTS, TARGET_SIMPLE, TARGET_CHIPS, TARGET_MOSAICS, TARGET_HIGH_SPEED } FitTarget;17 typedef enum {TARGET_NONE, TARGET_OBJECTS, TARGET_SIMPLE, TARGET_CHIPS, TARGET_MOSAICS, TARGET_HIGH_SPEED, TARGET_MERGE_SOURCE} FitTarget; 18 18 19 19 typedef struct { … … 94 94 char SKY_TABLE[256]; 95 95 int SKY_DEPTH; /** XXX EAM : depth of catalog tables, fix usage */ 96 97 unsigned int OBJ_ID_SRC; 98 unsigned int CAT_ID_SRC; 99 unsigned int OBJ_ID_DST; 100 unsigned int CAT_ID_DST; 96 101 97 102 double SIGMA_LIM; … … 210 215 void getfullregion PROTO((Image *image, off_t Nimage, GSCRegion *fullregion)); 211 216 Image *getimage PROTO((off_t N)); 212 Image *getimages PROTO((off_t *N ));217 Image *getimages PROTO((off_t *N, off_t **line_number)); 213 218 void global_stats PROTO((Catalog *catalog, int Ncatalog)); 214 219 void initGrid PROTO((int dX, int dY)); 215 220 void initGridBins PROTO((Catalog *catalog, int Ncatalog)); 216 221 void initImageBins PROTO((Catalog *catalog, int Ncatalog, int FULLINIT)); 217 void initImages PROTO((Image *input, off_t N));222 void initImages PROTO((Image *input, off_t *line_number, off_t N)); 218 223 void initMosaicBins PROTO((Catalog *catalog, int Ncatalog)); 219 224 void initMosaicGrid PROTO((Image *image, off_t Nimage)); … … 372 377 int applyConstraintsB(Catalog *catalog, off_t i); 373 378 void setupAreaSelection(SkyRegion *region); 379 380 int relastro_merge_source (); 381 void resort_catalog (Catalog *catalog); -
branches/eam_branches/ipp-20110710/Ohana/src/relastro/src/CoordOps.c
r27581 r32055 13 13 Image *images; 14 14 15 images = getimages (&N );15 images = getimages (&N, NULL); 16 16 17 17 NoldCoords = N; -
branches/eam_branches/ipp-20110710/Ohana/src/relastro/src/FitPM.c
r17210 r32055 73 73 chisq = 0.0; 74 74 for (i = 0; i < Npts; i++) { 75 Xf = fit[0].Ro + fit[0].uR*T[i];76 Yf = fit[0].Do + fit[0].uD*T[i];77 chisq += SQ(X[i] - Xf) / SQ(dX[i]);78 chisq += SQ(Y[i] - Yf) / SQ(dY[i]);75 Xf = fit[0].Ro + fit[0].uR*T[i]; 76 Yf = fit[0].Do + fit[0].uD*T[i]; 77 chisq += SQ(X[i] - Xf) / SQ(dX[i]); 78 chisq += SQ(Y[i] - Yf) / SQ(dY[i]); 79 79 } 80 80 fit[0].Nfit = Npts; -
branches/eam_branches/ipp-20110710/Ohana/src/relastro/src/FitPMandPar.c
r16060 r32055 9 9 double wx, wy, Wx, Wy, Tx, Ty, Tx2, Ty2, Xs, Ys, XT, YT; 10 10 double PR, PD, PRT, PDT, PRX, PDY, PR2, PD2; 11 double chisq, Xf, Yf; 11 12 12 13 A = array_init (5, 5); … … 95 96 /* get the chisq from the matrix values */ 96 97 98 // add up the chi square for the fit 99 chisq = 0.0; 100 for (i = 0; i < Npts; i++) { 101 Xf = fit[0].Ro + fit[0].uR*T[i] + fit[0].dp*pR[i]; 102 Yf = fit[0].Do + fit[0].uD*T[i] + fit[0].dp*pD[i]; 103 chisq += SQ(X[i] - Xf) / SQ(dX[i]); 104 chisq += SQ(Y[i] - Yf) / SQ(dY[i]); 105 } 106 fit[0].Nfit = Npts; 107 108 // the reduced chisq is divided by (Ndof = 2*Npts - 5) 109 fit[0].chisq = chisq / (2.0*Npts - 5.0); 97 110 return (TRUE); 98 111 } -
branches/eam_branches/ipp-20110710/Ohana/src/relastro/src/FixProblemImages.c
r27581 r32055 15 15 ALLOCATE (sublist.filename, char *, 1); 16 16 17 image = getimages (&Nimage );17 image = getimages (&Nimage, NULL); 18 18 19 19 Nbad = 0; -
branches/eam_branches/ipp-20110710/Ohana/src/relastro/src/ImageOps.c
r31664 r32055 11 11 static Image *image; // list of available images 12 12 static off_t Nimage; // number of available images 13 static off_t *LineNumber; // match of subset to full image table 13 14 14 15 static int *Ncatlist; // catalogs associated with each image … … 27 28 # endif 28 29 29 Image *getimages (off_t *N) { 30 Image *getimages (off_t *N, off_t **line_number) { 31 30 32 *N = Nimage; 33 if (line_number) *line_number = LineNumber; 31 34 return (image); 32 35 } … … 42 45 } 43 46 44 void initImages (Image *input, off_t N) {47 void initImages (Image *input, off_t *line_number, off_t N) { 45 48 46 49 off_t i; 47 50 48 51 image = input; 52 LineNumber = line_number; 49 53 Nimage = N; 50 54 -
branches/eam_branches/ipp-20110710/Ohana/src/relastro/src/StarMaps.c
r30616 r32055 40 40 off_t i, Nimages; 41 41 42 images = getimages(&Nimages );42 images = getimages(&Nimages, NULL); 43 43 44 44 ALLOCATE (starmap, StarMap, Nimages); … … 64 64 gettimeofday (&start, (void *) NULL); 65 65 66 images = getimages(&Nimages );66 images = getimages(&Nimages, NULL); 67 67 68 68 for (i = 0; i < catalog[0].Nmeasure; i++) { … … 90 90 int ix, iy; 91 91 92 images = getimages(&Nimages );92 images = getimages(&Nimages, NULL); 93 93 94 94 for (i = 0; i < Nimages; i++) { … … 129 129 double L, M, dLmax, dMmax; 130 130 131 images = getimages(&Nimages );131 images = getimages(&Nimages, NULL); 132 132 133 133 dLmax = dMmax = 0.0; -
branches/eam_branches/ipp-20110710/Ohana/src/relastro/src/UpdateChips.c
r30616 r32055 18 18 Nskip = Nmosaic = NnewFit = NoldFit = 0; 19 19 20 image = getimages (&Nimage );20 image = getimages (&Nimage, NULL); 21 21 22 22 // save fit results for summary plot -
branches/eam_branches/ipp-20110710/Ohana/src/relastro/src/UpdateMeasures.c
r29001 r32055 13 13 ID_IMAGE_ASTROM_FEW; 14 14 15 image = getimages (&Nimage );15 image = getimages (&Nimage, NULL); 16 16 17 17 for (i = 0; i < Nimage; i++) { -
branches/eam_branches/ipp-20110710/Ohana/src/relastro/src/UpdateObjects.c
r31450 r32055 196 196 } 197 197 198 XVERB = FALSE &&(catalog[i].measure[m].dM < 0.01) && (N == 6) && (mode == FIT_PM_ONLY);198 XVERB = (catalog[i].measure[m].dM < 0.01) && (N == 6) && (mode == FIT_PM_ONLY); 199 199 200 200 // to judge the quality of the PM and PAR fits, we need to fit all three models and compare Chisq … … 225 225 226 226 if (mode == FIT_PM_AND_PAR) { 227 fprintf (stderr, "parallax fitting is still untested (%s, %d)", __FILE__, __LINE__); 228 exit (2); 227 // fprintf (stderr, "parallax fitting is still untested (%s, %d)\n", __FILE__, __LINE__); 229 228 230 229 for (k = 0; k < N; k++) { -
branches/eam_branches/ipp-20110710/Ohana/src/relastro/src/UpdateSimple.c
r27581 r32055 8 8 StarData *raw, *ref; 9 9 10 image = getimages (&Nimage );10 image = getimages (&Nimage, NULL); 11 11 12 12 for (i = 0; i < Nimage; i++) { -
branches/eam_branches/ipp-20110710/Ohana/src/relastro/src/args.c
r31664 r32055 1 1 # include "relastro.h" 2 2 void usage (void); 3 void usage_merge_source (void); 4 void usage_merge_source_id (char *name); 3 5 4 6 int args (int argc, char **argv) { … … 6 8 int N; 7 9 double trange; 10 char *endptr; 8 11 9 12 /* possible operations */ 10 13 FIT_TARGET = TARGET_NONE; 11 14 FIT_MODE = FIT_AVERAGE; 15 16 if ((N = get_argument (argc, argv, "-merge-source"))) { 17 if (N > argc - 6) usage_merge_source(); 18 if (strcmp(argv[N+3], "into")) usage_merge_source(); 19 FIT_TARGET = TARGET_MERGE_SOURCE; 20 remove_argument (N, &argc, argv); 21 OBJ_ID_SRC = strtol(argv[N], &endptr, 0); 22 if (*endptr) usage_merge_source_id (argv[N]); 23 remove_argument (N, &argc, argv); 24 CAT_ID_SRC = strtol(argv[N], &endptr, 0); 25 if (*endptr) usage_merge_source_id (argv[N]); 26 remove_argument (N, &argc, argv); 27 remove_argument (N, &argc, argv); // remove the 'into' 28 OBJ_ID_DST = strtol(argv[N], &endptr, 0); 29 if (*endptr) usage_merge_source_id (argv[N]); 30 remove_argument (N, &argc, argv); 31 CAT_ID_DST = strtol(argv[N], &endptr, 0); 32 if (*endptr) usage_merge_source_id (argv[N]); 33 remove_argument (N, &argc, argv); 34 35 if (argc != 1) usage (); 36 return TRUE; 37 } 38 12 39 if ((N = get_argument (argc, argv, "-update-objects"))) { 13 40 remove_argument (N, &argc, argv); … … 307 334 fprintf (stderr, "ERROR: USAGE: relastro -region RA RA DEC DEC\n"); 308 335 fprintf (stderr, " OR: relastro -catalog (ra) (dec)\n\n"); 336 fprintf (stderr, " OR: relastro -high-speed [options]\n\n"); 337 fprintf (stderr, " OR: relastro -merge-source [options]\n\n"); 309 338 fprintf (stderr, " specify one of the following modes: \n"); 310 339 fprintf (stderr, " -update-objects\n"); … … 340 369 } 341 370 371 void usage_merge_source_id (char *name) { 372 373 fprintf (stderr, "ERROR: invalid ID %s (remember to prefix 0x to hex IDs)\n", name); 374 exit (2); 375 } 376 377 void usage_merge_source () { 378 fprintf (stderr, "ERROR: USAGE: relastro -merge-source (objID) (catID) into (objID) (catID)\n"); 379 exit (2); 380 } -
branches/eam_branches/ipp-20110710/Ohana/src/relastro/src/initialize.c
r31635 r32055 10 10 ConfigInit (&argc, argv); 11 11 args (argc, argv); 12 13 if (FIT_TARGET == TARGET_MERGE_SOURCE) return; 12 14 13 15 /* build a list of accepted photcodes. these will be used by bcatalog to accept or -
branches/eam_branches/ipp-20110710/Ohana/src/relastro/src/load_images.c
r31664 r32055 44 44 MARKTIME(" select images: %f sec\n", dtime); 45 45 46 // generate db->vtable from db->ftable based on the selection 47 // XXX does this simply duplicate the memory needlessly? we recreate these lines 48 // in reload_images. If we had saved the line numbers, we could avoid this 49 // vtable points *another* copy of the subset rows 50 // (the later call to 'reload_images' copies the subset elements back on top of 51 // the rows of the vtable) 52 // gfits_vtable_from_ftable (&db[0].ftable, &db[0].vtable, LineNumber, Nsubset); 53 // MARKTIME("converted ftable to vtable: %f sec\n", dtime); 54 55 initImages (subset, Nsubset); 46 initImages (subset, LineNumber, Nsubset); 56 47 MARKTIME(" init images: %f sec\n", dtime); 57 48 … … 68 59 69 60 Image *image; 70 off_t Nimage, Nx, i ;61 off_t Nimage, Nx, i, *LineNumber; 71 62 VTable *vtable; 72 63 73 image = getimages (&Nimage );64 image = getimages (&Nimage, &LineNumber); 74 65 66 gfits_vtable_from_ftable (&db[0].ftable, &db[0].vtable, LineNumber, Nimage); 75 67 vtable = &db[0].vtable; 76 68 -
branches/eam_branches/ipp-20110710/Ohana/src/relastro/src/relastro.c
r30616 r32055 23 23 if (FIT_TARGET == TARGET_HIGH_SPEED) { 24 24 high_speed_catalogs (); 25 exit (0); 26 } 27 28 /* the object analysis is a separate process iterating over catalogs */ 29 if (FIT_TARGET == TARGET_MERGE_SOURCE) { 30 relastro_merge_source (); 25 31 exit (0); 26 32 }
Note:
See TracChangeset
for help on using the changeset viewer.
