labtyp : there are two kinds of labtyp, offset-types and non-offset-type. For offset-type labtyp, the label values are shifted from the original by the amount of the given offset. For either types, one can optionally specify the scale parameter and the scaled values (offset will be applied first if given) will be used. i.e.,
world1 = (world0 - offset) * scale
Followings are currently available labtyp.
- non-offset : absval, absdeg, hms, dms
- offset : delta, arcdeg, arcmin, arcsec
By default, the tick locations will be chosen automatically. And nbins parameter controls the approximate number of ticks. When you want your ticks at the specified location, use the locs parameter, which takes a list of tick values. However, manual ticks are not possible for labtyp of hms, dms, delta. The locs parameter will be simply ignored.
For the wcs coordinate, the default values are in the unit of degree. And for the ctype of longitude, you may specify latitude (in degree) instead of the scale.
[source code, hires.png, pdf]
Set the label type of the x and y axis. Available options are
“hms” | label is in H M S.S (e.g. for RA) |
“dms” | label is in D M S.S (e.g. for DEC) |
“absval” | label is in actual wcs value |
“absdeg” | label is in degrees |
“delta” | label is in offsets (arcsec, arcmin, etc) |
“arcdeg” | label is in arcdegree offsets |
“arcmin” | label is in arcminute offsets |
“arcsec” | label is in arcsecond offsets |
If labtyp2 is None, labtyp1 is used.
For labtyp in [“delta”, “arcdeg”, “arcmin”, “arcsec”], center_pixel parameter needs to be specified, from which the offsets will be calculated.
center_pixel : in pixel coordinate (data coordinate in matplotlib)
If None, the center position of the current view-limit will be used.
labtyp1_kwargs and labtyp2_kwargs should be a dictionary of keyword arguments that are associated with labtyp1 and labtyp2. Any other keyword arguments will be associated both with labtyp1 and labtyp2. The available keywords arguments will depends on the value of labtyp1 and labtyp2. Most common options are nbins and locs. nbins specify approximate number of automatically generated ticks. locs manually specify the tick locations.
labtyp of individual axis can be set using set_ticklabel1_type() and set_ticklabel2_type() methods. See documentaion of these methods for more details.
This method is deprecated. Use set_ticklabel_type or locator_params.
coord_format=(“hms”, “dms”), label_density=(4, 4),
Creates an axes for displaying FITS images. The axes uses the FITS header information for ticks and grids appropriate for sky coordinate.
The arguments for this axes is same as mpl’s Axes, except that either header or grid_helper (but not both) keyword arguments must be provided.
Necessary Keyword arguments:
- header: pyfits.Header instance
- header of the fits file that will be used for the axes a new pywcsgrid2.GridHelper instance is created using the header.
or:
grid_helper: pywcsgrid2.GridHelper instance
Add a ellipse patch to the axes with given sizes. This is intended to display beam size (or PSF size) of the observed image. The ellipse is located according to the loc parameter, which should be the location code as in the legend.
Keyword arguments:
major_pixel : major axis size in pixel (in the image coordinate)
minor_pixel : minor axis size in pixel
angle : angle of rotation for the ellipse
- patch_props : a dictionary of properties to be passed for
- Patch creation, e.g. facecolor, alpha, etc.
See mpl_toolkits.axes_grid1.anchored_artists for orther options.
Add two arros with appropriate labels showing the increasing direction of the coordinate. The default label is “E” and “N”.
Keyword arguments:
arrow_length : length of the arrows in a fraction of axes size.
loc : the location code as in the legend
coord : the coordinate name. default is “fk5”
txt, txt2 : labels assocated with the arrows. Defaults are “E” & “N”
- delta_a1, delta_a2 : an optional angles (in degree) to be added to
- automatically determined directions.
Add a horizontal line with a label underneath. Intended to display the angular size.
Keyword arguments:
length_pixel : length of the line in pixel in the image coordinate.
label : label
loc : the location code as in the legend
set the coordinate system to be displayed for the axes.
Set the label type of the x axis. Available options depend on the grid_helper used. The default is GridHelperWcsBase and its variants.
See set_ticklabel1_type() for available options.
Set the label type of the y axis. Available options depend on the grid_helper used. The default is GridHelperWcsBase and its variants.
See set_ticklabel1_type() for available options.
Set the label type of the x and y axes. Available options depend on the grid_helper used. The default is GridHelperWcsBase and its variants.
See set_ticklabel_type() for available options.
This method is deprecated. Use set_ticklabel_type or locator_params.
adjust the controlling option for ticks and grid.
The option should be given as keyword arguments.
Keyword arguments:
- coord_format: a tuple of two strings describing how ticks
- are located and labeld. Currently,”hms”, “dms” are only available options. The default is (“hms”, “dms”), i.e., (hour, minute, second) for the first coordinate and (degree, minute, second) for the second coordinate. For Galactic coordinate, (“dms”, “dms”) should be more sensible. The default is (“hms”, “dms”).
- label_density: approxmate number of ticks for each coordinates.
- Currently, this is the only parameter to control the tick locations. The default is (4, 4).