Changeset 39439
- Timestamp:
- Mar 6, 2016, 8:58:07 PM (10 years ago)
- Location:
- branches/eam_branches/ohana.20160226/src/relastro
- Files:
-
- 17 edited
-
include/relastro.h (modified) (5 diffs)
-
src/BootstrapOps.c (modified) (1 diff)
-
src/BrightCatalog.c (modified) (1 diff)
-
src/FitAstromOps.c (modified) (1 diff)
-
src/ImageOps.c (modified) (3 diffs)
-
src/ImageTable.c (modified) (2 diffs)
-
src/MosaicOps.c (modified) (3 diffs)
-
src/StarMaps.c (modified) (2 diffs)
-
src/args.c (modified) (3 diffs)
-
src/launch_region_hosts.c (modified) (2 diffs)
-
src/load_catalogs.c (modified) (3 diffs)
-
src/load_images.c (modified) (1 diff)
-
src/relastro.c (modified) (4 diffs)
-
src/relastro_images.c (modified) (4 diffs)
-
src/relastro_parallel_images.c (modified) (1 diff)
-
src/relastro_parallel_regions.c (modified) (1 diff)
-
src/share_images_pos.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20160226/src/relastro/include/relastro.h
r39436 r39439 418 418 419 419 void relastro_client_free (); 420 void relastro_free (); 420 421 421 422 GSCRegion *find_regions PROTO((Image *image, off_t Nimage, int *Nregions, GSCRegion *fullregion)); … … 439 440 void initImageBins PROTO((Catalog *catalog, int Ncatalog, int FULLINIT)); 440 441 void initImages PROTO((Image *input, off_t *line_number, off_t N)); 442 void freeImages PROTO(()); 441 443 void initMosaicBins PROTO((Catalog *catalog, int Ncatalog)); 442 444 void initMosaicGrid PROTO((Image *image, off_t Nimage)); … … 554 556 Mosaic *getmosaics (off_t *N); 555 557 void initMosaics (Image *image, off_t Nimage); 558 void freeMosaics (); 556 559 StarData *getMosaicRaw (Catalog *catalog, int Ncatalog, off_t mos, off_t *Nstars); 557 560 StarData *getMosaicRef (Catalog *catalog, int Ncatalog, off_t mos, off_t *Nstars); … … 590 593 591 594 int initStarMaps (); 595 void freeStarMaps (); 592 596 int updateStarMaps(Catalog *catalog); 593 597 int createStarMapPoints(); … … 684 688 AstromOffsetTable *get_astrom_table (); 685 689 void put_astrom_table (AstromOffsetTable *myTable); 690 void free_astrom_table (); 686 691 687 692 int fit_map (AstromOffsetMap *map, StarData *raw, StarData *ref, int Npts); -
branches/eam_branches/ohana.20160226/src/relastro/src/BootstrapOps.c
r39364 r39439 98 98 myAbort ("invalid option"); 99 99 } 100 free (values); 100 101 101 102 return TRUE; -
branches/eam_branches/ohana.20160226/src/relastro/src/BrightCatalog.c
r39413 r39439 829 829 int BrightCatalogSplitFree (CatalogSplitter *catalogs) { 830 830 831 free (catalogs->catIDs); 832 free (catalogs->NAVERAGE); 833 free (catalogs->NMEASURE); 834 free (catalogs->index); 835 free (catalogs); 831 # if (0) 832 int i; 833 834 for (i = 0; i < catalogs->NCATALOG; i++) { 835 FREE (catalogs->catalog[i].average); 836 FREE (catalogs->catalog[i].secfilt); 837 FREE (catalogs->catalog[i].measureT); 838 } 839 FREE (catalogs->catalog); 840 # endif 841 842 FREE (catalogs->catIDs); 843 FREE (catalogs->NAVERAGE); 844 FREE (catalogs->NMEASURE); 845 FREE (catalogs->index); 846 FREE (catalogs); 836 847 return TRUE; 837 848 } -
branches/eam_branches/ohana.20160226/src/relastro/src/FitAstromOps.c
r39375 r39439 297 297 median = x[(int)(0.5*Npoints)]; 298 298 } 299 free (x); 299 300 300 301 return median; -
branches/eam_branches/ohana.20160226/src/relastro/src/ImageOps.c
r39432 r39439 119 119 } 120 120 # endif 121 } 122 123 void freeImages () { 124 125 FREE (LineNumber); 126 127 # if USE_IMAGE_ID 128 FREE (imageIDs); 129 FREE (imageIdx); 130 FREE (imageSeq); 131 # else 132 FREE (start); 133 FREE (stop); 134 # endif 135 136 free_astrom_table(); 121 137 } 122 138 … … 196 212 197 213 for (i = 0; i < Ncatalog; i++) { 198 free(MeasureToImage[i]);199 } 200 free(MeasureToImage);214 FREE (MeasureToImage[i]); 215 } 216 FREE (MeasureToImage); 201 217 for (i = 0; i < Nimage; i++) { 202 if (ImageToCatalog[i]) { free (ImageToCatalog[i]); } 203 if (ImageToMeasure[i]) { free (ImageToMeasure[i]); } 204 } 205 free (ImageToCatalog); 206 free (ImageToMeasure); 207 free (N_onImage); 208 free (N_ONIMAGE); 218 FREE (ImageToCatalog[i]); 219 FREE (ImageToMeasure[i]); 220 FREE (catlist[i]); 221 } 222 FREE (Ncatlist); 223 FREE (NCATLIST); 224 FREE (catlist); 225 226 FREE (ImageToCatalog); 227 FREE (ImageToMeasure); 228 FREE (N_onImage); 229 FREE (N_ONIMAGE); 209 230 } 210 231 … … 239 260 name = GetPhotcodeNamebyCode (image[i].photcode); 240 261 int showExample = (Nfew < 30); 241 if (showExample) fprintf (stderr, "image "OFF_T_FMT" (%d, %s) has "OFF_T_FMT" of %d measures (%s, %s) ", i, image[i].imageID, image[i].name, N_onImage[i], image[i].nstar, 242 ohana_sec_to_date(image[i].tzero), name); 262 if (showExample) { 263 char *myDate = ohana_sec_to_date(image[i].tzero); 264 fprintf (stderr, "image "OFF_T_FMT" (%d, %s) has "OFF_T_FMT" of %d measures (%s, %s) ", i, image[i].imageID, image[i].name, N_onImage[i], image[i].nstar, myDate, name); 265 free (myDate); 266 } 243 267 if (N_onImage[i] < 20) { 244 268 if (showExample) fprintf (stderr, "*"); -
branches/eam_branches/ohana.20160226/src/relastro/src/ImageTable.c
r38441 r39439 33 33 } 34 34 35 // gfits_db_free (&db); 36 gfits_free_header (&db.header); 37 gfits_free_matrix (&db.matrix); 38 gfits_free_header (&db.theader); 39 free (db.filename); 40 35 41 *nimage = Nimage; 36 42 return image; … … 61 67 dvo_image_unlock (&db); 62 68 69 gfits_db_free (&db); 70 63 71 return TRUE; 64 72 } -
branches/eam_branches/ohana.20160226/src/relastro/src/MosaicOps.c
r39411 r39439 3 3 // array of mosaic definition structures 4 4 static off_t Nmosaic; 5 static Mosaic *mosaic ;5 static Mosaic *mosaic = NULL; 6 6 7 7 // list of all images associated with a mosaic … … 185 185 } 186 186 187 void freeMosaics () { 188 189 off_t i; 190 191 if (!mosaic) return; 192 193 for (i = 0; i < Nmosaic; i++) { 194 FREE (mosaic_own_images[i]); 195 } 196 197 FREE (mosaic); 198 FREE (Nmosaic_own_images); 199 FREE (Amosaic_own_images); 200 FREE (mosaic_own_images); 201 FREE (mosaic_for_images); 202 } 203 187 204 // return StarData values for detections in the specified image, converting coordinates from the 188 205 // chip positions: X,Y -> L,M -> P,Q -> R,D … … 325 342 } 326 343 344 free (addMosaic); 345 327 346 host->Nimage += Nadd; 328 347 } 348 free (mosaicUsed); 349 329 350 return TRUE; 330 351 } -
branches/eam_branches/ohana.20160226/src/relastro/src/StarMaps.c
r38986 r39439 25 25 } StarMap; 26 26 27 static StarMap *starmap;27 static StarMap *starmap = NULL; 28 28 // static int Nstarmap; -- is it always == Nimages? 29 29 … … 55 55 } 56 56 57 void freeStarMaps () { 58 59 off_t i, Nimages; 60 61 getimages(&Nimages, NULL); 62 63 for (i = 0; i < Nimages; i++) { 64 FREE (starmap[i].points); 65 FREE (starmap[i].stars); 66 } 67 68 FREE (starmap); 69 return; 70 } 71 57 72 int updateStarMaps(Catalog *catalog) { 58 73 -
branches/eam_branches/ohana.20160226/src/relastro/src/args.c
r39436 r39439 380 380 snprintf (PHOTCODE_SKIP_LIST, Ntotal, "%s,%s", SuperCOSMOS_SKIP, RawSkip); 381 381 free (RawSkip); 382 free (SuperCOSMOS_SKIP);383 382 } else { 384 383 PHOTCODE_SKIP_LIST = RawSkip; … … 386 385 remove_argument (N, &argc, argv); 387 386 } 387 free (SuperCOSMOS_SKIP); 388 388 389 389 VERBOSE = VERBOSE2 = FALSE; … … 570 570 if (argc != 1) usage (); 571 571 return TRUE; 572 } 573 574 void relastro_free () { 575 FREE (REGION_FILE); 576 FREE (IMAGE_TABLE); 577 FREE (LoopWeight2MASSstr); 578 FREE (LoopWeightTychostr); 579 580 FREE (PHOTCODE_SKIP_LIST); 581 FREE (PHOTCODE_KEEP_LIST); 582 FREE (PHOTCODE_RESET_LIST); 583 FREE (DCR_RED_COLOR_POS); 584 FREE (DCR_RED_COLOR_NEG); 585 FREE (DCR_BLUE_COLOR_POS); 586 FREE (DCR_BLUE_COLOR_NEG); 587 588 FREE (PHOTCODE_A_LIST); 589 FREE (PHOTCODE_B_LIST); 590 FREE (HIGH_SPEED_DIR); 591 FREE (BCATALOG); 592 FREE (HOSTDIR); 572 593 } 573 594 -
branches/eam_branches/ohana.20160226/src/relastro/src/launch_region_hosts.c
r39389 r39439 161 161 fprintf (stderr, "command: %s\n", command); 162 162 163 if (PARALLEL_REGIONS_MANUAL) continue; 163 if (PARALLEL_REGIONS_MANUAL) { 164 free (command); 165 continue; 166 } 164 167 165 168 // launch the job, then wait for it to be done loading catalogs. force the remote … … 180 183 check_sync_file (syncfile, 1); 181 184 free (syncfile); 185 186 free (command); 182 187 } 183 188 -
branches/eam_branches/ohana.20160226/src/relastro/src/load_catalogs.c
r39436 r39439 229 229 fprintf (stderr, "command: %s\n", command); 230 230 231 if (PARALLEL_MANUAL) continue; 231 if (PARALLEL_MANUAL) { 232 free (command); 233 continue; 234 } 232 235 233 236 if (PARALLEL_SERIAL) { … … 247 250 table->hosts[i].pid = pid; // save for future reference 248 251 } 252 free (command); 249 253 } 250 254 … … 294 298 } 295 299 300 FreeHostTable (table); 301 296 302 Catalog *catalog = catalogs->catalog; 297 303 *Ncatalog = catalogs->Ncatalog; 304 305 // need to free the place-holder catalogs: 306 for (i = catalogs->Ncatalog; i < catalogs->NCATALOG; i++) { 307 free (catalogs->catalog[i].average); 308 free (catalogs->catalog[i].measureT); 309 free (catalogs->catalog[i].secfilt); 310 } 298 311 299 312 int Nmeasure = 0; -
branches/eam_branches/ohana.20160226/src/relastro/src/load_images.c
r38986 r39439 102 102 } 103 103 104 void free_astrom_table () { 105 if (!table) return; 106 AstromOffsetTableFree (table); 107 free (table); 108 } -
branches/eam_branches/ohana.20160226/src/relastro/src/relastro.c
r39382 r39439 7 7 initialize (argc, argv); 8 8 9 SkyTable *sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, TRUE, SKY_DEPTH, VERBOSE); 10 SkyTableSetFilenames (sky, CATDIR, "cpt"); 11 SkyList *skylist = SkyListByPatch (sky, -1, &UserPatch); 9 SkyTable *sky = NULL; 10 SkyList *skylist = NULL; 11 12 if ((RELASTRO_OP != OP_PARALLEL_IMAGES) && (RELASTRO_OP != OP_PARALLEL_REGIONS)) { 13 sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, TRUE, SKY_DEPTH, VERBOSE); 14 SkyTableSetFilenames (sky, CATDIR, "cpt"); 15 skylist = SkyListByPatch (sky, -1, &UserPatch); 16 } 12 17 13 18 switch (RELASTRO_OP) { … … 15 20 /* the object analysis is a separate process iterating over catalogs */ 16 21 relastro_objects (skylist, 0, NULL); 22 ohana_memcheck (VERBOSE); 23 ohana_memdump (VERBOSE); 17 24 exit (0); 18 25 … … 33 40 case OP_IMAGES: 34 41 relastro_images (skylist); 42 43 relastro_free (); 44 FREE(photcodesKeep); 45 FREE(photcodesSkip); 46 FREE(photcodesReset); 47 FREE(photcodesGroupA); 48 FREE(photcodesGroupB); 49 50 SkyTableFree (sky); 51 SkyListFree(skylist); 52 FreePhotcodeTable(); 53 54 ohana_memcheck (VERBOSE); 55 ohana_memdump (VERBOSE); 35 56 exit (0); 36 57 … … 55 76 // iterate over catalogs to make detection coordinates consistant 56 77 UpdateObjectOffsets (skylist, 0, NULL); 78 ohana_memcheck (VERBOSE); 79 ohana_memdump (VERBOSE); 57 80 exit (0); 58 81 -
branches/eam_branches/ohana.20160226/src/relastro/src/relastro_images.c
r39434 r39439 98 98 } 99 99 100 if (!UPDATE) exit (0); 100 if (!UPDATE) { 101 freeStarMaps(); 102 gfits_db_free (&db); 103 ohana_memcheck (VERBOSE); 104 ohana_memdump (VERBOSE); 105 exit (0); 106 } 101 107 102 108 // free the image / measurement pointers 103 freeImageBins (1); 109 freeImageBins (Ncatalog); 110 for (i = 0; i < Ncatalog; i++) { 111 dvo_catalog_free (&catalog[i]); 112 } 113 free (catalog); 114 freeMosaics (); 104 115 105 116 // If we did NOT use all images, then we applied the measured corrections to a subset of … … 110 121 reload_images (&db); 111 122 } 123 freeStarMaps(); 112 124 113 125 if (PARALLEL) { … … 121 133 } 122 134 dvo_image_unlock (&db); 135 gfits_db_free (&db); 136 freeImages(); 123 137 } 124 138 … … 146 160 } 147 161 dvo_image_unlock (&db); 162 gfits_db_free (&db); 163 freeImages(); 148 164 } 149 165 150 exit (0);166 return TRUE; 151 167 } -
branches/eam_branches/ohana.20160226/src/relastro/src/relastro_parallel_images.c
r39432 r39439 181 181 LOGRTIME("share image pos loop %d on %s, host %d: %f sec\n", -1, myHostName, REGION_HOST_ID, dtime); 182 182 183 // free the image / measurement pointers 184 freeImageBins (Ncatalog); 185 for (i = 0; i < Ncatalog; i++) { 186 dvo_catalog_free (&catalog[i]); 187 } 188 free (catalog); 189 freeMosaics (); 190 191 freeStarMaps(); 192 193 freeImages(); 194 free (image); 195 196 relastro_free (); 197 FREE(photcodesKeep); 198 FREE(photcodesSkip); 199 FREE(photcodesReset); 200 FREE(photcodesGroupA); 201 FREE(photcodesGroupB); 202 203 SkyTableFree (sky); 204 SkyListFree(skylist); 205 FreePhotcodeTable(); 206 207 FreeRegionHostTable (regionHosts); 208 209 ohana_memcheck (VERBOSE); 210 ohana_memdump (VERBOSE); 183 211 exit (0); 184 212 } -
branches/eam_branches/ohana.20160226/src/relastro/src/relastro_parallel_regions.c
r38441 r39439 83 83 } 84 84 85 // testjump: 86 85 87 MARKTIME ("finished relastro -parallel-regions: %f sec total\n", dtime); 88 89 gfits_db_free (&db); 90 freeImages(); 91 freeMosaics (); 92 93 relastro_free (); 94 FREE(photcodesKeep); 95 FREE(photcodesSkip); 96 FREE(photcodesReset); 97 FREE(photcodesGroupA); 98 FREE(photcodesGroupB); 99 100 SkyTableFree (sky); 101 SkyListFree(skylist); 102 FreePhotcodeTable(); 103 104 FreeRegionHostTable (regionHosts); 105 106 ohana_memcheck (VERBOSE); 107 ohana_memdump (VERBOSE); 86 108 87 109 exit (0); -
branches/eam_branches/ohana.20160226/src/relastro/src/share_images_pos.c
r39435 r39439 141 141 142 142 AstromOffsetTableFree(table); 143 free (table); 143 144 LOGRTIME("image_maps_free host %d loop %d on %s, host %d: %f sec\n", i, nloop, myHostName, REGION_HOST_ID, dtime); 144 145 }
Note:
See TracChangeset
for help on using the changeset viewer.
