This clip_ (Command Line Image Processing) script computes the histogram of pixel values in a user-specificied box in a FITS image. It should be noted that I use clip_imhist.sh in various other scripts such as imstats_view, run_skyboxes, and run_skyhistfit. Hence, it is not advisable to dink around with this routine.
% clip_imhist --help Usage: clip_imhist.sh a.fits 0.0 10000.0 20 695 762 534 631 arg1 - input FITS image 1 arg2 - zmin (low end of first bin) arg3 - zmax (high end of last bin) arg4 - number of bins arg5 - min i of image sub-region arg6 - max i of image sub-region arg7 - min j of image sub-region arg8 - max j of image sub-region A typical call: % clip_imhist.sh ../20170420T101656.1_acm_sci.fits 1283.1 1734.3 360 404 510 493 594