Changeset 38441 for trunk/Ohana/src/relphot
- Timestamp:
- Jun 12, 2015, 6:18:23 PM (11 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 15 edited
-
. (modified) (1 prop)
-
src/relphot/include/relphot.h (modified) (2 diffs)
-
src/relphot/src/ImageTable.c (modified) (3 diffs)
-
src/relphot/src/StarOps.c (modified) (3 diffs)
-
src/relphot/src/args.c (modified) (2 diffs)
-
src/relphot/src/assign_images.c (modified) (1 diff)
-
src/relphot/src/bcatalog.c (modified) (3 diffs)
-
src/relphot/src/launch_region_hosts.c (modified) (2 diffs)
-
src/relphot/src/load_catalogs.c (modified) (4 diffs)
-
src/relphot/src/load_images.c (modified) (1 diff)
-
src/relphot/src/reload_catalogs.c (modified) (5 diffs)
-
src/relphot/src/relphot_images.c (modified) (2 diffs)
-
src/relphot/src/relphot_objects.c (modified) (3 diffs)
-
src/relphot/src/relphot_parallel_regions.c (modified) (1 diff)
-
src/relphot/src/relphot_synthphot.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
Property svn:mergeinfo
set to
/branches/eam_branches/ohana.20150429 merged eligible
-
Property svn:mergeinfo
set to
-
trunk/Ohana/src/relphot/include/relphot.h
r38062 r38441 213 213 char *BOUNDARY_TREE; 214 214 215 int SET_MREL_VERSION;215 // XXX deprecate int SET_MREL_VERSION; 216 216 int IS_DIFF_DB; 217 217 … … 494 494 495 495 int launch_region_hosts (RegionHostTable *regionHosts); 496 int strextend (char *input, char *format,...);497 496 498 497 Image *ImageTableLoad(char *filename, off_t *nimage); -
trunk/Ohana/src/relphot/src/ImageTable.c
r37807 r38441 7 7 FITS_DB db; 8 8 9 gfits_db_init (&db); 9 10 db.mode = dvo_catalog_catmode (CATMODE); 10 11 db.format = dvo_catalog_catformat (CATFORMAT); … … 27 28 // convert database table to internal structure (binary to Image) 28 29 // 'image' points to the same memory as db->ftable->buffer 29 Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.s wapped);30 Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder); 30 31 if (!image) { 31 32 Shutdown ("ERROR: failed to read images"); … … 45 46 46 47 // setup image table format and lock 48 gfits_db_init (&db); 47 49 db.mode = dvo_catalog_catmode (CATMODE); 48 50 db.format = dvo_catalog_catformat (CATFORMAT); 51 49 52 status = dvo_image_lock (&db, filename, 60.0, LCK_XCLD); // shorter timeout? 50 53 if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename); -
trunk/Ohana/src/relphot/src/StarOps.c
r37116 r38441 128 128 129 129 for (i = 0; i < Ncatalog; i++) { 130 // pass == -1 for anything other than the final pass 131 switch (SET_MREL_VERSION) { 132 case 0: 133 setMrel_catalog (catalog, i, -1, flatcorr, &results, Nsecfilt); 134 break; 135 case 1: 136 setMrel_catalog_alt (catalog, i, -1, flatcorr, &results, Nsecfilt); 137 break; 138 default: 139 fprintf (stderr, "invalid setMrel version %d (use 0 or 1)\n", SET_MREL_VERSION); 140 exit (2); 141 } 130 setMrel_catalog_alt (catalog, i, -1, flatcorr, &results, Nsecfilt); 142 131 SetMrelInfoAccum (&summary, &results); 143 132 } … … 175 164 176 165 for (i = 0; i < Ncatalog; i++) { 177 switch (SET_MREL_VERSION) { 178 // case 0: 179 // setMrel_catalog (catalog, i, pass, flatcorr, &results, Nsecfilt); 180 // break; 181 case 1: 182 setMrel_catalog_alt (catalog, i, pass, flatcorr, &results, Nsecfilt); 183 break; 184 default: 185 fprintf (stderr, "invalid setMrel version %d (use 1)\n", SET_MREL_VERSION); 186 exit (2); 187 } 166 setMrel_catalog_alt (catalog, i, pass, flatcorr, &results, Nsecfilt); 188 167 SetMrelInfoAccum (&summary, &results); 189 168 } … … 293 272 294 273 // pass == -1 for anything other than the final pass 295 switch (SET_MREL_VERSION) { 296 case 0: 297 setMrel_catalog (catalog, i, -1, flatcorr, &results, Nsecfilt); 298 break; 299 case 1: 300 setMrel_catalog_alt (catalog, i, -1, flatcorr, &results, Nsecfilt); 301 break; 302 default: 303 fprintf (stderr, "invalid setMrel version %d (use 0 or 1)\n", SET_MREL_VERSION); 304 exit (2); 305 } 274 setMrel_catalog_alt (catalog, i, -1, flatcorr, &results, Nsecfilt); 306 275 SetMrelInfoAccum (&threadinfo->summary, &results); 307 276 } -
trunk/Ohana/src/relphot/src/args.c
r38062 r38441 76 76 } 77 77 78 SET_MREL_VERSION = 1;79 if ((N = get_argument (argc, argv, "-set-mrel-version"))) {80 remove_argument (N, &argc, argv);81 SET_MREL_VERSION = atof(argv[N]);82 remove_argument (N, &argc, argv);83 }84 85 78 VERBOSE = VERBOSE2 = FALSE; 86 79 if ((N = get_argument (argc, argv, "-v"))) { … … 529 522 } 530 523 531 SET_MREL_VERSION = 1;532 if ((N = get_argument (argc, argv, "-set-mrel-version"))) {533 remove_argument (N, &argc, argv);534 SET_MREL_VERSION = atof(argv[N]);535 remove_argument (N, &argc, argv);536 }537 538 524 VERBOSE = VERBOSE2 = FALSE; 539 525 if ((N = get_argument (argc, argv, "-v"))) { -
trunk/Ohana/src/relphot/src/assign_images.c
r37807 r38441 11 11 // convert database table to internal structure (binary to Image) 12 12 // 'image' points to the same memory as db->ftable->buffer 13 Image *image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].s wapped);13 Image *image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder); 14 14 if (!image) { 15 15 fprintf (stderr, "ERROR: failed to read images\n"); -
trunk/Ohana/src/relphot/src/bcatalog.c
r37116 r38441 245 245 subcatalog[0].Nmeasure = Nmeasure; 246 246 subcatalog[0].Nsecfilt = catalog[0].Nsecfilt; 247 subcatalog[0].Nsecf _mem = Naverage * catalog[0].Nsecfilt;247 subcatalog[0].Nsecfilt_mem = Naverage * catalog[0].Nsecfilt; 248 248 249 249 if (VERBOSE) { … … 368 368 subcatalog[0].Nmeasure = Nmeasure; 369 369 subcatalog[0].Nsecfilt = oldcatalog[0].Nsecfilt; 370 subcatalog[0].Nsecf _mem = Naverage * oldcatalog[0].Nsecfilt;370 subcatalog[0].Nsecfilt_mem = Naverage * oldcatalog[0].Nsecfilt; 371 371 372 372 return (TRUE); … … 461 461 subcatalog[0].Nmeasure = Nmeasure; 462 462 subcatalog[0].Nsecfilt = catalog[0].Nsecfilt; 463 subcatalog[0].Nsecf _mem = Naverage * catalog[0].Nsecfilt;463 subcatalog[0].Nsecfilt_mem = Naverage * catalog[0].Nsecfilt; 464 464 465 465 return (TRUE); -
trunk/Ohana/src/relphot/src/launch_region_hosts.c
r37037 r38441 1 1 # include "relphot.h" 2 2 # define DEBUG 0 3 4 int strextend (char *input, char *format,...) {5 6 char tmpextra[1024], tmpline[1024];7 va_list argp;8 9 va_start (argp, format);10 vsnprintf (tmpextra, 1024, format, argp);11 snprintf (tmpline, 1024, "%s %s", input, tmpextra);12 strcpy (input, tmpline);13 14 return TRUE;15 }16 3 17 4 int launch_region_hosts (RegionHostTable *regionHosts) { … … 54 41 ImageTableSave (filename, host->image, host->Nimage); 55 42 56 char command[1024];57 s nprintf (command, 1024, "relphot %s", PhotcodeList);58 strextend ( command, "-parallel-images %s", filename);59 strextend ( command, "-region-hosts %s", REGION_FILE);60 strextend ( command, "-region-hostID %d", host->hostID);61 strextend ( command, "-D CATDIR %s", CATDIR);62 strextend ( command, "-region %f %f %f %f", host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat);63 strextend ( command, "-statmode %s", STATMODE);64 strextend ( command, "-D CAMERA %s", CAMERA);65 strextend ( command, "-D STAR_TOOFEW %d", STAR_TOOFEW);66 strextend ( command, "-minerror %f", MIN_ERROR);67 strextend ( command, "-cloud-limit %f", CLOUD_TOLERANCE);43 char *command = NULL; 44 strextend (&command, "relphot %s", PhotcodeList); 45 strextend (&command, "-parallel-images %s", filename); 46 strextend (&command, "-region-hosts %s", REGION_FILE); 47 strextend (&command, "-region-hostID %d", host->hostID); 48 strextend (&command, "-D CATDIR %s", CATDIR); 49 strextend (&command, "-region %f %f %f %f", host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat); 50 strextend (&command, "-statmode %s", STATMODE); 51 strextend (&command, "-D CAMERA %s", CAMERA); 52 strextend (&command, "-D STAR_TOOFEW %d", STAR_TOOFEW); 53 strextend (&command, "-minerror %f", MIN_ERROR); 54 strextend (&command, "-cloud-limit %f", CLOUD_TOLERANCE); 68 55 69 if (VERBOSE) strextend ( command, "-v");70 if (VERBOSE2) strextend ( command, "-vv");71 if (RESET) strextend ( command, "-reset");72 if (RESET_ZEROPTS) strextend ( command, "-reset-zpts");73 if (!KEEP_UBERCAL) strextend ( command, "-reset-ubercal");74 if (DophotSelect) strextend ( command, "-dophot %d", DophotValue);75 if (ImagSelect) strextend ( command, "-instmag %f %f", ImagMin, ImagMax);76 if (MaxDensityUse) strextend ( command, "-max-density %f", MaxDensityValue);77 if (SyntheticPhotometry) strextend ( command, "-synthphot");56 if (VERBOSE) strextend (&command, "-v"); 57 if (VERBOSE2) strextend (&command, "-vv"); 58 if (RESET) strextend (&command, "-reset"); 59 if (RESET_ZEROPTS) strextend (&command, "-reset-zpts"); 60 if (!KEEP_UBERCAL) strextend (&command, "-reset-ubercal"); 61 if (DophotSelect) strextend (&command, "-dophot %d", DophotValue); 62 if (ImagSelect) strextend (&command, "-instmag %f %f", ImagMin, ImagMax); 63 if (MaxDensityUse) strextend (&command, "-max-density %f", MaxDensityValue); 64 if (SyntheticPhotometry) strextend (&command, "-synthphot"); 78 65 79 if (UPDATE) strextend ( command, "-update");80 if (MOSAIC_ZEROPT) strextend ( command, "-mosaic");81 if (FREEZE_IMAGES) strextend ( command, "-imfreeze");82 if (FREEZE_MOSAICS) strextend ( command, "-mosfreeze");83 if (PARALLEL) strextend ( command, "-parallel");84 if (PARALLEL_MANUAL) strextend ( command, "-parallel-manual");85 if (PARALLEL_SERIAL) strextend ( command, "-parallel-serial");66 if (UPDATE) strextend (&command, "-update"); 67 if (MOSAIC_ZEROPT) strextend (&command, "-mosaic"); 68 if (FREEZE_IMAGES) strextend (&command, "-imfreeze"); 69 if (FREEZE_MOSAICS) strextend (&command, "-mosfreeze"); 70 if (PARALLEL) strextend (&command, "-parallel"); 71 if (PARALLEL_MANUAL) strextend (&command, "-parallel-manual"); 72 if (PARALLEL_SERIAL) strextend (&command, "-parallel-serial"); 86 73 87 74 // XXX deprecate this if we are happy with the new version 88 if (SET_MREL_VERSION != 1) strextend (command, "-set-mrel-version %d", SET_MREL_VERSION);75 // if (SET_MREL_VERSION != 1) strextend (command, "-set-mrel-version %d", SET_MREL_VERSION); 89 76 90 77 fprintf (stderr, "command: %s\n", command); -
trunk/Ohana/src/relphot/src/load_catalogs.c
r37037 r38441 34 34 // XXX keep in mind that not all catalogs are loaded 35 35 dvo_catalog_init (&catalog[i], TRUE); 36 dvo_catalog_init (&tcatalog, TRUE); 36 37 37 38 // does this host ID match the desired location for the table? … … 41 42 char hostfile[1024]; 42 43 snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name); 43 tcatalog.filename = hostID ? hostfile : skylist[0].filename[i]; 44 45 tcatalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data 46 tcatalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 47 tcatalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; // don't need to load all data at this point 48 tcatalog.Nsecfilt = GetPhotcodeNsecfilt (); // set the desired number in case we need to create the catalog 44 tcatalog.filename = hostID ? hostfile : skylist[0].filename[i]; 45 tcatalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT; // don't need to load all data at this point 46 tcatalog.Nsecfilt = GetPhotcodeNsecfilt (); // set the desired number in case we need to create the catalog 47 48 // tcatalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data 49 // tcatalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 50 // tcatalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data 49 51 50 52 if (!dvo_catalog_open (&tcatalog, skylist[0].regions[i], VERBOSE2, "r")) { … … 52 54 exit (1); 53 55 } 54 if (!tcatalog.Nave s_disk) {56 if (!tcatalog.Naverage_disk) { 55 57 if (VERBOSE2) { fprintf (stderr, "no data in %s, skipping\n", tcatalog.filename); } 56 58 dvo_catalog_unlock (&tcatalog); … … 153 155 // MaxDensityUse, MaxDensityValue 154 156 155 char command[1024];156 s nprintf (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",157 char *command = NULL; 158 strextend (&command, "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", 157 159 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); 158 160 159 char tmpline[1024]; 160 if (VERBOSE) { snprintf (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); } 161 if (VERBOSE2) { snprintf (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); } 162 if (RESET) { snprintf (tmpline, 1024, "%s -reset", command); strcpy (command, tmpline); } 163 if (RESET_ZEROPTS) { snprintf (tmpline, 1024, "%s -reset-zpts", command); strcpy (command, tmpline); } 164 if (!KEEP_UBERCAL) { snprintf (tmpline, 1024, "%s -reset-ubercal", command); strcpy (command, tmpline); } 165 if (DophotSelect) { snprintf (tmpline, 1024, "%s -dophot %d", command, DophotValue); strcpy (command, tmpline); } 166 if (ImagSelect) { snprintf (tmpline, 1024, "%s -instmag %f %f", command, ImagMin, ImagMax); strcpy (command, tmpline); } 167 if (MaxDensityUse) { snprintf (tmpline, 1024, "%s -max-density %f", command, MaxDensityValue); strcpy (command, tmpline); } 168 if (SyntheticPhotometry) { snprintf (tmpline, 1024, "%s -synthphot", command); strcpy (command, tmpline); } 161 if (VERBOSE) { strextend (&command, "-v"); } 162 if (VERBOSE2) { strextend (&command, "-vv"); } 163 if (RESET) { strextend (&command, "-reset"); } 164 if (RESET_ZEROPTS) { strextend (&command, "-reset-zpts"); } 165 if (!KEEP_UBERCAL) { strextend (&command, "-reset-ubercal"); } 166 if (DophotSelect) { strextend (&command, "-dophot %d", DophotValue); } 167 if (ImagSelect) { strextend (&command, "-instmag %f %f", ImagMin, ImagMax); } 168 if (MaxDensityUse) { strextend (&command, "-max-density %f", MaxDensityValue); } 169 if (SyntheticPhotometry) { strextend (&command, "-synthphot"); } 169 170 170 171 if (TimeSelect) { 171 172 char *tstart = ohana_sec_to_date (TSTART); 172 173 char *tstop = ohana_sec_to_date (TSTOP); 173 s nprintf (tmpline, 1024, "%s -time %s %s", command, tstart, tstop);174 strextend (&command, "-time %s %s", tstart, tstop); 174 175 free (tstart); 175 176 free (tstop); 176 strcpy (command, tmpline);177 177 } 178 178 -
trunk/Ohana/src/relphot/src/load_images.c
r37807 r38441 21 21 // convert database table to internal structure (binary to Image) 22 22 // 'image' points to the same memory as db->ftable->buffer 23 image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].s wapped);23 image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder); 24 24 if (!image) { 25 25 fprintf (stderr, "ERROR: failed to read images\n"); -
trunk/Ohana/src/relphot/src/reload_catalogs.c
r37907 r38441 56 56 TIMESTAMP(time1); 57 57 58 catalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data 59 catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 60 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 61 catalog.Nsecfilt = GetPhotcodeNsecfilt (); // set the desired number in case we need to create the catalog 58 // catalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data 59 // catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 60 // catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data 61 catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT; 62 catalog.Nsecfilt = GetPhotcodeNsecfilt (); // set the desired number in case we need to create the catalog 62 63 63 64 if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) { … … 65 66 exit (1); 66 67 } 67 if (VERBOSE && (catalog.Nave s_disk == 0)) {68 if (VERBOSE && (catalog.Naverage_disk == 0)) { 68 69 fprintf (stderr, "no data in %s, skipping\n", catalog.filename); 69 70 dvo_catalog_unlock (&catalog); … … 170 171 171 172 int Ngroups; 172 HostTableGroup *groups = HostTableGroups (table, &Ngroups);173 HostTableGroup *groups = HostTableGroupsUniqueMachines (table, &Ngroups); 173 174 // split the table into Ngroups, each with a unique set of machines (this avoids overloading the remote host machines) 174 175 … … 206 207 group->hosts[i][0].pathname = tmppath; 207 208 208 char command[1024]; 209 snprintf (command, 1024, "relphot_client %s -update-catalogs %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -D CAMERA %s -D STAR_TOOFEW %d -minerror %f", 210 PhotcodeList, imageFile, group->hosts[i][0].hostID, CATDIR, group->hosts[i][0].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, CAMERA, STAR_TOOFEW, MIN_ERROR); 209 char *command = NULL; 210 strextend (&command, "relphot_client %s -update-catalogs %s", PhotcodeList, imageFile); 211 strextend (&command, "-hostID %d -D CATDIR %s -hostdir %s", group->hosts[i][0].hostID, CATDIR, group->hosts[i][0].pathname); 212 strextend (&command, "-region %f %f %f %f", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 213 strextend (&command, "-statmode %s", STATMODE); 214 strextend (&command, "-D CAMERA %s", CAMERA); 215 strextend (&command, "-D STAR_TOOFEW %d -minerror %f", STAR_TOOFEW, MIN_ERROR); 211 216 212 217 // options & configs which affect relphot_client -update-catalogs … … 220 225 // MIN_ERROR 221 226 222 char tmpline[1024]; 223 if (VERBOSE) { snprintf (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); } 224 if (VERBOSE2) { snprintf (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); } 225 if (RESET) { snprintf (tmpline, 1024, "%s -reset", command); strcpy (command, tmpline); } 226 if (RESET_ZEROPTS) { snprintf (tmpline, 1024, "%s -reset-zpts", command); strcpy (command, tmpline); } 227 if (UPDATE) { snprintf (tmpline, 1024, "%s -update", command); strcpy (command, tmpline); } 228 if (IS_DIFF_DB) { snprintf (tmpline, 1024, "%s -is-diff-db", command); strcpy (command, tmpline); } 229 if (!KEEP_UBERCAL) { snprintf (tmpline, 1024, "%s -reset-ubercal", command); strcpy (command, tmpline); } 230 if (UPDATE_CATFORMAT) { snprintf (tmpline, 1024, "%s -update-catformat %s", command, UPDATE_CATFORMAT); strcpy (command, tmpline); } 231 if (BOUNDARY_TREE) { snprintf (tmpline, 1024, "%s -boundary-tree %s", command, BOUNDARY_TREE); strcpy (command, tmpline); } 232 if (SET_MREL_VERSION != 1) { snprintf (tmpline, 1024, "%s -set-mrel-version %d", command, SET_MREL_VERSION); strcpy (command, tmpline); } 233 if (AreaSelect) { snprintf (tmpline, 1024, "%s -area %f %f %f %f", command, AreaXmin, AreaXmax, AreaYmin, AreaYmax); strcpy (command, tmpline); } 227 if (VERBOSE) { strextend (&command, "-v"); } 228 if (VERBOSE2) { strextend (&command, "-vv"); } 229 if (RESET) { strextend (&command, "-reset"); } 230 if (RESET_ZEROPTS) { strextend (&command, "-reset-zpts"); } 231 if (UPDATE) { strextend (&command, "-update"); } 232 if (IS_DIFF_DB) { strextend (&command, "-is-diff-db"); } 233 if (!KEEP_UBERCAL) { strextend (&command, "-reset-ubercal"); } 234 if (UPDATE_CATFORMAT) { strextend (&command, "-update-catformat %s", UPDATE_CATFORMAT); } 235 if (BOUNDARY_TREE) { strextend (&command, "-boundary-tree %s", BOUNDARY_TREE); } 236 237 // deprecate 238 // if (SET_MREL_VERSION != 1) { snprintf (tmpline, 1024, "%s -set-mrel-version %d", SET_MREL_VERSION); } // XXXX deprecate this... 239 240 if (AreaSelect) { strextend (&command, "-area %f %f %f %f", AreaXmin, AreaXmax, AreaYmin, AreaYmax); } 234 241 if (TimeSelect) { 235 242 char *tstart = ohana_sec_to_date (TSTART); 236 243 char *tstop = ohana_sec_to_date (TSTOP); 237 s nprintf (tmpline, 1024, "%s -time %s %s", command, tstart, tstop);244 strextend (&command, "-time %s %s", tstart, tstop); 238 245 free (tstart); 239 246 free (tstop); 240 strcpy (command, tmpline);241 247 } 242 248 -
trunk/Ohana/src/relphot/src/relphot_images.c
r37037 r38441 18 18 /* register database handle with shutdown procedure */ 19 19 set_db (&db); 20 gfits_db_init (&db); 20 21 db.mode = dvo_catalog_catmode (CATMODE); 21 22 db.format = dvo_catalog_catformat (CATFORMAT); … … 185 186 // convert database table to internal structure (binary to Image) 186 187 // 'image' points to the same memory as db->ftable->buffer 187 image = gfits_table_get_Image (&db.ftable, &Nimage, &db.s wapped);188 image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder); 188 189 if (!image) { 189 190 fprintf (stderr, "ERROR: failed to read images\n"); -
trunk/Ohana/src/relphot/src/relphot_objects.c
r37807 r38441 39 39 char hostfile[1024]; 40 40 snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name); 41 catalog.filename = hostID ? hostfile : skylist[0].filename[i]; 42 catalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data 43 catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 44 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 45 catalog.Nsecfilt = GetPhotcodeNsecfilt (); 41 catalog.filename = hostID ? hostfile : skylist[0].filename[i]; 42 // catalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data 43 // catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 44 // catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data 45 catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT; 46 catalog.Nsecfilt = GetPhotcodeNsecfilt (); 46 47 47 48 if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) { … … 49 50 exit (1); 50 51 } 51 if (!catalog.Nave s_disk) {52 if (!catalog.Naverage_disk) { 52 53 if (VERBOSE) fprintf (stderr, "no data in %s, skipping\n", catalog.filename); 53 54 dvo_catalog_unlock (&catalog); … … 153 154 // MaxDensityUse, MaxDensityValue 154 155 155 char command[1024];156 s nprintf (command, 1024, "relphot_client -update-objects -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -D CAMERA %s -D STAR_TOOFEW %d -minerror %f",156 char *command = NULL; 157 strextend (&command, "relphot_client -update-objects -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -D CAMERA %s -D STAR_TOOFEW %d -minerror %f", 157 158 table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, CAMERA, STAR_TOOFEW, MIN_ERROR); 158 159 159 char tmpline[1024];160 if (VERBOSE ) { snprintf (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); }161 if ( VERBOSE2) { snprintf (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); }162 if (RESET ) { snprintf (tmpline, 1024, "%s -reset", command); strcpy (command, tmpline); }163 if ( RESET_ZEROPTS) { snprintf (tmpline, 1024, "%s -reset-zpts", command); strcpy (command, tmpline); }164 if ( UPDATE) { snprintf (tmpline, 1024, "%s -update", command); strcpy (command, tmpline); }165 if (!KEEP_UBERCAL) { snprintf (tmpline, 1024, "%s -reset-ubercal", command); strcpy (command, tmpline); } 166 if (SET_MREL_VERSION != 1) { snprintf (tmpline, 1024, "%s -set-mrel-version %d", command, SET_MREL_VERSION); strcpy (command, tmpline); }160 if (VERBOSE) { strextend (&command, "-v"); } 161 if (VERBOSE2) { strextend (&command, "-vv"); } 162 if (RESET) { strextend (&command, "-reset"); } 163 if (RESET_ZEROPTS) { strextend (&command, "-reset-zpts"); } 164 if (UPDATE) { strextend (&command, "-update"); } 165 if (!KEEP_UBERCAL) { strextend (&command, "-reset-ubercal"); } 166 167 // if (SET_MREL_VERSION != 1) { strextend (&command, "-set-mrel-version %d", SET_MREL_VERSION); } 167 168 168 169 fprintf (stderr, "command: %s\n", command); -
trunk/Ohana/src/relphot/src/relphot_parallel_regions.c
r37807 r38441 23 23 // register database handle with shutdown procedure 24 24 set_db (&db); 25 gfits_db_init (&db); 25 26 db.mode = dvo_catalog_catmode (CATMODE); 26 27 db.format = dvo_catalog_catformat (CATFORMAT); -
trunk/Ohana/src/relphot/src/relphot_synthphot.c
r38062 r38441 40 40 char hostfile[1024]; 41 41 snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name); 42 catalog.filename = hostID ? hostfile : skylist[0].filename[i]; 43 catalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data 44 catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 45 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 46 catalog.Nsecfilt = GetPhotcodeNsecfilt (); 42 catalog.filename = hostID ? hostfile : skylist[0].filename[i]; 43 // catalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data 44 // catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 45 // catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data 46 catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT; 47 catalog.Nsecfilt = GetPhotcodeNsecfilt (); 47 48 48 49 if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) { … … 50 51 exit (1); 51 52 } 52 if (!catalog.Nave s_disk) {53 if (!catalog.Naverage_disk) { 53 54 if (VERBOSE) fprintf (stderr, "no data in %s, skipping\n", catalog.filename); 54 55 dvo_catalog_unlock (&catalog); … … 109 110 // VERBOSE, VERBOSE2 110 111 111 char command[1024]; 112 snprintf (command, 1024, "relphot_client -synthphot_means %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f", 113 SYNTH_ZERO_POINTS, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 112 char *command = NULL; 113 strextend (&command, "relphot_client -synthphot_means %s", SYNTH_ZERO_POINTS); 114 strextend (&command, "-hostID %d -D CATDIR %s -hostdir %s", table->hosts[i].hostID, CATDIR, table->hosts[i].pathname); 115 strextend (&command, "-region %f %f %f %f", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 114 116 115 char tmpline[1024]; 116 if (VERBOSE) { snprintf (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); } 117 if (VERBOSE2) { snprintf (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); } 118 if (UPDATE) { snprintf (tmpline, 1024, "%s -update", command); strcpy (command, tmpline); } 117 if (VERBOSE) { strextend (&command, "-v"); } 118 if (VERBOSE2) { strextend (&command, "-vv"); } 119 if (UPDATE) { strextend (&command, "-update"); } 119 120 120 121 fprintf (stderr, "command: %s\n", command);
Note:
See TracChangeset
for help on using the changeset viewer.
