IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 5, 2010, 10:04:42 PM (16 years ago)
Author:
eugene
Message:

handle errors in dvo I/O functions; better support for DIS images; merge in high-speed mods from Niall; systematic errors in astrometry (somewhat hackish); add fits I/O option to succeed reading a short file (padding as needed); various kapa improvements (frames consistent in X, PS, PNG; fix tick label signif digits; add function for image overlays; better thick box lines; PNG of the image); bDrawBuffer mods to drop static buffer and refer to passed through buffer; ResizeByImage; DefineSectionByImage; buutos to do png & jpeg; add program roc for raid over cluster; support for mosaic photcodes in dvo image plot; densify; section name [-image x y] : width based on current image; resize -by-image; threaded addstar -resort; threaded dvomerge; dvorepair; dvoverify; dvomerge continue; dvomerge from list (of regions)

Location:
trunk/Ohana/src/libdvo
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libdvo/include/dvo.h

    r29001 r29938  
    5858// these are used as NAN for types of int values
    5959typedef enum {
    60     NAN_S_CHAR  = 0x7f,
    61     NAN_U_CHAR  = 0xff,   // was NO_ERR
    62     NAN_S_SHORT = 0x7fff, // was NO_MAG
    63     NAN_U_SHORT = 0xffff,
    64     NAN_S_INT   = 0x7fffffff,
    65     NAN_U_INT   = 0xffffffff,
     60  NAN_S_CHAR  = 0x7f,
     61  NAN_U_CHAR  = 0xff,   // was NO_ERR
     62  NAN_S_SHORT = 0x7fff, // was NO_MAG
     63  NAN_U_SHORT = 0xffff,
     64  NAN_S_INT   = 0x7fffffff,
     65  NAN_U_INT   = (signed int) 0xffffffff,
    6666} DVO_INT_NAN;
    6767
     
    135135/* Average.code values -- these values are 32 bit (as of PS1_V1) */
    136136typedef enum {
    137   ID_STAR_FEW     = 0x00000001, // used within relphot: skip star 
    138   ID_STAR_POOR    = 0x00000002, // used within relphot: skip star 
    139   ID_PROPER       = 0x00000400, // star with large proper motion 
    140   ID_TRANSIENT    = 0x00001000, // is this mutually exclusive with USNO? 
    141   ID_VARIABLE     = 0x00002000, // not currently set? 
    142   ID_ASTEROID     = 0x00002000, // identified with an asteroid 
    143   ID_BAD_OBJECT   = 0x00004000, // if all measurements are bad, set this bit 
     137  ID_STAR_FEW     = 0x00000001, // used within relphot: skip star
     138  ID_STAR_POOR    = 0x00000002, // used within relphot: skip star
     139  ID_PROPER       = 0x00000400, // star with large proper motion
     140  ID_TRANSIENT    = 0x00001000, // is this mutually exclusive with USNO?
     141  ID_VARIABLE     = 0x00002000, // not currently set?
     142  ID_ASTEROID     = 0x00002000, // identified with an asteroid
     143  ID_BAD_OBJECT   = 0x00004000, // if all measurements are bad, set this bit
    144144  ID_MOVING       = 0x00008000, // is a moving object
    145   ID_ROCK         = 0x0000a000, // 0x8000 + 0x2000 
    146   ID_GHOST        = 0x0000c001, // 0x8000 + 0x4000 + 0x0001 
    147   ID_TRAIL        = 0x0000c002, // 0x8000 + 0x4000 + 0x0002 
    148   ID_BLEED        = 0x0000c003, // 0x8000 + 0x4000 + 0x0003 
    149   ID_COSMIC       = 0x0000c004, // 0x8000 + 0x4000 + 0x0004 
     145  ID_ROCK         = 0x0000a000, // 0x8000 + 0x2000
     146  ID_GHOST        = 0x0000c001, // 0x8000 + 0x4000 + 0x0001
     147  ID_TRAIL        = 0x0000c002, // 0x8000 + 0x4000 + 0x0002
     148  ID_BLEED        = 0x0000c003, // 0x8000 + 0x4000 + 0x0003
     149  ID_COSMIC       = 0x0000c004, // 0x8000 + 0x4000 + 0x0004
    150150  ID_STAR_FIT_AVE = 0x00010000, // average position fitted
    151151  ID_STAR_FIT_PM  = 0x00020000, // proper motion fitted
     
    156156  ID_OBJ_EXT      = 0x01000000, // extended in our data (eg, PS)
    157157  ID_OBJ_EXT_ALT  = 0x02000000, // extended in external data (eg, 2MASS)
    158   ID_OBJ_GOOD     = 0x04000000, // good-quality measurement in our data (eg, PS)
    159   ID_OBJ_GOOD_ALT = 0x08000000, // good-quality measurement in external data (eg, 2MASS)
     158  ID_OBJ_GOOD     = 0x04000000, // good-quality measurement in our data (eg,PS)
     159  ID_OBJ_GOOD_ALT = 0x08000000, // good-quality measurement in  external data (eg, 2MASS)
    160160} DVOAverageFlags;
    161161
     
    233233     *** that is just silly, and bad: convert to using Nsec_mem, Nsec_disk, Nsec_off.
    234234     *** unless we always require the secfilt and average entries to be loaded sychronously.
    235    */
     235     */
    236236
    237237  /* pointers to split data files */
     
    293293int isRegisteredMosaic (void);
    294294off_t GetRegisteredMosaic (void);
     295off_t *GetChipMatch (void);
    295296int GetMosaicCoords (Coords *coords);
    296297int FindMosaicForImage (Image *images, off_t Nimages, off_t entry);
  • trunk/Ohana/src/libdvo/src/dvo_catalog.c

    r27580 r29938  
    302302int dvo_catalog_save (Catalog *catalog, char VERBOSE) {
    303303
     304  int status = FALSE;
     305
    304306  // set the 'sorted' header keyword
    305307  gfits_modify_alt (&catalog[0].header, "SORTED",  "%t", 1, catalog[0].sorted);
     
    308310  switch (catalog[0].catmode) {
    309311    case DVO_MODE_RAW:
    310       dvo_catalog_save_raw (catalog, VERBOSE);
     312      status = dvo_catalog_save_raw (catalog, VERBOSE);
    311313      break;
    312314    case DVO_MODE_MEF:
    313       dvo_catalog_save_mef (catalog, VERBOSE);
     315      status = dvo_catalog_save_mef (catalog, VERBOSE);
    314316      break;
    315317    case DVO_MODE_SPLIT:
    316       dvo_catalog_save_split (catalog, VERBOSE);
     318      status = dvo_catalog_save_split (catalog, VERBOSE);
    317319      break;
    318320    default:
     
    320322      exit (2);
    321323  }
    322   return (TRUE);
     324  return (status);
    323325}
    324326
  • trunk/Ohana/src/libdvo/src/dvo_catalog_mef.c

    r29001 r29938  
    6666  /* read Average table data (or skip) */
    6767  if (catalog[0].catflags & LOAD_AVES) {
    68     if (!gfits_fread_ftable_data (f, &ftable)) {
     68    if (!gfits_fread_ftable_data (f, &ftable, FALSE)) {
    6969      if (VERBOSE) fprintf (stderr, "can't read table average data");
    7070      return (FALSE);
     
    9494  /* read Measure table data */
    9595  if (catalog[0].catflags & LOAD_MEAS) {
    96     if (!gfits_fread_ftable_data (f, &ftable)) {
     96    if (!gfits_fread_ftable_data (f, &ftable, FALSE)) {
    9797      if (VERBOSE) fprintf (stderr, "can't read table measure data");
    9898      return (FALSE);
     
    119119  /* read Missing table data */
    120120  if (catalog[0].catflags & LOAD_MISS) {
    121     if (!gfits_fread_ftable_data (f, &ftable)) {
     121    if (!gfits_fread_ftable_data (f, &ftable, FALSE)) {
    122122      if (VERBOSE) fprintf (stderr, "can't read table missing data");
    123123      return (FALSE);
     
    149149  /* read secfilt table data */
    150150  if (catalog[0].catflags & LOAD_SECF) {
    151     if (!gfits_fread_ftable_data (f, &ftable)) {
     151    if (!gfits_fread_ftable_data (f, &ftable, FALSE)) {
    152152      if (VERBOSE) fprintf (stderr, "can't read table secfilt data");
    153153      return (FALSE);
  • trunk/Ohana/src/libdvo/src/dvo_catalog_split.c

    r29001 r29938  
    218218    }
    219219    /* read Average table data : format is irrelevant here */
    220     if (!gfits_fread_ftable_data (catalog[0].f, &ftable)) {
     220    if (!gfits_fread_ftable_data (catalog[0].f, &ftable, FALSE)) {
    221221      if (VERBOSE) fprintf (stderr, "can't read table average data");
    222222      return (FALSE);
     
    249249    // XXX this allows an empty Measure catalog with non-empty Average catalog : is that OK?
    250250    /* read Measure table data */
    251     if (!gfits_fread_ftable_data (catalog[0].measure_catalog[0].f, &ftable)) {
     251    if (!gfits_fread_ftable_data (catalog[0].measure_catalog[0].f, &ftable, FALSE)) {
    252252      if (VERBOSE) fprintf (stderr, "can't read table measure data\n");
    253253      return (FALSE);
     
    279279  if ((status != DVO_CAT_OPEN_EMPTY) && (catalog[0].catflags & LOAD_MISS)) {
    280280    /* read Missing table data */
    281     if (!gfits_fread_ftable_data (catalog[0].missing_catalog[0].f, &ftable)) {
     281    if (!gfits_fread_ftable_data (catalog[0].missing_catalog[0].f, &ftable, FALSE)) {
    282282      if (VERBOSE) fprintf (stderr, "can't read table missing data\n");
    283283      return (FALSE);
     
    313313  if ((status != DVO_CAT_OPEN_EMPTY) && (catalog[0].catflags & LOAD_SECF)) {
    314314    /* read secfilt table data */
    315     if (!gfits_fread_ftable_data (catalog[0].secfilt_catalog[0].f, &ftable)) {
     315    if (!gfits_fread_ftable_data (catalog[0].secfilt_catalog[0].f, &ftable, FALSE)) {
    316316      if (VERBOSE) fprintf (stderr, "can't read table secfilt data\n");
    317317      return (FALSE);
  • trunk/Ohana/src/libdvo/src/dvo_photcode_ops.c

    r29182 r29938  
    557557      }
    558558    }
    559     if (entry == -1) {
    560       // entry is missing fail (no printfs in this file)
    561       free(map);
    562       return(FALSE);
    563     }
     559    // if (entry == -1) {
     560    //   // entry is missing fail (no printfs in this file)
     561    //   free(map);
     562    //   return(FALSE);
     563    // }
     564
     565    // if entry is still -1, we will skip this one (not map into the output db)
    564566    map[i] = entry;
    565567  }
  • trunk/Ohana/src/libdvo/src/fits_db.c

    r28246 r29938  
    8383    return (FALSE);
    8484  }
    85   if (!gfits_fread_ftable_data (db[0].f, &db[0].ftable)) {
     85  if (!gfits_fread_ftable_data (db[0].f, &db[0].ftable, FALSE)) {
    8686    fprintf (stderr, "can't read table data");
    8787    gfits_db_free (db);
  • trunk/Ohana/src/libdvo/src/mosaic_astrom.c

    r27435 r29938  
    1717}
    1818
     19/* what is the currently registered mosaic image? */
     20off_t *GetChipMatch () {
     21  return (ChipMatch);
     22}
     23
    1924/* given an image array and a current entry of type WRP, find matching DIS & Register it */
    2025int FindMosaicForImage (Image *images, off_t Nimages, off_t entry) {
     
    4045  if (strcmp(&images[entry].coords.ctype[4], "-WRP")) {
    4146    /* not a wrp image, do nothing */
    42     return (TRUE); /* error or not */
     47    return (entry + 1); /* error or not */
    4348  }
    4449
     
    5257    RegisterMosaic (&images[i].coords);
    5358    iDIS = i;
    54     return (TRUE);
     59    return (i + 1);
    5560  }
    5661
     
    6267    RegisterMosaic (&images[i].coords);
    6368    iDIS = i;
    64     return (TRUE);
     69    return (i + 1);
    6570  }
    6671  return (FALSE);
     
    7479  if (strcmp(&images[entry].coords.ctype[4], "-WRP")) {
    7580    /* not a wrp image, do nothing */
    76     return (TRUE); /* error or not? */
     81    return (entry + 1); /* error or not? */
    7782  }
    7883
     
    8590  RegisterMosaic (&images[N].coords);
    8691  iDIS = N;
    87   return (TRUE);
     92  return (N + 1);
    8893}
    8994
     
    165170  SortDISindex (DIStzero, DISentry, Ndis);
    166171
     172  // ChipMatch has a few possible values:
     173  // -3 : image is a mosaic (DIS)
     174  // -2 : image is an unassigned WRP image
     175  // -1 : image is not a WRP or DIS images
     176  // >= 0 : value is the mosaic seq number for this WRP image
     177
    167178  /* find all matched WRP images */
    168179  ALLOCATE (ChipMatch, off_t, Nimages);
    169180  for (i = 0; i < Nimages; i++) {
    170181    ChipMatch[i] = -1;
     182    if (!strcmp(&images[i].coords.ctype[4], "-DIS")) {
     183      ChipMatch[i] = -3;
     184      continue;
     185    }
    171186    if (strcmp(&images[i].coords.ctype[4], "-WRP")) continue;
    172187
Note: See TracChangeset for help on using the changeset viewer.