IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 3, 2015, 4:16:29 PM (11 years ago)
Author:
eugene
Message:

merge changes from eam_branches/ipp-20151113

Location:
trunk
Files:
13 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/Ohana

  • trunk/Ohana/src/opihi/cmd.astro

  • trunk/Ohana/src/opihi/cmd.astro/Makefile

    r39169 r39225  
    2323$(SRC)/cdot.$(ARCH).o              \
    2424$(SRC)/cline.$(ARCH).o             \
     25$(SRC)/cneedles.$(ARCH).o                  \
    2526$(SRC)/cplot.$(ARCH).o             \
    2627$(SRC)/csystem.$(ARCH).o           \
     
    7677$(SRC)/vshimage.$(ARCH).o         \
    7778$(SRC)/shimage.$(ARCH).o         \
     79$(SRC)/wcs.$(ARCH).o         \
    7880$(SRC)/imsub.$(ARCH).o             \
    7981$(SRC)/imfit.$(ARCH).o             \
  • trunk/Ohana/src/opihi/cmd.astro/drizzle.c

    r19823 r39225  
    141141
    142142          if (Vmk && Vmk[Ni]) continue;
     143          if (!isfinite(Vin[Ni])) continue;
     144
    143145          Vout[No] += Vin[Ni];
    144146          Vwt[No] ++;
     
    195197
    196198          if (Vmk && Vmk[Ni]) continue;
     199          if (!isfinite(Vin[Ni])) continue;
    197200          Vout[No] += Vin[Ni];
    198201          Vwt[No] ++;
  • trunk/Ohana/src/opihi/cmd.astro/init.c

    r39169 r39225  
    77int cdot                    PROTO((int, char **));
    88int cline                   PROTO((int, char **));
     9int cneedles                PROTO((int, char **));
    910int cplot                   PROTO((int, char **));
    1011int csystem                 PROTO((int, char **));
     
    6667int vshimage                PROTO((int, char **));
    6768int shimage                 PROTO((int, char **));
     69int wcs                     PROTO((int, char **));
    6870
    6971static Command cmds[] = { 
     
    7476  {1, "cdot",        cdot,         "plot point in sky coordinates"},
    7577  {1, "cline",       cline,        "plot line connecting two sky coordinates"},
     78  {1, "cneedles",    cneedles,     "plot vectors in sky coordinates"},
    7679  {1, "cplot",       cplot,        "plot vectors in sky coordinates"},
    7780  {1, "csystem",     csystem,      "convert between coordinate systems"},
     
    131134  {1, "vshimage",    vshimage,     "generate images for vector spherical harmonic terms"},
    132135  {1, "shimage",     shimage,      "generate images for spherical harmonic terms"},
     136  {1, "wcs",         wcs,          "set the wcs for the given image"},
    133137};
    134138
  • trunk/Ohana/src/opihi/cmd.astro/region.c

    r37807 r39225  
    7474  }
    7575
     76  float Angle = 0.0;
     77  if ((N = get_argument (argc, argv, "-angle"))) {
     78    remove_argument (N, &argc, argv);
     79    Angle = atof(argv[N]);
     80    remove_argument (N, &argc, argv);
     81  }
     82
    7683  if ((argc != 4) && (argc != 5)) {
    7784    gprint (GP_ERR, "USAGE: region Ra Dec Radius [projection] [orientation]\n");
    78     gprint (GP_ERR, "  [-image] [-ew] [+ew] [-ns] [+ns] [-no-clear]\n");
     85    gprint (GP_ERR, "  [-image] [-ew] [+ew] [-ns] [+ns] [-no-clear] [-angle theta]\n");
    7986    gprint (GP_ERR, " current: %f %f (%f x %f) (%s)\n",
    8087             graphmode.coords.crval1, graphmode.coords.crval2,
     
    111118  graphmode.coords.crval2 = Dec;
    112119
    113   graphmode.coords.pc1_1 = (graphmode.flipeast) ? -1 : 1;
    114   graphmode.coords.pc2_2 = (graphmode.flipnorth) ? -1 : 1;
     120  float pc1_1 = (graphmode.flipeast)  ? -1 : 1;
     121  float pc2_2 = (graphmode.flipnorth) ? -1 : 1;
     122
     123  graphmode.coords.pc1_1 =  cos(Angle*RAD_DEG)*pc1_1;
     124  graphmode.coords.pc1_2 =  sin(Angle*RAD_DEG)*pc2_2;
     125  graphmode.coords.pc2_1 = -sin(Angle*RAD_DEG)*pc1_1;
     126  graphmode.coords.pc2_2 =  cos(Angle*RAD_DEG)*pc2_2;
    115127
    116128  /* ask kapa for coordinate limits, to get the right aspect ratio */
  • trunk/Ohana/src/opihi/cmd.data/Makefile

    r38463 r39225  
    9797$(SRC)/medimage_commands.$(ARCH).o \
    9898$(SRC)/mset.$(ARCH).o           \
     99$(SRC)/needles.$(ARCH).o                \
    99100$(SRC)/peak.$(ARCH).o           \
    100101$(SRC)/periodogram.$(ARCH).o    \
  • trunk/Ohana/src/opihi/cmd.data/init.c

    r38463 r39225  
    8686int medimage_command PROTO((int, char **));
    8787int mset             PROTO((int, char **));
     88int needles          PROTO((int, char **));
    8889int peak             PROTO((int, char **));
    8990int periodogram      PROTO((int, char **));
     
    261262  {1, "mset",         mset,             "insert a vector in an image"},
    262263  {1, "imset",        mset,             "insert a vector in an image"},
     264  {1, "needles",      needles,          "plot vectors needles"},
    263265  {1, "parity",       parity,           "set image parity"},
    264266  {1, "peak",         peak,             "find vector peak in range"},
  • trunk/Ohana/src/opihi/dvo/avmatch.c

    r38601 r39225  
    328328  gprint (GP_ERR, "USAGE: avmatch (RA) (DEC) (RADIUS) field[,field,field...]\n");
    329329  gprint (GP_ERR, "   OR: avmatch -coords (filename.fits) (RADIUS) field[,field,field...]\n");
     330  gprint (GP_ERR, "   RADIUS is in arcseconds\n");
    330331
    331332  if ((argc > N + 1) && !strcasecmp (argv[N+1], "fields")) {
  • trunk/Ohana/src/opihi/dvo/imlist.c

    r37807 r39225  
    2121  }
    2222
     23  int VERBOSE = TRUE;
     24  if ((N = get_argument (argc, argv, "-quiet"))) {
     25    VERBOSE = FALSE;
     26    remove_argument (N, &argc, argv);
     27  }
     28  if ((N = get_argument (argc, argv, "-q"))) {
     29    VERBOSE = FALSE;
     30    remove_argument (N, &argc, argv);
     31  }
     32
    2333  TimeSelect = FALSE;
    2434  if ((N = get_argument (argc, argv, "-time"))) {
     
    3545    remove_argument (N, &argc, argv);
    3646    TimeSelect = TRUE;
    37     gprint (GP_ERR, "plotting in range %ds - %ds (%f seconds)\n", (int)tzero, (int)(tzero + trange), trange);
     47    if (VERBOSE) gprint (GP_ERR, "plotting in range %ds - %ds (%f seconds)\n", (int)tzero, (int)(tzero + trange), trange);
    3848  }
    3949
     
    8898  GetTimeFormat (&TimeReference, &TimeFormat);
    8999
     100  int Nfound = 0;
     101
    90102  for (j = 0; j < MAX_LIST; j++) {
    91103    i = subset[j];
     
    104116      XY_to_RD (&r, &d, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords);
    105117    }
    106     gprint (GP_LOG, "%3lld %s %8lld %8.4f %8.4f %f %5d %2d %4.2f %5.3f %5.3f\n",
    107             (long long) i, image[i].name, (long long) image[i].imageID, r, d, t, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal);
     118    if (VERBOSE) gprint (GP_LOG, "%3lld %s %8lld %8.4f %8.4f %f %5d %2d %4.2f %5.3f %5.3f\n",
     119                         (long long) i, image[i].name, (long long) image[i].imageID, r, d, t, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal);
     120
     121    char name[80];
     122    sprintf (name, "imlist:%d", Nfound);
     123    set_str_variable (name, image[i].name);
     124    Nfound ++;
    108125  }
     126  set_int_variable ("imlist:n", Nfound);
    109127
    110128  FreeImagesDVO(image);
  • trunk/Ohana/src/opihi/include/dvomath.h

    r38441 r39225  
    147147Vector       *InitVector            PROTO((void));
    148148void          FreeVectorArray       PROTO((Vector **vec, int Nvec));
     149void          FreeVector            PROTO((Vector *vec));
    149150int           CopyVector            PROTO((Vector *out, Vector *in));
    150151int           ResetVector           PROTO((Vector *vec, char type, int Nelements));
  • trunk/Ohana/src/opihi/lib.shell/VectorOps.c

    r33662 r39225  
    1515
    1616// this function is NOT thread protected : it is only used in startup and/or shutdown
     17void FreeVector (Vector *vec) {
     18
     19  if (!vec) return;
     20  if (vec->elements.Int) {
     21    free (vec->elements.Int);
     22  }
     23  free (vec);
     24}
     25
     26// this function is NOT thread protected : it is only used in startup and/or shutdown
    1727void FreeVectorArray (Vector **vec, int Nvec) {
    1828
     
    2131  if (!vec) return;
    2232  for (i = 0; i < Nvec; i++) {
    23     if (!vec[i]) continue;
    24     if (vec[i]->elements.Int) {
    25       free (vec[i]->elements.Int);
    26     }
    27     free (vec[i]);
     33    FreeVector (vec[i]);
    2834  }
    2935  free (vec);
Note: See TracChangeset for help on using the changeset viewer.