Changeset 37422
- Timestamp:
- Sep 23, 2014, 9:53:58 AM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src/addstar
- Files:
-
- 9 edited
-
Makefile (modified) (2 diffs)
-
include/loadstarpar.h (modified) (1 diff)
-
src/args_loadstarpar.c (modified) (1 diff)
-
src/coord_transforms.c (modified) (2 diffs)
-
src/find_matches_starpar.c (modified) (2 diffs)
-
src/loadstarpar.c (modified) (1 diff)
-
src/loadstarpar_make_subset.c (modified) (1 diff)
-
src/loadstarpar_readstars.c (modified) (5 diffs)
-
src/loadstarpar_save_remote.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/addstar/Makefile
r37417 r37422 250 250 $(SRC)/SkyRegionUtils.$(ARCH).o \ 251 251 $(SRC)/args_loadstarpar.$(ARCH).o \ 252 $(SRC)/coord_transforms.$(ARCH).o \253 252 $(SRC)/find_matches_starpar.$(ARCH).o \ 254 253 $(SRC)/loadstarpar_catalog.$(ARCH).o \ … … 268 267 $(SRC)/SkyRegionUtils.$(ARCH).o \ 269 268 $(SRC)/args_loadstarpar.$(ARCH).o \ 270 $(SRC)/coord_transforms.$(ARCH).o \271 269 $(SRC)/find_matches_starpar.$(ARCH).o \ 272 270 $(SRC)/loadstarpar_catalog.$(ARCH).o \ -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/include/loadstarpar.h
r37417 r37422 3 3 double R, D; 4 4 StarPar starpar; 5 int flag; // XXX how is this used?5 int flag; // in a subset? 6 6 int found; // assigned to an object? 7 7 } StarPar_Stars; -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/args_loadstarpar.c
r37417 r37422 23 23 UserPatch.Dmin = -90; 24 24 UserPatch.Dmax = +90; 25 26 // XXX for the moment, make this selection manual. it needs to be automatic 27 // based on the state of the SkyTable 28 HOST_ID = 0; 29 PARALLEL = FALSE; 30 if ((N = get_argument (argc, argv, "-parallel"))) { 31 PARALLEL = TRUE; 32 remove_argument (N, &argc, argv); 33 } 34 // this is a test mode : rather than launching the remote jobs and waiting for completion, 35 // relphot will simply list the remote command and wait for the user to signal completion 36 PARALLEL_MANUAL = FALSE; 37 if ((N = get_argument (argc, argv, "-parallel-manual"))) { 38 PARALLEL = TRUE; // -parallel-manual implies -parallel 39 PARALLEL_MANUAL = TRUE; 40 remove_argument (N, &argc, argv); 41 } 42 // this is a test mode : rather than launching the relphot_client jobs remotely, they are 43 // run in serial via 'system' 44 PARALLEL_SERIAL = FALSE; 45 if ((N = get_argument (argc, argv, "-parallel-serial"))) { 46 if (PARALLEL_MANUAL) { 47 fprintf (stderr, "ERROR: cannot mix -parallel-manual and -parallel-serial\n"); 48 exit (1); 49 } 50 PARALLEL = TRUE; // -parallel-serial implies -parallel 51 PARALLEL_SERIAL = TRUE; 52 remove_argument (N, &argc, argv); 53 } 25 54 26 55 /* only add to existing regions */ -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/coord_transforms.c
r37417 r37422 1 1 # include "addstar.h" 2 2 # include "loadstarpar.h" 3 4 // values used by libdvo/coord_systems (from Liu et al 2011, A&A 526, A16): 5 // Liu etal and Reid etal disagree at the 0.3 arcsec level 6 // transform->phi = 62.8717488056*RAD_DEG; 7 // transform->Xo = 32.9319185700*RAD_DEG; 8 // transform->xo = 282.8594812080; 3 9 4 10 int galactic_to_celestial (double *R, double *D, double l, double b) { … … 7 13 abort(); 8 14 } 15 16 int celestial_to_galactic (double *l, double *b, double R, double D) { 17 18 _angp = np.radians(192.859508333) # 12h 51m 26.282s (J2000) 19 _dngp = np.radians(27.128336111) # +27d 07' 42.01" (J2000) 20 _l0 = np.radians(32.932) 21 _ce = np.cos(_dngp) 22 _se = np.sin(_dngp) 23 24 25 26 } 27 28 29 30 31 /*** python version from LSD (Mario Juric) 32 33 # Appendix of Reid et al. (http://adsabs.harvard.edu/cgi-bin/bib_query?2004ApJ...616..872R) 34 # This convention is also used by LAMBDA/WMAP (http://lambda.gsfc.nasa.gov/toolbox/tb_coordconv.cfm) 35 _angp = np.radians(192.859508333) # 12h 51m 26.282s (J2000) 36 _dngp = np.radians(27.128336111) # +27d 07' 42.01" (J2000) 37 _l0 = np.radians(32.932) 38 _ce = np.cos(_dngp) 39 _se = np.sin(_dngp) 40 41 def equgal(ra, dec): 42 ra = np.radians(ra) 43 dec = np.radians(dec) 44 45 cd, sd = np.cos(dec), np.sin(dec) 46 ca, sa = np.cos(ra - _angp), np.sin(ra - _angp) 47 48 sb = cd*_ce*ca + sd*_se 49 l = np.arctan2(sd - sb*_se, cd*sa*_ce) + _l0 50 b = np.arcsin(sb) 51 52 l = np.where(l < 0, l + 2.*np.pi, l) 53 54 l = np.degrees(l) 55 b = np.degrees(b) 56 57 return NamedList(('l', l), ('b', b)) 58 59 def galequ(l, b): 60 l = np.radians(l) 61 b = np.radians(b) 62 63 cb, sb = np.cos(b), np.sin(b) 64 cl, sl = np.cos(l-_l0), np.sin(l-_l0) 65 66 ra = np.arctan2(cb*cl, sb*_ce-cb*_se*sl) + _angp 67 dec = np.arcsin(cb*_ce*sl + sb*_se) 68 69 ra = np.where(ra < 0, ra + 2.*np.pi, ra) 70 71 ra = np.degrees(ra) 72 dec = np.degrees(dec) 73 74 return NamedList(('ra', ra), ('dec', dec)) 75 76 ***/ -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/find_matches_starpar.c
r37417 r37422 151 151 } 152 152 153 # if ( 0)153 # if (1) 154 154 /** incorporate unmatched image stars? **/ 155 155 for (i = 0; (i < Nstars) && !options->only_match; i++) { … … 157 157 // skip already matched stars 158 158 if (stars[i].found != -1) continue; 159 if (!IN_REGION (stars[i]. average.R, stars[i].average.D)) continue;159 if (!IN_REGION (stars[i].R, stars[i].D)) continue; 160 160 161 161 /* make sure there is space for next entry */ 162 162 if (Nstarpar >= NSTARPAR) { 163 163 NSTARPAR = Nstarpar + 1000; 164 REALLOCATE (catalog[0].starpar, Star par, NSTARPAR);164 REALLOCATE (catalog[0].starpar, StarPar, NSTARPAR); 165 165 } 166 166 if (Nave >= NAVE) { -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadstarpar.c
r37417 r37422 25 25 26 26 // load the list of hosts 27 HostTable *hosts = HostTableLoad (CATDIR, sky->hosts); 28 if (!hosts) { 29 fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR); 30 exit (1); 31 } 27 HostTable *hosts = NULL; 28 if (PARALLEL) { 29 hosts = HostTableLoad (CATDIR, sky->hosts); 30 if (!hosts) { 31 fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR); 32 exit (1); 33 } 34 35 // ensure that the paths are absolute path names 36 for (i = 0; i < hosts->Nhosts; i++) { 37 char *tmppath = abspath (hosts->hosts[i].pathname, DVO_MAX_PATH); 38 free (hosts->hosts[i].pathname); 39 hosts->hosts[i].pathname = tmppath; 40 } 41 42 // set up the array of active hosts 43 init_remote_hosts (); 44 } 32 45 33 46 // generate the subset matching the user-selected region -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadstarpar_make_subset.c
r37417 r37422 35 35 Nsubset ++; 36 36 37 stars[i].flag = TRUE; 38 37 39 CHECK_REALLOCATE (subset, StarPar_Stars, NSUBSET, Nsubset, 10000); 38 40 } -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadstarpar_readstars.c
r37417 r37422 44 44 return (NULL); 45 45 } 46 fclose (f);47 46 48 47 char type[16]; … … 75 74 return NULL; 76 75 } 76 fclose (f); 77 77 78 78 double *errImage = (double *) matrix.buffer; … … 93 93 ALLOCATE (stars, StarPar_Stars, NSTARS); 94 94 95 // libdvo uses Liu et al 2011 (A&A 526, A16) for default galactic coords, 96 // but Greg Green / LSD use the older Reid et al 2004 (ApJ 616, 872) definition 97 CoordTransform *transform = InitTransform (COORD_GALACTIC_REID_2004, COORD_CELESTIAL); 98 95 99 for (i = 0; i < NstarsIn; i++) { 96 100 … … 100 104 101 105 double R, D; 102 galactic_to_celestial (&R, &D, glon[i], glat[i]);106 ApplyTransform (&R, &D, glon[i], glat[i], transform); 103 107 104 108 Rmin = MIN (Rmin, R); … … 114 118 stars[Nstars].R = R; 115 119 stars[Nstars].D = D; 120 stars[Nstars].flag = FALSE; 121 stars[Nstars].found = FALSE; 116 122 117 123 stars[Nstars].starpar.galLon = glon[i]; -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadstarpar_save_remote.c
r37417 r37422 24 24 25 25 // if this region is a parallel thing, save and launch remote 26 if (! region->hostID) {26 if (!PARALLEL) { 27 27 loadstarpar_catalog (stars, Nstars, region, fullname, options); 28 28 } else { … … 61 61 // got a valid slot, so launch a new host 62 62 63 // XXX do this after we load the host table:64 // ensure that the paths are absolute path names65 // char *tmppath = abspath (table->hosts[i].pathname, DVO_MAX_PATH);66 // free (table->hosts[i].pathname);67 // table->hosts[i].pathname = tmppath;68 69 63 // need to generate the remote command 70 64 char command[1024];
Note:
See TracChangeset
for help on using the changeset viewer.
