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/cmd.data
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 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 */
Note: See TracChangeset for help on using the changeset viewer.