1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
.help phistogram Nov89 plot
.ih
NAME
phistogram -- print or plot the histogram of an image or stream of values
.ih
USAGE
phistogram input
.ih
PARAMETERS
.ls input
The name of the image, image subsection, or the text file containing the
stream of values whose histogram is to be computed. \fIInput\fR may be
the standard input "STDIN".
.le
.ls z1 = INDEF, z2 = INDEF
The minimum and maximum values included in the histogram. The image or data
minimum and maximum values are used by default.
.le
.ls binwidth = INDEF
The resolution of the histogram in data units. If \fIbinwidth\fR is not defined,
the parameters \fInbins\fR, \fIz1\fR, and \fIz2\fR determine the resolution of
the histogram.
.le
.ls nbins = 512
The number of bins in, or resolution of, the histogram.
The \fInbins\fR parameter is overridden if \fIbinwidth\fR is defined.
.le
.ls autoscale = yes
In the case of integer image data, automatically adjust \fInbins\fR and
\fIz2\fR to avoid aliasing effects. Data in text files is not autoscaled.
.le
.ls top_closed = no
Include z2 in the top bin? Each bin of the histogram is a subinterval
that is half open at the top. \fITop_closed\fR decides whether those
pixels with values equal to z2 are to be counted in the histogram. If
\fBtop_closed\fR is yes, the top bin will be larger than the other bins.
.le
.ls hist_type = "normal"
The type of histogram to plot or list. The choices are "normal",
"cumulative", "difference", or "second_difference". The two
"difference" options are calculated as forward differences, i.e.
diff[n] = hist[n+1] - hist[n].
.le
.ls listout = no
List instead of plot the histogram? The list is never log scaled.
.le
.ls title = "imtitle"
The plot title. If title = "imtitle", the image name and title or the
text file name, and the
characteristics of the histogram are included in the title.
.le
.ls xlabel = "Data values", ylabel = "Counts"
The labels for the X and Y axes.
.le
.ls wx1 = INDEF, wx2 = INDEF, wy1 = 0.0, wy2 = INDEF
The range of user coordinates spanned by the plot. If either of the x axis
limits is INDEF the histogram minimum or maximum data values
are used. If either of the y axis limits is INDEF, the
minimum or maximum counts in the histogram is used.
.le
.ls logx = no, logy = yes
Use log scaling on the x or y axes of the plot?
.le
.ls round = no
Round the axes minimum and maximum values up to "nice" values?
.le
.ls plot_type = "line"
The style of histogram to plot. The options are "line", "box" and "fullbox".
If \fIplot_type\fR is "line" the histogram data points are connected by
straight lines; if it is "box" a stepped histogram is drawn; if it is "fullbox"
the histogram lines are drawn to the base of the plot.
.le
.ls box = yes
Draw axes at the perimeter of the plotting window?
.le
.ls ticklabels = yes
Label the tick marks?
.le
.ls majrx = 5, minrx = 5, majry = 5, minry = 5
Number of major tick marks on each axis and number of minor tick marks between
major tick marks. These quantities are ignored if log scaling is in effect
for an axis.
.le
.ls fill = yes
Fill the output viewport regardless of the device aspect ratio?
.le
.ls vx1 = 0.0, vx2 = 1.0, vy1 = 0.0, vy2 = 1.0
The NDC coordinates (0.0:1.0) of the device plotting viewport.
.le
.ls append = no
Append to an existing plot?
.le
.ls pattern = "solid"
The type of line used to draw the histogram. The options are "solid",
"dashed" "dotted", and "dotdash". \fIPattern\fR can be changed when
appending to an existing plot.
.le
.ls device = "stdgraph"
The output graphics device.
.le
.ih
DESCRIPTION
\fIPhistogram\fR computes the histogram of the IRAF image or stream
of values in the text file specified by
\fIinput\fR, using the parameters \fIbinwidth\fR, \fInbins\fR,
\fIz1\fR and \fIz2\fR.
If either \fIz1\fR or \fIz2\fR is undefined the data minimum or
maximum values define the histogram limits.
If \fIbinwidth\fR is undefined, \fInbins\fR
determines the resolution of the histogram. If \fIlistout\fR = no,
the histogram is plotted on
the graphics device \fIdevice\fR in the style specified by
\fIplot_type\fR. The plot may be log scaled if \fIlogy\fR = yes (the
default) and the input is an IRAF image. If \fIlistout\fR = yes,
the histogram is printed on the standard output.
In addition to computing the "normal" histogram, PHISTOGRAM can also
calculate the cumulative and the first and second difference histograms
depending on the value of the \fIhist_type\fR parameter. The options are:
"normal", "cumulative", "difference", and "second_difference".
Each bin of the histogram is defined to be half open at the top. This
results in an ambiguity in deciding whether those pixels with z=z2 are
included in the topmost bin. This decision is left to the user via the
\fItop_closed\fR parameter. This is usually only of concern with integer
image data and histograms with few bins.
If \fBappend\fR is enabled, previous values for \fBbox\fR,
\fBfill\fR, \fBround\fR, the plotting viewport (\fBvx1\fR, \fBvx2\fR,
\fBvy1\fR, \fBvy2\fR), and the plotting window (\fBwx1\fR, \fBwx2\fR,
\fBwy1\fR, \fBwy2\fR) are used.
By default, the plot drawn will fill the device viewport. Setting
the value of \fBfill\fR to "no" means the viewport will be adjusted so
that equal numbers of data values in x and y will occupy equal lengths
when plotted. That is, when \fBfill = no\fR, a unity aspect ratio is
enforced, and plots
appear square regardless of the device aspect ratio. On devices with non
square full device viewports (e.g., the vt640), a plot drawn by
PHISTOGRAM appears extended in the x direction unless \fBfill\fR = no.
.ih
EXAMPLES
1. Output the histogram of an image to a file.
.nf
cl> phist M51.imh li+ nbins=100 > fits1.hst
.fi
2. Plot the histogram of an image using only values from 0 to 2000.
.nf
cl> phist M31.imh nbins=100 z1=0. z2=2000.
.fi
3. Ditto, but set the histogram resolution explicitly to avoid
smoothing the histogram.
.nf
cl> phist M31.imh z1=0 z2=2000 nbins=2001
.fi
4. Plot the cumulative histogram. This is most useful for images with
fairly flat "normal" histograms.
.nf
cl> phist R50.imh hist=cum
.fi
5. Plot the histogram of a stream of values in the textfile "list".
.nf
cl> phist list
.fi
.ih
BUGS
If the resolution of the histogram (number of bins) is a non-integral multiple
of the intensity resolution of the data (number of possible intensity values),
then \fIaliasing\fR can occur. The effect is to cause periodic zero dropouts
(for an oversampled histogram) or excess-valued bins (for a slightly
undersampled histogram). The \fIautoscaling\fR feature, if enabled, will
adjust the histogram parameters to avoid such aliasing effects for integer
data. This is not possible for floating point data, however, in which case
aliasing is certainly possible and can only be avoided by manually adjusting
the histogram parameters. One should also be aware that \fIsmoothing\fR of
the histogram will occur whenever the data range exceeds the histogram
resolution.
.ih
SEE ALSO
listpixels, plot.graph, proto.mkhistogram
.endhelp
|