contourOverlayChart(imageData,
imageWCS,
contourImageData,
contourImageWCS,
RADeg,
decDeg,
clipSizeDeg,
contourLevels,
outputFileName=None,
cutLevels=["smart",99.5],
colorMapName="gray",
contourSmoothFactor=0,
contourColor="white",
contourWidth=1,
title=None,
axisLabels="sexagesimal",
minorLabels=False,
colorBar="off")
| source code
|
Makes a plot of an image array with a second image array overlaid as a
contour map, with celestial coordinate axes determined from WCS
information. The image arrays are rotated such that North is at the top,
East is at the left. The axes can be marked in either sexagesimal or
decimal celestial coordinates: the appropriate axis scales will be
determined automatically from the size of the clipped image section.
By default, this function does not write the finder chart to a file -
instead, the figure will become the currently active matplotlib.pylab
figure (this allows the user to modify the figure as desired). To output
the figure to a file, set outputFileName to the path where you wish to
save the figure: the file format will be determined from the file
extension (e.g. .eps, .png), and can be any file format that matplotlib
is capable of writing.
- Parameters:
imageData (numpy array) - image data array for the background image
imageWCS (astWCS.WCS) - astWCS.WCS object for the background image
contourImageData (numpy array) - image data array from which contours are to be generated
contourImageWCS (astWCS.WCS) - astWCS.WCS object for the image to be contoured
RADeg (float) - coordinate in decimal degrees
decDeg (float) - coordinate in decimal degrees
clipSizeDeg (float) - size of square clipped section in decimal degrees
contourLevels (list) - sets the contour levels - available options:
-
values: contourLevels=[list of values specifying each
level]
-
linear spacing: contourLevels=['linear', min level value,
max level value, number of levels]
-
log spacing: contourLevels=['log', min level value, max
level value, number of levels]
For linear and log spacing, the minimum contour level can
either be set explicitly or have one of the following special
values:
-
'min': sets the minimum level automatically to the minimum
value in contourImageData
-
['mean', x]: sets the minimum level to x*the mean value of
contourImageData
-
['median', x]: sets the minimum level to x*the median
value of contourImageData
-
['mode', x]: sets the minimum level x*the mode value of
the contourImageData (note that the mode is estimated using
mode=3*median-2*mode: if mode<0 and log scaling is set,
defaults to using x*median as the minimum contour level.)
Likewise, the maximum contour level can either be set
explicitly or have the following special value:
-
'max': sets the maximum level automatically to the maximum
value of contourImageData
outputFileName (string) - path where to save the figure, file format determined by the
file extention (e.g. .eps, .png)
cutLevels (list) - sets the image scaling - available options:
-
pixel values: cutLevels=[low value, high value].
-
histogram equalisation: cutLevels=["histEq",
number of bins ( e.g. 1024)]
-
relative: cutLevels=["relative", cut per cent
level (e.g. 99.5)]
-
smart: cutLevels=["smart", cut per cent level
(e.g. 99.5)]
["smart", 99.5] seems to provide good scaling over a
range of different images.
colorMapName (string) - name of a standard matplotlib colormap, e.g. "hot",
"cool", "gray" etc. (do
"help(pylab.colormaps)" in the Python interpreter to
see available options)
contourSmoothFactor (float) - standard deviation (in pixels) of Gaussian filter for
pre-smoothing of contour image data (set to 0 for no
smoothing)
contourColor (string) - color of the overlaid contours, specified by the name of a
standard matplotlib color, e.g., "black",
"white", "cyan" etc. (do
"help(pylab.colors)" in the Python interpreter to see
available options)
contourWidth (int) - width of the overlaid contours
title (string) - optional title for the plot
axisLabels (string) - either "sexagesimal" (for H:M:S, D:M:S) or
"decimal" (for decimal degrees)
minorLabels (bool) - if set to True, add additional labels between coordinate
labels
colorBar (bool) - if True, plot a vertical color bar at the side of the image
indicating the intensity scale.
|