Changeset 33564
- Timestamp:
- Mar 17, 2012, 2:49:51 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/Ohana/src
- Files:
-
- 9 edited
-
libdvo/include/dvo.h (modified) (2 diffs)
-
libdvo/src/HostTable.c (modified) (1 diff)
-
opihi/dvo/dvo_host_utils.c (modified) (4 diffs)
-
relastro/src/load_catalogs.c (modified) (2 diffs)
-
relphot/src/StarOps.c (modified) (4 diffs)
-
relphot/src/bcatalog.c (modified) (1 diff)
-
relphot/src/load_catalogs.c (modified) (4 diffs)
-
relphot/src/relphot_objects.c (modified) (2 diffs)
-
relphot/src/setMrelFinal.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/libdvo/include/dvo.h
r33520 r33564 172 172 /* Secfilt.flags values -- these values are 32 bit (as of PS1_V1) */ 173 173 typedef enum { 174 ID_SECF_STAR_FEW = 0x00000001, // used within relphot: skip star 175 ID_SECF_STAR_POOR = 0x00000002, // used within relphot: skip star 176 ID_PHOTOM_PASS_0 = 0x00000100, // average magnitude calculated in 0th pass 177 ID_PHOTOM_PASS_1 = 0x00000200, // average magnitude calculated in 1th pass 178 ID_PHOTOM_PASS_2 = 0x00000400, // average magnitude calculated in 2th pass 179 ID_PHOTOM_PASS_3 = 0x00000800, // average magnitude calculated in 3th pass 180 ID_PHOTOM_PASS_4 = 0x00001000, // average magnitude calculated in 4th pass 181 ID_SECF_OBJ_EXT = 0x01000000, // extended in this band 174 ID_SECF_STAR_FEW = 0x00000001, // used within relphot: skip star 175 ID_SECF_STAR_POOR = 0x00000002, // used within relphot: skip star 176 ID_SECF_USE_SYNTH = 0x00000004, // synthetic photometry used in average measurement 177 ID_SECF_USE_UBERCAL = 0x00000008, // synthetic photometry used in average measurement 178 ID_PHOTOM_PASS_0 = 0x00000100, // average magnitude calculated in 0th pass 179 ID_PHOTOM_PASS_1 = 0x00000200, // average magnitude calculated in 1th pass 180 ID_PHOTOM_PASS_2 = 0x00000400, // average magnitude calculated in 2th pass 181 ID_PHOTOM_PASS_3 = 0x00000800, // average magnitude calculated in 3th pass 182 ID_PHOTOM_PASS_4 = 0x00001000, // average magnitude calculated in 4th pass 183 ID_SECF_OBJ_EXT = 0x01000000, // extended in this band 182 184 } DVOSecfiltFlags; 183 185 … … 254 256 char *hostname; // name of remote machine 255 257 char *pathname; // name of directory for this machine's data 258 char *results; // name of file machine's result data 256 259 int hostID; // remove machine ID in SkyTable 257 260 int stdio[3]; // fd's for communication with the remote host -
branches/eam_branches/ipp-20111122/Ohana/src/libdvo/src/HostTable.c
r33544 r33564 9 9 hosts[i].hostname = NULL; 10 10 hosts[i].pathname = NULL; 11 hosts[i].results = NULL; 11 12 hosts[i].stdio[HOST_STDIN] = -1; 12 13 hosts[i].stdio[HOST_STDOUT] = -1; -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/dvo_host_utils.c
r33563 r33564 8 8 int HostTableLaunchJobs (HostTable *table, char *basecmd, char *options) { 9 9 10 char uniquer[12]; 11 int TIME = time(NULL); 12 int PID = getpid(); 13 snprintf (uniquer, 12, "%05d.%05d", PID, TIME % 100000); 14 10 15 int i; 11 16 for (i = 0; i < table->Nhosts; i++) { … … 16 21 table->hosts[i].pathname = tmppath; 17 22 18 char resultFile[MAX_PATH_LENGTH]; 19 snprintf (resultFile, MAX_PATH_LENGTH, "%s/dvo.results.fits", table->hosts[i].pathname); 23 // need to save the results filename with the uniquer 24 // XXX a bit of a waste (but only 1024 * 60 bytes or so 25 ALLOCATE (table->hosts[i].results, char, MAX_PATH_LENGTH); 26 snprintf (table->hosts[i].results, MAX_PATH_LENGTH, "%s/dvo.results.%s.fits", table->hosts[i].pathname, uniquer); 20 27 21 char *commandFile = abspath("dvo_client.command.txt", MAX_PATH_LENGTH); 28 char commandBase[MAX_PATH_LENGTH]; 29 snprintf (commandBase, MAX_PATH_LENGTH, "dvo.command.%s.txt", uniquer); 30 char *commandFile = abspath(commandBase, MAX_PATH_LENGTH); 31 22 32 FILE *f = fopen (commandFile, "w"); 23 33 fprintf (f, "%s\n", basecmd); … … 25 35 26 36 char command[1024]; 27 snprintf (command, 1024, "dvo_client %s -result %s %s -hostID %d -hostdir %s", commandFile, resultFile, options, table->hosts[i].hostID, table->hosts[i].pathname);37 snprintf (command, 1024, "dvo_client %s -result %s %s -hostID %d -hostdir %s", commandFile, table->hosts[i].results, options, table->hosts[i].hostID, table->hosts[i].pathname); 28 38 free (commandFile); 29 39 … … 134 144 if (table->hosts[i].status) continue; 135 145 136 char resultFile[MAX_PATH_LENGTH];137 snprintf (resultFile, MAX_PATH_LENGTH, "%s/dvo.results.fits", table->hosts[i].pathname);138 139 146 int Ninvec = 0; 140 Vector **invec = ReadVectorTableFITS (resultFile, "RESULT", &Ninvec); 147 Vector **invec = ReadVectorTableFITS (table->hosts[i].results, "RESULT", &Ninvec); 148 free (table->hosts[i].results); 149 table->hosts[i].results = NULL; 141 150 142 151 if (Nelements == 0) { -
branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/load_catalogs.c
r33547 r33564 127 127 table->hosts[i].pathname = tmppath; 128 128 129 char catalogFile[512];130 snprintf ( catalogFile, 512, "%s/relastro.catalog.subset.dat", table->hosts[i].pathname);129 ALLOCATE (table->hosts[i].results, char, 1024); 130 snprintf (table->hosts[i].results, 1024, "%s/relastro.catalog.subset.dat", table->hosts[i].pathname); 131 131 132 132 // options / arguments that can affect relastro_client -load: … … 211 211 for (i = 0; i < table->Nhosts; i++) { 212 212 213 // XXX save this name in table->hosts[]? it is created above as well... 214 char catalogFile[512]; 215 snprintf (catalogFile, 512, "%s/relastro.catalog.subset.dat", table->hosts[i].pathname); 216 217 BrightCatalog *bcatalog = BrightCatalogLoad (catalogFile); 213 BrightCatalog *bcatalog = BrightCatalogLoad (table->hosts[i].results); 218 214 assert (bcatalog); 219 215 -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/StarOps.c
r33549 r33564 200 200 int Ncode = 0; 201 201 int Next = 0; 202 int haveSynth = FALSE; 203 int haveUbercal = FALSE; 202 204 203 205 N = 0; … … 250 252 } 251 253 } 254 // ignore SYNTH photocdes until PASS == 4 (where we also accept saturated stars) 255 if ((catalog[i].measure[m].photcode >= 3001) && (catalog[i].measure[m].photcode <= 3005)) { 256 if (pass < 4) continue; 257 haveSynth = TRUE; 258 } 252 259 253 260 // dlist gives the error, which is used as the weight in WT_MEAN. … … 262 269 if (catalog[i].measureT[m].dbFlags & ID_MEAS_PHOTOM_UBERCAL) { 263 270 dlist[N] = MAX (0.1*catalog[i].measureT[m].dM, MIN_ERROR); 271 haveUbercal = TRUE; 264 272 } 265 273 … … 299 307 } 300 308 309 if (haveSynth) { 310 catalog[i].secfilt[Nsecfilt*j+Nsec].flags |= ID_SECF_USE_SYNTH; 311 } 312 if (haveUbercal) { 313 catalog[i].secfilt[Nsecfilt*j+Nsec].flags |= ID_SECF_USE_UBERCAL; 314 } 315 301 316 /* use sigma or error in dM for output? */ 302 317 catalog[i].secfilt[Nsecfilt*j+Nsec].M = stats.mean; -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/bcatalog.c
r33483 r33564 60 60 ID_PHOTOM_PASS_2 | 61 61 ID_PHOTOM_PASS_3 | 62 ID_PHOTOM_PASS_4; 62 ID_PHOTOM_PASS_4 | 63 ID_SECF_USE_SYNTH | 64 ID_SECF_USE_UBERCAL | 65 ID_SECF_OBJ_EXT; 63 66 for (Ns = 0; Ns < Nphotcodes; Ns++) { 64 67 -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/load_catalogs.c
r33548 r33564 127 127 table->hosts[i].pathname = tmppath; 128 128 129 char catalogFile[512];130 snprintf ( catalogFile, 512, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname);129 ALLOCATE (table->hosts[i].results, char, 1024); 130 snprintf (table->hosts[i].results, 1024, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname); 131 131 132 132 // options / arguments that can affect relphot_client -load: … … 144 144 char command[1024]; 145 145 snprintf (command, 1024, "relphot_client %s -load %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -D CAMERA %s -D MAG_LIM %f -D SIGMA_LIM %f", 146 PhotcodeList, catalogFile, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, CAMERA, MAG_LIM, SIGMA_LIM);146 PhotcodeList, table->hosts[i].results, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, CAMERA, MAG_LIM, SIGMA_LIM); 147 147 148 148 char tmpline[1024]; … … 202 202 for (i = 0; i < table->Nhosts; i++) { 203 203 204 char catalogFile[512];205 snprintf (catalogFile, 512, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname);206 207 204 BrightCatalog *bcatalog = NULL; 208 while ((bcatalog = BrightCatalogLoad ( catalogFile)) == NULL) {205 while ((bcatalog = BrightCatalogLoad (table->hosts[i].results)) == NULL) { 209 206 // failed to get the data from this host. This can happen for various reasons. Give the user a chance to try again... 210 207 fprintf (stderr, "failed to read data from %s, stopping operations until this can be fixed\n", table->hosts[i].hostname); … … 212 209 int pid = getpid(); 213 210 kill (pid, SIGSTOP); 214 fprintf (stderr, "retrying %s\n", catalogFile); 215 } 211 fprintf (stderr, "retrying %s\n", table->hosts[i].results); 212 } 213 free (table->hosts[i].results); 214 table->hosts[i].results = NULL; 216 215 217 216 BrightCatalogSplit (catalogs, bcatalog); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/relphot_objects.c
r33548 r33564 67 67 ID_PHOTOM_PASS_2 | 68 68 ID_PHOTOM_PASS_3 | 69 ID_PHOTOM_PASS_4; 70 69 ID_PHOTOM_PASS_4 | 70 ID_SECF_USE_SYNTH | 71 ID_SECF_USE_UBERCAL | 72 ID_SECF_OBJ_EXT; 73 71 74 for (j = 0; j < catalog.Naverage; j++) { 72 75 catalog.average[j].flags = 0; … … 128 131 table->hosts[i].pathname = tmppath; 129 132 130 char catalogFile[512];131 snprintf (catalogFile, 512, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname);132 133 133 // options / arguments that can affect relphot_client -update-objects: 134 134 // VERBOSE, VERBOSE2 -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/setMrelFinal.c
r33452 r33564 22 22 23 23 // flags used by the photometry analysis (excluding UBERCAL) 24 unsigned int PHOTOM_PASSES=24 unsigned int secfiltFlags = 25 25 ID_PHOTOM_PASS_0 | // average measured at pass 0 26 26 ID_PHOTOM_PASS_1 | // average measured at pass 1 27 27 ID_PHOTOM_PASS_2 | // average measured at pass 2 28 28 ID_PHOTOM_PASS_3 | // average measured at pass 3 29 ID_PHOTOM_PASS_4; // average measured at pass 4 29 ID_PHOTOM_PASS_4 | // average measured at pass 3 30 ID_SECF_USE_SYNTH | // average measured at pass 3 31 ID_SECF_USE_UBERCAL | // average measured at pass 3 32 ID_SECF_OBJ_EXT; // average measured at pass 3 30 33 31 34 int Ns; … … 45 48 catalog[0].secfilt[N].Ncode = 0; 46 49 catalog[0].secfilt[N].Nused = 0; 47 catalog[0].secfilt[N].flags &= ~ PHOTOM_PASSES;50 catalog[0].secfilt[N].flags &= ~secfiltFlags; 48 51 catalog[0].secfilt[N].ubercalDist = 1000; 49 52
Note:
See TracChangeset
for help on using the changeset viewer.
