IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 30, 2008, 7:45:21 AM (18 years ago)
Author:
eugene
Message:

modify functions to use both int and flt vectors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/ungridify.c

    r20839 r20857  
    11# include "data.h"
    22
     3// XXX adapt this to accept an optional region to limit the areas, otherwise use the whole image
    34int ungridify (int argc, char **argv) {
    45
     
    1314  if (argc != 9) {
    1415    gprint (GP_ERR, "USAGE: ungridify buffer Xmin Xmax Ymin Ymax x y z\n");
     16    gprint (GP_ERR, "  convert a portion of an image to a collection a triplet of vectors\n");
    1517    return (FALSE);
    1618  }
     
    3032  if ((vy = SelectVector (argv[7], ANYVECTOR, TRUE)) == NULL) return (FALSE);
    3133  if ((vz = SelectVector (argv[8], ANYVECTOR, TRUE)) == NULL) return (FALSE);
    32   REALLOCATE (vx[0].elements.Flt, opihi_flt, Nx*Ny);
    33   REALLOCATE (vy[0].elements.Flt, opihi_flt, Nx*Ny);
    34   REALLOCATE (vz[0].elements.Flt, opihi_flt, Nx*Ny);
     34
     35  ResetVector (vx, OPIHI_FLT, Nx*Ny);
     36  ResetVector (vy, OPIHI_FLT, Nx*Ny);
     37  ResetVector (vz, OPIHI_FLT, Nx*Ny);
    3538
    3639  x = vx[0].elements.Flt;
     
    5255  if (n != Nx*Ny) {
    5356    gprint (GP_ERR, "error in ungrid: %d vs %d (%d x %d)\n", n, Nx*Ny, Nx, Ny);
     57    gprint (GP_ERR, "(this is probably a programming error in ungridify)\n");
    5458  }
    5559  vx[0].Nelements = vy[0].Nelements = vz[0].Nelements = n;
Note: See TracChangeset for help on using the changeset viewer.