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

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, plugins])

This class exists solely to be able to customize the reference viewer startup.

ginga.colors Module

Module to handle colors supported by Ginga.

Functions

recalc_color_list()

Recalculate ginga.colors.color_list.

lookup_color(name[, format])

Find RGB or hex values for a supported color.

resolve_color(color)

Return RGB tuple of a given color.

add_color(name, tup)

Add (color, RGB to ginga.colors.color_list.

remove_color(name)

Remove a given color from ginga.colors.color_list.

get_colors()

Return ginga.colors.color_list.

scan_rgbtxt(filepath)

Parse colors from a given filename.

scan_rgbtxt_buf(buf)

Parse colors from a given string buffer.

ginga.AutoCuts Module

Functions

get_autocuts(name)

Return the class object used to implement an autocuts algorithm.

get_autocuts_names()

Return the list of algorithm names for the available autocuts methods.

Classes

AutoCutsBase(logger)

Base class for auto cuts algorithms.

Minmax(logger)

Calculate the cut levels as the minimum and maximum of the data.

Histogram(logger[, usecrop, sample, ...])

Calculate the cut levels based on a histogram analysis of the data.

StdDev(logger[, usecrop, sample, ...])

Calculate the cut levels based on a standard deviation analysis of the data.

MedianFilter(logger[, num_points, length])

Calculate the cut levels based on a median filtering analysis of the data.

ZScale(logger[, contrast, num_points])

Calculate the cut levels based on a median filtering analysis of the data.

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.

ra_deg_to_str(ra_deg[, precision, format])

dec_deg_to_str(dec_deg[, precision, 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.

raDegToString(ra_deg[, format])

decDegToString(dec_deg[, format])

ginga.util.ap_region Module

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

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.

ginga.util.iqcalc Module

Module to handle image quality calculations.

Functions

get_mean(data_np)

Calculate mean for valid values.

get_median(data_np)

Like get_mean() but for median.

Classes

IQCalcError

Base exception for raising errors in this module.

IQCalc([logger])

Class to handle model fitting and FWHM calculations.

ginga.util.iqcalc_astropy Module

Module to handle image quality calculations using astropy.

Classes

IQCalc(*args, **kwargs)

This is ginga.util.iqcalc.IQCalc that uses astropy.