IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 24, 2013, 1:37:30 PM (13 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20130509
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130509

  • branches/eam_branches/ipp-20130509/Ohana

  • branches/eam_branches/ipp-20130509/Ohana/src/addstar/include/addstar.h

    r35263 r35594  
    119119int     ACCEPT_TIME;    // accept time stamp (or 0)
    120120int     NO_STARS;       // ignore the stars
     121int     NO_DUPLICATE_IMAGES; // allow / skip duplicate images
     122int     IMAGE_ID_OVERRIDE; // allow / skip duplicate images
    121123int     TEXTMODE;       // force input file to be loaded as RAW
    122124int     SUBPIX;         // apply a subpix correction
  • branches/eam_branches/ipp-20130509/Ohana/src/addstar/src/ImageIndex.c

    r35263 r35594  
    159159  if (!index) {
    160160      fprintf (stderr, "image index file is not found, cannot check for image duplicates\n");
    161       exit (2);
     161      exit (1);
    162162  }
    163163
  • branches/eam_branches/ipp-20130509/Ohana/src/addstar/src/UpdateImageIDs.c

    r35263 r35594  
    3535  }
    3636
     37  // TEST IMAGE_ID OVER-RIDE:
     38  if (IMAGE_ID_OVERRIDE) {
     39    imageID = IMAGE_ID_OVERRIDE;
     40  }
     41
    3742  // XXX should the first image ID be 1, not 0?
    3843  if (imageID == 0) imageID = 1;
     
    5459  // set and update the imageID sequence
    5560  // the file holding the index is created above if this is an empty db
    56   CheckDuplicateImageIDs (images, Nimages);
     61  if (NO_DUPLICATE_IMAGES) {
     62    CheckDuplicateImageIDs (images, Nimages);
     63  }
    5764
    5865  imageID += Nimages;
  • branches/eam_branches/ipp-20130509/Ohana/src/addstar/src/args.c

    r34405 r35594  
    308308  if ((N = get_argument (argc, argv, "-no-stars"))) {
    309309    NO_STARS = TRUE;
     310    remove_argument (N, &argc, argv);
     311  }
     312  /* skip the stars */
     313  NO_DUPLICATE_IMAGES = TRUE;
     314  if ((N = get_argument (argc, argv, "-dup-images"))) {
     315    NO_DUPLICATE_IMAGES = FALSE;
     316    remove_argument (N, &argc, argv);
     317  }
     318  /* skip the stars */
     319  IMAGE_ID_OVERRIDE = 0;
     320  if ((N = get_argument (argc, argv, "-image-id-override"))) {
     321    remove_argument (N, &argc, argv);
     322    IMAGE_ID_OVERRIDE = atoi(argv[N]);
    310323    remove_argument (N, &argc, argv);
    311324  }
     
    438451  fprintf (stderr, "  -use-name                   : use the given name instead of the filename as the filename\n");
    439452  fprintf (stderr, "  -no-stars                   : skip the stars\n");
     453  fprintf (stderr, "  -dup-images                 : skip the test for duplicate image IDs (test only!)\n");
    440454  fprintf (stderr, "  -force                      : force read of database with inconsistent info\n");
    441455  fprintf (stderr, "  -threads (N)                : use N threads for resort option\n");
  • branches/eam_branches/ipp-20130509/Ohana/src/dvomerge

  • branches/eam_branches/ipp-20130509/Ohana/src/dvomerge/include/dvomerge.h

    r35416 r35594  
    2525
    2626int    VERBOSE;
     27int    VERIFY;
     28int    IMAGES_ONLY;
    2729char   CATDIR[256];
    2830char   GSCFILE[256];
  • branches/eam_branches/ipp-20130509/Ohana/src/dvomerge/src/args.c

    r35416 r35594  
    1212    remove_argument (N, argc, argv);
    1313  }
     14
     15  /* verify merge status of output tables, but do not modify */
     16  VERIFY = FALSE;
     17  if ((N = get_argument (*argc, argv, "-verify"))) {
     18    VERIFY = TRUE;
     19    remove_argument (N, argc, argv);
     20  }
     21  if ((N = get_argument (*argc, argv, "-check-only"))) {
     22    VERIFY = TRUE;
     23    remove_argument (N, argc, argv);
     24  }
     25
     26  /* use a different photcode file to define mean values */
    1427  if ((N = get_argument (*argc, argv, "-photcode-file"))) {
    1528    remove_argument (N, argc, argv);
     
    113126  }
    114127
     128  /* verify merge status of output tables, but do not modify */
     129  VERIFY = FALSE;
     130  if ((N = get_argument (*argc, argv, "-verify"))) {
     131    VERIFY = TRUE;
     132    remove_argument (N, argc, argv);
     133  }
     134  if ((N = get_argument (*argc, argv, "-check-only"))) {
     135    VERIFY = TRUE;
     136    remove_argument (N, argc, argv);
     137  }
     138
    115139  /* replace measurement, don't duplicate */
    116140  REPLACE_BY_PHOTCODE = FALSE;
  • branches/eam_branches/ipp-20130509/Ohana/src/dvomerge/src/dvomerge.c

    r29938 r35594  
    1010  if (argc == 6) {
    1111    if (!strcasecmp (argv[2], "and")) {
     12      if (VERIFY) {
     13        fprintf (stderr, "WARNING / ERROR : dvomerge (input1) and (input2) into (output) : VERIFY mode not implemented\n");
     14        exit (3);
     15      }
    1216      dvomergeCreate (argc, argv);
    1317    } else {
     18      if (VERIFY) {
     19        fprintf (stderr, "WARNING / ERROR : dvomerge (input) into (output) from (list) : VERIFY mode not implemented\n");
     20        exit (3);
     21      }
    1422      dvomergeFromList (argc, argv);
    1523    }
     
    2634}
    2735
    28 /* we have two possible modes of operation:
     36/* we have two major modes of operation:
    2937
    30    Create   : dvomerge (in1) and (in2) to (out) -- create a new db from two input dbs
    31    Update   : dvomerge (in) into (out)          -- merge a new db into an existing db
    32    Continue : dvomerge (in) into (out) continue -- merge a new db into an existing db
     38   Create    : dvomerge (in1) and (in2) to (out) -- create a new db from two input dbs
     39   Update    : dvomerge (in) into (out)          -- merge a new db into an existing db
    3340
     41   we also have varients on Update:
     42   Continue  : dvomerge (in) into (out) continue -- merge only unmerged tables into the existing db
     43   From List : dvomerge (in) into (out) from (list) -- merge only specified tables into the existing db
     44
     45   neither of the 2 above modes update the image table
    3446*/
  • branches/eam_branches/ipp-20130509/Ohana/src/dvomerge/src/dvomergeFromList.c

    r35454 r35594  
    108108    dmhObjectStats *inStats = dmhObjectStatsRead (inputfile);
    109109
     110    // XXX : we are not checking for already-merged entries
     111
    110112    LoadCatalog (&incatalog, NULL, inputfile, "r", NsecfiltInput);
    111113
  • branches/eam_branches/ipp-20130509/Ohana/src/dvomerge/src/dvomergeUpdate.c

    r33963 r35594  
    2323    CONTINUE = TRUE;
    2424  }
     25  if (VERIFY) CONTINUE = TRUE;
    2526
    2627  input  = argv[1];
     
    7879  } else {
    7980    dvomergeImagesUpdate (&IDmap, input, output);
     81    if (IMAGES_ONLY) exit (0);
    8082  }
    8183
  • branches/eam_branches/ipp-20130509/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c

    r34405 r35594  
    7676    }
    7777    if (!missed) {
    78       if (VERBOSE) fprintf (stderr, "skipping %s, empty or already merged\n", inlist[0].filename[i]);
     78      if (VERBOSE || VERIFY) fprintf (stderr, "skipping %s, already merged\n", inlist[0].filename[i]);
    7979      OutputStatusFree (outstat, outlist->Nregions);
    8080      dmhObjectStatsFree (inStats);
    8181      SkyListFree (outlist);
     82      continue;
     83    }
     84    if (VERIFY) {
     85      fprintf (stderr, "%s NOT merged\n", inlist[0].filename[i]);
    8286      continue;
    8387    }
     
    193197    char tmpline[DVO_MAX_PATH];
    194198    if (VERBOSE)             { snprintf (tmpline, DVO_MAX_PATH, "%s -v",       command); strcpy (command, tmpline); }
     199    if (VERIFY)              { snprintf (tmpline, DVO_MAX_PATH, "%s -verify",  command); strcpy (command, tmpline); }
    195200    if (REPLACE_BY_PHOTCODE) { snprintf (tmpline, DVO_MAX_PATH, "%s -replace", command); strcpy (command, tmpline); }
    196201
  • branches/eam_branches/ipp-20130509/Ohana/src/dvomerge/src/dvomergeUpdate_threaded.c

    r33657 r35594  
    129129  output = argv[3];
    130130
     131  fprintf (stderr, "WARNING / ERROR : multi-threaded dvomerge does not handle merge tracking yet\n");
     132  exit (2);
     133
    131134  if (ALTERNATE_PHOTCODE_FILE) {
    132135    fprintf (stderr, "cannot specify photcodes when merging into an existing catdir\n");
  • branches/eam_branches/ipp-20130509/Ohana/src/dvomerge/src/help.c

    r35416 r35594  
    5959  fprintf (stderr, "  optional flags:\n");
    6060  fprintf (stderr, "  -v                          : verbose mode\n");
     61  fprintf (stderr, "  -verify                     : verify merge status of output tables, but do not modify\n");
     62  fprintf (stderr, "  -check-only                 : verify merge status of output tables, but do not modify [same as -verify]\n");
    6163  fprintf (stderr, "  -help                       : this list\n");
    6264  fprintf (stderr, "  -h                          : this list\n\n");
     
    8183  fprintf (stderr, "  optional flags:\n");
    8284  fprintf (stderr, "  -v                          : verbose mode\n");
     85  fprintf (stderr, "  -verify                     : verify merge status of output tables, but do not modify\n");
     86  fprintf (stderr, "  -check-only                 : verify merge status of output tables, but do not modify [same as -verify]\n");
    8387  fprintf (stderr, "  -help                       : this list\n");
    8488  fprintf (stderr, "  -h                          : this list\n\n");
  • branches/eam_branches/ipp-20130509/Ohana/src/dvopsps/include/dvopsps.h

    r35207 r35594  
    1313  uint64_t ippObjID;
    1414  uint64_t objID;
     15  int      photcode;
    1516  unsigned int flags;
    1617  float zp;
  • branches/eam_branches/ipp-20130509/Ohana/src/dvopsps/src/DetectionOps.c

    r35098 r35594  
    5454  GET_COLUMN(ippObjID    , "ippObjID",    int64_t);
    5555  GET_COLUMN(objID       , "objID",       int64_t);
     56  GET_COLUMN(photcode    , "photcode",    int);
    5657  GET_COLUMN(flags       , "flags",       int);
    5758  GET_COLUMN(zp          , "zp",          float);
     
    7374    detections[i].ippObjID     = ippObjID[i];   
    7475    detections[i].objID        = objID[i];     
     76    detections[i].photcode     = photcode[i];     
    7577    detections[i].flags        = flags[i];     
    7678    detections[i].zp           = zp[i];         
     
    9092  free (ippObjID   );
    9193  free (objID      );
     94  free (photcode   );
    9295  free (flags      );
    9396  free (zp         );
     
    154157  // gfits_define_bintable_column (&theader, "K", "ippObjID",    NULL, NULL, 1.0, BZERO_INT64);
    155158  // gfits_define_bintable_column (&theader, "K", "objID",       NULL, NULL, 1.0, BZERO_INT64);
     159  gfits_define_bintable_column (&theader, "J", "photcode",    NULL, NULL, 1.0, 0.0);
    156160  gfits_define_bintable_column (&theader, "J", "flags",       NULL, NULL, 1.0, BZERO_INT32);
    157161  gfits_define_bintable_column (&theader, "E", "zp",          NULL, NULL, 1.0, 0.0);
     
    173177  uint64_t   *ippObjID    ; ALLOCATE (ippObjID    ,  uint64_t, Ndetections);
    174178  uint64_t   *objID       ; ALLOCATE (objID       ,  uint64_t, Ndetections);
     179  int        *photcode    ; ALLOCATE (photcode    ,  int,      Ndetections);
    175180  uint32_t   *flags       ; ALLOCATE (flags       ,  uint32_t, Ndetections);
    176181  float      *zp          ; ALLOCATE (zp          ,  float,    Ndetections);
     
    190195    ippObjID[i]    = detections[i].ippObjID    ;
    191196    objID[i]       = detections[i].objID       ;
     197    photcode[i]    = detections[i].photcode    ;
    192198    flags[i]       = detections[i].flags       ;
    193199    zp[i]          = detections[i].zp          ;
     
    207213  gfits_set_bintable_column (&theader, &ftable, "ippObjID",    ippObjID    , Ndetections);
    208214  gfits_set_bintable_column (&theader, &ftable, "objID",       objID       , Ndetections);
     215  gfits_set_bintable_column (&theader, &ftable, "photcode",    photcode    , Ndetections);
    209216  gfits_set_bintable_column (&theader, &ftable, "flags",       flags       , Ndetections);
    210217  gfits_set_bintable_column (&theader, &ftable, "zp",          zp          , Ndetections);
     
    222229  free (ippObjID    );
    223230  free (objID       );
     231  free (photcode    );
    224232  free (flags       );
    225233  free (zp          );
  • branches/eam_branches/ipp-20130509/Ohana/src/dvopsps/src/insert_detections_dvopsps_catalog.c

    r35416 r35594  
    4949      // detections[Ndetections]. ((uint64_t)average->catID << 32) + (uint64_t)average->objID; // ippObjID
    5050      detections[Ndetections].objID        = average->extID;   // objID
     51      detections[Ndetections].photcode     = measure->photcode;   // photcode
    5152      detections[Ndetections].flags        = measure->dbFlags;  // flags
    5253      detections[Ndetections].zp           = code->C * 0.001 + code->K * (measure->airmass - 1) - measure->Mcal;   // zp
     
    168169  }
    169170
    170   PrintIOBuffer (buffer, "INSERT INTO dvoDetectionFull (imageID, ippDetectID, detectID, ippObjID, objID, flags, zp, zpErr, airMass, expTime, ra, dec_, raErr, decErr) VALUES \n");
     171  PrintIOBuffer (buffer, "INSERT INTO dvoDetectionFull (imageID, ippDetectID, detectID, ippObjID, objID, photcode, flags, zp, zpErr, airMass, expTime, ra, dec_, raErr, decErr) VALUES \n");
    171172
    172173  return TRUE;
     
    179180int insert_detections_mysql_value (IOBuffer *buffer, Average *average, Measure *measure) {
    180181
    181   // XXX I am changing the def of ippObjID if I use the code below
    182182  PhotCode *code = GetPhotcodebyCode(measure->photcode);
    183   // PrintIOBuffer (buffer, "    (%d, %u, %lu, %lu, %lu, %u, %f, %f, %f, %f, %lf, %lf, %f, %f),\n",
    184   //             measure->imageID,    // imageID
    185   //             measure->detID,   // ippDetectID
    186   //             measure->extID,   // detectID
    187   //             ((uint64_t)average->catID * 1000000000) + (uint64_t)average->objID, // ippObjID
    188   //             // NOTE: this is better, but the above is the current ippToPsps value
    189   //             // ((uint64_t)average->catID << 32) + (uint64_t)average->objID, // ippObjID
    190   //             average->extID,   // objID
    191   //             measure->dbFlags,  // flags
    192   //             code->C * 0.001 + code->K * (measure->airmass - 1) - measure->Mcal,   // zp
    193   //             measure->dMcal,    // zpErr
    194   //             measure->airmass,
    195   //             pow(10.0, 0.4 * measure->dt),    // expTime
    196   //             average->R - measure->dR / 3600.,    // ra
    197   //             average->D - measure->dR / 3600.,    // dec
    198   //             measure->dXccd * 0.01 * fabs(measure->pltscale), // estimate of raErr
    199   //             measure->dYccd * 0.01 * fabs(measure->pltscale) // estimate of decErr
    200   //   );
    201  
    202183  PrintIOBuffer (buffer, "(%d, ", measure->imageID);      // imageID
    203184  PrintIOBuffer (buffer, "%u, ", measure->detID); // ippDetectID
     
    207188  // ((uint64_t)average->catID << 32) + (uint64_t)average->objID, // ippObjID
    208189  PrintIOBuffer (buffer, "%lu, ", average->extID);        // objID
     190  PrintIOBuffer (buffer, "%d, ", measure->photcode);      // photcode
    209191  PrintIOBuffer (buffer, "%u, ", measure->dbFlags);       // flags
    210192
  • branches/eam_branches/ipp-20130509/Ohana/src/libfits/include/gfitsio.h

    r35162 r35594  
    2626# define FT_LINE_LENGTH          80  /* FITS header line length */
    2727# define FT_RECORD_SIZE        2880  /* FITS block size */
     28
     29# define FT_BZERO_INT16 1.0*0x8000       
     30# define FT_BZERO_INT32 1.0*0x80000000
    2831
    2932/* this structure defines the buffer which contains a header
  • branches/eam_branches/ipp-20130509/Ohana/src/libfits/table/F_define_column.c

    r33648 r35594  
    11# include <ohana.h>
    22# include <gfitsio.h>
     3
     4# if (0)
     5/*** special version of this function to define unsigned int columns (special values for BZERO, BSCALE) ********************/
     6int gfits_define_bintable_column_unsigned_int (Header *header, char *format, char *label, char *comment, char *unit, int inttype) {
     7
     8  assert (label);
     9  assert (format);
     10
     11  off_t Naxis1;
     12  int Nfields, Nbytes, Nval;
     13  char type[16], field[16];
     14 
     15  if (!gfits_bintable_format (format, type, &Nval, &Nbytes)) return (FALSE);
     16 
     17  Nfields = 0;
     18  gfits_scan (header, "TFIELDS", "%d", 1, &Nfields);
     19  gfits_scan (header, "NAXIS1",  OFF_T_FMT, 1,  &Naxis1);
     20  Nfields ++;
     21  Naxis1 += Nbytes*Nval;
     22
     23  sprintf (field, "TTYPE%d", Nfields);
     24  gfits_modify (header, field, "%s", 1, label);
     25  gfits_modify_alt (header, field, "%C", 1, comment);
     26  sprintf (field, "TUNIT%d", Nfields);
     27  gfits_modify (header, field, "%s", 1, unit);
     28  sprintf (field, "TFORM%d", Nfields);
     29  gfits_modify (header, field, "%s", 1, format);
     30
     31  // add scaling parameters unless they amount to a noop
     32  if ((bscale != 1.0) || (bzero != 0.0)) {
     33      sprintf (field, "TSCAL%d", Nfields);
     34      gfits_modify (header, field, "%lf", 1, bscale);
     35      sprintf (field, "TZERO%d", Nfields);
     36      gfits_modify (header, field, "%lf", 1, bzero);
     37  }
     38
     39  /* update TFIELDS & NAXIS1 */
     40  gfits_modify (header, "TFIELDS", "%d", 1, Nfields);
     41  gfits_modify (header, "NAXIS1",  OFF_T_FMT, 1,  Naxis1);
     42  header[0].Naxis[0] = Naxis1;
     43
     44  return (TRUE);
     45}
     46# endif
    347
    448/***********************/
  • branches/eam_branches/ipp-20130509/Ohana/src/libohana/src

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20130509/Ohana/src/opihi

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20130509/Ohana/src/opihi/cmd.astro

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20130509/Ohana/src/opihi/cmd.data

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.