IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35102


Ignore:
Timestamp:
Feb 6, 2013, 3:22:03 PM (13 years ago)
Author:
eugene
Message:

add suppport for Xfix,Yfix; code to get skyregions by cpt names

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

Legend:

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

    r34844 r35102  
    367367  float          Xccd;
    368368  float          Yccd;
     369  float          Xfix;
     370  float          Yfix;
    369371  float          dt;
    370372  int            t;
     
    658660SkyTable  *SkyTableLoadOptimal     PROTO((char *catdir, char *SKYFILE, char *GSCFILE, int readwrite, int depth, int VERBOSE));
    659661int        SkyTableSetDepth        PROTO((SkyTable *sky, int depth));
     662SkyList   *SkyRegionByCPT          PROTO((SkyTable *table, char *filename));
    660663SkyList   *SkyRegionByPoint        PROTO((SkyTable *table, int depth, double ra, double dec));
    661664SkyList   *SkyListByPoint          PROTO((SkyTable *table, double ra, double dec));
  • trunk/Ohana/src/libdvo/include/dvodb.h

    r34749 r35102  
    122122      MEAS_XCCD_ERR,
    123123      MEAS_YCCD_ERR,
    124       MEAS_XOFF,
    125       MEAS_YOFF,
     124      MEAS_XFIX,
     125      MEAS_YFIX,
    126126      MEAS_POS_SYS_ERR,
    127127      MEAS_XMOSAIC,
     
    250250      IMAGE_Y_ERR_SYS,
    251251      IMAGE_MAG_ERR_SYS,
     252      IMAGE_UBERCAL_DIST,
    252253      IMAGE_NFIT_PHOTOM,
    253254      IMAGE_NFIT_ASTROM,
  • trunk/Ohana/src/libdvo/src/HostTable.c

    r33963 r35102  
    243243  Nmax ++;
    244244
     245  // need the list of connected hosts for exit test below
     246  int Nrunning = 0;
     247  for (i = 0; i < table->Nhosts; i++) {
     248    if (!table->hosts[i].pid) continue; // any unconnected hosts should be skipped
     249    Nrunning ++;
     250  }
     251
    245252  int Nfound = 0;
    246253
     
    262269    // we have some sockets to check, check sockets for all hosts
    263270    for (i = 0; (status > 0) && (i < table->Nhosts); i++) {
     271      if (!table->hosts[i].pid) continue; // any unconnected hosts should be skipped
     272
    264273      if (FALSE && FD_ISSET (table->hosts[i].stdio[HOST_STDIN], &wtSet)) {
    265274        // this host is waiting for input : this is an error, so exit
     
    268277      }
    269278     
    270       if (FD_ISSET (table->hosts[i].stdio[HOST_STDOUT], &rdSet)) {
     279      if ((table->hosts[i].stdio[HOST_STDOUT] > 0) && FD_ISSET (table->hosts[i].stdio[HOST_STDOUT], &rdSet)) {
    271280        // this host has waiting output : read to buffer, and dump if necessary
    272281        ReadtoIOBuffer (&table->hosts[i].stdout, table->hosts[i].stdio[HOST_STDOUT]);
     
    282291      }
    283292
    284       if (FD_ISSET (table->hosts[i].stdio[HOST_STDERR], &rdSet)) {
     293      if ((table->hosts[i].stdio[HOST_STDERR] > 0) && FD_ISSET (table->hosts[i].stdio[HOST_STDERR], &rdSet)) {
    285294        // this host has waiting output : read to buffer, and dump if necessary
    286295        ReadtoIOBuffer (&table->hosts[i].stderr, table->hosts[i].stdio[HOST_STDERR]);
     
    361370      }
    362371      Nfound ++;
    363       if (Nfound == table->Nhosts) goto escape; // we've harvested all jobs
     372      if (Nfound == Nrunning) goto escape; // we've harvested all jobs
    364373    }
    365374  }
  • trunk/Ohana/src/libdvo/src/dbExtractImages.c

    r31635 r35102  
    328328      break;
    329329
     330    case IMAGE_UBERCAL_DIST:
     331      value.Int = image[N].ubercalDist;
     332      break;
     333
    330334    case IMAGE_NFIT_PHOTOM:
    331335      value.Int = image[N].nFitPhotom;
  • trunk/Ohana/src/libdvo/src/dbExtractMeasures.c

    r34749 r35102  
    443443# endif
    444444      break;
    445     case MEAS_XOFF: /* OK */
    446       value.Flt = measure[0].Xoff;
    447       break;
    448     case MEAS_YOFF: /* OK */
    449       value.Flt = measure[0].Yoff;
     445    case MEAS_XFIX: /* OK */
     446      value.Flt = measure[0].Xfix;
     447      break;
     448    case MEAS_YFIX: /* OK */
     449      value.Flt = measure[0].Yfix;
    450450      break;
    451451    case MEAS_XCCD_ERR: /* OK */
  • trunk/Ohana/src/libdvo/src/dbFields.c

    r34749 r35102  
    217217  if (!strcasecmp (fieldName, "XCCD:ERR"))       ESCAPE (MEAS_XCCD_ERR,       MAG_NONE, OPIHI_FLT);
    218218  if (!strcasecmp (fieldName, "YCCD:ERR"))       ESCAPE (MEAS_YCCD_ERR,       MAG_NONE, OPIHI_FLT);
    219   if (!strcasecmp (fieldName, "XOFF"))           ESCAPE (MEAS_XOFF,           MAG_NONE, OPIHI_FLT);
    220   if (!strcasecmp (fieldName, "YOFF"))           ESCAPE (MEAS_YOFF,           MAG_NONE, OPIHI_FLT);
     219  if (!strcasecmp (fieldName, "XFIX"))           ESCAPE (MEAS_XFIX,           MAG_NONE, OPIHI_FLT);
     220  if (!strcasecmp (fieldName, "YFIX"))           ESCAPE (MEAS_YFIX,           MAG_NONE, OPIHI_FLT);
    221221  if (!strcasecmp (fieldName, "POS_SYS_ERR"))    ESCAPE (MEAS_POS_SYS_ERR,    MAG_NONE, OPIHI_FLT);
    222222  if (!strcasecmp (fieldName, "XMOSAIC"))        ESCAPE (MEAS_XMOSAIC,        MAG_NONE, OPIHI_FLT);
     
    473473  if (!strcasecmp (fieldName, "dY_SYS"  )) ESCAPE (IMAGE_Y_ERR_SYS,  MAG_NONE, OPIHI_FLT);
    474474  if (!strcasecmp (fieldName, "dM_SYS"  )) ESCAPE (IMAGE_MAG_ERR_SYS,MAG_NONE, OPIHI_FLT);
     475
     476  if (!strcasecmp (fieldName, "UBERCAL_DIST")) ESCAPE (IMAGE_UBERCAL_DIST,MAG_NONE, OPIHI_INT);
     477  if (!strcasecmp (fieldName, "UCDIST")) ESCAPE (IMAGE_UBERCAL_DIST,MAG_NONE, OPIHI_INT);
     478
    475479  if (!strcasecmp (fieldName, "NFIT_PHOTOM")) ESCAPE (IMAGE_NFIT_PHOTOM,MAG_NONE, OPIHI_INT);
    476480  if (!strcasecmp (fieldName, "NFIT_ASTROM")) ESCAPE (IMAGE_NFIT_ASTROM,MAG_NONE, OPIHI_INT);
  • trunk/Ohana/src/libdvo/src/dvo_catalog.c

    r34749 r35102  
    161161 measure->Xccd      = NAN;
    162162 measure->Yccd      = NAN;
    163  measure->Xoff      = 0.0;
    164  measure->Yoff      = 0.0;
     163 measure->Xfix      = NAN;
     164 measure->Yfix      = NAN;
    165165
    166166 measure->Sky       = NAN;
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V4.c

    r34749 r35102  
    3131    out[i].Xccd       = in[i].Xccd;
    3232    out[i].Yccd       = in[i].Yccd;
    33     out[i].Xoff       = in[i].Xoff;
    34     out[i].Yoff       = in[i].Yoff;
     33    out[i].Xfix       = in[i].Xfix;
     34    out[i].Yfix       = in[i].Yfix;
    3535    out[i].Sky        = in[i].Sky;
    3636    out[i].dSky       = in[i].dSky;
     
    9494    out[i].Xccd       = in[i].Xccd;
    9595    out[i].Yccd       = in[i].Yccd;
     96    out[i].Xfix       = in[i].Xfix;
     97    out[i].Yfix       = in[i].Yfix;
    9698    out[i].Sky        = in[i].Sky;
    9799    out[i].dSky       = in[i].dSky;
  • trunk/Ohana/src/libdvo/src/dvo_tiny_values.c

    r34088 r35102  
    2020  measureT[0].Xccd       = measure[0].Xccd;
    2121  measureT[0].Yccd       = measure[0].Yccd;
     22  measureT[0].Xfix       = measure[0].Xfix;
     23  measureT[0].Yfix       = measure[0].Yfix;
    2224  measureT[0].t          = measure[0].t;
    2325  measureT[0].dt         = measure[0].dt;
  • trunk/Ohana/src/libdvo/src/skyregion_ops.c

    r33649 r35102  
    77   If the region at the given depth is populated with an image table, then 'image' is TRUE.
    88   I have defined no accelerators other than the table hierarchy */
     9
     10/* given /path/file.ext return pointer to file.ext */
     11char *filebasename_ptr (char *name) {
     12 
     13  char *c;
     14
     15  c = strrchr (name, '/');
     16  if (c) return (c+1);
     17  return name;
     18}
     19
     20/* find region which matches the named file */
     21SkyList *SkyRegionByCPT (SkyTable *table, char *filename) {
     22 
     23  int i;
     24  SkyList *list;
     25
     26  ALLOCATE (list, SkyList, 1);
     27  ALLOCATE (list[0].regions,  SkyRegion *, 1);
     28  ALLOCATE (list[0].filename,  char *, 1);
     29  list[0].Nregions = 0;
     30  list[0].ownElements = FALSE; // this list is only holding a view to the elements
     31  strcpy (list[0].hosts, table[0].hosts);
     32
     33  // i'd like to select the region from the given cpt filename, but
     34  // in a parallel environment, the filename does not match the canonical name
     35  // i select the basename to match
     36
     37  // we might have been given foo.cpt or just foo:
     38  char *tgtbase = filebasename_ptr (filename);
     39  int Ntgtbase = strlen(tgtbase);
     40  if ((Ntgtbase > 4) && (!strcmp (&tgtbase[Ntgtbase - 4], ".cpt"))) {
     41    Ntgtbase -= 4;
     42  }
     43
     44  for (i = 0; i < table[0].Nregions; i++) {
     45    char *regbase = filebasename_ptr (table[0].regions[i].name);
     46    if (strncmp (regbase, tgtbase, Ntgtbase)) continue;
     47
     48    list[0].regions[0] = &table[0].regions[i];
     49    list[0].filename[0] = table[0].filename[i];
     50    list[0].Nregions = 1;
     51    return (list);
     52  }
     53 
     54  free (list[0].regions);
     55  free (list[0].filename);
     56  free (list);
     57  return NULL;
     58}
    959
    1060/* find region which overlaps c at given depth (-1 : populated ) */
Note: See TracChangeset for help on using the changeset viewer.