Changeset 16040 for trunk/Ohana/src/addstar
- Timestamp:
- Jan 8, 2008, 12:50:52 PM (19 years ago)
- Location:
- trunk/Ohana/src/addstar
- Files:
-
- 1 deleted
- 7 edited
-
Makefile (modified) (4 diffs)
-
src/SEDops.c (modified) (2 diffs)
-
src/SkyListForStars.c (modified) (1 diff)
-
src/calibrate.c (modified) (1 diff)
-
src/find_matches.c (modified) (4 diffs)
-
src/find_matches_closest.c (modified) (4 diffs)
-
src/find_matches_refstars.c (modified) (4 diffs)
-
src/sort_lists.c (deleted)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/Makefile
r15036 r16040 68 68 $(SRC)/ReadStarsTEXT.$(ARCH).o \ 69 69 $(SRC)/FilterStars.$(ARCH).o \ 70 $(SRC)/sort_lists.$(ARCH).o \71 70 $(SRC)/ImageOptions.$(ARCH).o \ 72 71 $(SRC)/GetFileMode.$(ARCH).o \ … … 114 113 $(SRC)/opening_angle.$(ARCH).o \ 115 114 $(SRC)/replace_match.$(ARCH).o \ 116 $(SRC)/sort_lists.$(ARCH).o \117 115 $(SRC)/update_coords.$(ARCH).o 118 116 … … 151 149 $(SRC)/SkyRegionUtils.$(ARCH).o \ 152 150 $(SRC)/SkyListForStars.$(ARCH).o \ 153 $(SRC)/sort_lists.$(ARCH).o \154 151 $(SRC)/update_coords.$(ARCH).o \ 155 152 $(SRC)/Shutdown.$(ARCH).o \ … … 194 191 $(SRC)/find_matches_refstars.$(ARCH).o \ 195 192 $(SRC)/args_load2mass.$(ARCH).o \ 196 $(SRC)/sort_lists.$(ARCH).o \197 193 $(SRC)/replace_match.$(ARCH).o \ 198 194 $(SRC)/update_coords.$(ARCH).o \ -
trunk/Ohana/src/addstar/src/SEDops.c
r13479 r16040 57 57 SEDtableRow **sort_SEDtable (SEDtableRow *raw, int N) { 58 58 59 int l,j,ir,i; 60 SEDtableRow **value, *temp; 59 int i; 60 61 SEDtableRow **value; 61 62 62 63 if (N <= 0) return (NULL); … … 66 67 value[i] = &raw[i]; 67 68 } 68 if (N < 2) return (value); 69 70 l = N >> 1; 71 ir = N - 1; 72 for (;;) { 73 if (l > 0) { 74 l--; 75 temp = value[l]; 76 } 77 else { 78 temp = value[ir]; 79 value[ir] = value[0]; 80 if (--ir == 0) { 81 value[0] = temp; 82 return (value); 83 } 84 } 85 i = l; 86 j = (l << 1) + 1; 87 while (j <= ir) { 88 if (j < ir && value[j][0].color < value[j+1][0].color) ++j; 89 if (temp[0].color < value[j][0].color) { 90 value[i] = value[j]; 91 j += (i=j) + 1; 92 } 93 else j = ir + 1; 94 } 95 value[i] = temp; 96 } 69 70 # define SWAPFUNC(A,B){ SEDtableRow *temp = value[A]; value[A] = value[B]; value[B] = temp; } 71 # define COMPARE(A,B)(value[A][0].color < value[B][0].color) 72 73 OHANA_SORT (N, COMPARE, SWAPFUNC); 74 75 # undef SWAPFUNC 76 # undef COMPARE 97 77 98 78 return (value); -
trunk/Ohana/src/addstar/src/SkyListForStars.c
r14401 r16040 15 15 list[0].ownElements = FALSE; // free these elements when freeing the list 16 16 17 sort_stars (stars, Nstars); /* sort by RA */17 sort_stars_ra (stars, Nstars); /* sort by RA */ 18 18 for (i = 0; i < Nstars; i++) { 19 19 if (stars[i].found) continue; -
trunk/Ohana/src/addstar/src/calibrate.c
r15509 r16040 188 188 return; 189 189 } 190 fsort 2(Dmag, dDmag, Nkeep);190 fsortpair (Dmag, dDmag, Nkeep); 191 191 192 192 /* take sort list of Dmag, find median */ -
trunk/Ohana/src/addstar/src/find_matches.c
r15743 r16040 5 5 int i, j, n, N, J, status, Nstars; 6 6 double RADIUS, RADIUS2; 7 float*X1, *Y1, *X2, *Y2;8 floatdX, dY, dR;7 double *X1, *Y1, *X2, *Y2; 8 double dX, dY, dR; 9 9 int *N1, *N2, *next_meas; 10 10 int Nave, NAVE, Nmeas, NMEAS, Nmatch; … … 21 21 22 22 /** allocate local arrays (stars) **/ 23 ALLOCATE (X1, float, NstarsIn);24 ALLOCATE (Y1, float, NstarsIn);23 ALLOCATE (X1, double, NstarsIn); 24 ALLOCATE (Y1, double, NstarsIn); 25 25 ALLOCATE (N1, int, NstarsIn); 26 26 27 27 /** allocate local arrays (catalog) **/ 28 28 NAVE = Nave = catalog[0].Naverage; 29 ALLOCATE (X2, float, NAVE);30 ALLOCATE (Y2, float, NAVE);29 ALLOCATE (X2, double, NAVE); 30 ALLOCATE (Y2, double, NAVE); 31 31 ALLOCATE (N2, int, NAVE); 32 32 ALLOCATE (catalog[0].found, int, NAVE); … … 60 60 Nstars = 0; 61 61 for (i = 0; i < NstarsIn; i++) { 62 status = fRD_to_XY (&X1[Nstars], &Y1[Nstars], stars[i].R, stars[i].D, &tcoords);62 status = RD_to_XY (&X1[Nstars], &Y1[Nstars], stars[i].R, stars[i].D, &tcoords); 63 63 if (!status) continue; 64 64 N1[Nstars] = i; … … 76 76 return (0); 77 77 } 78 if (Nstars > 1) sort_ lists(X1, Y1, N1, Nstars);78 if (Nstars > 1) sort_coords_index (X1, Y1, N1, Nstars); 79 79 80 80 /* build spatial index (RA sort) */ 81 81 for (i = 0; i < Nave; i++) { 82 fRD_to_XY (&X2[i], &Y2[i], catalog[0].average[i].R, catalog[0].average[i].D, &tcoords);82 RD_to_XY (&X2[i], &Y2[i], catalog[0].average[i].R, catalog[0].average[i].D, &tcoords); 83 83 N2[i] = i; 84 84 catalog[0].found[N2[i]] = -1; 85 85 } 86 if (Nave > 1) sort_ lists(X2, Y2, N2, Nave);86 if (Nave > 1) sort_coords_index (X2, Y2, N2, Nave); 87 87 88 88 /* set up pointers for linked list of measure */ -
trunk/Ohana/src/addstar/src/find_matches_closest.c
r15743 r16040 5 5 int i, j, n, N, J, Jmin, status, Nstars; 6 6 double RADIUS, RADIUS2, Rmin; 7 float*X1, *Y1, *X2, *Y2;8 floatdX, dY, dR;7 double *X1, *Y1, *X2, *Y2; 8 double dX, dY, dR; 9 9 int *N1, *N2, *next_meas, *next_miss; 10 10 int Nave, NAVE, Nmeas, NMEAS, Nmiss, NMISS, Nmatch; … … 21 21 22 22 /** allocate local arrays (stars) **/ 23 ALLOCATE (X1, float, NstarsIn);24 ALLOCATE (Y1, float, NstarsIn);23 ALLOCATE (X1, double, NstarsIn); 24 ALLOCATE (Y1, double, NstarsIn); 25 25 ALLOCATE (N1, int, NstarsIn); 26 26 27 27 /** allocate local arrays (catalog) **/ 28 28 NAVE = Nave = catalog[0].Naverage; 29 ALLOCATE (X2, float, NAVE);30 ALLOCATE (Y2, float, NAVE);29 ALLOCATE (X2, double, NAVE); 30 ALLOCATE (Y2, double, NAVE); 31 31 ALLOCATE (N2, int, NAVE); 32 32 ALLOCATE (catalog[0].found, int, NAVE); … … 61 61 Nstars = 0; 62 62 for (i = 0; i < NstarsIn; i++) { 63 status = fRD_to_XY (&X1[Nstars], &Y1[Nstars], stars[i].R, stars[i].D, &tcoords);63 status = RD_to_XY (&X1[Nstars], &Y1[Nstars], stars[i].R, stars[i].D, &tcoords); 64 64 if (!status) continue; 65 65 N1[Nstars] = i; … … 77 77 return (0); 78 78 } 79 if (Nstars > 1) sort_ lists(X1, Y1, N1, Nstars);79 if (Nstars > 1) sort_coords_index (X1, Y1, N1, Nstars); 80 80 81 81 /* build spatial index (RA sort) */ 82 82 for (i = 0; i < Nave; i++) { 83 fRD_to_XY (&X2[i], &Y2[i], catalog[0].average[i].R, catalog[0].average[i].D, &tcoords);83 RD_to_XY (&X2[i], &Y2[i], catalog[0].average[i].R, catalog[0].average[i].D, &tcoords); 84 84 N2[i] = i; 85 85 catalog[0].found[N2[i]] = -1; 86 86 } 87 if (Nave > 1) sort_ lists(X2, Y2, N2, Nave);87 if (Nave > 1) sort_coords_index (X2, Y2, N2, Nave); 88 88 89 89 /* set up pointers for linked list of measure, missing */ -
trunk/Ohana/src/addstar/src/find_matches_refstars.c
r15743 r16040 5 5 int i, j, k, n, m, N, J; 6 6 double RADIUS, RADIUS2; 7 float*X1, *Y1, *X2, *Y2;8 floatdX, dY, dR;7 double *X1, *Y1, *X2, *Y2; 8 double dX, dY, dR; 9 9 int *N1, *N2, *next, *next_miss, last, last_miss; 10 10 int Nave, NAVE, Nmeas, NMEAS, Nmiss, NMISS, Nmatch; … … 18 18 19 19 /** allocate local arrays (stars) **/ 20 ALLOCATE (X1, float, Nstars);21 ALLOCATE (Y1, float, Nstars);20 ALLOCATE (X1, double, Nstars); 21 ALLOCATE (Y1, double, Nstars); 22 22 ALLOCATE (N1, int, Nstars); 23 23 … … 25 25 Nave = catalog[0].Naverage; 26 26 NAVE = Nave + 1000; 27 ALLOCATE (X2, float, NAVE);28 ALLOCATE (Y2, float, NAVE);27 ALLOCATE (X2, double, NAVE); 28 ALLOCATE (Y2, double, NAVE); 29 29 ALLOCATE (N2, int, NAVE); 30 30 ALLOCATE (catalog[0].found, int, NAVE); … … 59 59 60 60 for (i = 0; i < Nstars; i++) { 61 fRD_to_XY (&X1[i], &Y1[i], stars[i][0].R, stars[i][0].D, &tcoords);61 RD_to_XY (&X1[i], &Y1[i], stars[i][0].R, stars[i][0].D, &tcoords); 62 62 N1[i] = i; 63 63 } 64 if (Nstars > 1) sort_ lists(X1, Y1, N1, Nstars);64 if (Nstars > 1) sort_coords_index (X1, Y1, N1, Nstars); 65 65 66 66 for (i = 0; i < Nave; i++) { 67 fRD_to_XY (&X2[i], &Y2[i], catalog[0].average[i].R, catalog[0].average[i].D, &tcoords);67 RD_to_XY (&X2[i], &Y2[i], catalog[0].average[i].R, catalog[0].average[i].D, &tcoords); 68 68 N2[i] = i; 69 69 catalog[0].found[N2[i]] = -1; 70 70 } 71 if (Nave > 1) sort_ lists(X2, Y2, N2, Nave);71 if (Nave > 1) sort_coords_index (X2, Y2, N2, Nave); 72 72 73 73 /* set up pointers for linked list of measurements */
Note:
See TracChangeset
for help on using the changeset viewer.
