Changeset 31535
- Timestamp:
- May 11, 2011, 6:21:03 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110505/Ohana/src/relphot
- Files:
-
- 6 edited
-
include/relphot.h (modified) (4 diffs)
-
src/ImageOps.c (modified) (6 diffs)
-
src/MosaicOps.c (modified) (6 diffs)
-
src/bcatalog.c (modified) (1 diff)
-
src/reload_catalogs.c (modified) (2 diffs)
-
src/relphot.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110505/Ohana/src/relphot/include/relphot.h
r31493 r31535 140 140 void dump_grid PROTO((void)); 141 141 int edge_check PROTO((double *x1, double *y1, double *x2, double *y2)); 142 void findImages PROTO((Catalog *catalog, int Ncatalog ));143 int findMosaics PROTO((Catalog *catalog, int Ncatalog ));142 void findImages PROTO((Catalog *catalog, int Ncatalog, int doImageList)); 143 int findMosaics PROTO((Catalog *catalog, int Ncatalog, int doMosaicList)); 144 144 145 145 void set_db (FITS_DB *in); … … 150 150 151 151 void freeGridBins PROTO((int Ncatalog)); 152 void freeImageBins PROTO((int Ncatalog ));153 void freeMosaicBins PROTO((int Ncatalog ));152 void freeImageBins PROTO((int Ncatalog, int doImageList)); 153 void freeMosaicBins PROTO((int Ncatalog, int doMosaicList)); 154 154 void free_catalogs PROTO((Catalog *catalog, int Ncatalog)); 155 155 int gcatalog PROTO((Catalog *catalog, int FINAL)); … … 165 165 void initGrid PROTO((int dX, int dY)); 166 166 void initGridBins PROTO((Catalog *catalog, int Ncatalog)); 167 void initImageBins PROTO((Catalog *catalog, int Ncatalog ));167 void initImageBins PROTO((Catalog *catalog, int Ncatalog, int doImageList)); 168 168 void initImages PROTO((Image *input, off_t *LineNumber, off_t N)); 169 void initMosaicBins PROTO((Catalog *catalog, int Ncatalog ));169 void initMosaicBins PROTO((Catalog *catalog, int Ncatalog, int doMosaicList)); 170 170 void initMosaicGrid PROTO((Image *image, off_t Nimage)); 171 171 void initMosaics PROTO((Image *image, off_t Nimage)); … … 180 180 int main PROTO((int argc, char **argv)); 181 181 void mark_images PROTO((Image *image, off_t Nimage, Image *timage, off_t Ntimage)); 182 void matchImage PROTO((Catalog *catalog, off_t meas, int cat ));183 void matchMosaics PROTO((Catalog *catalog, off_t meas, int cat ));182 void matchImage PROTO((Catalog *catalog, off_t meas, int cat, int doImageList)); 183 void matchMosaics PROTO((Catalog *catalog, off_t meas, int cat, int doMosaicList)); 184 184 double opening_angle PROTO((double x1, double y1, double x2, double y2, double x3, double y3)); 185 185 void plot_chisq PROTO((Catalog *catalog, int Ncatalog)); -
branches/eam_branches/ipp-20110505/Ohana/src/relphot/src/ImageOps.c
r31493 r31535 69 69 } 70 70 71 void initImageBins (Catalog *catalog, int Ncatalog ) {71 void initImageBins (Catalog *catalog, int Ncatalog, int doImageList) { 72 72 73 73 off_t i, j; … … 79 79 } 80 80 81 ALLOCATE (Nlist, off_t, Nimage); 82 ALLOCATE (NLIST, off_t, Nimage); 83 ALLOCATE (clist, off_t *, Nimage); 84 ALLOCATE (mlist, off_t *, Nimage); 85 86 for (i = 0; i < Nimage; i++) { 87 Nlist[i] = 0; 88 NLIST[i] = 100; 89 ALLOCATE (clist[i], off_t, NLIST[i]); 90 ALLOCATE (mlist[i], off_t, NLIST[i]); 91 } 92 } 93 94 void freeImageBins (int Ncatalog) { 81 if (doImageList) { 82 ALLOCATE (Nlist, off_t, Nimage); 83 ALLOCATE (NLIST, off_t, Nimage); 84 ALLOCATE (clist, off_t *, Nimage); 85 ALLOCATE (mlist, off_t *, Nimage); 86 87 for (i = 0; i < Nimage; i++) { 88 Nlist[i] = 0; 89 NLIST[i] = 100; 90 ALLOCATE (clist[i], off_t, NLIST[i]); 91 ALLOCATE (mlist[i], off_t, NLIST[i]); 92 } 93 } 94 } 95 96 void freeImageBins (int Ncatalog, int doImageList) { 95 97 96 98 off_t i; … … 100 102 } 101 103 free (bin); 102 for (i = 0; i < Nimage; i++) { 103 free (clist[i]); 104 free (mlist[i]); 105 } 106 free (clist); 107 free (mlist); 108 free (Nlist); 109 free (NLIST); 104 105 if (doImageList) { 106 for (i = 0; i < Nimage; i++) { 107 free (clist[i]); 108 free (mlist[i]); 109 } 110 free (clist); 111 free (mlist); 112 free (Nlist); 113 free (NLIST); 114 } 110 115 } 111 116 112 117 /* select all image equivalent to the active photcode set */ 113 void findImages (Catalog *catalog, int Ncatalog ) {118 void findImages (Catalog *catalog, int Ncatalog, int doImageList) { 114 119 115 120 off_t j; … … 125 130 } 126 131 if (!found) continue; 127 matchImage (catalog, j, i );132 matchImage (catalog, j, i, doImageList); 128 133 Nmatch ++; 129 134 } … … 181 186 } 182 187 183 void matchImage (Catalog *catalog, off_t meas, int cat ) {188 void matchImage (Catalog *catalog, off_t meas, int cat, int doImageList) { 184 189 185 190 off_t idx, ID; … … 207 212 bin[cat][meas] = idx; 208 213 209 // index for image, Nentry -> catalog 210 clist[idx][Nlist[idx]] = cat; 211 212 // index for image, Nentry -> measure 213 mlist[idx][Nlist[idx]] = meas; 214 Nlist[idx] ++; 215 216 if (Nlist[idx] == NLIST[idx]) { 217 NLIST[idx] += 100; 218 REALLOCATE (clist[idx], off_t, NLIST[idx]); 219 REALLOCATE (mlist[idx], off_t, NLIST[idx]); 220 } 214 if (doImageList) { 215 // index for image, Nentry -> catalog 216 clist[idx][Nlist[idx]] = cat; 217 218 // index for image, Nentry -> measure 219 mlist[idx][Nlist[idx]] = meas; 220 Nlist[idx] ++; 221 222 if (Nlist[idx] == NLIST[idx]) { 223 NLIST[idx] += 100; 224 REALLOCATE (clist[idx], off_t, NLIST[idx]); 225 REALLOCATE (mlist[idx], off_t, NLIST[idx]); 226 } 227 } 221 228 222 229 return; -
branches/eam_branches/ipp-20110505/Ohana/src/relphot/src/MosaicOps.c
r31525 r31535 211 211 } 212 212 213 void initMosaicBins (Catalog *catalog, int Ncatalog ) {213 void initMosaicBins (Catalog *catalog, int Ncatalog, int doMosaicList) { 214 214 215 215 off_t i, j; … … 224 224 } 225 225 226 /* mosaic -> measure */ 227 ALLOCATE (Nlist, off_t, Nmosaic); 228 ALLOCATE (NLIST, off_t, Nmosaic); 229 ALLOCATE (clist, int *, Nmosaic); 230 ALLOCATE (mlist, off_t *, Nmosaic); 231 232 for (i = 0; i < Nmosaic; i++) { 233 Nlist[i] = 0; 234 NLIST[i] = 100; 235 ALLOCATE (clist[i], int, NLIST[i]); 236 ALLOCATE (mlist[i], off_t, NLIST[i]); 237 } 238 } 239 240 void freeMosaicBins (int Ncatalog) { 226 if (doMosaicList) { 227 /* mosaic -> measure */ 228 ALLOCATE (Nlist, off_t, Nmosaic); 229 ALLOCATE (NLIST, off_t, Nmosaic); 230 ALLOCATE (clist, int *, Nmosaic); 231 ALLOCATE (mlist, off_t *, Nmosaic); 232 233 for (i = 0; i < Nmosaic; i++) { 234 Nlist[i] = 0; 235 NLIST[i] = 100; 236 ALLOCATE (clist[i], int, NLIST[i]); 237 ALLOCATE (mlist[i], off_t, NLIST[i]); 238 } 239 } 240 } 241 242 void freeMosaicBins (int Ncatalog, int doMosaicList) { 241 243 242 244 off_t i; … … 250 252 free (bin); 251 253 252 /* mosaic -> measure */ 253 for (i = 0; i < Nmosaic; i++) { 254 free (clist[i]); 255 free (mlist[i]); 256 } 257 free (Nlist); 258 free (NLIST); 259 free (clist); 260 free (mlist); 261 } 262 263 int findMosaics (Catalog *catalog, int Ncatalog) { 254 if (doMosaicList) { 255 /* mosaic -> measure */ 256 for (i = 0; i < Nmosaic; i++) { 257 free (clist[i]); 258 free (mlist[i]); 259 } 260 free (Nlist); 261 free (NLIST); 262 free (clist); 263 free (mlist); 264 } 265 } 266 267 int findMosaics (Catalog *catalog, int Ncatalog, int doMosaicList) { 264 268 265 269 int i, ecode, found, Ns; … … 281 285 } 282 286 if (!found) continue; 283 matchMosaics (catalog, j, i );287 matchMosaics (catalog, j, i, doMosaicList); 284 288 Nmatch ++; 285 289 } … … 289 293 } 290 294 291 void matchMosaics (Catalog *catalog, off_t meas, int cat ) {295 void matchMosaics (Catalog *catalog, off_t meas, int cat, int doMosaicList) { 292 296 293 297 off_t idx, ID, mosID; … … 322 326 bin[cat][meas] = mosID; 323 327 324 clist[mosID][Nlist[mosID]] = cat; 325 mlist[mosID][Nlist[mosID]] = meas; 326 Nlist[mosID] ++; 328 if (doMosaicList) { 329 clist[mosID][Nlist[mosID]] = cat; 330 mlist[mosID][Nlist[mosID]] = meas; 331 Nlist[mosID] ++; 327 332 328 if (Nlist[mosID] == NLIST[mosID]) { 329 NLIST[mosID] += 100; 330 REALLOCATE (clist[mosID], int, NLIST[mosID]); 331 REALLOCATE (mlist[mosID], off_t, NLIST[mosID]); 332 } 333 if (Nlist[mosID] == NLIST[mosID]) { 334 NLIST[mosID] += 100; 335 REALLOCATE (clist[mosID], int, NLIST[mosID]); 336 REALLOCATE (mlist[mosID], off_t, NLIST[mosID]); 337 } 338 } 333 339 return; 334 340 } -
branches/eam_branches/ipp-20110505/Ohana/src/relphot/src/bcatalog.c
r31524 r31535 340 340 int free_tiny_values (Catalog *catalog) { 341 341 342 free (catalog[0].averageT);343 free (catalog[0].measureT);344 return (TRUE); 345 } 346 342 if (catalog[0].averageT) free (catalog[0].averageT); 343 if (catalog[0].measureT) free (catalog[0].measureT); 344 return (TRUE); 345 } 346 -
branches/eam_branches/ipp-20110505/Ohana/src/relphot/src/reload_catalogs.c
r31524 r31535 60 60 TIMESTAMP(time3a); 61 61 62 initImageBins (&catalog, 1 );63 initMosaicBins (&catalog, 1 );62 initImageBins (&catalog, 1, FALSE); 63 initMosaicBins (&catalog, 1, FALSE); 64 64 initGridBins (&catalog, 1); 65 65 TIMESTAMP(time3b); 66 66 67 findImages (&catalog, 1 ); // FX68 findMosaics (&catalog, 1 ); //67 findImages (&catalog, 1, FALSE); 68 findMosaics (&catalog, 1, FALSE); 69 69 TIMESTAMP(time4); 70 70 … … 79 79 TIMESTAMP(time6); 80 80 81 freeImageBins (1 );82 freeMosaicBins (1 );81 freeImageBins (1, FALSE); 82 freeMosaicBins (1, FALSE); 83 83 freeGridBins (1); 84 84 TIMESTAMP(time7); -
branches/eam_branches/ipp-20110505/Ohana/src/relphot/src/relphot.c
r31524 r31535 66 66 67 67 /* match measurements with images, mosaics */ 68 initImageBins (catalog, Ncatalog );68 initImageBins (catalog, Ncatalog, TRUE); 69 69 MARKTIME("-- make image bins: %f sec\n", dtime); 70 70 71 initMosaicBins (catalog, Ncatalog );71 initMosaicBins (catalog, Ncatalog, TRUE); 72 72 initGridBins (catalog, Ncatalog); 73 73 initMrel (catalog, Ncatalog); 74 74 75 findImages (catalog, Ncatalog );75 findImages (catalog, Ncatalog, TRUE); 76 76 MARKTIME("-- set up image indexes: %f sec\n", dtime); 77 77 78 findMosaics (catalog, Ncatalog ); /* also sets Grid values */78 findMosaics (catalog, Ncatalog, TRUE); /* also sets Grid values */ 79 79 MARKTIME("-- set up mosaic indexes: %f sec\n", dtime); 80 80 … … 220 220 dvo_catalog_free (&catalog[i]); 221 221 } 222 freeImageBins (Ncatalog );223 freeMosaicBins (Ncatalog );222 freeImageBins (Ncatalog, TRUE); 223 freeMosaicBins (Ncatalog, TRUE); 224 224 freeGridBins (Ncatalog); 225 225
Note:
See TracChangeset
for help on using the changeset viewer.
