IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 16, 2020, 2:04:27 PM (6 years ago)
Author:
tdeboer
Message:

quick undo

File:
1 edited

Legend:

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

    r41340 r41341  
    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.