IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 25, 2012, 10:07:49 AM (14 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20120905/Ohana/src
Files:
15 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120905/Ohana/src/addstar/src/ReadStarsFITS.c

    r34426 r34468  
    606606    stars[i].measure.psfChisq   = ps1data[i].psfChisq;
    607607    stars[i].measure.psfQF      = ps1data[i].psfQF;
    608     stars[i].measure.psfQFperf  = ps1data[i].psfQFpef;
     608    stars[i].measure.psfQFperf  = ps1data[i].psfQFperf;
    609609    stars[i].measure.psfNdof    = ps1data[i].psfNdof;
    610610    stars[i].measure.psfNpix    = ps1data[i].psfNpix;
     
    687687    stars[i].measure.psfChisq   = ps1data[i].psfChisq;
    688688    stars[i].measure.psfQF      = ps1data[i].psfQF;
    689     stars[i].measure.psfQFperf  = ps1data[i].psfQFpef;
     689    stars[i].measure.psfQFperf  = ps1data[i].psfQFperf;
     690
    690691    stars[i].measure.psfNdof    = ps1data[i].psfNdof;
    691692    stars[i].measure.psfNpix    = ps1data[i].psfNpix;
     
    773774    stars[i].measure.psfChisq   = ps1data[i].psfChisq;
    774775    stars[i].measure.psfQF      = ps1data[i].psfQF;
    775     stars[i].measure.psfQFperf  = ps1data[i].psfQFpef;
     776    stars[i].measure.psfQFperf  = ps1data[i].psfQFperf;
     777
    776778    stars[i].measure.psfNdof    = ps1data[i].psfNdof;
    777779    stars[i].measure.psfNpix    = ps1data[i].psfNpix;
     
    930932    stars[i].measure.psfChisq   = ps1data[i].psfChisq;
    931933    stars[i].measure.psfQF      = ps1data[i].psfQF;
    932     stars[i].measure.psfQFperf  = ps1data[i].psfQFpef;
     934    stars[i].measure.psfQFperf  = ps1data[i].psfQFperf;
     935
    933936    stars[i].measure.psfNdof    = ps1data[i].psfNdof;
    934937    stars[i].measure.psfNpix    = ps1data[i].psfNpix;
  • branches/eam_branches/ipp-20120905/Ohana/src/getstar/src/MatchImages.c

    r28241 r34468  
    4343    tcoords.pc1_1 = tcoords.pc2_2 = 1.0;
    4444    tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
     45    tcoords.Npolyterms = 1;
    4546    strcpy (tcoords.ctype, "RA---TAN");
    4647  }
  • branches/eam_branches/ipp-20120905/Ohana/src/getstar/src/args.c

    r20985 r34468  
    4040
    4141  MagLimitUse = FALSE;
     42  MagLimitValue = 100;
    4243  if ((N = get_argument (argc, argv, "-maglim"))) {
    4344    MagLimitUse = TRUE;
     
    6061
    6162  MinMagUse = FALSE;
     63  MinMagValue = -100;
    6264  if ((N = get_argument (argc, argv, "-minmag"))) {
    6365    MinMagUse = TRUE;
  • branches/eam_branches/ipp-20120905/Ohana/src/getstar/src/select_by_region.c

    r34088 r34468  
    8282      }
    8383      if (isnan(mag)) continue;
     84      if (mag < MinMagValue) continue;
     85      if (mag > MagLimitValue) continue;
    8486
    8587      bin = (mag - MagMin) / dMag;
     
    118120    if (D > region[0].Dmax) continue;
    119121
    120     if (MagLimitUse) {
     122    // If either magnitude limit was specfied it a apply both.
     123    // If one of the limits is not used it is initialized to an unphysical value so test will succeed
     124    if (MagLimitUse || MinMagUse) {
    121125      mag = NAN;
    122126      if (needMeas) {
     
    132136      }
    133137      if (isnan(mag) || (mag > MagLimitValue)) continue;
     138      if (isnan(mag) || (mag < MinMagValue)) continue;
    134139    }
    135140
  • branches/eam_branches/ipp-20120905/Ohana/src/libohana/include/ohana.h

    r34260 r34468  
    256256int     iparse                 PROTO((int *X, int NX, char *line));
    257257int     iparse_csv             PROTO((int *X, int NX, char *line));
     258int     charparse_csv          PROTO((char *X, int NX, char *line));
     259int     charparse              PROTO((char *X, int NX, char *line));
    258260int     tparse                 PROTO((time_t *X, int NX, char *line));
    259261int     tparse_csv             PROTO((time_t *X, int NX, char *line));
  • branches/eam_branches/ipp-20120905/Ohana/src/libohana/src/string.c

    r33963 r34468  
    267267}
    268268
     269int charparse (char *X, int NX, char *line) {
     270
     271  int i;
     272  char *word;
     273
     274  word = line;
     275  for (i = 0; i < NX - 1; i++)
     276    word = _parse_nextword (word);
     277
     278  *X = word[0];
     279  return (1);
     280}
     281
     282int charparse_csv (char *X, int NX, char *line) {
     283
     284  int i;
     285  char *word;
     286
     287  word = line;
     288  for (i = 0; i < NX - 1; i++)
     289    word = _parse_nextword_csv (word);
     290 
     291  if (word[0] == '"') word[0] = word[1];
     292  if (word[0] == ',') {
     293      *X = 0;
     294      return 1;
     295  }
     296
     297  *X = word[0];
     298  return (1);
     299}
     300
    269301int tparse (time_t *X, int NX, char *line) {
    270302
  • branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.astro

  • branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/read_vectors.c

    r33662 r34468  
    2222
    2323// vector types
    24 enum {COLTYPE_NONE, COLTYPE_FLT, COLTYPE_INT, COLTYPE_TIME};
     24enum {COLTYPE_NONE, COLTYPE_FLT, COLTYPE_INT, COLTYPE_TIME, COLTYPE_CHAR};
    2525
    2626int read_vectors (int argc, char **argv) {
     
    101101      if (!strcasecmp(ptr, "float")) { coltype[i] = COLTYPE_FLT; }
    102102      if (!strcasecmp(ptr, "int"))   { coltype[i] = COLTYPE_INT; }
     103      if (!strcasecmp(ptr, "char"))  { coltype[i] = COLTYPE_CHAR; }
    103104      if (!strcasecmp(ptr, "time"))  { coltype[i] = COLTYPE_TIME; }
    104105      if (!coltype[i]) goto bad_colname;
     
    143144  NELEM = 1000;
    144145  for (i = 0; i < Nvec; i++) {
    145     if (coltype[i] == COLTYPE_INT) {
     146    if ((coltype[i] == COLTYPE_INT) || (coltype[i] == COLTYPE_CHAR)) {
    146147      ResetVector (vec[i], OPIHI_INT, NELEM);
    147148    } else {
     
    195196      for (i = 0; i < Nvec; i++) {
    196197        int ivalue;
     198        char cvalue;
    197199        double dvalue;
    198200        time_t tvalue;
     
    203205            readStatus = IsCSV ? iparse_csv (&ivalue, col[i], c0) : iparse (&ivalue, col[i], c0);
    204206            vec[i][0].elements.Int[Nelem] = readStatus ? ivalue : 0;
     207            break;
     208          case COLTYPE_CHAR:
     209            readStatus = IsCSV ? charparse_csv (&cvalue, col[i], c0) : charparse (&cvalue, col[i], c0);
     210            vec[i][0].elements.Int[Nelem] = readStatus ? cvalue : 0;
    205211            break;
    206212          case COLTYPE_FLT:
  • branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/reindex.c

    r33662 r34468  
    55int reindex (int argc, char **argv) {
    66 
    7   int  i, Npts, Nmax;
     7  int  i, Nmax, N;
    88  Vector *ivec, *ovec, *xvec;
    99
    1010  ivec = ovec = xvec = NULL;
    11   Npts = 0;
     11  int Npts = 0;
     12
     13  int KEEP_UNMATCH = FALSE;
     14  if ((N = get_argument (argc, argv, "-keep-unmatched"))) {
     15    remove_argument (N, &argc, argv);
     16    KEEP_UNMATCH = TRUE;
     17  }
    1218
    1319  if (argc != 6) goto usage;
     
    2228
    2329  // ovec matches ivec in type and xvec in size (xvec need not have all ivec elements, and may have duplicates
     30  int NPTS = xvec[0].Nelements;
    2431  ResetVector (ovec, ivec->type, xvec[0].Nelements);
    2532
     
    3138    opihi_int *vx = xvec[0].elements.Int;
    3239    for (Npts = i = 0; i < xvec[0].Nelements; i++, vx++) {
    33       if (*vx == -1) continue;
    34       if (*vx < 0) ESCAPE("unexpected value in index: %d (%d)\n", *vx, i);
     40      if (Npts >= NPTS) {
     41        NPTS += 2000;
     42        REALLOCATE (ovec[0].elements.Flt, opihi_flt, NPTS);
     43      }
     44      if (*vx < 0) {
     45        if (KEEP_UNMATCH) {
     46          ovec[0].elements.Flt[Npts] = NAN;
     47          Npts++;
     48        }
     49        continue;
     50      }
    3551      if (*vx > Nmax) ESCAPE("unexpected value in index: %d (%d)\n", *vx, i);
    3652      ovec[0].elements.Flt[Npts] = vi[*vx];
     
    4258    opihi_int *vx = xvec[0].elements.Int;
    4359    for (Npts = i = 0; i < xvec[0].Nelements; i++, vx++) {
    44       if (*vx == -1) continue;
    45       if (*vx < 0) ESCAPE("unexpected value in index: %d (%d)\n", *vx, i);
     60      if (Npts >= NPTS) {
     61        NPTS += 2000;
     62        REALLOCATE (ovec[0].elements.Int, opihi_int, NPTS);
     63      }
     64      if (*vx < 0) {
     65        if (KEEP_UNMATCH) {
     66          ovec[0].elements.Flt[Npts] = -1;
     67          Npts++;
     68        }
     69        continue;
     70      }
    4671      if (*vx > Nmax) ESCAPE("unexpected value in index: %d (%d)\n", *vx, i);
    4772      ovec[0].elements.Int[Npts] = vi[*vx];
     
    6085usage:
    6186    gprint (GP_ERR, "USAGE: reindex (out) = (in) using (index)\n");
    62     gprint (GP_ERR, "  creates a new vectors (out) from (in) based on sequence in (index)\n");
     87    gprint (GP_ERR, "  Creates a new vector (out) from (in) based on sequence in (index)\n");
     88    gprint (GP_ERR, "  output[i] = input[index[i]]\n");
     89    gprint (GP_ERR, "  If -keep-unmatched is provided, elements of index with negative values will be set to NaN / -1,\n");
     90    gprint (GP_ERR, "    otherwise they will be skipped in the output.\n");
     91    gprint (GP_ERR, "  The output vector has the type of the input vector and the length of the index (if -keep-unmatched).\n");
     92    gprint (GP_ERR, "  The index vector may have duplicates\n");
    6393    return (FALSE);
    6494}
  • branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/subset.c

    r30610 r34468  
    1313  Npts = 0;
    1414
     15  if (argc < 6) {
     16    gprint (GP_ERR, "SYNTAX: subset vec = vec [if/where] (logic expression)\n");
     17    return (FALSE);
     18  }
     19
    1520  valid = TRUE;
    16   valid &= (argc >= 6);
    1721  valid &= !strcmp(argv[2], "=");
    1822  valid &= !strcmp(argv[4], "if") || !strcmp (argv[4], "where");
  • branches/eam_branches/ipp-20120905/Ohana/src/opihi/dvo/Makefile

    r33662 r34468  
    6767$(SRC)/lightcurve.$(ARCH).o             \
    6868$(SRC)/mextract.$(ARCH).o               \
     69$(SRC)/mmatch.$(ARCH).o         \
    6970$(SRC)/mmextract.$(ARCH).o              \
    7071$(SRC)/objectcoverage.$(ARCH).o         \
  • branches/eam_branches/ipp-20120905/Ohana/src/opihi/dvo/avmatch.c

    r34405 r34468  
    203203      Npts = j;
    204204
    205       if (Ncat == -1) continue;
    206       if (Ncat == -2) continue;
     205      if (Ncat == -1) continue; // this point is not in this catalog file
     206      if (Ncat == -2) continue; // no matches to this point
    207207
    208208      m = catalog.average[Ncat].measureOffset;
  • branches/eam_branches/ipp-20120905/Ohana/src/opihi/dvo/init.c

    r33662 r34468  
    4242int lightcurve      PROTO((int, char **));
    4343int mextract        PROTO((int, char **));
     44int mmatch          PROTO((int, char **));
    4445int mmextract       PROTO((int, char **));
    4546int objectcoverage  PROTO((int, char **));
     
    9798  {1, "lightcurve",  lightcurve,   "extract lightcurve for a star"},
    9899  {1, "mextract",    mextract,     "extract measure data values"},
     100  {1, "mmatch",      mmatch,       "extract measure data values matched to RA,DEC points"},
    99101  {1, "mmextract",   mmextract,    "extract joined measurements"},
    100102  {1, "objectcoverage", objectcoverage, "plot catalog boundaries"},
  • branches/eam_branches/ipp-20120905/Ohana/src/relastro/src/UpdateObjects.c

    r34423 r34468  
    113113        }
    114114
    115         //outlier rejection
     115        // outlier rejection
    116116        if (FlagOutlier && (measure[k].dbFlags & ID_MEAS_POOR_ASTROM)) {
    117117          measure[k].dbFlags &= ~ID_MEAS_USED_OBJ;
  • branches/eam_branches/ipp-20120905/Ohana/src/relphot/src/StarOps.c

    r34427 r34468  
    651651
    652652          // get the zero point for the selected image
    653           float zp = Mcal + Mmos + Mgrid + PhotZeroPoint (&catalog[Nc].measure[m], &catalog[Nc].average[j], &catalog[Nc].secfilt[j*Nsecfilt]);
     653          float zp = PhotZeroPoint (&catalog[Nc].measure[m], &catalog[Nc].average[j], &catalog[Nc].secfilt[j*Nsecfilt]) - (Mcal + Mmos + Mgrid);
    654654
    655655          // flux_cgs : erg sec^1 cm^-2 Hz^-1
Note: See TracChangeset for help on using the changeset viewer.