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

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

CanvasMapper(viewer) A coordinate mapper that maps to the viewer’s canvas in canvas coordinates.
CartesianMapper(viewer) A coordinate mapper that maps to the viewer’s canvas in Cartesian coordinates that do not scale (unlike DataMapper).
DataMapper(viewer) A coordinate mapper that maps to the viewer’s canvas in data coordinates.
OffsetMapper(viewer, refobj) A coordinate mapper that maps to the viewer’s canvas in data coordinates that are offsets relative to some other reference object.
WCSMapper(viewer, data_mapper) A coordinate mapper that maps to the viewer’s canvas 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

Inheritance diagram of ginga.canvas.types.layer.CompoundObject, ginga.canvas.types.layer.Canvas, ginga.canvas.types.layer.DrawingCanvas

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 Module

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 the register_wcs() function.

Functions

use(wcspkg[, raise_err]) Choose WCS package.
choose_coord_units(header) Return the appropriate key code for the units value for the axes by examining the FITS header.
get_coord_system_name(header) Return an appropriate key code for the axes coordinate system by examining the FITS header.
register_wcs(name, wrapper_class, coord_types) Register a custom WCS wrapper.

Classes

BaseWCS(logger) Base class for WCS.
AstropyWCS2(logger) Astropy 1.0+ WCS / Coordinate System
AstropyWCS(logger) A WCS interface for astropy.wcs You need to install python module ‘astropy’ (http://pypi.python.org/pypi/astropy) if you want to use this version.
AstLibWCS(logger) A WCS interface for astLib.astWCS.WCS You need to install python module ‘astLib’ (http://sourceforge.net/projects/astlib) if you want to use this version.
KapteynWCS(logger) A WCS interface for kapteyn.wcs.Projection You need to install python module ‘kapteyn’ (http://www.astro.rug.nl/software/kapteyn/) if you want to use this version.
StarlinkWCS(logger) A WCS interface for Starlink You need to install python module ‘starlink-pyast’ (http://www.astro.rug.nl/software/kapteyn/) if you want to use this version.
BareBonesWCS(logger) A dummy placeholder WCS.

Class Inheritance Diagram

Inheritance diagram of ginga.util.wcsmod.BaseWCS, ginga.util.wcsmod.AstropyWCS2, ginga.util.wcsmod.AstropyWCS, ginga.util.wcsmod.AstLibWCS, ginga.util.wcsmod.KapteynWCS, ginga.util.wcsmod.StarlinkWCS, ginga.util.wcsmod.BareBonesWCS

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
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.