Reference/API¶
ginga.canvas.CanvasMixin Module¶
Classes¶
CanvasMixin () |
A CanvasMixin is combined with the CompoundMixin to make a tag-addressible canvas-like interface. |
ginga.canvas.CanvasObject Module¶
Functions¶
get_canvas_type (name) |
|
get_canvas_types () |
|
register_canvas_type (name, klass) |
|
register_canvas_types (klass_dict) |
Classes¶
CanvasObjectBase (**kwdargs) |
This is the abstract base class for a CanvasObject. |
ginga.canvas.CompoundMixin Module¶
Classes¶
CompoundMixin () |
A CompoundMixin is a mixin class that makes an object that is an aggregation of other objects. |
ginga.canvas.coordmap Module¶
Classes¶
NativeMapper (viewer) |
A coordinate mapper that maps to the viewer’s canvas in the viewer’s canvas coordinates. |
WindowMapper (viewer) |
A coordinate mapper that maps to the viewer in ‘window’ coordinates. |
PercentageMapper (viewer) |
A coordinate mapper that maps to the viewer in ‘percentage’ coordinates. |
CartesianMapper (viewer) |
A coordinate mapper that maps to the viewer in Cartesian coordinates that do not scale (unlike DataMapper). |
DataMapper (viewer) |
A coordinate mapper that maps to the viewer in data coordinates. |
OffsetMapper (viewer, refobj) |
A coordinate mapper that maps to the viewer in data coordinates that are offsets relative to some other reference object. |
WCSMapper (viewer) |
A coordinate mapper that maps to the viewer in WCS coordinates. |
ginga.canvas.DrawingMixin Module¶
Classes¶
DrawingMixin () |
The DrawingMixin is a mixin class that adds drawing capability for some of the basic CanvasObject-derived types. |
ginga.canvas.types.layer Module¶
Classes¶
CompoundObject (*objects, **kwdargs) |
Compound object on a ImageViewCanvas. |
Canvas (*objects, **kwdargs) |
Class to handle canvas in Ginga. |
DrawingCanvas (**kwdargs) |
Drawing canvas. |
Class Inheritance Diagram¶
ginga.ImageView Module¶
This module handles image viewers.
Classes¶
ImageViewBase ([logger, rgbmap, settings]) |
An abstract base class for displaying images represented by Numpy data arrays. |
ginga.rv.main Module¶
This module handles the main reference viewer.
Classes¶
ReferenceViewer ([layout]) |
This class exists solely to be able to customize the reference viewer startup. |
ginga.util.wcsmod Package¶
We are fortunate to have several possible choices for a python WCS package compatible with Ginga: astlib, kapteyn, starlink and astropy. kapteyn and astropy wrap Mark Calabretta’s “WCSLIB”, astLib wraps Jessica Mink’s “wcstools”, and I’m not sure what starlink uses (their own?).
Note that astlib requires pyfits (or astropy) in order to create a WCS object from a FITS header.
To force the use of one, do:
from ginga.util import wcsmod
wcsmod.use('kapteyn')
before you load any images. Otherwise Ginga will try to pick one for you.
Note that you can register custom WCS types using:
from ginga.util.wcsmod.common import register_wcs
register_wcs('mywcs', MyWCSClass, list_of_coord_types)
Look at the implemented WCS wrappers for details.
Functions¶
get_wcs_class (name) |
Get a WCS class corresponding to the registered name. |
ginga.util.wcs Module¶
This module handles calculations based on world coordinate system.
Functions¶
hmsToDeg (h, m, s) |
Convert RA hours, minutes, seconds into an angle in degrees. |
dmsToDeg (sign, deg, min, sec) |
Convert dec sign, degrees, minutes, seconds into a signed angle in degrees. |
decTimeToDeg (sign_sym, deg, min, sec) |
Convert dec sign, degrees, minutes, seconds into a signed angle in degrees. |
degToHms (ra) |
Converts the ra (in degrees) to HMS three tuple. |
degToDms (dec[, isLatitude]) |
Convert the dec, in degrees, to an (sign,D,M,S) tuple. |
arcsecToDeg (arcsec) |
Convert numeric arcseconds (aka DMS seconds) to degrees of arc. |
hmsStrToDeg (ra) |
Convert a string representation of RA into a float in degrees. |
dmsStrToDeg (dec) |
Convert a string representation of DEC into a float in degrees. |
raDegToString (ra_deg[, format]) |
|
decDegToString (dec_deg[, format]) |
|
trans_coeff (eq, x, y, z) |
This function is provided by MOKA2 Development Team (1996.xx.xx) and used in SOSS system. |
eqToEq2000 (ra_deg, dec_deg, eq) |
Convert Eq to Eq 2000. |
get_xy_rotation_and_scale (header) |
CREDIT: See IDL code at http://www.astro.washington.edu/docs/idl/cgi-bin/getpro/library32.html?GETROT |
get_rotation_and_scale (header[, skew_threshold]) |
Calculate rotation and CDELT. |
get_relative_orientation (image, ref_image) |
Computes the relative orientation and scale of an image to a reference image. |
simple_wcs (px_x, px_y, ra_deg, dec_deg, …) |
Calculate a set of WCS keywords for a 2D simple instrument FITS file with a ‘standard’ RA/DEC pixel projection. |
deg2fmt (ra_deg, dec_deg, format) |
Format coordinates. |
dispos (dra0, decd0, dra, decd) |
Compute distance and position angle solving a spherical triangle (no approximations). |
deltaStarsRaDecDeg1 (ra1_deg, dec1_deg, …) |
Spherical triangulation. |
deltaStarsRaDecDeg2 (ra1_deg, dec1_deg, …) |
|
get_starsep_RaDecDeg (ra1_deg, dec1_deg, …) |
Calculate separation. |
add_offset_radec (ra_deg, dec_deg, …) |
Algorithm to compute RA/Dec from RA/Dec base position plus tangent plane offsets. |
get_RaDecOffsets (ra1_deg, dec1_deg, ra2_deg, …) |
Calculate offset. |
lon_to_deg (lon) |
Convert longitude to degrees. |
lat_to_deg (lat) |
Convert latitude to degrees. |