IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2011, 1:19:27 PM (15 years ago)
Author:
eugene
Message:

updates from eam branch

Location:
trunk/Ohana/src/opihi
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.astro/region.c

    r30611 r31160  
    55  double Ra, Dec, Radius;
    66  float dx, dy;
    7   int N, kapa, NoClear;
     7  int N, kapa, NoClear, dXpix, dYpix;
    88  char *name;
    99  Graphdata graphmode;
     
    2727    remove_argument (N, &argc, argv);
    2828    KapaGetImageCoords (kapa, &graphmode.coords);
    29     KapaGetImageRange (kapa, &graphmode.xmin, &graphmode.xmax, &graphmode.ymax, &graphmode.ymin);
     29    KapaGetImageRange (kapa, &graphmode.xmin, &graphmode.xmax, &graphmode.ymax, &graphmode.ymin, &dXpix, &dYpix);
    3030
    3131    set_variable ("XMIN", graphmode.xmin);
  • trunk/Ohana/src/opihi/cmd.data/densify.c

    r29938 r31160  
    11# include "data.h"
     2
     3# define CHECKVAL(ARG) if (!isfinite(ARG)) { gprint (GP_ERR, "illegal value for %s: %f\n", #ARG, ARG); return (FALSE); }
    24
    35int densify (int argc, char **argv) {
    46
    5   int i, Nx, Ny, Xb, Yb, Normalize, N;
    6   float Xmin, Xmax, dX, Ymin, Ymax, dY;
     7  int i, Nx, Ny, Xb, Yb, Normalize, N, Xpix, Ypix, good, UseGraph;
     8  double Xmin, Xmax, dX, Ymin, Ymax, dY;
    79  float *val;
    810  Buffer *bf;
     
    1618  }
    1719
    18   if (argc != 10) {
     20  UseGraph = FALSE;
     21  if ((N = get_argument (argc, argv, "-graph"))) {
     22    remove_argument (N, &argc, argv);
     23    UseGraph = TRUE;
     24  }
     25
     26  good = UseGraph ? (argc == 4) : (argc == 10);
     27  if (!good) {
    1928    gprint (GP_ERR, "USAGE: densify buffer x y Xmin Xmax dX Ymin Ymax dY\n");
     29    gprint (GP_ERR, "   OR: densify buffer x y -graph\n");
    2030    return (FALSE);
    2131  }
     
    3040  REQUIRE_VECTOR_FLT (vy, FALSE);
    3141
    32   Xmin = atof (argv[4]);
    33   Xmax = atof (argv[5]);
    34   dX   = atof (argv[6]);
     42  if (UseGraph) {
     43    int kapa;
     44    Graphdata graphmode;
     45    if (!GetGraph (&graphmode, &kapa, NULL)) return (FALSE);
     46    KapaGetImageRange (kapa, &Xmin, &Xmax, &Ymax, &Ymin, &Xpix, &Ypix);
     47    Xmax = graphmode.xmax;
     48    Xmin = graphmode.xmin;
     49    Ymax = graphmode.ymax;
     50    Ymin = graphmode.ymin;
     51    dX = (Xmax - Xmin) / (Xpix - 1);
     52    dY = (Ymax - Ymin) / (Ypix - 1);
     53  } else {
     54    Xmin = atof (argv[4]);
     55    Xmax = atof (argv[5]);
     56    dX   = atof (argv[6]);
    3557
    36   Ymin = atof (argv[7]);
    37   Ymax = atof (argv[8]);
    38   dY   = atof (argv[9]);
     58    Ymin = atof (argv[7]);
     59    Ymax = atof (argv[8]);
     60    dY   = atof (argv[9]);
     61  }
     62
     63  CHECKVAL(Xmin);
     64  CHECKVAL(Xmax);
     65  CHECKVAL(dX);
     66
     67  CHECKVAL(Ymin);
     68  CHECKVAL(Ymax);
     69  CHECKVAL(dY);
    3970
    4071  Nx = (Xmax - Xmin) / dX + 1;
  • trunk/Ohana/src/opihi/cmd.data/fit1d.c

    r27817 r31160  
    4242
    4343  if (argc != 4) {
    44     gprint (GP_ERR, "USAGE: fit x y order [-dy wt] [-quiet/-q] [-clip Nsigma Niter]\n");
     44    gprint (GP_ERR, "USAGE: fit1d x y order [-dy wt] [-quiet/-q] [-clip Nsigma Niter]\n");
    4545    return (FALSE);
    4646  }
  • trunk/Ohana/src/opihi/cmd.data/fit2d.c

    r29001 r31160  
    4848
    4949  if (argc != 5) {
    50     gprint (GP_ERR, "USAGE: fit x y z order [-dz wt]\n");
     50    gprint (GP_ERR, "USAGE: fit2d x y z order [-dz wt] [-quiet/-q] [-clip Nsigma Niter]\n");
    5151    return (FALSE);
    5252  }
  • trunk/Ohana/src/opihi/cmd.data/histogram.c

    r27817 r31160  
    6161    opihi_int *V = xvec[0].elements.Int;
    6262    for (i = 0; i < xvec[0].Nelements; i++, V++) {
    63       if (isnan(*V)) continue;
    6463      bin = MIN (MAX (0, (*V - start) / delta), Nbins - 1);
    6564      OUT[bin]++;
  • trunk/Ohana/src/opihi/cmd.data/limits.c

    r30610 r31160  
    33int limits (int argc, char **argv) {
    44
    5   int N, APPLY;
     5  int N, APPLY, dX, dY;
    66  int kapa;
    77  char *name;
     
    2828  if ((N = get_argument (argc, argv, "-image"))) {
    2929    remove_argument (N, &argc, argv);
    30     KapaGetImageRange (kapa, &graphmode.xmin, &graphmode.xmax, &graphmode.ymax, &graphmode.ymin);
     30    KapaGetImageRange (kapa, &graphmode.xmin, &graphmode.xmax, &graphmode.ymax, &graphmode.ymin, &dX, &dY);
    3131
    3232    set_variable ("XMIN", graphmode.xmin);
     
    3434    set_variable ("YMIN", graphmode.ymin);
    3535    set_variable ("YMAX", graphmode.ymax);
     36
     37    set_variable ("KAPA_XMIN", graphmode.xmin);
     38    set_variable ("KAPA_XMAX", graphmode.xmax);
     39    set_variable ("KAPA_YMIN", graphmode.ymin);
     40    set_variable ("KAPA_YMAX", graphmode.ymax);
     41
     42    set_variable ("KAPA_XPIX", dX);
     43    set_variable ("KAPA_YPIX", dY);
    3644
    3745    // if (!NoClear) KapaClearSections (kapa);
  • trunk/Ohana/src/opihi/cmd.data/section.c

    r29938 r31160  
    6868  if ((argc == 1) && (action == NONE)) {
    6969    KapaGetSection (kapa, "*");
    70     gprint (GP_ERR, "USAGE: section name [x y dx dy] [options]\n");
     70    gprint (GP_ERR, "USAGE: section name [x y dx dy] or [options]\n");
    7171    gprint (GP_ERR, "OPTIONS: -list   : show properties of all sections\n");
    7272    gprint (GP_ERR, "         -up     : move section up in display stack\n");
     
    7676    gprint (GP_ERR, "         -imtool (position) : set location of image zoom / status box\n");
    7777    gprint (GP_ERR, "                 (position may be: -x, +x, -y, +y, none)\n");
     78    gprint (GP_ERR, "         -image  : define section upper-right corner so image fills the section\n");
     79    gprint (GP_ERR, "         -bg (color) : set background color (see style -c help for color choices)\n");
     80   
    7881    return (TRUE);
    7982  }
    8083 
     84  if ((argc != 2) && (action != NONE)) {
     85      gprint (GP_ERR, "can only use dash options without numbers\n");
     86      return (FALSE);
     87  }
     88
    8189  if (argc == 2) {
    8290    /* select / show section */
  • trunk/Ohana/src/opihi/dvo/dbExtractImages.c

    r30612 r31160  
    5959  time_t t;
    6060  dbValue value;
     61  off_t Nmosaic;
    6162
    6263  value.Flt = NAN;
     
    236237      value.Flt = image[N].fwhm_y / 25.0;
    237238      break;
     239
     240    case IMAGE_FWHM_MEDIAN:
     241      if (!(Nmosaic = FindMosaicForImage (image, Nimage, N))) return value;
     242      Nmosaic --; // XXX kind of a hack: FindMosaicForImage returns 0 or the mosaic seq number + 1
     243      value.Flt = (image[Nmosaic].fwhm_x + image[Nmosaic].fwhm_y) / 50.0;
     244      break;
     245    case IMAGE_FWHM_MAJ_MEDIAN:
     246      if (!(Nmosaic = FindMosaicForImage (image, Nimage, N))) return value;
     247      Nmosaic --; // XXX kind of a hack: FindMosaicForImage returns 0 or the mosaic seq number + 1
     248      value.Flt = image[Nmosaic].fwhm_x / 25.0;
     249      break;
     250    case IMAGE_FWHM_MIN_MEDIAN:
     251      if (!(Nmosaic = FindMosaicForImage (image, Nimage, N))) return value;
     252      Nmosaic --; // XXX kind of a hack: FindMosaicForImage returns 0 or the mosaic seq number + 1
     253      value.Flt = image[Nmosaic].fwhm_y / 25.0;
     254      break;
     255
    238256    case IMAGE_TRATE:
    239257      value.Flt = image[N].trate / 10000.0;
  • trunk/Ohana/src/opihi/dvo/dbFields.c

    r30612 r31160  
    395395  if (!strcasecmp (fieldName, "cerror"   )) ESCAPE (IMAGE_CERROR,    MAG_NONE, OPIHI_FLT);
    396396
    397   if (!strcasecmp (fieldName, "FWHM"     )) ESCAPE (IMAGE_FWHM,      MAG_NONE, OPIHI_FLT);
    398   if (!strcasecmp (fieldName, "FWHM_MAJ" )) ESCAPE (IMAGE_FWHM_MAJ,  MAG_NONE, OPIHI_FLT);
    399   if (!strcasecmp (fieldName, "FWHM_MIN" )) ESCAPE (IMAGE_FWHM_MIN,  MAG_NONE, OPIHI_FLT);
     397  if (!strcasecmp (fieldName, "FWHM"       )) ESCAPE (IMAGE_FWHM,      MAG_NONE, OPIHI_FLT);
     398  if (!strcasecmp (fieldName, "FWHM_MAJ"   )) ESCAPE (IMAGE_FWHM_MAJ,  MAG_NONE, OPIHI_FLT);
     399  if (!strcasecmp (fieldName, "FWHM_MIN"   )) ESCAPE (IMAGE_FWHM_MIN,  MAG_NONE, OPIHI_FLT);
     400  if (!strcasecmp (fieldName, "FWHM_MAJOR" )) ESCAPE (IMAGE_FWHM_MAJ,  MAG_NONE, OPIHI_FLT);
     401  if (!strcasecmp (fieldName, "FWHM_MINOR" )) ESCAPE (IMAGE_FWHM_MIN,  MAG_NONE, OPIHI_FLT);
     402
     403  if (!strcasecmp (fieldName, "FWHM_MEDIAN"    ))   ESCAPE (IMAGE_FWHM_MEDIAN,      MAG_NONE, OPIHI_FLT);
     404  if (!strcasecmp (fieldName, "FWHM_MAJ_MEDIAN"))   ESCAPE (IMAGE_FWHM_MAJ_MEDIAN,  MAG_NONE, OPIHI_FLT);
     405  if (!strcasecmp (fieldName, "FWHM_MIN_MEDIAN"))   ESCAPE (IMAGE_FWHM_MIN_MEDIAN,  MAG_NONE, OPIHI_FLT);
     406  if (!strcasecmp (fieldName, "FWHM_MAJOR_MEDIAN")) ESCAPE (IMAGE_FWHM_MAJ_MEDIAN,  MAG_NONE, OPIHI_FLT);
     407  if (!strcasecmp (fieldName, "FWHM_MINOR_MEDIAN")) ESCAPE (IMAGE_FWHM_MIN_MEDIAN,  MAG_NONE, OPIHI_FLT);
     408
    400409  if (!strcasecmp (fieldName, "trate"    )) ESCAPE (IMAGE_TRATE,     MAG_NONE, OPIHI_FLT);
    401410
  • trunk/Ohana/src/opihi/dvo/imextract.c

    r30612 r31160  
    197197    gprint (GP_ERR, "  cerror : astrometric scatter\n");
    198198
    199     gprint (GP_ERR, "  FWHM : mean fwhm of exposure\n");
    200     gprint (GP_ERR, "  FWHM_MAJ : fwhm of major axis\n");
    201     gprint (GP_ERR, "  FWHM_MIN : fwhm of minor axis\n");
     199    gprint (GP_ERR, "  -- Note: the follow FWHM are from the PSF model --\n");
     200    gprint (GP_ERR, "  FWHM : mean fwhm of chip\n");
     201    gprint (GP_ERR, "  FWHM_MAJ : fwhm of chip (major axis)\n");
     202    gprint (GP_ERR, "  FWHM_MIN : fwhm of chip (minor axis)\n");
     203    gprint (GP_ERR, "  FWHM_MAJOR : fwhm of chip (major axis)\n");
     204    gprint (GP_ERR, "  FWHM_MININ : fwhm of chip (minor axis)\n");
     205
     206    gprint (GP_ERR, "  FWHM_MEDIAN : median fwhm of exposure\n");
     207    gprint (GP_ERR, "  FWHM_MAJ_MEDIAN : median fwhm of major axis\n");
     208    gprint (GP_ERR, "  FWHM_MIN_MEDIAN : median fwhm of minor axis\n");
     209    gprint (GP_ERR, "  FWHM_MAJOR_MEDIAN : median fwhm of major axis\n");
     210    gprint (GP_ERR, "  FWHM_MININ_MEDIAN : median fwhm of minor axis\n");
     211
    202212    gprint (GP_ERR, "  trate : tracking rate for TDI images\n");
    203213
  • trunk/Ohana/src/opihi/dvo/skycoverage.c

    r29540 r31160  
    55int skycoverage (int argc, char **argv) {
    66
    7   int WITH_MOSAIC, SOLO_MOSAIC;
     7  int WITH_MOSAIC, SOLO_MOSAIC, ShowDensity;
    88  off_t i, Nimage;
    99  int N, status, TimeSelect, ByName, xs, ys;
     
    6060  }
    6161
     62  ShowDensity = FALSE;
     63  if ((N = get_argument (argc, argv, "-density"))) {
     64    remove_argument (N, &argc, argv);
     65    ShowDensity = TRUE;
     66  }
     67
    6268  ByName = FALSE;
    6369  if ((N = get_argument (argc, argv, "-name"))) {
     
    141147  if (argc != 3) {
    142148    gprint (GP_ERR, "USAGE: skycoverage (buffer) (Npts)\n");
    143     gprint (GP_ERR, "  options: [-scale pixscale] [-center ra dec] [-size Nx Nx] [-proj projection] [-time start range] [-trange start stop] [-name name] [-photcode name] [+mosaic] [-mosaic]\n");
     149    gprint (GP_ERR, "  options: [-scale pixscale] [-center ra dec] [-size Nx Nx] [-proj projection] [-time start range] [-trange start stop] [-name name] [-photcode name] [+mosaic] [-mosaic] [-density]\n");
    144150    gprint (GP_ERR, "       (buffer) saves bitmapped image\n");
    145151    gprint (GP_ERR, "       (Npts) gives the number of test points per image in each dimension\n");
     
    148154    gprint (GP_ERR, "       -size (Nx) (Ny)    : specifies the size of the image [360/scale, 180/scale]\n");
    149155    gprint (GP_ERR, "       -proj (projection) : specifies the projection choice [AIT]\n");
     156    gprint (GP_ERR, "       -density           : create image with relative density (else binary on/off)\n");
    150157    gprint (GP_ERR, "       note: we need 64800 / (pixscale)^2 pixels to represent the sky\n");
    151158    return (FALSE);
     
    186193
    187194  V = (float *)buf[0].matrix.buffer;
    188   bzero (V, Nx*Ny*sizeof(float));
    189195
    190196  for (ys = 0; ys < Ny; ys++) {
     
    194200      status &= (r <= 360);
    195201      if (status) {
    196         V[ys*Nx + xs] = 2;
     202        V[ys*Nx + xs] = ShowDensity ?  0 : 2;
     203      } else {
     204        V[ys*Nx + xs] = ShowDensity ? -1 : 0;
    197205      }
    198206    }
     
    249257          xs = (int)Xs;
    250258          ys = (int)Ys;
    251           V[ys*Nx + xs] = 1;
     259          if (ShowDensity) {
     260              V[ys*Nx + xs] += 1;
     261          } else {
     262              V[ys*Nx + xs] = 1;
     263          }
    252264        }
    253265      }
  • trunk/Ohana/src/opihi/include/dvoshell.h

    r30614 r31160  
    179179      IMAGE_TIME,
    180180      IMAGE_FWHM,
     181      IMAGE_FWHM_MEDIAN,
    181182      IMAGE_EXPTIME,
    182183      IMAGE_NSTAR,
     
    200201      IMAGE_FWHM_MAJ,
    201202      IMAGE_FWHM_MIN,
     203      IMAGE_FWHM_MAJ_MEDIAN,
     204      IMAGE_FWHM_MIN_MEDIAN,
    202205      IMAGE_TRATE,
    203206      IMAGE_IMAGE_ID,
  • trunk/Ohana/src/opihi/lib.data/graphtools.c

    r20936 r31160  
    5959  set_variable ("YMIN", graphmode[0].ymin);
    6060  set_variable ("YMAX", graphmode[0].ymax);
     61
     62  set_variable ("KAPA_XMIN", graphmode[0].xmin);
     63  set_variable ("KAPA_XMAX", graphmode[0].xmax);
     64  set_variable ("KAPA_YMIN", graphmode[0].ymin);
     65  set_variable ("KAPA_YMAX", graphmode[0].ymax);
    6166}
    6267
     
    95100  SetGraph (graphmode);
    96101
     102  set_variable ("KAPA_XMIN", graphmode[0].xmin);
     103  set_variable ("KAPA_XMAX", graphmode[0].xmax);
     104  set_variable ("KAPA_YMIN", graphmode[0].ymin);
     105  set_variable ("KAPA_YMAX", graphmode[0].ymax);
     106
    97107  set_variable ("XMIN", graphmode[0].xmin);
    98108  set_variable ("XMAX", graphmode[0].xmax);
  • trunk/Ohana/src/opihi/lib.shell/VectorOps.c

    r30614 r31160  
    218218    }
    219219    free (vec[0].elements.Int);
    220     vec[0].elements.Flt = vo;
     220    vec[0].elements.Flt = temp;
    221221    vec[0].type = OPIHI_FLT;
    222222  } else {
     
    229229    }
    230230    free (vec[0].elements.Flt);
    231     vec[0].elements.Int = vo;
     231    vec[0].elements.Int = temp;
    232232    vec[0].type = OPIHI_INT;
    233233  }
Note: See TracChangeset for help on using the changeset viewer.