Changeset 42166 for branches/eam_branches/ipp-20220316/Ohana
- Timestamp:
- Apr 8, 2022, 5:04:42 PM (4 years ago)
- Location:
- branches/eam_branches/ipp-20220316
- Files:
-
- 36 edited
- 1 copied
-
. (modified) (1 prop)
-
Ohana (modified) (1 prop)
-
Ohana/src/addstar/include/WISE.h (modified) (3 diffs)
-
Ohana/src/addstar/include/ukirt_uhs.h (modified) (1 diff)
-
Ohana/src/addstar/src/args_loadwise.c (modified) (5 diffs)
-
Ohana/src/addstar/src/loadukirt_uhs_readstars_ugcs.c (modified) (8 diffs)
-
Ohana/src/addstar/src/loadukirt_uhs_readstars_ugps.c (modified) (7 diffs)
-
Ohana/src/addstar/src/loadukirt_uhs_readstars_uhs.c (modified) (2 diffs)
-
Ohana/src/addstar/src/loadukirt_uhs_readstars_ulas.c (modified) (7 diffs)
-
Ohana/src/addstar/src/loadwise.c (modified) (1 diff)
-
Ohana/src/addstar/src/loadwise_ops.c (modified) (2 diffs)
-
Ohana/src/addstar/src/loadwise_rawdata.c (modified) (7 diffs)
-
Ohana/src/addstar/src/loadwise_star_full.c (modified) (3 diffs)
-
Ohana/src/dvomerge/include/dvomerge.h (modified) (1 diff)
-
Ohana/src/dvomerge/src/args.c (modified) (2 diffs)
-
Ohana/src/dvomerge/src/dvo_image_merge_dbs.c (modified) (1 diff)
-
Ohana/src/dvomerge/src/dvomergeUpdate.c (modified) (1 diff)
-
Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c (modified) (1 diff)
-
Ohana/src/dvomerge/src/dvomergeUpdate_threaded.c (modified) (2 diffs)
-
Ohana/src/libohana/src/errors.c (modified) (1 diff)
-
Ohana/src/opihi (modified) (1 prop)
-
Ohana/src/opihi/cmd.data/Makefile (modified) (1 diff)
-
Ohana/src/opihi/cmd.data/create.c (modified) (4 diffs)
-
Ohana/src/opihi/cmd.data/init.c (modified) (2 diffs)
-
Ohana/src/opihi/cmd.data/mlayer.c (copied) (copied from trunk/Ohana/src/opihi/cmd.data/mlayer.c )
-
Ohana/src/opihi/cmd.data/mslice.c (modified) (1 diff)
-
Ohana/src/opihi/cmd.data/write_vectors.c (modified) (2 diffs)
-
Ohana/src/opihi/lib.shell/VectorIO.c (modified) (1 diff)
-
Ohana/src/relphot (modified) (1 prop)
-
Ohana/src/relphot/include/relphot.h (modified) (1 diff)
-
Ohana/src/relphot/src/ResetOps.c (modified) (1 diff)
-
Ohana/src/relphot/src/args.c (modified) (6 diffs)
-
Ohana/src/relphot/src/help.c (modified) (3 diffs)
-
Ohana/src/relphot/src/initialize.c (modified) (1 diff)
-
Ohana/src/relphot/src/relphot_images.c (modified) (1 diff)
-
Ohana/src/relphot/src/setMrelCatalog.c (modified) (2 diffs)
-
Ohana/src/relphot/src/setMrelFinal.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20220316
- Property svn:mergeinfo changed
/trunk (added) merged: 42122,42124-42136,42142,42146,42149-42152,42154-42155
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20220316/Ohana
- Property svn:mergeinfo changed
/trunk/Ohana (added) merged: 42124,42126-42128,42131-42136,42146,42149-42151
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20220316/Ohana/src/addstar/include/WISE.h
r38986 r42166 21 21 short WISE_W1, WISE_W2, WISE_W3, WISE_W4; 22 22 23 enum {MODE_NONE, MODE_ ALLWISE, MODE_ALLSKY, MODE_PRELIM};23 enum {MODE_NONE, MODE_CATWISE, MODE_ALLWISE, MODE_ALLSKY, MODE_PRELIM}; 24 24 int MODE; 25 25 26 AddstarClientOptions args_loadwise (int argc, char **argv, AddstarClientOptions options);26 AddstarClientOptions args_loadwise (int *argc, char **argv, AddstarClientOptions options); 27 27 28 28 int loadwise_rawdata (SkyList *skytable, char *filename, AddstarClientOptions options); … … 38 38 int loadwise_star_allsky (Measure *measure, char *line, int Nmax); 39 39 int loadwise_star_allwise (Measure *measure, char *line, int Nmax); 40 40 int loadwise_star_catwise (Measure *measure, char *line, int Nmax, double Rs, double Ds); 41 41 42 42 char *nextWISEfield (char *line); … … 49 49 int setWISE_dup_flag (Measure *measure, char qual); 50 50 int setWISE_use_flag (Measure *measure, char qual); 51 int setWISE_sat_flag (Measure *measure, char *ptr); 52 53 int setCatWISE_sat_flag (Measure *measure, char *ptr, int start, int end); 54 int setCatWISE_blend_flag (Measure *measure, char *line); 51 55 52 56 char *skipNbounds (char *line, char bound, int Nbound, int Nbyte); 57 58 char *getLineSegment (char *line, int start, int end); 59 double getDoubleRAW (char *line, int start, int end); 60 double getDoubleNAN (char *line, int start, int end); -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/include/ukirt_uhs.h
r42077 r42166 3 3 4 4 # define NSTARS_MAX 10000000 5 //# define NSTARS_MAX 5000 5 6 // # define NSTARS_MAX 10 6 7 -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/args_loadwise.c
r38062 r42166 3 3 static void help (void); 4 4 5 AddstarClientOptions args_loadwise (int argc, char **argv, AddstarClientOptions options) {5 AddstarClientOptions args_loadwise (int *argc, char **argv, AddstarClientOptions options) { 6 6 7 7 int N; 8 8 9 9 /* check for help request */ 10 if (get_argument ( argc, argv, "-help") ||11 get_argument ( argc, argv, "-h")) {10 if (get_argument (*argc, argv, "-help") || 11 get_argument (*argc, argv, "-h")) { 12 12 help (); 13 13 } … … 29 29 /* only add to existing regions */ 30 30 options.existing_regions = FALSE; 31 if ((N = get_argument ( argc, argv, "-existing-regions"))) {31 if ((N = get_argument (*argc, argv, "-existing-regions"))) { 32 32 options.existing_regions = TRUE; 33 remove_argument (N, &argc, argv);33 remove_argument (N, argc, argv); 34 34 } 35 35 /* only add to existing objects */ 36 36 options.only_match = FALSE; 37 if ((N = get_argument ( argc, argv, "-only-match"))) {37 if ((N = get_argument (*argc, argv, "-only-match"))) { 38 38 options.only_match = TRUE; 39 remove_argument (N, &argc, argv);39 remove_argument (N, argc, argv); 40 40 } 41 41 /* replace measurement, don't duplicate (ref/cat only) */ 42 42 options.replace = FALSE; 43 if ((N = get_argument ( argc, argv, "-replace"))) {43 if ((N = get_argument (*argc, argv, "-replace"))) { 44 44 options.replace = TRUE; 45 remove_argument (N, &argc, argv);45 remove_argument (N, argc, argv); 46 46 } 47 47 48 48 /* extra error messages */ 49 49 VERBOSE = FALSE; 50 if ((N = get_argument ( argc, argv, "-v"))) {50 if ((N = get_argument (*argc, argv, "-v"))) { 51 51 VERBOSE = TRUE; 52 remove_argument (N, &argc, argv);52 remove_argument (N, argc, argv); 53 53 } 54 54 55 55 /* load the prelim data dump */ 56 MODE = MODE_ ALLWISE;57 if ((N = get_argument ( argc, argv, "-mode"))) {58 MODE = MODE_NONE;59 remove_argument (N, &argc, argv);56 MODE = MODE_NONE; 57 if ((N = get_argument (*argc, argv, "-mode"))) { 58 remove_argument (N, argc, argv); 59 if (!strcasecmp(argv[N], "catwise")) MODE = MODE_CATWISE; 60 60 if (!strcasecmp(argv[N], "allwise")) MODE = MODE_ALLWISE; 61 61 if (!strcasecmp(argv[N], "allsky")) MODE = MODE_ALLSKY; … … 65 65 exit (2); 66 66 } 67 remove_argument (N, &argc, argv);67 remove_argument (N, argc, argv); 68 68 } 69 69 … … 85 85 DUMP = NULL; 86 86 87 if ( argc < 2) {87 if (*argc < 2) { 88 88 fprintf (stderr, "USAGE: loadwise [options] (wisefile) [..more files]\n"); 89 89 exit (2); … … 94 94 static void help () { 95 95 96 fprintf (stderr, "USAGE: loadwise [ options] (wisefile) [..more files]\n");96 fprintf (stderr, "USAGE: loadwise [-mode MODE] [options] (wisefile) [..more files]\n"); 97 97 fprintf (stderr, " add data from WISE catalog to DVO\n\n"); 98 99 fprintf (stderr, " MODE may be : catwise, allwise, allsky, prelim\n"); 98 100 99 101 fprintf (stderr, " optional flags:\n"); -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadukirt_uhs_readstars_ugcs.c
r42077 r42166 467 467 NELEM += 1000; 468 468 469 REALLOCATE (sourceID, uint64_t, NELEM); 469 REALLOCATE (sourceID, uint64_t, NELEM); 470 470 REALLOCATE (frameSetID, uint64_t, NELEM); 471 471 REALLOCATE (ra, double, NELEM); 472 472 REALLOCATE (dec, double, NELEM); 473 REALLOCATE (epoch, double, NELEM); 473 474 REALLOCATE (priOrSec, uint64_t, NELEM); 474 475 REALLOCATE (mergedClass, int, NELEM); 475 476 REALLOCATE (pStar, double, NELEM); 476 477 REALLOCATE (pGalaxy, double, NELEM); 478 477 479 REALLOCATE (zHallMag, double, NELEM); 478 480 REALLOCATE (zHallMagErr, double, NELEM); … … 485 487 REALLOCATE (zppErrBits, int, NELEM); 486 488 REALLOCATE (zSeqNum, int, NELEM); 489 487 490 REALLOCATE (yHallMag, double, NELEM); 488 491 REALLOCATE (yHallMagErr, double, NELEM); … … 495 498 REALLOCATE (yppErrBits, int, NELEM); 496 499 REALLOCATE (ySeqNum, int, NELEM); 500 497 501 REALLOCATE (jHallMag, double, NELEM); 498 502 REALLOCATE (jHallMagErr, double, NELEM); … … 505 509 REALLOCATE (jppErrBits, int, NELEM); 506 510 REALLOCATE (jSeqNum, int, NELEM); 511 507 512 REALLOCATE (hHallMag, double, NELEM); 508 513 REALLOCATE (hHallMagErr, double, NELEM); … … 515 520 REALLOCATE (hppErrBits, int, NELEM); 516 521 REALLOCATE (hSeqNum, int, NELEM); 522 517 523 REALLOCATE (k1HallMag, double, NELEM); 518 524 REALLOCATE (k1HallMagErr, double, NELEM); … … 525 531 REALLOCATE (k1ppErrBits, int, NELEM); 526 532 REALLOCATE (k1SeqNum, int, NELEM); 533 527 534 REALLOCATE (k2HallMag, double, NELEM); 528 535 REALLOCATE (k2HallMagErr, double, NELEM); … … 541 548 } 542 549 } 550 fprintf (stderr, " DONE: Nelem: %d, *nstars: %d\n", Nelem, *nstars); 543 551 544 552 // Nelem is now the number of items (objects,stars) read from the Gaia CSV file … … 715 723 Nstars ++; 716 724 717 if (N STARS >= Nstars) {725 if (Nstars >= NSTARS) { 718 726 NSTARS += 10000; 719 727 REALLOCATE (stars, UKIRT_Stars, NSTARS); -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadukirt_uhs_readstars_ugps.c
r42077 r42166 388 388 NELEM += 1000; 389 389 390 REALLOCATE (sourceID, uint64_t, NELEM); 390 REALLOCATE (sourceID, uint64_t, NELEM); 391 391 REALLOCATE (frameSetID, uint64_t, NELEM); 392 392 REALLOCATE (ra, double, NELEM); 393 393 REALLOCATE (dec, double, NELEM); 394 REALLOCATE (epoch, double, NELEM); 394 395 REALLOCATE (priOrSec, uint64_t, NELEM); 395 396 REALLOCATE (mergedClass, int, NELEM); 396 397 REALLOCATE (pStar, double, NELEM); 397 398 REALLOCATE (pGalaxy, double, NELEM); 399 398 400 REALLOCATE (jAperMag1, double, NELEM); 399 401 REALLOCATE (jAperMag1Err, double, NELEM); … … 406 408 REALLOCATE (jppErrBits, int, NELEM); 407 409 REALLOCATE (jSeqNum, int, NELEM); 410 408 411 REALLOCATE (hAperMag1, double, NELEM); 409 412 REALLOCATE (hAperMag1Err, double, NELEM); … … 416 419 REALLOCATE (hppErrBits, int, NELEM); 417 420 REALLOCATE (hSeqNum, int, NELEM); 421 418 422 REALLOCATE (k1AperMag1, double, NELEM); 419 423 REALLOCATE (k1AperMag1Err, double, NELEM); … … 426 430 REALLOCATE (k1ppErrBits, int, NELEM); 427 431 REALLOCATE (k1SeqNum, int, NELEM); 432 428 433 REALLOCATE (k2AperMag1, double, NELEM); 429 434 REALLOCATE (k2AperMag1Err, double, NELEM); … … 436 441 REALLOCATE (k2ppErrBits, int, NELEM); 437 442 REALLOCATE (k2SeqNum, int, NELEM); 443 438 444 REALLOCATE (h2AperMag1, double, NELEM); 439 445 REALLOCATE (h2AperMag1Err, double, NELEM); … … 452 458 } 453 459 } 460 fprintf (stderr, " DONE: Nelem: %d, *nstars: %d\n", Nelem, *nstars); 454 461 455 462 // Nelem is now the number of items (objects,stars) read from the Gaia CSV file … … 606 613 Nstars ++; 607 614 608 if (N STARS >= Nstars) {615 if (Nstars >= NSTARS) { 609 616 NSTARS += 10000; 610 617 REALLOCATE (stars, UKIRT_Stars, NSTARS); -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadukirt_uhs_readstars_uhs.c
r42077 r42166 234 234 } 235 235 } 236 fprintf (stderr, " DONE: Nelem: %d, *nstars: %d\n", Nelem, *nstars); 236 237 237 238 // Nelem is now the number of items (objects,stars) read from the Gaia CSV file … … 307 308 Nstars ++; 308 309 309 if (N STARS >= Nstars) {310 if (Nstars >= NSTARS) { 310 311 NSTARS += 10000; 311 312 REALLOCATE (stars, UKIRT_Stars, NSTARS); -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadukirt_uhs_readstars_ulas.c
r42077 r42166 415 415 NELEM += 1000; 416 416 417 REALLOCATE (sourceID, uint64_t, NELEM); 417 REALLOCATE (sourceID, uint64_t, NELEM); 418 418 REALLOCATE (frameSetID, uint64_t, NELEM); 419 419 REALLOCATE (ra, double, NELEM); 420 420 REALLOCATE (dec, double, NELEM); 421 REALLOCATE (epoch, double, NELEM); 421 422 REALLOCATE (priOrSec, uint64_t, NELEM); 422 423 REALLOCATE (mergedClass, int, NELEM); 423 424 REALLOCATE (pStar, double, NELEM); 424 425 REALLOCATE (pGalaxy, double, NELEM); 426 425 427 REALLOCATE (yHallMag, double, NELEM); 426 428 REALLOCATE (yHallMagErr, double, NELEM); … … 433 435 REALLOCATE (yppErrBits, int, NELEM); 434 436 REALLOCATE (ySeqNum, int, NELEM); 437 435 438 REALLOCATE (j1HallMag, double, NELEM); 436 439 REALLOCATE (j1HallMagErr, double, NELEM); … … 443 446 REALLOCATE (j1ppErrBits, int, NELEM); 444 447 REALLOCATE (j1SeqNum, int, NELEM); 448 445 449 REALLOCATE (j2HallMag, double, NELEM); 446 450 REALLOCATE (j2HallMagErr, double, NELEM); … … 453 457 REALLOCATE (j2ppErrBits, int, NELEM); 454 458 REALLOCATE (j2SeqNum, int, NELEM); 459 455 460 REALLOCATE (hHallMag, double, NELEM); 456 461 REALLOCATE (hHallMagErr, double, NELEM); … … 463 468 REALLOCATE (hppErrBits, int, NELEM); 464 469 REALLOCATE (hSeqNum, int, NELEM); 470 465 471 REALLOCATE (kHallMag, double, NELEM); 466 472 REALLOCATE (kHallMagErr, double, NELEM); … … 479 485 } 480 486 } 487 fprintf (stderr, " DONE: Nelem: %d, *nstars: %d\n", Nelem, *nstars); 481 488 482 489 // Nelem is now the number of items (objects,stars) read from the Gaia CSV file … … 633 640 Nstars ++; 634 641 635 if (N STARS >= Nstars) {642 if (Nstars >= NSTARS) { 636 643 NSTARS += 10000; 637 644 REALLOCATE (stars, UKIRT_Stars, NSTARS); -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadwise.c
r38986 r42166 22 22 SetSignals (); 23 23 options = ConfigInit (&argc, argv); 24 options = args_loadwise ( argc, argv, options);24 options = args_loadwise (&argc, argv, options); 25 25 26 26 // load the full sky description table: -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadwise_ops.c
r33653 r42166 17 17 char *ptr = line; 18 18 19 ptr = skipNbounds (ptr, '|', 1, Nmax); 20 *R = strtod (ptr, NULL); 21 ptr = skipNbounds (ptr, '|', 1, Nmax); 22 *D = strtod (ptr, NULL); 19 if (MODE == MODE_CATWISE) { 20 // copy the string ranges and then use strtod (not necessary?) 21 *R = strtod (&ptr[47], NULL); // safe to use the strtod on the line because it is white-space separated 22 *D = strtod (&ptr[59], NULL); 23 } else { 24 ptr = skipNbounds (ptr, '|', 1, Nmax); 25 *R = strtod (ptr, NULL); 26 ptr = skipNbounds (ptr, '|', 1, Nmax); 27 *D = strtod (ptr, NULL); 28 } 23 29 if (*D > 90) Shutdown ("weird DEC value: something is wrong"); 24 30 … … 91 97 } 92 98 99 /* return a pointer to the first char after Nbound of value bound */ 100 char *getLineSegment (char *line, int start, int end) { 101 102 // do NOT damage the buffer by seting the end byte to NULL 103 if (0) { line[end] = 0; } 104 char *ptr = &line[start]; 105 return (ptr); 106 } 107 108 double getDoubleRAW (char *line, int start, int end) { 109 char *ptr = getLineSegment(line, start, end); 110 double value = strtod (ptr, NULL); 111 return value; 112 } 113 114 double getDoubleNAN (char *line, int start, int end) { 115 char *endpoint = NULL; 116 char *ptr = getLineSegment(line, start, end); 117 double value = strtod (ptr, &endpoint); 118 if (endpoint == ptr) { value = NAN; } 119 return value; 120 } 121 93 122 /* watch for patches which cross 0,360 boundary */ 94 123 SkyTable *loadWISE_acc (char *path, char *accel) { -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadwise_rawdata.c
r38986 r42166 28 28 getWISE_setup (); 29 29 30 int NMeasPerStar = (MODE == MODE_CATWISE) ? 2 : 4; 31 30 32 ALLOCATE (buffer, char, NBYTE); 31 33 … … 34 36 if (f == NULL) Shutdown ("can't read WISE data file: %s", filename); 35 37 // test if this is a raw datafile or gzipped... 38 39 int skipHeader = TRUE; 36 40 37 41 Nextra = 0; // number excess bytes from lsat partial row … … 59 63 Dmax = -90.0; 60 64 65 // XXX buffer is being reread instead of continuing. 66 61 67 // scan through entire buffer for star coords 62 68 while (1) { 69 70 if (skipHeader && (MODE == MODE_CATWISE)) { 71 if (*p == '\\') goto skip_header; 72 if (*p == '|') goto skip_header; 73 } 74 if (skipHeader && (MODE == MODE_CATWISE)) { 75 // once we get past the header, do not skip any more 76 skipHeader = FALSE; 77 } 78 63 79 getWISE_coords (p, &tstars[Ntstars].R, &tstars[Ntstars].D, Nbyte - offset); 64 80 tstars[Ntstars].offset = offset; // offset within scan … … 74 90 Ntstars ++; 75 91 CHECK_REALLOCATE (tstars, WISE_Stars, NTSTARS, Ntstars, 10000); 92 93 skip_header: 76 94 77 95 /* start of the next line */ … … 143 161 if (tstars[j].D > UserPatch.Dmax) continue; 144 162 163 // offset is bytes to start of line from start of buffer 145 164 offset = tstars[j].offset; 146 165 147 166 dvo_average_init (&newcat->average[Nave]); 148 for (k = 0; k < 4; k++) {167 for (k = 0; k < NMeasPerStar; k++) { 149 168 dvo_measure_init (&newcat->measure[Nmeas+k]); 150 169 } … … 163 182 loadwise_star_allwise (&newcat->measure[Nmeas], &buffer[offset], Nbyte - offset); 164 183 break; 184 case MODE_CATWISE: 185 loadwise_star_catwise (&newcat->measure[Nmeas], &buffer[offset], Nbyte - offset, tstars[j].R, tstars[j].D); 186 break; 165 187 default: 166 188 break; … … 169 191 tstars[j].flag = TRUE; 170 192 171 newcat->average[Nave].Nmeasure = 4;193 newcat->average[Nave].Nmeasure = NMeasPerStar; 172 194 newcat->average[Nave].measureOffset = Nmeas; 173 195 174 196 Nave ++; 175 Nmeas += 4;197 Nmeas += NMeasPerStar; 176 198 177 199 CHECK_REALLOCATE (newcat->average, Average, NAVE, Nave, 1000); -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadwise_star_full.c
r38986 r42166 2 2 # include "WISE.h" 3 3 4 int setWISE_ph_qual (Measure *measure, char qual);5 4 int setWISE_var_flag_allsky (Measure *measure, char qual); 6 5 int setWISE_ext_flag_allsky (Measure *measure, char ptr); 7 6 int setWISE_var_flag_prelim (Measure *measure, char qual); 8 7 int setWISE_ext_flag_prelim (Measure *measure, char ptr); 9 int setWISE_cc_flag (Measure *measure, char qual);10 int setWISE_sat_flag (Measure *measure, char *ptr);11 8 int setWISE_blend_flag (Measure *measure, char *ptr); 9 10 // fill in the data for a CatWISE double star. takes a pointer to the start of the line the 11 // RA and DEC have already been set 12 int loadwise_star_catwise (Measure *measure, char *line, int Nmax, double Rs, double Ds) { 13 14 if (line == NULL) Shutdown ("format error in WISE"); 15 16 /*** CATWISE has fixed width data, not pipe-separated, etc ***/ 17 18 // https://irsa.ipac.caltech.edu/data/WISE/CatWISE/gator_docs/catwise_colDescriptions.html 19 20 // We are supplied a pointer (line) to the start of a full line of data. The CatWISE 21 // format uses fixed-width fields with white-space separators. The ra & dec values have 22 // already been extracted. 23 24 measure[0].R = Rs; 25 measure[0].D = Ds; 26 measure[1].R = Rs; 27 measure[1].D = Ds; 28 29 // I can assign dRA and dDEC to dX and dY if I can consistently set posangle and pltscale 30 measure[0].dXccd = ToShortPixels(getDoubleRAW (line, 71, 79) + 0.005); // sig_ra -- add 5/1000 to avoid truncation 31 measure[0].dYccd = ToShortPixels(getDoubleRAW (line, 80, 88) + 0.005); // sig_dec 32 measure[0].posangle = 0.0; 33 measure[0].pltscale = 1.0; 34 35 // we only know a single set of values for both bands 36 measure[1].dXccd = measure[0].dXccd; 37 measure[1].dYccd = measure[0].dYccd; 38 measure[1].posangle = measure[0].posangle; 39 measure[1].pltscale = measure[0].pltscale; 40 41 measure[0].Xccd = getDoubleRAW (line, 98, 106); // wx 42 measure[0].Yccd = getDoubleRAW (line, 107, 115); // wy 43 measure[1].Xccd = measure[0].Xccd; 44 measure[1].Yccd = measure[0].Yccd; 45 46 // W1 47 measure[0].M = getDoubleNAN (line, 248, 254); // w1mpro 48 measure[0].dM = getDoubleNAN (line, 255, 264); // w1sigmpro 49 measure[0].psfChisq = getDoubleRAW (line, 265, 275); // w1rchi2 50 measure[0].psfQF = measure[0].psfChisq; 51 measure[0].photFlags = 0; 52 53 // W2 54 measure[1].M = getDoubleNAN (line, 276, 282); // w2mpro 55 measure[1].dM = getDoubleNAN (line, 283, 292); // w2sigmpro 56 measure[1].psfChisq = getDoubleRAW (line, 293, 303); // w2rchi2 57 measure[1].psfQF = measure[1].psfChisq; 58 measure[1].photFlags = 0; 59 60 setCatWISE_blend_flag (measure, line); // w1sat 61 62 setCatWISE_sat_flag (&measure[0], line, 323, 330); // w1sat 63 setCatWISE_sat_flag (&measure[1], line, 331, 338); // w2sat 64 65 // cc_flags? 1642 - 1657 66 // setWISE_cc_flag (&measure[0], ptr[i]); // cc_flags 67 68 // set ext flags for all 4 measures 69 // setCatWISE_ext_flag_allsky (measure, ptr[0]); // ext_flg 70 71 // setWISE_var_flag_allsky (&measure[0], ptr[i]); // var_flg 72 73 // setWISE_ph_qual (&measure[i], ptr[i]); // ph_qual 74 75 double mjdmean = getDoubleRAW (line, 1126, 1138); // MeanObsMJD 76 77 // the release is based on data taken in the period 14 January 2010 to 29 April 2010 78 if (mjdmean == 0.0) { 79 measure[0].t = 0; 80 } else { 81 measure[0].t = ohana_mjd_to_sec (mjdmean); 82 } 83 measure[1].t = measure[0].t; 84 85 measure[0].photcode = WISE_W1; 86 measure[0].detID = 0; 87 measure[0].imageID = 0; 88 89 measure[1].photcode = WISE_W2; 90 measure[1].detID = 0; 91 measure[1].imageID = 0; 92 93 return TRUE; 94 } 12 95 13 96 // fill in the data for a WISE quad star. takes a pointer to the start of the line the … … 458 541 } 459 542 543 int setCatWISE_blend_flag (Measure *measure, char *line) { 544 545 // na 546 int nb = atoi(getLineSegment(line, 315, 318)); // nb 547 int na = atoi(getLineSegment(line, 319, 322)); // na 548 549 if (nb != 1) { 550 if (na == 0) { 551 measure[0].photFlags |= FLAG_BLEND_ACTIVE; 552 measure[1].photFlags |= FLAG_BLEND_ACTIVE; 553 } else { 554 measure[0].photFlags |= FLAG_BLEND_PASSIVE; 555 measure[1].photFlags |= FLAG_BLEND_PASSIVE; 556 } 557 } 558 return TRUE; 559 } 560 460 561 int setWISE_sat_flag (Measure *measure, char *ptr) { 461 562 … … 465 566 } 466 567 return TRUE; 568 } 569 570 int setCatWISE_sat_flag (Measure *measure, char *ptr, int start, int end) { 571 572 float sat = getDoubleRAW (ptr, start, end); 573 if (sat > 0.0) { 574 measure[0].photFlags |= FLAG_SATURATED_PIX; 575 } 576 return TRUE; 467 577 } 468 578 -
branches/eam_branches/ipp-20220316/Ohana/src/dvomerge/include/dvomerge.h
r41341 r42166 65 65 int RESET_LENSING; 66 66 67 int SKIP_IMAGES; 67 68 int SKIP_MEASURE; 68 69 int SKIP_MISSING; -
branches/eam_branches/ipp-20220316/Ohana/src/dvomerge/src/args.c
r41341 r42166 39 39 remove_argument (N, argc, argv); 40 40 } 41 42 /* extra error messages */ 43 MATCHED_TABLES = FALSE; 41 SKIP_IMAGES = FALSE; 42 if ((N = get_argument (*argc, argv, "-skip-images"))) { 43 SKIP_IMAGES = TRUE; 44 remove_argument (N, argc, argv); 45 } 46 47 /* extra error messages */ 48 MATCHED_TABLES = TRUE; 44 49 if ((N = get_argument (*argc, argv, "-matched-tables"))) { 45 50 MATCHED_TABLES = TRUE; 51 remove_argument (N, argc, argv); 52 } 53 if ((N = get_argument (*argc, argv, "-unmatched-tables"))) { 54 MATCHED_TABLES = FALSE; 46 55 remove_argument (N, argc, argv); 47 56 } … … 77 86 SKIP_GALPHOT = TRUE; 78 87 remove_argument (N, argc, argv); 88 } 89 90 if (SKIP_IMAGES && !(SKIP_MEASURE || SKIP_LENSING)) { 91 fprintf (stderr, "WARNING: skipping images but merging measure and lensing tables: imageIDs will not be correct\n"); 92 fprintf (stderr, "type Ctrl-C within 5 seconds to cancel\n"); 93 for (int i = 5; i > 0; i--) { 94 fprintf (stderr, "%d.. ", i); 95 usleep (1000000); 96 } 97 fprintf (stderr, "\n"); 79 98 } 80 99 -
branches/eam_branches/ipp-20220316/Ohana/src/dvomerge/src/dvo_image_merge_dbs.c
r39329 r42166 404 404 off_t i; 405 405 406 for (i = 0; i < IDmap->oldIDmax + 1; i++) {406 for (i = 0; IDmap->notFoundMeasure && (i < IDmap->oldIDmax + 1); i++) { 407 407 if (!IDmap->notFoundMeasure[i]) continue; 408 408 fprintf (stderr, "SKIP IMAGE MEASURE: "OFF_T_FMT", %d measures\n", i, IDmap->notFoundMeasure[i]); 409 409 } 410 for (i = 0; i < IDmap->oldIDmax + 1; i++) {410 for (i = 0; IDmap->notFoundLensing && (i < IDmap->oldIDmax + 1); i++) { 411 411 if (!IDmap->notFoundLensing[i]) continue; 412 412 fprintf (stderr, "SKIP IMAGE LENSING: "OFF_T_FMT", %d lensings\n", i, IDmap->notFoundLensing[i]); -
branches/eam_branches/ipp-20220316/Ohana/src/dvomerge/src/dvomergeUpdate.c
r39301 r42166 81 81 } 82 82 83 if (CONTINUE) { 84 // need to determine the mapping from the input to the output images 85 dvomergeImagesGetMap (&IDmap, input, output); 86 } else { 87 dvomergeImagesUpdate (&IDmap, input, output); 88 if (IMAGES_ONLY) exit (0); 83 // do not merge the images unless requested 84 if (!SKIP_IMAGES) { 85 if (CONTINUE) { 86 // need to determine the mapping from the input to the output images 87 dvomergeImagesGetMap (&IDmap, input, output); 88 } else { 89 dvomergeImagesUpdate (&IDmap, input, output); 90 if (IMAGES_ONLY) exit (0); 91 } 89 92 } 90 93 91 94 // load the sky table for the existing database 92 95 insky = SkyTableLoadOptimal (input, NULL, NULL, FALSE, SKY_DEPTH_HST, VERBOSE); -
branches/eam_branches/ipp-20220316/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c
r41341 r42166 163 163 } 164 164 165 // for SKIP_IMAGES, this is a NO-OP 165 166 dvo_update_image_IDs (IDmap, &incatalog); 166 167 -
branches/eam_branches/ipp-20220316/Ohana/src/dvomerge/src/dvomergeUpdate_threaded.c
r38986 r42166 69 69 LoadCatalog (&outcatalog, outlist[0].regions[j], outlist[0].filename[j], "w", threadData->NsecfiltOutput); 70 70 71 // for SKIP_IMAGES, this is a NO-OP 71 72 dvo_update_image_IDs (threadData->IDmap, &incatalog); 72 73 merge_catalogs_old (&threadData->outsky->regions[j], &outcatalog, &incatalog, RADIUS, threadData->secfiltMap); … … 183 184 } 184 185 185 if (CONTINUE) { 186 // need to determine the mapping from the input to the output images 187 dvomergeImagesGetMap (&IDmap, input, output); 188 } else { 189 dvomergeImagesUpdate (&IDmap, input, output); 190 if (IMAGES_ONLY) exit (0); 186 if (!SKIP_IMAGES) { 187 if (CONTINUE) { 188 // need to determine the mapping from the input to the output images 189 dvomergeImagesGetMap (&IDmap, input, output); 190 } else { 191 dvomergeImagesUpdate (&IDmap, input, output); 192 if (IMAGES_ONLY) exit (0); 193 } 191 194 } 192 195 -
branches/eam_branches/ipp-20220316/Ohana/src/libohana/src/errors.c
r41468 r42166 26 26 27 27 int push_error (char *line) { 28 29 if (!errorlines) { 30 NLINE = 10; 31 ALLOCATE (errorlines, char *, NLINE); 32 for (int i = 0; i < NLINE; i++) { 33 errorlines[i] = NULL; 34 } 35 } 28 36 29 37 errorlines[Nline] = strcreate (line); -
branches/eam_branches/ipp-20220316/Ohana/src/opihi
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/Makefile
r42082 r42166 106 106 $(SRC)/mget3d.$(ARCH).o \ 107 107 $(SRC)/mslice.$(ARCH).o \ 108 $(SRC)/mlayer.$(ARCH).o \ 108 109 $(SRC)/minterpolate.$(ARCH).o \ 109 110 $(SRC)/medimage.$(ARCH).o \ -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/create.c
r41341 r42166 3 3 int create (int argc, char **argv) { 4 4 5 int i, N , INT;5 int i, N; 6 6 opihi_flt start, end, delta; 7 7 Vector *vec; … … 34 34 } 35 35 36 INT = FALSE;36 int INT = FALSE; 37 37 if ((N = get_argument (argc, argv, "-int"))) { 38 38 INT = TRUE; … … 40 40 } 41 41 42 if ((argc != 5) && (argc != 4)) { 43 gprint (GP_ERR, "USAGE: create vector start end [delta] [-int]\n"); 44 gprint (GP_ERR, " -int : resulting vector is integer type (delta must be integer)\n"); 45 gprint (GP_ERR, " -str : resulting vector is string type (only give number of elements)\n"); 46 return (FALSE); 42 int EMPTY = FALSE; 43 if ((N = get_argument (argc, argv, "-empty"))) { 44 EMPTY = TRUE; 45 remove_argument (N, &argc, argv); 47 46 } 48 47 48 if (!EMPTY && (argc != 5) && (argc != 4)) goto usage; 49 if (EMPTY && (argc != 2)) goto usage; 50 49 51 if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) return (FALSE); 52 if (EMPTY) { 53 ResetVector (vec, (INT ? OPIHI_INT : OPIHI_FLT), 0); 54 return TRUE; 55 } 50 56 51 57 delta = 1; … … 91 97 92 98 return (TRUE); 99 100 usage: 101 gprint (GP_ERR, "USAGE: create vector start end [delta] [-int]\n"); 102 gprint (GP_ERR, " -int : resulting vector is integer type (delta must be integer)\n"); 103 gprint (GP_ERR, " -str : resulting vector is string type (only give number of elements)\n"); 104 gprint (GP_ERR, "OR: create vector -empty (creates vector of length zero)\n"); 105 return (FALSE); 93 106 } -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/init.c
r42082 r42166 97 97 int mget3d PROTO((int, char **)); 98 98 int mslice PROTO((int, char **)); 99 int mlayer PROTO((int, char **)); 99 100 int minterp PROTO((int, char **)); 100 101 int medimage_command PROTO((int, char **)); … … 296 297 {1, "mget3d", mget3d, "extract a vector from a 3D image"}, 297 298 {1, "mslice", mslice, "extract an image plane from a 3D image"}, 299 {1, "mlayer", mlayer, "insert an image plane into a 3D image"}, 298 300 {1, "imget", mget, "extract a vector from an image"}, 299 301 {1, "minterp", minterp, "interpolate image pixels"}, -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/mslice.c
r40334 r42166 31 31 if (argc != 4) { 32 32 gprint (GP_ERR, "USAGE: mslice <input> <output> plane [-x,-y,-z]\n"); 33 gprint (GP_ERR, " extract 2D image from 3D cube (opposite of mlayer)\n"); 33 34 gprint (GP_ERR, " -z is default\n"); 34 35 return (FALSE); -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/write_vectors.c
r41341 r42166 102 102 if (argc < 3) { 103 103 gprint (GP_ERR, "USAGE: write [options] file vector vector ...\n"); 104 gprint (GP_ERR, "OPTIONS: [-header ] [-append] [-f \"format\"] [-fits NAME] [-csv] [-h,--help]\n");104 gprint (GP_ERR, "OPTIONS: [-header [buf]] [-append] [-f \"format\"] [-fits NAME] [-csv] [-h,--help]\n"); 105 105 return (FALSE); 106 106 } … … 289 289 usage: 290 290 gprint (GP_ERR, "USAGE: write [options] file vector vector ...\n"); 291 gprint (GP_ERR, "OPTIONS: [-header ] [-append] [-f \"format\"] [-fits NAME] [-csv] [-h,--help]\n\n");291 gprint (GP_ERR, "OPTIONS: [-header [buf]] [-append] [-f \"format\"] [-fits NAME] [-csv] [-h,--help]\n\n"); 292 292 293 293 gprint (GP_ERR, "OPTIONS: \n"); 294 gprint (GP_ERR, " -header : add a descriptive header line to ascii or csv output \n");294 gprint (GP_ERR, " -header : add a descriptive header line to ascii or csv output (see below for FITS)\n"); 295 295 gprint (GP_ERR, " -append : write to the end of the existing file\n"); 296 296 gprint (GP_ERR, " -fits NAME : write a fits table (extention name is NAME, column names match vector names)\n"); -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/lib.shell/VectorIO.c
r41422 r42166 267 267 } 268 268 269 static char *rawkeywords[] = {"SIMPLE", "BITPIX", "NAXIS", "PCOUNT", "GCOUNT", "EXTEND", "EXTNAME", "BSCALE", "BZERO", "TFIELDS", "TFORM", "T ZERO", "TSCAL", " ", NULL};269 static char *rawkeywords[] = {"SIMPLE", "BITPIX", "NAXIS", "PCOUNT", "GCOUNT", "EXTEND", "EXTNAME", "BSCALE", "BZERO", "TFIELDS", "TFORM", "TTYPE", "TZERO", "TSCAL", " ", NULL}; 270 270 271 271 // write a set of vectors to a FITS file (vectors names become fits column names) -
branches/eam_branches/ipp-20220316/Ohana/src/relphot
- Property svn:mergeinfo changed
/trunk/Ohana/src/relphot (added) merged: 42124,42132,42134-42135,42151
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20220316/Ohana/src/relphot/include/relphot.h
r42112 r42166 721 721 int relphot_images (SkyList *skylist); 722 722 723 void relphot_usage ( void);723 void relphot_usage (int argc, char **argv); 724 724 void relphot_help (int argc, char **argv); 725 725 -
branches/eam_branches/ipp-20220316/Ohana/src/relphot/src/ResetOps.c
r41946 r42166 123 123 124 124 for (off_t i = 0; i < catalog->Naverage; i++) { 125 catalog->average[i].psfQF = NAN; // force recalculation in setMrelCatalog 126 catalog->average[i].psfQFperf = NAN; // force recalculation in setMrelCatalog 127 catalog->average[i].stargal = NAN; // force recalculation in setMrelCatalog 128 catalog->average[i].photFlagsUpper = 0; // reset (will be re-calculated) 129 catalog->average[i].photFlagsLower = 0; // reset (will be re-calculated) 130 catalog->average[i].NwarpOK = 0; // reset (will be re-calculated) 125 if (STAGES & STAGE_CHIP) { 126 catalog->average[i].psfQF = NAN; // force recalculation in setMrelCatalog 127 catalog->average[i].psfQFperf = NAN; // force recalculation in setMrelCatalog 128 catalog->average[i].stargal = NAN; // force recalculation in setMrelCatalog 129 catalog->average[i].photFlagsUpper = 0; // reset (will be re-calculated) 130 catalog->average[i].photFlagsLower = 0; // reset (will be re-calculated) 131 } 132 133 if (STAGES & STAGE_WARP) { 134 catalog->average[i].NwarpOK = 0; // reset (will be re-calculated) 135 } 131 136 132 137 // RESET_FLATCORR independent of RESET? -
branches/eam_branches/ipp-20220316/Ohana/src/relphot/src/args.c
r42112 r42166 203 203 remove_argument (N, &argc, argv); 204 204 TEST_IMAGE1 = strtol(argv[N], &endptr, 0); 205 if (*endptr) relphot_usage ( );205 if (*endptr) relphot_usage (argc, argv); 206 206 remove_argument (N, &argc, argv); 207 207 } … … 211 211 remove_argument (N, &argc, argv); 212 212 TEST_IMAGE2 = strtol(argv[N], &endptr, 0); 213 if (*endptr) relphot_usage ( );213 if (*endptr) relphot_usage (argc, argv); 214 214 remove_argument (N, &argc, argv); 215 215 } … … 584 584 remove_argument (N, &argc, argv); 585 585 mode = PARALLEL_IMAGES; 586 if (N >= argc) relphot_usage( );586 if (N >= argc) relphot_usage(argc, argv); 587 587 IMAGE_TABLE = strcreate (argv[N]); 588 588 remove_argument (N, &argc, argv); 589 if (!REGION_FILE) relphot_usage( );589 if (!REGION_FILE) relphot_usage(argc, argv); 590 590 } 591 591 … … 594 594 remove_argument (N, &argc, argv); 595 595 mode = PARALLEL_REGIONS; 596 if (!REGION_FILE) relphot_usage( );596 if (!REGION_FILE) relphot_usage(argc, argv); 597 597 if ((N = get_argument (argc, argv, "-parallel-regions-manual"))) { 598 598 remove_argument (N, &argc, argv); … … 609 609 // note: initialize sets PhotcodeList to the full set of average photcodes 610 610 // if the mode is UPDATE_AVERAGES 611 if (argc != 1) relphot_usage();612 break;611 // if (argc != 1) relphot_usage(argc, argv); 612 // break; 613 613 614 if (argc == 1) break; // if no photcodes are given, use them all? 615 614 616 case UPDATE_IMAGES: 615 617 case PARALLEL_IMAGES: … … 623 625 default: 624 626 fprintf (stderr, "no valid mode selected\n"); 625 relphot_usage( );627 relphot_usage(argc, argv); 626 628 break; 627 629 } 628 if (argc != 1) relphot_usage ( );630 if (argc != 1) relphot_usage (argc, argv); 629 631 630 632 // if we supplied a file, we need to load it now -
branches/eam_branches/ipp-20220316/Ohana/src/relphot/src/help.c
r38062 r42166 1 1 # include "relphot.h" 2 2 3 void relphot_usage ( void) {3 void relphot_usage (int argc, char **argv) { 4 4 fprintf (stderr, "ERROR: USAGE: relphot (photcodes) -images\n"); 5 5 fprintf (stderr, " or: relphot -averages\n"); … … 11 11 fprintf (stderr, " or: -catalog (name)\n"); 12 12 fprintf (stderr, " use -h for more usage information\n"); 13 14 fprintf (stderr, "unparsed arguments: "); 15 for (int i = 0; i < argc; i++) { 16 fprintf (stderr, "%s ", argv[i]); 17 } 18 fprintf (stderr, "\n"); 19 13 20 exit (2); 14 21 } … … 19 26 if (get_argument (argc, argv, "-help")) goto show_help; 20 27 if (get_argument (argc, argv, "-h")) goto show_help; 21 if (argc == 1) relphot_usage( );28 if (argc == 1) relphot_usage(0, NULL); 22 29 return; 23 30 -
branches/eam_branches/ipp-20220316/Ohana/src/relphot/src/initialize.c
r41647 r42166 9 9 if (!mode) exit (2); 10 10 11 // UPDATE_AVERAGES always operates on all photcodes? 12 if (mode == UPDATE_AVERAGES) { 11 // UPDATE_AVERAGES used to always operate on all photcodes 12 // now, if a list of photcodes are given that is used, otherwise 13 // all will be used 14 if (!photcodes) { 13 15 char tmpline1[256]; 14 16 int Ns; -
branches/eam_branches/ipp-20220316/Ohana/src/relphot/src/relphot_images.c
r42112 r42166 132 132 133 133 // if (GRID_ZEROPT) dump_grid (); 134 setMcal (catalog); 135 setMmos (catalog); 136 setMgrp (catalog); 134 137 135 138 setMcal (catalog); -
branches/eam_branches/ipp-20220316/Ohana/src/relphot/src/setMrelCatalog.c
r42010 r42166 266 266 // overlaps). Msys + measure.Mcal is our best guess of the true magnitude 267 267 Mcal = measureT[k].McalPSF; // check that this is zero for loaded REF value 268 // but external reference photometry might not have Mcal set, so set to 0.0 in that case. 269 if (isnan(Mcal)) Mcal = 0.0; 268 270 } else { 269 271 // getMcal returns image[].Mcal … … 412 414 413 415 // XXX hardwired grizy = (01234) JHK = (567) w = (8) 414 if ( (Nsec < 5) || (Nsec == 8)) {416 if (Nsec < 5) { 415 417 secfilt[Nsec].Ncode = results->NexpPS1[Nsec]; 416 418 } else { -
branches/eam_branches/ipp-20220316/Ohana/src/relphot/src/setMrelFinal.c
r41647 r42166 11 11 int Nsecfilt = GetPhotcodeNsecfilt (); 12 12 13 // this resets values only if -reset is used 13 14 ResetAverageAndMeasure (catalog); 14 15
Note:
See TracChangeset
for help on using the changeset viewer.
