Changeset 33537
- Timestamp:
- Mar 15, 2012, 2:59:06 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/Ohana/src/relastro
- Files:
-
- 8 edited
-
include/relastro.h (modified) (1 diff)
-
src/UpdateObjectOffsets.c (modified) (1 diff)
-
src/UpdateObjects.c (modified) (4 diffs)
-
src/args.c (modified) (1 diff)
-
src/high_speed_catalogs.c (modified) (3 diffs)
-
src/high_speed_objects.c (modified) (1 diff)
-
src/load_catalogs.c (modified) (1 diff)
-
src/relastro_objects.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/relastro/include/relastro.h
r33532 r33537 142 142 int PARALLEL_MANUAL; 143 143 int PARALLEL_SERIAL; 144 145 int PARALLEL_OUTPUT; 144 146 145 147 int VERBOSE; -
branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/UpdateObjectOffsets.c
r33532 r33537 15 15 16 16 // XXX need to decide how to determine PARALLEL mode... 17 if (PARALLEL & !hostID) {17 if (PARALLEL && !hostID) { 18 18 UpdateObjectOffsets_parallel (skylist); 19 19 return TRUE; -
branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/UpdateObjects.c
r33448 r33537 98 98 // when we update the output measure values, we need to do it here 99 99 100 Tmin = Tmax = (measure[0].t - T2000) / (86400*365.25);101 100 mode = FIT_MODE; 102 101 103 102 // find the basic properties of the detections for this object (Tmin, Tmax, Tmean) 104 Tmean = 0;105 103 for (k = 0; k < catalog[i].average[j].Nmeasure; k++) { 106 104 … … 129 127 T[N] = (measure[k].t - T2000) / (86400*365.25) ; // time relative to J2000 in years 130 128 131 Tmin = MIN(Tmin, T[N]);132 Tmax = MAX(Tmax, T[N]);133 Tmean += T[N];134 135 129 // dX, dY : error in arcsec -- 136 130 dX[N] = GetAstromErrorTiny (&measure[k], ERROR_MODE_RA); 137 131 dY[N] = GetAstromErrorTiny (&measure[k], ERROR_MODE_DEC); 132 133 // XXX this is a bit hackish -- allow a given photcode or measurement to be 134 // ignored by ignoring excessively bad errors 135 if (dX[N] > 10.0) continue; 136 if (dY[N] > 10.0) continue; 138 137 139 138 // add systematic error in quadrature, if desired … … 166 165 catalog[i].average[j].flags &= ~ID_STAR_FEW; 167 166 167 // find Tmin & Tmax from the list of accepted measurements 168 Tmean = 0; 169 Tmin = Tmax = T[0]; 170 for (k = 0; k < N; k++) { 171 Tmin = MIN(Tmin, T[N]); 172 Tmax = MAX(Tmax, T[N]); 173 Tmean += T[N]; 174 } 168 175 // XXX add the parallax factor range as a criterion as well 169 176 Trange = Tmax - Tmin; 170 177 if (Trange < PM_DT_MIN) mode = FIT_AVERAGE; 171 178 if ((mode == FIT_PM_ONLY) && (N < PM_TOOFEW)) mode = FIT_AVERAGE; 179 180 if (FIT_TARGET == TARGET_HIGH_SPEED) { 181 Tmean = 0.5*(Tmax - Tmin); 182 } else { 183 Tmean /= (float) N; 184 } 172 185 173 186 // too few measurements for average position (require 2 values) … … 186 199 coords.crval2 = D[0]; 187 200 188 if (FIT_TARGET == TARGET_HIGH_SPEED) {189 Tmean = 0.5*(Tmax - Tmin);190 } else {191 Tmean /= (float) N;192 }193 194 201 // XVERB |= (catalog[i].averge[j].objID == 0xc90) && (catalog[i].average[j].catID == 0x2a1e); 195 202 XVERB |= (catalog[i].average[j].objID == OBJ_ID_SRC) && (catalog[i].average[j].catID == CAT_ID_SRC); -
branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/args.c
r33448 r33537 95 95 HIGH_SPEED_DIR = abspath(argv[N], MAX_PATH_LENGTH); 96 96 remove_argument (N, &argc, argv); 97 } 98 99 PARALLEL_OUTPUT = FALSE; 100 if ((N = get_argument (argc, argv, "-parallel-output"))) { 101 remove_argument (N, &argc, argv); 102 PARALLEL_OUTPUT = TRUE; 103 if (FIT_TARGET != TARGET_HIGH_SPEED) { 104 fprintf (stderr, "-parallel-output only valid for -high-speed mode\n"); 105 exit (1); 106 } 97 107 } 98 108 -
branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/high_speed_catalogs.c
r33520 r33537 14 14 15 15 // XXX need to decide how to determine PARALLEL mode... 16 if (PARALLEL & !hostID) {16 if (PARALLEL && !hostID) { 17 17 high_speed_catalogs_parallel (skylist); 18 18 goto finish; … … 87 87 } 88 88 89 // If we want to parallelize the output, the remote client needs to load the HostTable 90 // for the output catdir. Require the output HostTable to match the input (ie, same 91 // hostIDs must exist). Preferred, but not required, that they match in the host 92 // location. 93 HostTable *tableOut = NULL; 94 if (PARALLEL_OUTPUT) { 95 // load the list of hosts 96 tableOut = HostTableLoad (HIGH_SPEED_DIR, skylist->hosts); 97 if (!tableOut) { 98 fprintf (stderr, "ERROR: failure reading Host Table %s for output database %s\n", skylist->hosts, HIGH_SPEED_DIR); 99 exit (1); 100 } 101 if (table->Nhosts != tableOut->Nhosts) { 102 fprintf (stderr, "ERROR: output HostTable must have matching hosts (%d in, %d out)\n", table->Nhosts, tableOut->Nhosts); 103 exit (1); 104 } 105 } 106 89 107 int i; 90 108 for (i = 0; i < table->Nhosts; i++) { … … 95 113 table->hosts[i].pathname = tmppath; 96 114 97 // options / arguments that can affect relastro_client -high-speed 115 // use this directory to save the output catalogs (distributed if parallel) 116 char *outputDir = strcreate(HIGH_SPEED_DIR); 117 if (PARALLEL_OUTPUT) { 118 // find the matching host entry in the output HostTable (match by ID, not index) 119 int hostID = table->hosts[i].hostID; 120 int index = table->index[hostID]; 121 if (index == -1) { 122 fprintf (stderr, "ERROR: output HostTable must have matching hosts (host ID %d not found)\n", hostID); 123 exit (1); 124 } 125 126 free (outputDir); 127 outputDir = abspath (tableOut->hosts[index].pathname, MAX_PATH_LENGTH); 128 } 98 129 99 130 char command[1024]; 100 131 snprintf (command, 1024, "relastro_client -high-speed %s %s %f %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f", 101 PHOTCODE_A_LIST, PHOTCODE_B_LIST, RADIUS, HIGH_SPEED_DIR, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 102 132 PHOTCODE_A_LIST, PHOTCODE_B_LIST, RADIUS, outputDir, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 133 134 free (outputDir); 135 136 // options / arguments that can affect relastro_client -high-speed 103 137 char tmpline[1024]; 104 138 if (FIT_MODE == FIT_PM_ONLY) { snprintf (tmpline, 1024, "%s -pm", command); strcpy (command, tmpline); } -
branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/high_speed_objects.c
r33479 r33537 18 18 int Nsecfilt; 19 19 char filename[1024]; 20 20 21 snprintf (filename, 1024, "%s/%s.cpt", HIGH_SPEED_DIR, region[0].name); 21 22 fprintf (stderr, "%s\n",filename); -
branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/load_catalogs.c
r33520 r33537 9 9 10 10 // XXX need to decide how to determine PARALLEL mode... 11 if (PARALLEL & !hostID) {11 if (PARALLEL && !hostID) { 12 12 catalog = load_catalogs_parallel (skylist, Ncatalog); 13 13 return catalog; -
branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/relastro_objects.c
r33520 r33537 26 26 27 27 // XXX need to decide how to determine PARALLEL mode... 28 if (PARALLEL & !hostID) {28 if (PARALLEL && !hostID) { 29 29 relastro_objects_parallel (skylist); 30 30 return TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.
