Changeset 36569
- Timestamp:
- Feb 27, 2014, 3:58:27 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140206/Ohana/src/relastro
- Files:
-
- 1 added
- 11 edited
-
Makefile (modified) (1 diff)
-
include/relastro.h (modified) (6 diffs)
-
src/ImageTable.c (added)
-
src/StarMaps.c (modified) (1 diff)
-
src/args.c (modified) (2 diffs)
-
src/assign_images.c (modified) (3 diffs)
-
src/launch_region_hosts.c (modified) (1 diff)
-
src/load_images.c (modified) (2 diffs)
-
src/relastro_images.c (modified) (1 diff)
-
src/resort_catalog.c (modified) (1 diff)
-
src/select_images.c (modified) (3 diffs)
-
src/share_mean_pos.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140206/Ohana/src/relastro/Makefile
r36566 r36569 77 77 $(SRC)/share_images_pos.$(ARCH).o \ 78 78 $(SRC)/ImagePosIO.$(ARCH).o \ 79 $(SRC)/ImageTable.$(ARCH).o \ 79 80 $(SRC)/markObjects.$(ARCH).o \ 80 81 $(SRC)/indexCatalogs.$(ARCH).o \ -
branches/eam_branches/ipp-20140206/Ohana/src/relastro/include/relastro.h
r36566 r36569 6 6 # include <pthread.h> 7 7 8 # define MARKTIME(MSG,...) { \ 9 gettimeofday (&stopTimer, (void *) NULL); \ 10 float dtime = DTIME (stopTimer, startTimer); \ 11 fprintf (stderr, MSG, __VA_ARGS__); } 12 13 # define INITTIME \ 14 struct timeval startTimer, stopTimer; \ 15 gettimeofday (&startTimer, (void *) NULL); 16 8 17 // choose off_t or int depending on full-scale relphot analysis resources 9 18 // # define IDX_T off_t … … 20 29 typedef enum {FIT_NONE, FIT_AVERAGE, FIT_PM_ONLY, FIT_PAR_ONLY, FIT_PM_AND_PAR} FitMode; 21 30 22 typedef enum {TARGET_NONE, TARGET_SIMPLE, TARGET_CHIPS, TARGET_MOSAICS, TARGET_HIGH_SPEED, TARGET_MERGE_SOURCE, TARGET_UPDATE_OBJECTS, TARGET_UPDATE_OFFSETS, TARGET_LOAD_OBJECTS, TARGET_HPM } FitTarget;31 typedef enum {TARGET_NONE, TARGET_SIMPLE, TARGET_CHIPS, TARGET_MOSAICS, TARGET_HIGH_SPEED, TARGET_MERGE_SOURCE, TARGET_UPDATE_OBJECTS, TARGET_UPDATE_OFFSETS, TARGET_LOAD_OBJECTS, TARGET_HPM, TARGET_PARALLEL_REGIONS, TARGET_PARALLEL_IMAGES} FitTarget; 23 32 24 33 typedef enum { … … 129 138 } StatType; 130 139 131 # define MARKTIME(MSG,...) { \132 float dtime; \133 gettimeofday (&stop, (void *) NULL); \134 dtime = DTIME (stop, start); \135 fprintf (stderr, MSG, __VA_ARGS__); }136 137 140 /* global variables set in parameter file */ 138 141 # define DVO_MAX_PATH 1024 … … 145 148 char SKY_TABLE[DVO_MAX_PATH]; 146 149 int SKY_DEPTH; /** XXX EAM : depth of catalog tables, fix usage */ 150 151 // globals for parallel region operations 152 char *REGION_FILE; 153 char *IMAGE_TABLE; 154 int REGION_HOST_ID; 155 int PARALLEL_REGIONS_MANUAL; 147 156 148 157 int HOST_ID; … … 486 495 int share_mean_pos (Catalog *catalog, int Ncatalog, RegionHostTable *regionHosts, int nloop); 487 496 int slurp_mean_pos (Catalog *catalog, int Ncatalog, RegionHostTable *regionHosts, int nloop); 488 int set_mean_pos (MeanPos *meanpos, AverageTiny *average , SecFilt *secfilt, int Nsec);497 int set_mean_pos (MeanPos *meanpos, AverageTiny *average); 489 498 MeanPos *merge_mean_pos (MeanPos *target, int *ntarget, MeanPos *source, int Nsource); 490 499 … … 505 514 int set_image_pos (ImagePos *image_pos, Image *image); 506 515 516 Image *ImageTableLoad(char *filename, off_t *nimage); 517 int ImageTableSave (char *filename, Image *images, off_t Nimages); -
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/StarMaps.c
r35105 r36569 59 59 off_t i, N, Nimages; 60 60 int xbin, ybin; 61 struct timeval start, stop;62 61 63 gettimeofday (&start, (void *) NULL);62 INITTIME; 64 63 65 64 // Images *images = getimages(&Nimages, NULL); return value ignored -
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/args.c
r35763 r36569 49 49 remove_argument (N, &argc, argv); 50 50 FIT_TARGET = TARGET_UPDATE_OFFSETS; 51 } 52 53 // elements needed for parallel regions / parallel images 54 REGION_FILE = NULL; 55 if ((N = get_argument (argc, argv, "-region-hosts"))) { 56 remove_argument (N, &argc, argv); 57 REGION_FILE = strcreate (argv[N]); 58 remove_argument (N, &argc, argv); 59 } 60 61 REGION_HOST_ID = 0; 62 if ((N = get_argument (argc, argv, "-region-hostID"))) { 63 remove_argument (N, &argc, argv); 64 REGION_HOST_ID = atoi (argv[N]); 65 remove_argument (N, &argc, argv); 66 } 67 68 IMAGE_TABLE = NULL; 69 if ((N = get_argument (argc, argv, "-parallel-images"))) { 70 remove_argument (N, &argc, argv); 71 FIT_TARGET = TARGET_PARALLEL_IMAGES; 72 if (N >= argc) usage(); 73 IMAGE_TABLE = strcreate (argv[N]); 74 remove_argument (N, &argc, argv); 75 if (!REGION_FILE) usage(); 76 } 77 78 PARALLEL_REGIONS_MANUAL = FALSE; 79 if ((N = get_argument (argc, argv, "-parallel-regions"))) { 80 remove_argument (N, &argc, argv); 81 FIT_TARGET = TARGET_PARALLEL_REGIONS; 82 if (!REGION_FILE) usage(); 83 if ((N = get_argument (argc, argv, "-parallel-regions-manual"))) { 84 remove_argument (N, &argc, argv); 85 PARALLEL_REGIONS_MANUAL = TRUE; 86 } 51 87 } 52 88 … … 436 472 437 473 BCATALOG = NULL; 474 475 REGION_FILE = NULL; 476 REGION_HOST_ID = 0; 477 IMAGE_TABLE = NULL; 478 PARALLEL_REGIONS_MANUAL = FALSE; 438 479 439 480 HOST_ID = 0; -
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/assign_images.c
r36564 r36569 38 38 // supply the mosaics to the image table for the regionHosts : we already have the image 39 39 // <-> mosaic relationship, we just need to select these mosaics (once per regionHost) 40 select_mosaics_hostregion (regionHosts, image, Nimage); 40 // XXX DEFINE ME: select_mosaics_hostregion (regionHosts, image, Nimage); 41 abort (); 41 42 42 43 return TRUE; … … 48 49 int select_images_hostregion (RegionHostTable *regionHosts, Image *image, off_t Nimage) { 49 50 50 int ecode, found;51 51 off_t i, j; 52 52 … … 61 61 for (j = 0; j < Nimage; j++) { 62 62 63 /* exclude images by photcode */ 64 ecode = GetPhotcodeEquivCodebyCode (image[j].photcode); 65 found = FALSE; 66 int Ns; 67 for (Ns = 0; !found && (Ns < Nphotcodes); Ns++) { 68 if (ecode == photcodes[Ns][0].code) found = TRUE; 69 } 70 if (!found) continue; 63 /* select images by photcode, or equiv photcode, if specified */ 64 if (NphotcodesKeep > 0) { 65 int found = FALSE; 66 // XXX this bit of code excludes DIS mosaics and should be fixed 67 for (i = 0; (i < NphotcodesKeep) && !found; i++) { 68 if (photcodesKeep[i][0].code == image[j].photcode) found = TRUE; 69 if (photcodesKeep[i][0].code == GetPhotcodeEquivCodebyCode(image[j].photcode)) found = TRUE; 70 } 71 if (!found) continue; 72 } 73 if (NphotcodesSkip > 0) { 74 int found = FALSE; 75 for (i = 0; (i < NphotcodesSkip) && !found; i++) { 76 if (photcodesSkip[i][0].code == image[j].photcode) found = TRUE; 77 if (photcodesSkip[i][0].code == GetPhotcodeEquivCodebyCode(image[j].photcode)) found = TRUE; 78 } 79 if (found) continue; 80 } 71 81 72 82 /* exclude images by time */ -
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/launch_region_hosts.c
r36564 r36569 55 55 56 56 char command[1024]; 57 snprintf (command, 1024, "relastro %s -parallel-images %s -region-hosts %s -region-hostID %d -D CATDIR %s -region %f %f %f %f -statmode %s -D CAMERA %s -D STAR_TOOFEW %d-minerror %f",58 PhotcodeList, filename, REGION_FILE, host->hostID, CATDIR, host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat, STATMODE, CAMERA, STAR_TOOFEW, MIN_ERROR);57 snprintf (command, 1024, "relastro -parallel-images %s -region-hosts %s -region-hostID %d -D CATDIR %s -region %f %f %f %f -statmode %s -minerror %f", 58 filename, REGION_FILE, host->hostID, CATDIR, host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat, STATMODE, MIN_ERROR); 59 59 60 if (VERBOSE) strextend (command, "-v");61 if (VERBOSE2) strextend (command, "-vv");62 if (RESET) strextend (command, "-reset");63 if ( RESET_ZEROPTS) strextend (command, "-reset-zpts");64 if ( UPDATE) strextend (command, "-update");65 if ( !KEEP_UBERCAL) strextend (command, "-reset-ubercal");66 if (PARALLEL ) strextend (command, "-parallel");67 if (P ARALLEL_MANUAL) strextend (command, "-parallel-manual");68 if (P ARALLEL_SERIAL) strextend (command, "-parallel-serial");60 if (VERBOSE) strextend (command, "-v"); 61 if (VERBOSE2) strextend (command, "-vv"); 62 if (RESET) strextend (command, "-reset"); 63 if (UPDATE) strextend (command, "-update"); 64 if (PARALLEL) strextend (command, "-parallel"); 65 if (PARALLEL_MANUAL) strextend (command, "-parallel-manual"); 66 if (PARALLEL_SERIAL) strextend (command, "-parallel-serial"); 67 if (PHOTCODE_KEEP_LIST) strextend (command, "+photcode %s", PHOTCODE_KEEP_LIST); 68 if (PHOTCODE_SKIP_LIST) strextend (command, "-photcode %s", PHOTCODE_SKIP_LIST); 69 69 70 70 fprintf (stderr, "command: %s\n", command); -
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/load_images.c
r35763 r36569 1 1 # include "relastro.h" 2 3 # define MARKTIME(MSG,...) { \4 float dtime; \5 gettimeofday (&stop, (void *) NULL); \6 dtime = DTIME (stop, start); \7 fprintf (stderr, MSG, __VA_ARGS__); }8 2 9 3 int load_images (FITS_DB *db, SkyList *skylist, int UseFullOverlap) { … … 12 6 off_t Nimage, Nsubset; 13 7 off_t *LineNumber; 14 struct timeval start, stop;15 8 16 gettimeofday (&start, (void *) NULL);9 INITTIME; 17 10 18 11 // convert database table to internal structure -
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/relastro_images.c
r35763 r36569 6 6 Catalog *catalog; 7 7 FITS_DB db; 8 struct timeval start, stop;9 8 10 gettimeofday (&start, (void *) NULL);9 INITTIME; 11 10 12 11 /* register database handle with shutdown procedure */ -
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/resort_catalog.c
r34088 r36569 30 30 if (catalog[0].sorted == TRUE) return; 31 31 32 // struct timeval start, stop; 33 // gettimeofday (&start, NULL); 32 // INITTIME; 34 33 35 34 /* internal counters */ -
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/select_images.c
r36482 r36569 15 15 void dsortindex (double *X, off_t *Y, int N); 16 16 off_t getRegionStartByRA (double R, double *Rref, off_t Nregions); 17 18 # define MARKTIME(MSG,...) { \19 float dtime; \20 gettimeofday (&stop, (void *) NULL); \21 dtime = DTIME (stop, start); \22 fprintf (stderr, MSG, __VA_ARGS__); }23 17 24 18 Image *select_images (SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage, int UseFullOverlap) { … … 31 25 Coords tcoords; 32 26 SkyRegionCoords *skycoords; 33 struct timeval start, stop;34 27 35 28 double RmaxSkyRegion, RminSkyRegion, RmidSkyRegion, DminSkyRegion, DmaxSkyRegion; … … 50 43 } 51 44 52 gettimeofday (&start, (void *) NULL);45 INITTIME; 53 46 54 47 // the comparison is made in the catalog local projection. below we set crval1,2 -
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/share_mean_pos.c
r36564 r36569 13 13 MeanPos *meanpos = NULL; 14 14 ALLOCATE (meanpos, MeanPos, NMEANPOS); 15 16 int Ns;17 int Nsecfilt = GetPhotcodeNsecfilt();18 15 19 16 int myHost = regionHosts->index[REGION_HOST_ID]; … … 38 35 if (catalog[i].averageT[j].nOwn == catalog[i].averageT[j].Nmeasure) continue; 39 36 40 for (Ns = 0; Ns < Nphotcodes; Ns++) { 41 int thisCode = photcodes[Ns][0].code; 42 int Nsec = GetPhotcodeNsec(thisCode); 43 set_mean_pos (&meanpos[Nmeanpos], &catalog[i].averageT[j], &catalog[i].secfilt[Nsecfilt*j + Nsec], Nsec); 44 Nmeanpos ++; 45 CHECK_REALLOCATE (meanpos, MeanPos, NMEANPOS, Nmeanpos, D_NMEANPOS); 46 } 37 set_mean_pos (&meanpos[Nmeanpos], &catalog[i].averageT[j]); 38 Nmeanpos ++; 39 CHECK_REALLOCATE (meanpos, MeanPos, NMEANPOS, Nmeanpos, D_NMEANPOS); 47 40 } 48 41 } … … 71 64 72 65 fprintf (stderr, "grabbing mean object pos from other hosts...\n"); 73 74 int Nsecfilt = GetPhotcodeNsecfilt();75 66 76 67 for (i = 0; i < regionHosts->Nhosts; i++) { … … 112 103 } 113 104 114 int set_mean_pos (MeanPos *meanpos, AverageTiny *average , SecFilt *secfilt, int Nsec) {105 int set_mean_pos (MeanPos *meanpos, AverageTiny *average) { 115 106 116 107 meanpos->R = average->R;
Note:
See TracChangeset
for help on using the changeset viewer.
