Changeset 39442
- Timestamp:
- Mar 8, 2016, 11:27:24 AM (10 years ago)
- Location:
- branches/eam_branches/ohana.20160226/src/relastro
- Files:
-
- 11 edited
-
include/relastro.h (modified) (2 diffs)
-
src/ImageOps.c (modified) (3 diffs)
-
src/UpdateObjectOffsets.c (modified) (6 diffs)
-
src/args.c (modified) (4 diffs)
-
src/indexCatalogs.c (modified) (1 diff)
-
src/initialize.c (modified) (1 diff)
-
src/relastro.c (modified) (3 diffs)
-
src/relastro_client.c (modified) (4 diffs)
-
src/relastro_objects.c (modified) (3 diffs)
-
src/relastro_parallel_images.c (modified) (3 diffs)
-
src/relastro_parallel_regions.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20160226/src/relastro/include/relastro.h
r39439 r39442 417 417 int SetSignals (void); 418 418 419 void relastro_ client_free ();420 void relastro_ free ();419 void relastro_free (SkyTable *sky, SkyList *skylist); 420 void relastro_client_free (SkyTable *sky, SkyList *skylist); 421 421 422 422 GSCRegion *find_regions PROTO((Image *image, off_t Nimage, int *Nregions, GSCRegion *fullregion)); … … 660 660 int indexCatalogs (Catalog *catalog, int Ncatalog); 661 661 int catID_and_objID_to_seq (unsigned int catID, unsigned int objID, int *catSeq, off_t *objSeq); 662 void freeCatalogIndexes (int Ncatalog); 662 663 663 664 int markObjects (Catalog *catalog, int Ncatalog); -
branches/eam_branches/ohana.20160226/src/relastro/src/ImageOps.c
r39439 r39442 9 9 // if we read only a subset of the rows from the Image FITS, LineNumber tells us to which row 10 10 // each image belongs 11 static off_t *LineNumber ; // match of subset to full image table12 13 static off_t *N_onImage ; // number of measurements on image14 static off_t *N_ONIMAGE ; // allocated number of measurements on image15 16 static int *Ncatlist ; // catalogs associated with each image17 static int *NCATLIST ; // catalogs associated with each image18 static int **catlist ; // catalogs associated with each image19 20 static IDX_T **MeasureToImage ; // link from catalog,measure to image21 static IDX_T **ImageToCatalog ; // catalog which supplied measurement on image22 static IDX_T **ImageToMeasure ; // measure reference for measurement on image11 static off_t *LineNumber = NULL; // match of subset to full image table 12 13 static off_t *N_onImage = NULL; // number of measurements on image 14 static off_t *N_ONIMAGE = NULL; // allocated number of measurements on image 15 16 static int *Ncatlist = NULL; // catalogs associated with each image 17 static int *NCATLIST = NULL; // catalogs associated with each image 18 static int **catlist = NULL; // catalogs associated with each image 19 20 static IDX_T **MeasureToImage = NULL; // link from catalog,measure to image 21 static IDX_T **ImageToCatalog = NULL; // catalog which supplied measurement on image 22 static IDX_T **ImageToMeasure = NULL; // measure reference for measurement on image 23 23 24 24 // if we search by image ID, we sort (imageIDs, imageIdx) by imageIDs to get a sorted … … 26 26 27 27 # if USE_IMAGE_ID 28 static off_t *imageIDs ; // list of all image IDs29 static off_t *imageIdx ; // list of index for image IDs28 static off_t *imageIDs = NULL; // list of all image IDs 29 static off_t *imageIdx = NULL; // list of index for image IDs 30 30 31 31 // as an alternative, we generate imageSeq, which directly maps imageID -> seq 32 static off_t *imageSeq ; // list of index for image IDs32 static off_t *imageSeq = NULL; // list of index for image IDs 33 33 34 34 // MAX_ID requires 512M to store the image index … … 218 218 FREE (ImageToCatalog[i]); 219 219 FREE (ImageToMeasure[i]); 220 FREE (catlist[i]);220 if (catlist) { FREE (catlist[i]); } 221 221 } 222 222 FREE (Ncatlist); 223 223 FREE (NCATLIST); 224 224 FREE (catlist); 225 Ncatlist = NULL; 226 NCATLIST = NULL; 227 catlist = NULL; 225 228 226 229 FREE (ImageToCatalog); -
branches/eam_branches/ohana.20160226/src/relastro/src/UpdateObjectOffsets.c
r39171 r39442 62 62 // uses MeasureTiny values, but will also update Measure values when populated 63 63 // if Galaxy Motion Model correction is active, do not apply at this last stage 64 UpdateObjects (&catalog, 1, FALSE);64 UpdateObjects (&catalog, 1, -1); 65 65 66 66 free_tiny_values(&catalog); … … 218 218 fprintf (stderr, "command: %s\n", command); 219 219 220 if (PARALLEL_MANUAL) continue; 220 if (PARALLEL_MANUAL) { 221 free (command); 222 continue; 223 } 221 224 222 225 if (PARALLEL_SERIAL) { … … 236 239 group->hosts[i][0].pid = pid; // save for future reference 237 240 } 241 free (command); 238 242 } 239 243 … … 338 342 fprintf (stderr, "command: %s\n", command); 339 343 340 if (PARALLEL_MANUAL) continue; 344 if (PARALLEL_MANUAL) { 345 free (command); 346 continue; 347 } 341 348 342 349 if (PARALLEL_SERIAL) { … … 356 363 table->hosts[i].pid = pid; // save for future reference 357 364 } 365 free (command); 358 366 } 359 367 … … 366 374 } 367 375 376 FreeHostTable (table); 377 368 378 return TRUE; 369 379 } -
branches/eam_branches/ohana.20160226/src/relastro/src/args.c
r39439 r39442 572 572 } 573 573 574 void relastro_free ( ) {574 void relastro_free (SkyTable *sky, SkyList *skylist) { 575 575 FREE (REGION_FILE); 576 576 FREE (IMAGE_TABLE); … … 591 591 FREE (BCATALOG); 592 592 FREE (HOSTDIR); 593 594 // these are set in initialize 595 FREE(photcodesKeep); 596 FREE(photcodesSkip); 597 FREE(photcodesReset); 598 FREE(photcodesGroupA); 599 FREE(photcodesGroupB); 600 601 SkyTableFree (sky); 602 SkyListFree(skylist); 603 FreePhotcodeTable(); 604 605 ohana_memcheck (VERBOSE); 606 ohana_memdump (VERBOSE); 593 607 } 594 608 … … 951 965 } 952 966 953 void relastro_client_free ( ) {967 void relastro_client_free (SkyTable *sky, SkyList *skylist) { 954 968 FREE (PHOTCODE_SKIP_LIST); 955 969 FREE (PHOTCODE_KEEP_LIST); … … 965 979 FREE(BCATALOG); 966 980 FREE (HOSTDIR); 981 982 // these are set in initialize 983 FREE(photcodesKeep); 984 FREE(photcodesSkip); 985 FREE(photcodesReset); 986 FREE(photcodesGroupA); 987 FREE(photcodesGroupB); 988 989 SkyTableFree (sky); 990 SkyListFree(skylist); 991 FreePhotcodeTable(); 992 993 ohana_memcheck (VERBOSE); 994 ohana_memdump (VERBOSE); 967 995 } 968 996 -
branches/eam_branches/ohana.20160226/src/relastro/src/indexCatalogs.c
r39412 r39442 51 51 } 52 52 53 void freeCatalogIndexes (int Ncatalog) { 54 int i; 55 56 for (i = 0; i < Ncatalog; i++) { 57 free (objIDseq[i]); 58 } 59 free (objIDmax); 60 free (objIDseq); 61 free (catIDseq); 62 } 63 53 64 int catID_and_objID_to_seq (unsigned int catID, unsigned int objID, int *catSeq, off_t *objSeq) { 54 65 -
branches/eam_branches/ohana.20160226/src/relastro/src/initialize.c
r37807 r39442 2 2 3 3 void initialize (int argc, char **argv) { 4 5 photcodesKeep = NULL; 6 photcodesSkip = NULL; 7 photcodesReset = NULL; 8 photcodesGroupA = NULL; 9 photcodesGroupB = NULL; 4 10 5 11 ConfigInit (&argc, argv); -
branches/eam_branches/ohana.20160226/src/relastro/src/relastro.c
r39439 r39442 20 20 /* the object analysis is a separate process iterating over catalogs */ 21 21 relastro_objects (skylist, 0, NULL); 22 ohana_memcheck (VERBOSE); 23 ohana_memdump (VERBOSE); 24 exit (0); 25 26 case OP_HIGH_SPEED: 27 /* high-speed is a 2pt cross-correlation process for linking moving objects (high PM) */ 28 high_speed_catalogs (sky, skylist, 0, NULL); 29 exit (0); 30 31 case OP_HPM: 32 hpm_catalogs (sky, skylist, 0, NULL); 33 exit (0); 34 35 case OP_MERGE_SOURCE: 36 /* a special method to manually merge unlinked detections of sources togther (not parallel) */ 37 relastro_merge_source (sky); 22 relastro_free (sky, skylist); 38 23 exit (0); 39 24 40 25 case OP_IMAGES: 41 26 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); 27 relastro_free (sky, skylist); 56 28 exit (0); 57 29 58 case OP_UPDATE_OFFSETS: 30 case OP_UPDATE_OFFSETS: { 31 FITS_DB db; 59 32 if (!PARALLEL) { 60 FITS_DB db;61 33 62 34 set_db (&db); … … 76 48 // iterate over catalogs to make detection coordinates consistant 77 49 UpdateObjectOffsets (skylist, 0, NULL); 78 ohana_memcheck (VERBOSE); 79 ohana_memdump (VERBOSE); 50 51 if (!PARALLEL) { 52 gfits_db_free (&db); 53 freeImages(); 54 freeMosaics (); 55 } 56 57 relastro_free (sky, skylist); 80 58 exit (0); 59 } 81 60 82 61 case OP_PARALLEL_REGIONS: … … 90 69 exit (0); 91 70 71 case OP_HIGH_SPEED: 72 /* high-speed is a 2pt cross-correlation process for linking moving objects (high PM) */ 73 high_speed_catalogs (sky, skylist, 0, NULL); 74 exit (0); 75 76 case OP_HPM: 77 hpm_catalogs (sky, skylist, 0, NULL); 78 exit (0); 79 80 case OP_MERGE_SOURCE: 81 /* a special method to manually merge unlinked detections of sources togther (not parallel) */ 82 relastro_merge_source (sky); 83 exit (0); 84 92 85 default: 93 86 fprintf (stderr, "impossible!\n"); -
branches/eam_branches/ohana.20160226/src/relastro/src/relastro_client.c
r39396 r39442 55 55 } 56 56 57 SkyTableFree (sky);58 SkyListFree(skylist);59 FreePhotcodeTable();60 61 57 int i; 62 58 for (i = 0; i < Ncatalog; i++) { … … 66 62 BrightCatalogFree(bcatalog); 67 63 68 relastro_client_free (); 69 FREE(photcodesKeep); 70 FREE(photcodesSkip); 71 FREE(photcodesReset); 72 FREE(photcodesGroupA); 73 FREE(photcodesGroupB); 74 75 ohana_memcheck (TRUE); 76 ohana_memdump (TRUE); 64 relastro_client_free (sky, skylist); 77 65 break; 78 66 } … … 81 69 // USAGE: relastro_client -update-objects 82 70 relastro_objects (skylist, HOST_ID, HOSTDIR); 83 break; 84 } 85 86 case OP_HIGH_SPEED: { 87 // USAGE: relastro_client -high-speed 88 high_speed_catalogs (sky, skylist, HOST_ID, HOSTDIR); 89 break; 90 } 91 92 case OP_HPM: { 93 // USAGE: relastro_client -high-speed 94 hpm_catalogs (sky, skylist, HOST_ID, HOSTDIR); 71 relastro_client_free (sky, skylist); 95 72 break; 96 73 } … … 112 89 /* load regions and images based on specified sky patch (default depth) */ 113 90 load_images (&db, skylist, FALSE, USE_ALL_IMAGES); 114 115 // I can free the database after I have loaded the images...116 117 // // load the image subset table from the specified location118 // off_t Nimage;119 // ImageSubset *image = ImageSubsetLoad (IMAGES, &Nimage);120 // if (!image) {121 // fprintf (stderr, "ERROR loading image subset %s\n", CATDIR);122 // exit (2);123 // }124 //125 // // save the available image information in the static array in ImageOps.c126 // initImagesSubset (image, NULL, Nimage);127 //128 // // load the flat-field correction table from CATDIR129 // char flatcorrFile[1024];130 // snprintf (flatcorrFile, 1024, "%s/flatcorr.fits", CATDIR);131 // FlatCorrectionTable *flatcorr = FlatCorrectionLoad (flatcorrFile, VERBOSE);132 91 133 92 UpdateObjectOffsets (skylist, HOST_ID, HOSTDIR); 134 93 94 gfits_db_free (&db); 95 freeImages(); 96 freeMosaics (); 97 98 relastro_client_free (sky, skylist); 99 break; 100 } 101 102 case OP_HIGH_SPEED: { 103 // USAGE: relastro_client -high-speed 104 high_speed_catalogs (sky, skylist, HOST_ID, HOSTDIR); 105 break; 106 } 107 108 case OP_HPM: { 109 // USAGE: relastro_client -high-speed 110 hpm_catalogs (sky, skylist, HOST_ID, HOSTDIR); 135 111 break; 136 112 } -
branches/eam_branches/ohana.20160226/src/relastro/src/relastro_objects.c
r39375 r39442 84 84 populate_tiny_values(&catalog, DVO_TV_MEASURE); 85 85 86 UpdateObjects (&catalog, 1, 0); 86 // the 3rd argument (-1) is the loop number for re-weighting 2MASS and Tycho. -1 is a special value meaning "ignore" 87 // we do NOT want to apply special weights to 2MASS and/or Tycho when calculating object final motions. 88 UpdateObjects (&catalog, 1, -1); 87 89 88 90 free_tiny_values(&catalog); … … 215 217 table->hosts[i].pid = pid; // save for future reference 216 218 } 219 free (command); 217 220 } 218 221 … … 224 227 HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE); 225 228 } 229 FreeHostTable (table); 226 230 227 231 return TRUE; -
branches/eam_branches/ohana.20160226/src/relastro/src/relastro_parallel_images.c
r39439 r39442 16 16 17 17 INITTIME; 18 19 // over-ride user selection here: this program does not set the final object 20 // astrometry. since it only sets the image parameters it should not use pm or par 21 FIT_MODE = FIT_AVERAGE; 18 22 19 23 client_logger_init (CATDIR); … … 187 191 } 188 192 free (catalog); 193 freeCatalogIndexes(Ncatalog); 194 189 195 freeMosaics (); 190 196 … … 194 200 free (image); 195 201 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 202 FreeRegionHostTable (regionHosts); 208 209 ohana_memcheck (VERBOSE); 210 ohana_memdump (VERBOSE); 203 relastro_free (sky, skylist); 204 211 205 exit (0); 212 206 } -
branches/eam_branches/ohana.20160226/src/relastro/src/relastro_parallel_regions.c
r39439 r39442 91 91 freeMosaics (); 92 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 93 FreeRegionHostTable (regionHosts); 105 106 ohana_memcheck (VERBOSE); 107 ohana_memdump (VERBOSE); 94 relastro_free (sky, skylist); 108 95 109 96 exit (0);
Note:
See TracChangeset
for help on using the changeset viewer.
