IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40905


Ignore:
Timestamp:
Oct 3, 2019, 3:54:22 PM (7 years ago)
Author:
eugene
Message:

add binning option to cdensify and cdhistogram

Location:
branches/eam_branches/ohana.20190329/src/opihi/cmd.astro
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20190329/src/opihi/cmd.astro/cdensify.c

    r39294 r40905  
    3939  }
    4040
     41  int binning = 1;
     42  if ((N = get_argument (argc, argv, "-binning"))) {
     43    remove_argument (N, &argc, argv);
     44    binning = atoi(argv[N]);
     45    remove_argument (N, &argc, argv);
     46  }
     47
    4148  int PSFTYPE = IS_DOT;
    4249  if ((N = get_argument (argc, argv, "-psf"))) {
     
    8087  Ymax = graphmode.ymax;
    8188  Ymin = graphmode.ymin;
    82   dX = (Xmax - Xmin) / (Xpix - 1);
    83   dY = (Ymax - Ymin) / (Ypix - 1);
     89
     90  // (dX, dY) are the pixel scale of the output image (output pixels / input pixels)
     91
     92  dX = binning * (Xmax - Xmin) / (Xpix - 1);
     93  dY = binning * (Ymax - Ymin) / (Ypix - 1);
    8494
    8595  CHECKVAL(Xmin);
  • branches/eam_branches/ohana.20190329/src/opihi/cmd.astro/cdhistogram.c

    r39233 r40905  
    1313  int kapa;
    1414  Graphdata graphmode;
     15
     16  int binning = 1;
     17  if ((N = get_argument (argc, argv, "-binning"))) {
     18    remove_argument (N, &argc, argv);
     19    binning = atoi(argv[N]);
     20    remove_argument (N, &argc, argv);
     21  }
    1522
    1623  range = NULL;
     
    7986  Ymax = graphmode.ymax;
    8087  Ymin = graphmode.ymin;
    81   dX = (Xmax - Xmin) / (Xpix - 1);
    82   dY = (Ymax - Ymin) / (Ypix - 1);
     88
     89  // (dX, dY) are the pixel scale of the output image (output pixels / input pixels)
     90
     91  dX = binning * (Xmax - Xmin) / (Xpix - 1);
     92  dY = binning * (Ymax - Ymin) / (Ypix - 1);
    8393
    8494  CHECKVAL(Xmin);
     
    90100  CHECKVAL(dY);
    91101
    92   int Nx = (Xmax - Xmin) / dX + 1;
    93   int Ny = (Ymax - Ymin) / dY + 1;
     102  int Nx = abs((Xmax - Xmin) / dX) + 1;
     103  int Ny = abs((Ymax - Ymin) / dY) + 1;
    94104 
    95105  Coords newcoords = graphmode.coords;
Note: See TracChangeset for help on using the changeset viewer.