Changeset 37402
- Timestamp:
- Sep 19, 2014, 3:58:14 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src
- Files:
-
- 10 edited
-
addstar/Makefile (modified) (3 diffs)
-
addstar/src/loadstarpar_client.c (modified) (1 diff)
-
addstar/src/loadstarpar_rawdata.c (modified) (1 diff)
-
addstar/src/loadstarpar_save_remote.c (modified) (2 diffs)
-
addstar/src/resort_catalog.c (modified) (2 diffs)
-
libautocode/def/starpar-ps1-v5.d (modified) (2 diffs)
-
libautocode/def/starpar.d (modified) (2 diffs)
-
libdvo/src/coordops.c (modified) (2 diffs)
-
libdvo/src/dvo_catalog.c (modified) (1 diff)
-
libdvo/src/dvo_convert_PS1_V5.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/addstar/Makefile
r37357 r37402 24 24 sedstar : $(BIN)/sedstar.$(ARCH) 25 25 load2mass : $(BIN)/load2mass.$(ARCH) 26 loadstarpar : $(BIN)/loadstarpar.$(ARCH) 26 27 loadwise : $(BIN)/loadwise.$(ARCH) 27 28 dumpskycells : $(BIN)/dumpskycells.$(ARCH) … … 31 32 mkcmf : $(BIN)/mkcmf.$(ARCH) 32 33 33 all: addstar addstar_client sedstar load2mass skycells mkcmf loadwise loadsupercos dumpskycells findskycell34 35 INSTALL = addstar addstar_client sedstar load2mass skycells mkcmf loadwise loadsupercos dumpskycells findskycell34 all: addstar addstar_client sedstar load2mass loadstarpar skycells mkcmf loadwise loadsupercos dumpskycells findskycell 35 36 INSTALL = addstar addstar_client sedstar load2mass loadstarpar skycells mkcmf loadwise loadsupercos dumpskycells findskycell 36 37 37 38 # I need to fix the client/server version of addstar now that I have dropped Stars … … 241 242 $(SRC)/psps_ids.$(ARCH).o 242 243 244 LOAD-STARPAR = \ 245 $(SRC)/loadstarpar.$(ARCH).o \ 246 $(SRC)/loadstarpar_rawdata.$(ARCH).o \ 247 $(SRC)/loadstarpar_catalog.$(ARCH).o \ 248 $(SRC)/loadstarpar_readstars.$(ARCH).o \ 249 $(SRC)/loadstarpar_make_subset.$(ARCH).o \ 250 $(SRC)/loadstarpar_save_remote.$(ARCH).o \ 251 $(SRC)/loadstarpar_io.$(ARCH).o \ 252 $(SRC)/loadstarpar_remote_hosts.$(ARCH).o \ 253 $(SRC)/find_matches_refstars.$(ARCH).o \ 254 $(SRC)/args_loadstarpar.$(ARCH).o \ 255 $(SRC)/replace_match.$(ARCH).o \ 256 $(SRC)/update_coords.$(ARCH).o \ 257 $(SRC)/SkyRegionUtils.$(ARCH).o \ 258 $(SRC)/StarOps.$(ARCH).o \ 259 $(SRC)/ConfigInit.$(ARCH).o \ 260 $(SRC)/Shutdown.$(ARCH).o \ 261 $(SRC)/SetSignals.$(ARCH).o \ 262 $(SRC)/psps_ids.$(ARCH).o 263 243 264 LOAD-WISE = \ 244 265 $(SRC)/loadwise.$(ARCH).o \ -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadstarpar_client.c
r37395 r37402 15 15 StarPar_Stars *stars = loadstarpar_load_stars (INPUT, &Nstars); 16 16 17 loadstarpar_catalog (stars, Nstars, region );17 loadstarpar_catalog (stars, Nstars, region, CPT_FILE); 18 18 19 19 free (stars); -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadstarpar_rawdata.c
r37395 r37402 39 39 // In parallel mode, write out the subset to a disk file. Block until a remote host 40 40 // is available. In serial mode, just match against the appropriate region and save 41 loadstarpar_save_remote (subset, Nsubset, hosts, region );41 loadstarpar_save_remote (subset, Nsubset, hosts, region, skylist[0].filename[0]); 42 42 } 43 43 -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadstarpar_save_remote.c
r37395 r37402 2 2 # include "loadstarpar.h" 3 3 4 int loadstarpar_save_remote (StarPar_Stars *stars, int Nstars, HostTable *hosts, SkyRegion *region ) {4 int loadstarpar_save_remote (StarPar_Stars *stars, int Nstars, HostTable *hosts, SkyRegion *region, char *fullname) { 5 5 6 6 char uniquer[12]; … … 10 10 11 11 // if this region is a parallel thing, save and launch remote 12 if (region->hostID) { 12 if (!region->hostID) { 13 loadstarpar_catalog (stars, Nstars, region, fullname); 14 } else { 13 15 int N = hosts->index[region->hostID]; 14 16 HostInfo *hostMach = hosts->hosts[N]; -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/resort_catalog.c
r37334 r37402 38 38 resort_catalog_measure (catalog); 39 39 resort_catalog_lensing (catalog); 40 resort_catalog_starpar (catalog); 40 41 } 41 42 … … 335 336 } 336 337 338 void resort_catalog_starpar (Catalog *catalog) { 339 340 off_t Naverage, Nstarpar; 341 Starpar *starpar; 342 Average *average; 343 off_t i, j, N, currentAve; 344 345 off_t *starparSeq = NULL; 346 off_t *averageSeq = NULL; 347 Starpar *starparTMP = NULL; 348 349 // struct timeval start, stop; 350 // gettimeofday (&start, NULL); 351 352 /* internal counters */ 353 Nstarpar = catalog[0].Nstarpar; 354 Naverage = catalog[0].Naverage; 355 356 if (!Nstarpar) return; 357 358 starpar = catalog[0].starpar; 359 average = catalog[0].average; 360 361 // we have a table of average objects and an unsorted table of measurements. each measurement 362 // has a reference to the average object sequence (as well as an ID) 363 // starpar[i].averef -> average[averef] 364 // starpar[i].objID = average[averef].objID 365 // starpar[i].catID = average[averef].catID 366 367 // we want a sorted starpar array with all averef entries in sequence 368 369 ALLOCATE (starparSeq, off_t, Nstarpar); 370 ALLOCATE (averageSeq, off_t, Nstarpar); 371 372 for (i = 0; i < Nstarpar; i++) { 373 starparSeq[i] = i; 374 averageSeq[i] = starpar[i].averef; 375 376 if (catalog[0].catformat >= DVO_FORMAT_PS1_V1) { 377 // earlier formats did not carry the objID or catID, so they are not available (we could assign on load, but we don't) 378 myAssert(average[averageSeq[i]].catID == starpar[starparSeq[i]].catID, "object / detection mismatch"); 379 # if (1) 380 myAssert(average[averageSeq[i]].objID == starpar[starparSeq[i]].objID, "object / detection mismatch"); 381 # else 382 // for reasons I do not understand, the mini dvodbs generated on stsci1X had a handful of detections with an inconsistency between averef and objID. 383 // this happened for 28 detections in the dbs on /data/stsci1?.0/eugene/dvo3pi.20130616, but not at all (as far as I know) in the rest of LAP DVO 384 if (average[averageSeq[i]].objID != starpar[starparSeq[i]].objID) { 385 fprintf (stderr, "R"); 386 starpar[starparSeq[i]].objID = average[averageSeq[i]].objID; // XXX I don't really like this... 387 } 388 # endif 389 } 390 } 391 392 // check that averageSeq is now in order 393 // for (i = 1; i < Nstarpar; i++) { 394 // if (averageSeq[i] < averageSeq[i-1]) { 395 // fprintf (stderr, "%d ", (int) i); 396 // } 397 // } 398 // fprintf (stderr, "\n"); 399 400 SortAveMatch(starparSeq, averageSeq, Nstarpar); 401 // MARKTIME("sort : %f sec\n", dtime); 402 403 // check that averageSeq is now in order 404 // for (i = 1; i < Nstarpar; i++) { 405 // if (averageSeq[i] < averageSeq[i-1]) { 406 // fprintf (stderr, "%d ", (int) i); 407 // } 408 // } 409 // fprintf (stderr, "\n"); 410 411 // copy the starpar entries in the sorted order 412 ALLOCATE (starparTMP, Starpar, Nstarpar); 413 for (i = 0; i < Nstarpar; i++) { 414 j = starparSeq[i]; 415 starparTMP[i] = starpar[j]; 416 } 417 // MARKTIME("assign starpar : %f sec\n", dtime); 418 419 // update the values of average.starparOffset and average.Nstarpar 420 FREE(starpar); 421 catalog[0].starpar = starparTMP; 422 423 N = 0; 424 currentAve = averageSeq[0]; 425 average[currentAve].starparOffset = 0; 426 for (i = 0; i < Nstarpar; i++) { 427 if (averageSeq[i] != currentAve) { 428 // we have hit the next entry in the list 429 average[currentAve].Nstarpar = N; 430 N = 0; 431 currentAve = averageSeq[i]; 432 average[currentAve].starparOffset = i; 433 } 434 N++; 435 } 436 // N++; 437 average[currentAve].Nstarpar = N; 438 // MARKTIME("update Nstarpar : %f sec\n", dtime); 439 440 int NstarparTotal = 0; 441 int starparOffsetOK = TRUE; 442 for (i = 0; i < Naverage; i++) { 443 NstarparTotal += catalog[0].average[i].Nstarpar; 444 if (VERBOSE && !(NstarparTotal <= catalog[0].Nstarpar)) { 445 fprintf (stderr, "too few starpar: %d %d %d\n", (int) i, NstarparTotal, (int) catalog[0].Nstarpar); 446 } 447 starparOffsetOK &= (catalog[0].average[i].starparOffset < catalog[0].Nstarpar); 448 if (VERBOSE && !(catalog[0].average[i].starparOffset < catalog[0].Nstarpar)) { 449 fprintf (stderr, "offset too large: %d %d %d\n", (int) i, catalog[0].average[i].Nstarpar, (int) catalog[0].Nstarpar); 450 } 451 starparOffsetOK &= (catalog[0].average[i].starparOffset + catalog[0].average[i].Nstarpar <= catalog[0].Nstarpar); 452 if (VERBOSE && !(catalog[0].average[i].starparOffset + catalog[0].average[i].Nstarpar <= catalog[0].Nstarpar)) { 453 fprintf (stderr, "orrset + Nstarpar too large: %d + %d > %d %d\n", (int) i, catalog[0].average[i].starparOffset, catalog[0].average[i].Nstarpar, (int) catalog[0].Nstarpar); 454 } 455 } 456 457 if (!starparOffsetOK) { 458 fprintf (stderr, "ERROR: catalog %s has an invalid starparOffset\n", catalog[0].filename); 459 } 460 461 if (NstarparTotal != catalog[0].Nstarpar) { 462 fprintf (stderr, "ERROR: catalog %s has an invalid Nstarpar\n", catalog[0].filename); 463 } 464 465 // MARKTIME(" match time %9.4f sec for %7lld starpars, %6lld average\n", dtime, (long long) Nstarpar, (long long) Naverage); 466 467 catalog[0].sorted = TRUE; 468 469 FREE (starparSeq); 470 FREE (averageSeq); 471 472 return; 473 } 474 337 475 // sort the measure or lensing Sequence based on the average Sequence entries 338 476 void SortAveMatch (off_t *MEAS, off_t *AVE, off_t N) { -
branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/starpar-ps1-v5.d
r37390 r37402 2 2 EXTNAME DVO_STELLAR_PARAMS_PS1_V5 3 3 TYPE BINTABLE 4 SIZE 484 SIZE 72 5 5 DESCRIPTION DVO Table of Stellar Properties 6 6 7 7 FIELD galLat, GAL_LAT, double, galactic latitude 8 8 FIELD galLon, GAL_LON, double, galactic longitude 9 FIELD MKtype, MK_TYPE, float, O0 = 0.0? 10 FIELD Par, PARALLAX, float, 1/pc 11 FIELD dPar, PARALLAX_ERR, float, 1/pc 9 FIELD Ebv, E_BV, float, extinction 10 FIELD dEbv, E_BV_ERR, float, extinction error 11 FIELD DistMag, DISTANCE_MOD, float, mag 12 FIELD dDistMag, DISTANCE_MOD_ERR, float, mag 13 FIELD M_r, M_R_ABS, float, r-band abs magnitude 14 FIELD dM_r, M_R_ABS_ERR, float, r-band abs magnitude error 15 FIELD FeH, F_E_H, float, metallicity 16 FIELD dFeH, F_E_H_ERR, float, metallicity error 12 17 FIELD uRA, U_RA, float, model guess for proper motion 13 18 FIELD uDEC, U_DEC, float, model guess for proper motion … … 15 20 FIELD objID, OBJ_ID, unsigned int, unique ID for object in table 16 21 FIELD catID, CAT_ID, unsigned int, unique ID for table in which object was first realized 17 18 # this is the list of stellar parameters loaded from Greg Green's tables: 22 FIELD dummy, DUMMY, unsigned int, dummy -
branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/starpar.d
r37395 r37402 2 2 EXTNAME DVO_STELLAR_PARAMS 3 3 TYPE BINTABLE 4 SIZE 484 SIZE 72 5 5 DESCRIPTION DVO Table of Stellar Properties 6 6 … … 20 20 FIELD objID, OBJ_ID, unsigned int, unique ID for object in table 21 21 FIELD catID, CAT_ID, unsigned int, unique ID for table in which object was first realized 22 FIELD dummy, DUMMY, unsigned int, dummy 22 23 23 24 # this is the list of stellar parameters loaded from Greg Green's tables: -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/coordops.c
r37395 r37402 656 656 if (status) { 657 657 char equinoxString[80]; 658 int haveEquinox = gfits_scan (header, "EQUINOX", "%s", 1, &equinoxString);658 int haveEquinox = gfits_scan (header, "EQUINOX", "%s", 1, equinoxString); 659 659 if (haveEquinox) { 660 660 // is the string a valid number (it is bad to interpret an error message as year 0.0) … … 664 664 } 665 665 if (!haveEquinox) { 666 haveEquinox = gfits_scan (header, "EPOCH", "%s", 1, &equinoxString);666 haveEquinox = gfits_scan (header, "EPOCH", "%s", 1, equinoxString); 667 667 if (haveEquinox) { 668 668 // is the string a valid number (it is bad to interpret an error message as year 0.0) -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/dvo_catalog.c
r37395 r37402 440 440 // init all data, or just catalog data 441 441 void dvo_starpar_init (StarPar *starpar) { 442 starpar->galLat = NAN; 443 starpar->galLon = NAN; 444 starpar->MKtype = NAN; 445 starpar->Par = NAN; 446 starpar->dPar = NAN; 447 starpar->uRA = NAN; 448 starpar->uDEC = NAN; 449 starpar->averef = -1; 450 starpar->objID = -1; 451 starpar->catID = -1; 442 starpar->galLat = NAN; 443 starpar->galLon = NAN; 444 starpar->Ebv = NAN; 445 starpar->dEbv = NAN; 446 starpar->DistMag = NAN; 447 starpar->dDistMag = NAN; 448 starpar->M_r = NAN; 449 starpar->dM_r = NAN; 450 starpar->FeH = NAN; 451 starpar->dFeH = NAN; 452 starpar->uRA = NAN; 453 starpar->uDEC = NAN; 454 starpar->averef = -1; 455 starpar->objID = -1; 456 starpar->catID = -1; 452 457 } 453 458 -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c
r37395 r37402 678 678 out[i].galLon = in[i].galLon; 679 679 680 out[i].MKtype = in[i].MKtype; 681 out[i].Par = in[i].Par ; 682 out[i].dPar = in[i].dPar ; 683 out[i].uRA = in[i].uRA ; 684 out[i].uDEC = in[i].uDEC ; 680 out[i].Ebv = in[i].Ebv ; 681 out[i].dEbv = in[i].dEbv ; 682 out[i].DistMag = in[i].DistMag ; 683 out[i].dDistMag = in[i].dDistMag; 684 out[i].M_r = in[i].M_r ; 685 out[i].dM_r = in[i].dM_r ; 686 out[i].FeH = in[i].FeH ; 687 out[i].dFeH = in[i].dFeH ; 688 out[i].uRA = in[i].uRA ; 689 out[i].uDEC = in[i].uDEC ; 685 690 686 691 out[i].averef = in[i].averef; … … 703 708 out[i].galLon = in[i].galLon; 704 709 705 out[i].MKtype = in[i].MKtype; 706 out[i].Par = in[i].Par ; 707 out[i].dPar = in[i].dPar ; 708 out[i].uRA = in[i].uRA ; 709 out[i].uDEC = in[i].uDEC ; 710 out[i].Ebv = in[i].Ebv ; 711 out[i].dEbv = in[i].dEbv ; 712 out[i].DistMag = in[i].DistMag ; 713 out[i].dDistMag = in[i].dDistMag; 714 out[i].M_r = in[i].M_r ; 715 out[i].dM_r = in[i].dM_r ; 716 out[i].FeH = in[i].FeH ; 717 out[i].dFeH = in[i].dFeH ; 718 out[i].uRA = in[i].uRA ; 719 out[i].uDEC = in[i].uDEC ; 710 720 711 721 out[i].averef = in[i].averef;
Note:
See TracChangeset
for help on using the changeset viewer.
