Changeset 37665
- Timestamp:
- Nov 23, 2014, 9:37:13 AM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src/relastro
- Files:
-
- 2 added
- 8 edited
-
Makefile (modified) (1 diff)
-
include/relastro.h (modified) (4 diffs)
-
src/ImageOps.c (modified) (2 diffs)
-
src/MeasPosIO.c (added)
-
src/launch_region_hosts.c (modified) (1 diff)
-
src/markObjects.c (modified) (1 diff)
-
src/relastro_parallel_images.c (modified) (3 diffs)
-
src/relastro_parallel_regions.c (modified) (1 diff)
-
src/share_images_pos.c (modified) (3 diffs)
-
src/share_meas_pos.c (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/relastro/Makefile
r37658 r37665 75 75 $(SRC)/relastro_parallel_regions.$(ARCH).o \ 76 76 $(SRC)/MeanPosIO.$(ARCH).o \ 77 $(SRC)/MeasPosIO.$(ARCH).o \ 77 78 $(SRC)/share_mean_pos.$(ARCH).o \ 79 $(SRC)/share_meas_pos.$(ARCH).o \ 78 80 $(SRC)/share_images_pos.$(ARCH).o \ 79 81 $(SRC)/share_icrf_obj.$(ARCH).o \ -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h
r37664 r37665 34 34 35 35 typedef struct { 36 floatR;37 floatD;36 double R; 37 double D; 38 38 unsigned int objID; 39 39 unsigned int catID; 40 40 } MeanPos; 41 42 typedef struct { 43 double R; 44 double D; 45 unsigned int objID; 46 unsigned int catID; 47 unsigned int imageID; 48 } MeasPos; 41 49 42 50 typedef struct { … … 451 459 int setImageRaw (Catalog *catalog, int Ncatalog, off_t im, StarData *raw, off_t Nraw, CoordMode mode); 452 460 off_t getImageByID (off_t ID); 461 int updateImageRaw (Catalog *catalog, int Ncatalog, off_t im); 453 462 454 463 Mosaic *getmosaics (off_t *N); … … 552 561 MeanPos *MeanPosLoad(char *filename, off_t *nmeanpos); 553 562 563 int share_meas_pos (Catalog *catalog, int Ncatalog, RegionHostTable *regionHosts, int nloop); 564 int slurp_meas_pos (Catalog *catalog, int Ncatalog, RegionHostTable *regionHosts, int nloop); 565 int set_meas_pos (MeasPos *measpos, Average *average, MeasureTiny *measure); 566 MeasPos *merge_meas_pos (MeasPos *target, int *ntarget, MeasPos *source, int Nsource); 567 568 int MeasPosSave(char *filename, MeasPos *measpos, off_t Nmeaspos); 569 MeasPos *MeasPosLoad(char *filename, off_t *nmeaspos); 570 554 571 int indexCatalogs (Catalog *catalog, int Ncatalog); 555 572 int catID_and_objID_to_seq (int catID, int objID, int *catSeq, off_t *objSeq); … … 561 578 562 579 int share_image_pos (RegionHostTable *regionHosts, int nloop); 563 int slurp_image_pos ( RegionHostTable *regionHosts, int nloop);580 int slurp_image_pos (Catalog *catalog, int Ncatalog, RegionHostTable *regionHosts, int nloop); 564 581 ImagePos *merge_image_pos (ImagePos *target, int *ntarget, ImagePos *source, int Nsource); 565 582 int set_image_pos (ImagePos *image_pos, Image *image); -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/ImageOps.c
r37646 r37665 251 251 return; 252 252 } 253 measure->myDet = TRUE; // I 'own' this detection (I am calibrating its image) 253 254 254 255 // index for (catalog, measure) -> image … … 906 907 catalog[c].measure[m].R = raw[i].R; 907 908 catalog[c].measure[m].D = raw[i].D; 909 } 910 } 911 return TRUE; 912 } 913 914 // return StarData values for detections in the specified image, converting coordinates from the 915 // chip positions: X,Y -> L,M -> P,Q -> R,D. This function is used by the image fitting steps, for 916 // which the detections have already been filtered when they were loaded (bcatalog) 917 int updateImageRaw (Catalog *catalog, int Ncatalog, off_t im) { 918 919 off_t i, m, c; 920 921 for (i = 0; i < N_onImage[im]; i++) { 922 m = ImageToMeasure[im][i]; 923 c = ImageToCatalog[im][i]; 924 925 MeasureTiny *measure = &catalog[c].measureT[m]; 926 927 /* apply the current image transformation or use the current value of R+dR, D+dD? */ 928 double X = measure[0].Xccd; 929 double Y = measure[0].Yccd; 930 if (USE_FIXED_PIXCOORDS) { 931 if (isfinite(measure[0].Xfix) && isfinite(measure[0].Yfix)) { 932 float dX = measure[0].Xfix - measure[0].Xccd; 933 float dY = measure[0].Yfix - measure[0].Yccd; 934 if (hypot(dX,dY) < 2.0) { 935 X = measure[0].Xfix; 936 Y = measure[0].Yfix; 937 } 938 } 939 } 940 941 double R, D; 942 XY_to_RD (&R, &D, X, Y, &image[im].coords); 943 measure->R = R; 944 measure->D = D; 945 if (catalog[c].measure) { 946 catalog[c].measure[m].R = R; 947 catalog[c].measure[m].D = D; 908 948 } 909 949 } -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/launch_region_hosts.c
r37664 r37665 8 8 // clear the I/O files 9 9 for (i = 0; i < regionHosts->Nhosts; i++) { 10 char *syncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanpos.sync"); 11 if (truncate (syncfile, 0)) fprintf (stderr, "trouble clearing syncfile %s\n", syncfile); 12 free (syncfile); 13 14 char *fitsfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanpos.fits"); 15 if (truncate (fitsfile, 0)) fprintf (stderr, "trouble clearing fitsfile %s\n", fitsfile); 16 free (fitsfile); 10 char *meansync = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanpos.sync"); 11 if (truncate (meansync, 0)) fprintf (stderr, "trouble clearing meansync %s\n", meansync); 12 free (meansync); 13 14 char *meanfits = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanpos.fits"); 15 if (truncate (meanfits, 0)) fprintf (stderr, "trouble clearing meanfits %s\n", meanfits); 16 free (meanfits); 17 18 char *meassync = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "measpos.sync"); 19 if (truncate (meassync, 0)) fprintf (stderr, "trouble clearing meassync %s\n", meassync); 20 free (meassync); 21 22 char *measfits = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "measpos.fits"); 23 if (truncate (measfits, 0)) fprintf (stderr, "trouble clearing measfits %s\n", measfits); 24 free (measfits); 17 25 18 26 char *icrfsync = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "icrfobj.sync"); -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/markObjects.c
r37038 r37665 14 14 int m = catalog[i].average[j].measureOffset; 15 15 for (n = 0; n < catalog[i].average[j].Nmeasure; n++) { 16 if (!catalog[i].measureT[m+n].myDet) continue; 17 nOwn ++; 16 // this is a detection I own (it is on one of my images) 17 if (catalog[i].measureT[m+n].myDet) { 18 nOwn ++; 19 continue; 20 } 21 // 2MASS detections are counted as 'owned' (I completely control this object is nOwn_t == Nmeasure; no sharing needed) 22 if ((catalog[i].measureT[m+n].photcode == 2011) || 23 (catalog[i].measureT[m+n].photcode == 2012) || 24 (catalog[i].measureT[m+n].photcode == 2013)) { 25 nOwn ++; 26 continue; 27 } 18 28 } 19 29 catalog[i].nOwn_t[j] = nOwn; -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/relastro_parallel_images.c
r37662 r37665 99 99 UpdateSimple (catalog, Ncatalog); 100 100 share_image_pos (regionHosts, i); 101 slurp_image_pos ( regionHosts, i);101 slurp_image_pos (catalog, Ncatalog, regionHosts, i); 102 102 } 103 103 break; … … 112 112 UpdateChips (catalog, Ncatalog); 113 113 share_image_pos (regionHosts, i); 114 slurp_image_pos (regionHosts, i); 114 slurp_image_pos (catalog, Ncatalog, regionHosts, i); 115 share_meas_pos (catalog, Ncatalog, regionHosts, i); 116 slurp_meas_pos (catalog, Ncatalog, regionHosts, i); 115 117 MARKTIME("update chips: %f sec\n", dtime); 116 118 } … … 126 128 UpdateMosaic (catalog, Ncatalog); 127 129 share_image_pos (regionHosts, i); 128 slurp_image_pos ( regionHosts, i);130 slurp_image_pos (catalog, Ncatalog, regionHosts, i); 129 131 } 130 132 break; -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/relastro_parallel_regions.c
r37658 r37665 49 49 50 50 // retrieve updated image parameters from the remote hosts (also set Image.mcal) 51 if (!slurp_image_pos ( regionHosts, -1)) Shutdown ("error loading image updates");51 if (!slurp_image_pos (NULL, 0, regionHosts, -1)) Shutdown ("error loading image updates"); 52 52 53 53 if (!UPDATE) { -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/share_images_pos.c
r37664 r37665 51 51 } 52 52 53 int slurp_image_pos ( RegionHostTable *regionHosts, int nloop) {53 int slurp_image_pos (Catalog *catalog, int Ncatalog, RegionHostTable *regionHosts, int nloop) { 54 54 55 55 off_t Nimage, i, j; … … 91 91 images[seq].flags = image_pos[i].flags ; 92 92 } 93 free (image_pos);94 93 95 94 // load the astrometry offset maps, if they exist, and apply … … 113 112 } 114 113 } 114 115 // apply the modified image parameters to my detections 116 for (i = 0; FALSE && (Ncatalog > 0) && (i < Nimage_pos); i++) { 117 off_t seq = getImageByID (image_pos[i].imageID); 118 if (seq < 0) continue; 119 updateImageRaw (catalog, Ncatalog, seq); 120 } 121 free (image_pos); 122 115 123 fprintf (stderr, "DONE grabbing image mags from other hosts\n"); 116 124
Note:
See TracChangeset
for help on using the changeset viewer.
