Changeset 39481
- Timestamp:
- Mar 24, 2016, 10:03:04 AM (10 years ago)
- Location:
- trunk/Ohana/src/relphot
- Files:
-
- 19 edited
-
Makefile (modified) (2 diffs)
-
include/relphot.h (modified) (10 diffs)
-
src/BoundaryTreeOps.c (modified) (1 diff)
-
src/ImageOps.c (modified) (2 diffs)
-
src/ImageTable.c (modified) (2 diffs)
-
src/MosaicOps.c (modified) (1 diff)
-
src/args.c (modified) (4 diffs)
-
src/assign_images.c (modified) (1 diff)
-
src/indexCatalog.c (modified) (1 diff)
-
src/launch_region_hosts.c (modified) (2 diffs)
-
src/load_images.c (modified) (4 diffs)
-
src/reload_catalogs.c (modified) (2 diffs)
-
src/relphot.c (modified) (6 diffs)
-
src/relphot_client.c (modified) (3 diffs)
-
src/relphot_images.c (modified) (2 diffs)
-
src/relphot_objects.c (modified) (8 diffs)
-
src/relphot_parallel_images.c (modified) (3 diffs)
-
src/relphot_parallel_regions.c (modified) (4 diffs)
-
src/relphot_synthphot.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relphot/Makefile
r39478 r39481 32 32 $(SRC)/Shutdown.$(ARCH).o \ 33 33 $(SRC)/StarOps.$(ARCH).o \ 34 $(SRC)/WarpImageMaps.$(ARCH).o \ 35 $(SRC)/RepairWarpMeasures.$(ARCH).o \ 36 $(SRC)/myIndex.$(ARCH).o \ 37 $(SRC)/psps_ids.$(ARCH).o \ 34 38 $(SRC)/args.$(ARCH).o \ 35 39 $(SRC)/help.$(ARCH).o \ … … 83 87 $(SRC)/Shutdown.$(ARCH).o \ 84 88 $(SRC)/StarOps.$(ARCH).o \ 89 $(SRC)/WarpImageMaps.$(ARCH).o \ 90 $(SRC)/RepairWarpMeasures.$(ARCH).o \ 91 $(SRC)/myIndex.$(ARCH).o \ 92 $(SRC)/psps_ids.$(ARCH).o \ 85 93 $(SRC)/bcatalog.$(ARCH).o \ 86 94 $(SRC)/args.$(ARCH).o \ -
trunk/Ohana/src/relphot/include/relphot.h
r39479 r39481 11 11 # define ID_SECF_STACK_PRIMARY 0x00004000 12 12 13 # ifndef MAX_INT 14 # define MAX_INT 2147483647 15 # endif 16 13 17 // choose off_t or int depending on full-scale relphot analysis resources 14 18 // # define IDX_T off_t 15 19 # define IDX_T int 20 21 typedef struct { 22 int minID; 23 int maxID; 24 int *index; 25 int Nindex; 26 int NINDEX; 27 } myIndexType; 16 28 17 29 typedef enum { … … 279 291 int RESET; 280 292 int RESET_ZEROPTS; 293 int REPAIR_WARPS; 281 294 int UPDATE; 282 295 int SAVE_IMAGE_UPDATES; … … 418 431 Catalog *load_catalogs_parallel PROTO((SkyList *sky, int *Ncatalog, char *syncfile)); 419 432 420 int load_images PROTO((FITS_DB *db, SkyList *skylist, SkyRegion *region ));433 int load_images PROTO((FITS_DB *db, SkyList *skylist, SkyRegion *region, int unlockImages)); 421 434 Image *select_images PROTO((SkyList *skylist, Image *timage, off_t Ntimage, char *inSubset, off_t **LineNumber, off_t *Nimage, SkyRegion *region)); 422 435 … … 475 488 void wimages PROTO((void)); 476 489 void write_coords PROTO((Header *header, Coords *coords)); 477 int relphot_objects (Sky Table *sky, SkyList *skylist, int hostID, char *hostpath);490 int relphot_objects (SkyList *skylist, int hostID, char *hostpath); 478 491 int relphot_images (SkyList *skylist); 479 492 … … 507 520 508 521 int load_tess (char *treefile); 522 void free_tess (void); 509 523 int get_tess_ids (int *tessID, int *projID, int *skycellID, double ra, double dec); 510 524 int TessellationIDsByImageName (int *tessID, int *projID, int *skycellID, char *name); … … 532 546 int add_synthetic_mags (AverageTiny *average, SecFilt *secfilt, MeasureTiny *measure, off_t *Nmeasure, off_t *Nm); 533 547 534 int relphot_parallel_regions (); 548 int relphot_parallel_regions (SkyTable *sky); 549 int relphot_parallel_images (SkyTable *sky); 535 550 536 551 int assign_images (FITS_DB *db, RegionHostTable *regionHosts); … … 546 561 int indexCatalogs (Catalog *catalog, int Ncatalog); 547 562 int catID_and_objID_to_seq (int catID, int objID, int *catSeq, off_t *objSeq); 563 void freeCatalogIndexes (int Ncatalog); 548 564 549 565 int check_sync_file (char *filename, int nloop); … … 569 585 570 586 int markObjects (Catalog *catalog, int Ncatalog); 571 572 int relphot_parallel_images ();573 int relphot_parallel_regions ();574 587 575 588 // in extra.c … … 587 600 SynthZeroPoints *SynthZeroPointsGet (); 588 601 589 int relphot_synthphot ( int hostID, char *hostpath);602 int relphot_synthphot (SkyList *sky, int hostID, char *hostpath); 590 603 int relphot_synthphot_parallel (SkyList *sky); 591 604 … … 598 611 599 612 void relphot_free (SkyTable *sky, SkyList *skylist); 600 void freeImages ( );613 void freeImages (int freeImageData); 601 614 void relphot_client_free (SkyTable *sky, SkyList *skylist); 602 615 void BrightCatalogFree (BrightCatalog *bcatalog); 603 616 617 void put_astrom_table (AstromOffsetTable *myTable); 604 618 void free_astrom_table (); 619 620 int RepairWarpMeasures (Catalog *catalog); 621 622 int FindWarpGroups (void); 623 int GetWarpSeq (Image *image, int obstime, unsigned short photcode, double Rave, double Dave, float X, float Y); 624 void FreeWarpGroups (void); 625 626 myIndexType *myIndexInit (); 627 int myIndexFree (myIndexType *myIndex); 628 int myIndexUpdateLimits (myIndexType *myIndex, int value); 629 int myIndexSetRange (myIndexType *myIndex); 630 int myIndexSetEntry (myIndexType *myIndex, int value, int entry); 631 int myIndexGetEntry (myIndexType *myIndex, int value); 632 633 uint64_t CreatePSPSObjectID(double ra, double dec); 634 uint64_t CreatePSPSStackDetectionID(int sourceID, int imageID, int detID); 635 uint64_t CreatePSPSDetectionID(double tobs, int ccdid, int detID); -
trunk/Ohana/src/relphot/src/BoundaryTreeOps.c
r37807 r39481 55 55 return status; 56 56 } 57 58 void free_tess () { 59 60 if (!tess) return; 61 TessellationTableFree (tess, Ntess); 62 free (tess); 63 } -
trunk/Ohana/src/relphot/src/ImageOps.c
r39478 r39481 24 24 25 25 // we have an array of images: image[ImageIndex] (ImageIndex : 0 < Nimage) 26 static off_t Nimage ; // number of available images27 static Image *image ; // array of available images26 static off_t Nimage = 0; // number of available images 27 static Image *image = NULL; // array of available images 28 28 29 29 // if we read only a subset of the rows from the Image FITS, LineNumber tells us to which row … … 267 267 } 268 268 269 void freeImages ( ) {270 271 FREE (image);269 void freeImages (int freeImageData) { 270 271 if (freeImageData) FREE (image); 272 272 FREE (LineNumber); 273 273 -
trunk/Ohana/src/relphot/src/ImageTable.c
r38441 r39481 33 33 } 34 34 35 // i want to keep the image data, but free everything else 36 db.ftable.buffer = NULL; 37 gfits_db_free (&db); 38 35 39 // XXX do not make the chip match -- we have not loaded the PHU entries (and do not need them here) 36 40 // BuildChipMatch (image, Nimage); … … 65 69 dvo_image_unlock (&db); 66 70 71 gfits_db_free (&db); 72 67 73 return TRUE; 68 74 } -
trunk/Ohana/src/relphot/src/MosaicOps.c
r39478 r39481 316 316 317 317 void freeMosaics () { 318 319 318 320 } 319 321 -
trunk/Ohana/src/relphot/src/args.c
r39478 r39481 193 193 remove_argument (N, &argc, argv); 194 194 RESET_ZEROPTS = TRUE; 195 } 196 197 REPAIR_WARPS = FALSE; 198 if ((N = get_argument (argc, argv, "-repair-warps"))) { 199 remove_argument (N, &argc, argv); 200 REPAIR_WARPS = TRUE; 195 201 } 196 202 … … 483 489 FREE (photcodes); 484 490 491 free_tess(); 485 492 SkyTableFree (sky); 486 493 SkyListFree(skylist); … … 619 626 remove_argument (N, &argc, argv); 620 627 RESET_ZEROPTS = TRUE; 628 } 629 630 REPAIR_WARPS = FALSE; 631 if ((N = get_argument (argc, argv, "-repair-warps"))) { 632 remove_argument (N, &argc, argv); 633 REPAIR_WARPS = TRUE; 621 634 } 622 635 … … 762 775 FREE (photcodes); 763 776 777 free_tess(); 764 778 SkyTableFree (sky); 765 779 SkyListFree(skylist); -
trunk/Ohana/src/relphot/src/assign_images.c
r39353 r39481 32 32 AstromOffsetTableMatchChips (image, Nimage, table); 33 33 } 34 put_astrom_table (table); 34 35 35 36 if (MOSAIC_ZEROPT) { -
trunk/Ohana/src/relphot/src/indexCatalog.c
r36630 r39481 63 63 return TRUE; 64 64 } 65 66 void freeCatalogIndexes (int Ncatalog) { 67 68 for (int i = 0; i < Ncatalog; i++) { 69 FREE (objIDseq[i]); 70 } 71 FREE (catIDseq); 72 FREE (objIDseq); 73 FREE (objIDmax); 74 } -
trunk/Ohana/src/relphot/src/launch_region_hosts.c
r39353 r39481 81 81 fprintf (stderr, "command: %s\n", command); 82 82 83 if (PARALLEL_REGIONS_MANUAL) continue; 83 if (PARALLEL_REGIONS_MANUAL) { 84 free (command); 85 continue; 86 } 84 87 85 88 // launch the job, then wait for it to be done loading catalogs. force the remote … … 100 103 check_sync_file (syncfile, 1); 101 104 free (syncfile); 105 free (command); 102 106 } 103 107 -
trunk/Ohana/src/relphot/src/load_images.c
r39479 r39481 5 5 // This function generates a subset of the images based on selections. Input db has already 6 6 // been loaded with the raw fits table data 7 int load_images (FITS_DB *db, SkyList *skylist, SkyRegion *region ) {7 int load_images (FITS_DB *db, SkyList *skylist, SkyRegion *region, int unlockImages) { 8 8 9 9 Image *image, *subset; … … 26 26 MARKTIME("build chip match for %d images: %f sec\n", (int) Nimage, dtime); 27 27 28 // XXX consider allowing relphot to skip the AstroMap load (do we need precise astrometry here?)29 30 char mapfile[DVO_MAX_PATH];31 snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);32 table = AstromOffsetMapLoad (mapfile, 100000, VERBOSE);33 34 // assign images.coords.offsetMap -> table->map[i]35 if (table) {36 AstromOffsetTableMatchChips (image, Nimage, table);37 }38 39 28 // allocate and init an array to identify the images included in the subset 40 29 ALLOCATE (inSubset, char, Nimage); … … 49 38 fprintf (stderr, "no images selected for analysis : problem with region or photcode?\n"); 50 39 exit (4); 40 } 41 42 // XXX consider allowing relphot to skip the AstroMap load (do we need precise astrometry here?) 43 44 // NOTE: unlock & free when running relphot_client (update-objects), but not when running relphot_images 45 // note that if we have MOSAIC_ZEROPT selected, we cannot free images as the full array is needed by initMosaic 46 47 /* unlock, if we can (else, unlocked below) and free, if we can */ 48 if (unlockImages && !MOSAIC_ZEROPT) { 49 if (subset != image) { 50 // if we have generated an image subset and we are running UPDATE_OFFSETS, the we can free images here 51 free (image); 52 db[0].ftable.buffer = NULL; 53 BuildChipMatch (subset, Nsubset); 54 } 55 dvo_image_unlock (db); 56 // allocate and init an array to identify the images included in the subset 57 } 58 59 char mapfile[DVO_MAX_PATH]; 60 snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR); 61 table = AstromOffsetMapLoad (mapfile, 100000, VERBOSE); 62 63 // assign images.coords.offsetMap -> table->map[i] 64 if (table) { 65 AstromOffsetTableMatchChips (subset, Nsubset, table); 51 66 } 52 67 … … 79 94 } 80 95 return (TRUE); 96 } 97 98 void put_astrom_table (AstromOffsetTable *myTable) { 99 table = myTable; 81 100 } 82 101 -
trunk/Ohana/src/relphot/src/reload_catalogs.c
r39478 r39481 67 67 fprintf (stderr, "ERROR: failure reading catalog %s, skipping\n", catalog.filename); 68 68 continue; 69 // exit (1);70 69 } 71 70 if (VERBOSE && (catalog.Naverage_disk == 0)) { … … 152 151 } 153 152 free (image); 154 // } else {155 // // load the current sky table (layout of all SkyRegions)156 // SkyTable *skytable = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, TRUE, SKY_DEPTH, VERBOSE);157 // // XXX kind of hackish...158 // ALLOCATE (sky, SkyList, 1);159 // strcpy (sky->hosts, skytable->hosts);160 // SkyTableFree (skytable);161 153 } 162 154 -
trunk/Ohana/src/relphot/src/relphot.c
r39479 r39481 8 8 if (!mode) exit (2); 9 9 10 SkyList *skylist = NULL; 11 10 12 SkyTable *sky = SkyTableLoadOptimal (CATDIR, NULL, NULL, TRUE, -1, VERBOSE); 11 13 if (!sky) { … … 15 17 SkyTableSetFilenames (sky, CATDIR, "cpt"); 16 18 17 SkyList *skylist = NULL; 18 if (UserCatalog) { 19 int Nchar = strlen(UserCatalog); 20 if (!strcmp (&UserCatalog[Nchar-4], ".cpt")) UserCatalog[Nchar-4] = 0; 21 skylist = SkyListByName (sky, UserCatalog); 22 } else { 23 skylist = SkyListByPatch (sky, -1, &UserPatch); 24 } 25 if (!skylist) { 26 fprintf (stderr, "ERROR setting up skylist for %s\n", CATDIR); 27 exit (2); 19 if ((mode != PARALLEL_REGIONS) && (mode != PARALLEL_IMAGES)) { 20 skylist = NULL; 21 if (UserCatalog) { 22 int Nchar = strlen(UserCatalog); 23 if (!strcmp (&UserCatalog[Nchar-4], ".cpt")) UserCatalog[Nchar-4] = 0; 24 skylist = SkyListByName (sky, UserCatalog); 25 } else { 26 skylist = SkyListByPatch (sky, -1, &UserPatch); 27 } 28 if (!skylist) { 29 fprintf (stderr, "ERROR setting up skylist for %s\n", CATDIR); 30 exit (2); 31 } 28 32 } 29 33 … … 37 41 case UPDATE_AVERAGES: 38 42 // take the current set of detections and set the mean magnitudes 39 // DOES NOT LOAD THE IMAGE TABLE 40 relphot_objects (sky, skylist, 0, NULL); 43 relphot_objects (skylist, 0, NULL); 41 44 relphot_free (sky, skylist); 42 45 exit (0); … … 44 47 case SYNTH_PHOT: 45 48 // set the mean magnitudes ONLY for SYNPHOT objects 46 relphot_synthphot ( 0, NULL);49 relphot_synthphot (skylist, 0, NULL); 47 50 relphot_free (sky, skylist); 48 51 exit (0); … … 50 53 case PARALLEL_REGIONS: 51 54 // run image updates in parallel across multiple remote machines 52 relphot_parallel_regions ( );55 relphot_parallel_regions (sky); 53 56 relphot_free (sky, skylist); 54 57 exit (0); … … 56 59 case PARALLEL_IMAGES: 57 60 // operation on the remote machines in the PARALLEL_REGION mode 58 relphot_parallel_images ( );61 relphot_parallel_images (sky); 59 62 relphot_free (sky, skylist); 60 63 exit (0); -
trunk/Ohana/src/relphot/src/relphot_client.c
r39478 r39481 83 83 FlatCorrectionTable *flatcorr = NULL; 84 84 reload_catalogs (skylist, flatcorr, HOST_ID, HOSTDIR); 85 freeImages ( );85 freeImages (TRUE); 86 86 free (image); 87 87 client_logger_message ("updated catalogs\n"); … … 91 91 92 92 case MODE_UPDATE_OBJECTS: { 93 relphot_objects (sky, skylist, HOST_ID, HOSTDIR); 93 // take the current set of detections and set the mean magnitudes 94 relphot_objects (skylist, HOST_ID, HOSTDIR); 94 95 relphot_client_free (sky, skylist); 95 96 client_logger_message ("updated objects\n"); … … 99 100 case MODE_SYNTH_PHOT: 100 101 // set the mean magnitudes ONLY for SYNPHOT objects 101 relphot_synthphot ( HOST_ID, HOSTDIR);102 relphot_synthphot (skylist, HOST_ID, HOSTDIR); 102 103 client_logger_message ("set synth photometry\n"); 103 104 break; -
trunk/Ohana/src/relphot/src/relphot_images.c
r39479 r39481 39 39 40 40 /* load regions and images based on specified sky patch and/or catalog */ 41 load_images (&db, skylist, &UserPatch );41 load_images (&db, skylist, &UserPatch, FALSE); 42 42 MARKTIME("-- load images: %f sec\n", dtime); 43 43 … … 261 261 dvo_image_unlock (&db); 262 262 gfits_db_free (&db); 263 freeImages ();263 freeImages (TRUE); 264 264 265 265 return TRUE; -
trunk/Ohana/src/relphot/src/relphot_objects.c
r39478 r39481 8 8 int relphot_objects_parallel (SkyList *sky); 9 9 10 int relphot_objects (Sky Table *sky, SkyList *skylist, int hostID, char *hostpath) {10 int relphot_objects (SkyList *skylist, int hostID, char *hostpath) { 11 11 12 12 off_t i, j, k; 13 13 int Nsecfilt; 14 struct stat filestat; 14 15 15 16 Catalog catalog; … … 21 22 } 22 23 24 FITS_DB db; 25 26 set_db (&db); 27 gfits_db_init (&db); 28 29 /* lock and load the image db table */ 30 int status = dvo_image_lock (&db, ImageCat, 60.0, LCK_SOFT); 31 if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename); 32 if (db.dbstate == LCK_EMPTY) Shutdown ("ERROR: No images in catalog %s (1)", db.filename); 33 if (!dvo_image_load (&db, VERBOSE, FALSE)) Shutdown ("can't read image catalog %s", db.filename); 34 // the raw FITS data is freed by dvo_image_load, leaving only the Image structure data 35 36 /* load regions and images based on specified sky patch (default depth) */ 37 load_images (&db, skylist, &UserPatch, TRUE); 38 23 39 // load the ZP corrections here 24 40 if (SYNTH_ZERO_POINTS) SynthZeroPointsLoad (SYNTH_ZERO_POINTS); 41 42 if (REPAIR_WARPS) FindWarpGroups (); 25 43 26 44 // load data from each region file, only use bright stars … … 36 54 dvo_catalog_init (&catalog, TRUE); 37 55 catalog.filename = hostID ? hostfile : skylist[0].filename[i]; 56 57 // only update existing db tables 58 int status = stat (catalog.filename, &filestat); 59 if ((status == -1) && (errno == ENOENT)) { 60 if (VERBOSE) fprintf (stderr, "no file %s, skipping\n", catalog.filename); 61 continue; 62 } 63 38 64 catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT; 39 65 catalog.Nsecfilt = GetPhotcodeNsecfilt (); 40 66 41 67 if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) { 42 fprintf (stderr, "ERROR: failure reading catalog %s \n", catalog.filename);43 exit (1);68 fprintf (stderr, "ERROR: failure reading catalog %s, skipping\n", catalog.filename); 69 continue; 44 70 } 45 71 if (!catalog.Naverage_disk) { … … 80 106 populate_tiny_values(&catalog, DVO_TV_MEASURE | DVO_TV_AVERAGE); 81 107 108 // XXX need to worry about the image subset data 109 initImageBins (&catalog, 1, FALSE); 110 initMosaicBins (&catalog, 1, FALSE); 111 initGridBins (&catalog, 1); 112 113 findImages (&catalog, 1, FALSE); 114 findMosaics (&catalog, 1, FALSE); 115 116 // update the detection coordinates using the new image parameters 117 if (REPAIR_WARPS) RepairWarpMeasures (&catalog); 118 82 119 initMrel (&catalog, 1); 83 120 setMrelFinal (&catalog, NULL, TRUE); 84 121 // XXX if we want to have options for setting warp, chip, stack independently, we need to init only the desired ones 122 // NOTE flatcorr == NULL, but it should have been applied already by setphot 85 123 86 124 if (!UPDATE) { … … 93 131 if (VERBOSE) fprintf (stderr, "saving catalog %s\n", catalog.filename); 94 132 133 char history[128]; 134 struct timeval now; 135 gettimeofday (&now, (void *) NULL); 136 char *moddate = ohana_sec_to_date (now.tv_sec); 137 gfits_modify (&catalog.header, "RELPHOT", "%s", 1, moddate); 138 snprintf (history, 128, "repair warp measure.imageID: %s", moddate); 139 gfits_modify_alt (&catalog.header, "HISTORY", "%S", 0, history); // adds a new entry 140 free (moddate); 141 95 142 // we can optionally convert output format here 96 143 // but it would be better to define a dvo crawler program to do this … … 100 147 if (!dvo_catalog_unlock (&catalog)) { fprintf (stderr, "ERROR: failed to unlock %s\n", catalog.filename); exit (1); } 101 148 SetProtect (FALSE); 149 102 150 free_tiny_values(&catalog); 103 151 dvo_catalog_free (&catalog); 104 } 152 153 freeImageBins (1, FALSE); 154 freeMosaicBins (1, FALSE); 155 freeGridBins (1); 156 } 157 158 if (REPAIR_WARPS) FreeWarpGroups (); 159 160 gfits_db_free (&db); 161 freeImages(TRUE); 162 105 163 return (TRUE); 106 164 } … … 118 176 exit (1); 119 177 } 178 179 if (BOUNDARY_TREE) { 180 char *tmppath = abspath(BOUNDARY_TREE, DVO_MAX_PATH); 181 free (BOUNDARY_TREE); 182 BOUNDARY_TREE = tmppath; 183 } 120 184 121 185 int i; … … 147 211 if (RESET) { strextend (&command, "-reset"); } 148 212 if (RESET_ZEROPTS) { strextend (&command, "-reset-zpts"); } 213 if (REPAIR_WARPS) { strextend (&command, "-repair-warps"); } 214 if (IS_DIFF_DB) { strextend (&command, "-is-diff-db"); } 149 215 if (UPDATE) { strextend (&command, "-update"); } 150 216 if (!KEEP_UBERCAL) { strextend (&command, "-reset-ubercal"); } 217 if (BOUNDARY_TREE) { strextend (&command, "-boundary-tree %s", BOUNDARY_TREE); } 151 218 if (SYNTH_ZERO_POINTS) { strextend (&command, "-synthphot-zpts %s", SYNTH_ZERO_POINTS); } 152 219 -
trunk/Ohana/src/relphot/src/relphot_parallel_images.c
r39344 r39481 12 12 int dumpObjects (char *filename, Catalog *catalog, int Ncatalog); 13 13 14 int relphot_parallel_images ( ) {14 int relphot_parallel_images (SkyTable *sky) { 15 15 16 16 int i, Ncatalog; … … 50 50 # endif 51 51 FlatCorrectionTable *flatcorr = NULL; 52 53 SkyTable *sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, TRUE, SKY_DEPTH, VERBOSE);54 SkyTableSetFilenames (sky, CATDIR, "cpt");55 52 56 53 // UserPatch.Rmin,Rmax may have range from a few degrees < 0.0 to few degrees > 360.0. … … 161 158 162 159 share_image_mags (regionHosts, -1); 160 161 for (i = 0; i < Ncatalog; i++) { 162 // these tiny values are set by BrightCatalogSplit from load_catalogs 163 free_tiny_values (&catalog[i]); 164 dvo_catalog_free (&catalog[i]); 165 } 166 free (catalog); 167 168 freeCatalogIndexes (Ncatalog); 169 freeImageBins(Ncatalog, TRUE); 170 freeMosaicBins (Ncatalog, TRUE); 171 freeGridBins (Ncatalog); 172 freeImages(TRUE); 173 174 SkyListFree(skylist); 175 FreeRegionHostTable (regionHosts); 176 163 177 client_logger_message ("done with parallel images\n"); 164 178 165 exit (0);179 return TRUE; 166 180 } -
trunk/Ohana/src/relphot/src/relphot_parallel_regions.c
r39289 r39481 2 2 int save_images_backup (FITS_DB *db); 3 3 4 int relphot_parallel_regions ( ) {4 int relphot_parallel_regions (SkyTable *sky) { 5 5 6 6 int status; … … 71 71 } 72 72 73 SkyTable *sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, TRUE, SKY_DEPTH, VERBOSE);74 SkyTableSetFilenames (sky, CATDIR, "cpt");75 73 SkyList *skylist = SkyListByBounds (sky, -1, regionHosts->Rmin, regionHosts->Rmax, regionHosts->Dmin, regionHosts->Dmax); 74 UserPatch.Rmin = regionHosts->Rmin; 75 UserPatch.Rmax = regionHosts->Rmax; 76 UserPatch.Dmin = regionHosts->Dmin; 77 UserPatch.Dmax = regionHosts->Dmax; 76 78 77 79 // I have to save a copy because dvo_image_save and _unlock swap and free the data … … 82 84 83 85 // save the changes to the image parameters 84 dvo_image_save (&db, VERBOSE); 86 dvo_image_save (&db, VERBOSE); // this function modifies the db.ftable.buffer: do not free stored Image table 85 87 dvo_image_unlock (&db); 86 88 MARKTIME ("finished relphot -parallel-regions: %f sec total\n", dtime); 87 89 88 exit (0); 90 gfits_db_free (&db); 91 freeImages(FALSE); 92 93 SkyListFree(skylist); 94 FreeRegionHostTable (regionHosts); 95 96 return TRUE; 89 97 } 90 98 … … 122 130 MARKTIME("-- save Image.dat.bck: %f sec\n", dtime); 123 131 132 gfits_db_free (&dbX); 124 133 return TRUE; 125 134 } -
trunk/Ohana/src/relphot/src/relphot_synthphot.c
r38986 r39481 6 6 int relphot_synthphot_parallel (SkyList *sky); 7 7 8 int relphot_synthphot ( int hostID, char *hostpath) {8 int relphot_synthphot (SkyList *skylist, int hostID, char *hostpath) { 9 9 10 10 off_t i; 11 11 12 SkyTable *sky = NULL;13 SkyList *skylist = NULL;14 12 Catalog catalog; 15 16 // load the current sky table (layout of all SkyRegions)17 sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, TRUE, SKY_DEPTH, VERBOSE);18 SkyTableSetFilenames (sky, CATDIR, "cpt");19 20 // determine the populated SkyRegions overlapping the requested area (default depth)21 skylist = SkyListByPatch (sky, -1, &UserPatch);22 13 23 14 // XXX need to decide how to determine PARALLEL mode...
Note:
See TracChangeset
for help on using the changeset viewer.
