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

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

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.io.io_asdf Module

Module wrapper for loading ASDF files.

Note

The API for this module is currently unstable and may change in a future release.

Functions

load_file(filepath[, idx, logger])

Load an object from an ASDF file.

load_asdf(asdf_obj[, idx, logger])

Load data from an open ASDF object.

load_from_asdf(asdf_obj[, data_key, …])

Load from an ASDF object.

Classes

ASDFFileHandler(logger)

Class Inheritance Diagram

Inheritance diagram of ginga.util.io.io_asdf.ASDFFileHandler

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.

ginga.util.ap_region Module

This module provides Ginga support for DS9 type region files and objects via the Astropy regions module.

Functions

astropy_region_to_ginga_canvas_object(r)

Convert an Astropy region object to a Ginga canvas object.

add_region(canvas, r[, tag, redraw])

Convenience function to plot an Astropy regions object on a Ginga canvas.

ginga_canvas_object_to_astropy_region(obj)

Convert a Ginga canvas object to an AstroPy region object.